diff options
author | Stephen Enders <84310577289916ceefd4132143fb36b63a5f0c71> | 2022-06-22 01:28:23 -0400 |
---|---|---|
committer | Steph Enders <smenders@gmail.com> | 2022-06-21 22:28:30 -0400 |
commit | a878cdc42bf41355758dabd353d521d4b12e73fc (patch) | |
tree | 312acaf0cd8724b42e692fc26945f2992467ed19 /CMakeLists.txt | |
parent | 09615be926efb7302bc348aa66feccb694b23ba8 (diff) |
Add windows support
Create res.h for handling resource loading
Update CMakeLists.txt to ensure compilation is passed properly
Fix unsupported functions (<limits>) on Windows
Use to_str(path) to get path as c_str() returns wchar_t* on windows
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 69cd9b2..c1902a0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,7 @@ project(dng VERSION 0.1.0) set(CMAKE_CXX_STANDARD 20) set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-${PROJECT_VERSION}) +set(CMAKE_SUPPRESS_DEVELOPER_WARNINGS ON) # Setup Lua Libraries # To determine which files look at the lua/makefile to see how the targets are built @@ -42,7 +43,9 @@ add_library(lualib STATIC ${LUA_SRC}/lstrlib.c ${LUA_SRC}/ltablib.c ${LUA_SRC}/lutf8lib.c) -target_compile_definitions(lualib PRIVATE -DLUA_USE_POSIX=1) # to properly use mkstemp +if(UNIX) + target_compile_definitions(lualib PRIVATE -DLUA_USE_POSIX=1) # to properly use mkstemp +endif() target_include_directories(lua PUBLIC lua) target_include_directories(lauxlib PUBLIC lua) target_include_directories(lualib PUBLIC lua) @@ -53,7 +56,9 @@ include_directories(${PROJECT_SOURCE_DIR}/thirdparty/lua) # System specific includes if (UNIX) set(RES_LIB src/linux/res.h) -endif () +elseif(WIN32) + set(RES_LIB src/windows/res.h) +endif() add_executable(${PROJECT_NAME} src/main.cpp src/Level.cpp src/Level.h src/CApi.h src/Scene.h src/LuaApi.h src/MessageBox.h ${RES_LIB}) target_link_libraries(${PROJECT_NAME} PUBLIC ${LUA_LIBRARIES}) @@ -65,7 +70,6 @@ if (WIN32) set(SFML_USE_STATIC_STD_LIBS TRUE) endif () set(SFML_USE_SYSTEM_DEPS ON) -set(CMAKE_SUPPRESS_DEVELOPER_WARNINGS ON) add_subdirectory(${PROJECT_SOURCE_DIR}/thirdparty/SFML EXCLUDE_FROM_ALL) target_link_libraries(${PROJECT_NAME} PUBLIC ${SFML_LIBRARIES} ${LUA_LIBRARIES}) |