This commit is contained in:
@@ -7,6 +7,13 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
set(BUILD_SHARED_LIBS OFF)
|
||||
|
||||
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
|
||||
if(NOT CMAKE_CONFIGURATION_TYPES)
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Build type" FORCE)
|
||||
endif()
|
||||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS Debug Release)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
set(CMAKE_C_FLAGS_DEBUG "/Od /Zi" CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "/W4 /permissive- /Od /Zi" CACHE STRING "" FORCE)
|
||||
@@ -108,12 +115,21 @@ file(GLOB PROJECT_SRC CONFIGURE_DEPENDS
|
||||
src/util/imgui/*.cpp
|
||||
)
|
||||
|
||||
add_executable(${PROJECT_NAME}
|
||||
${PROJECT_SRC}
|
||||
${IMGUI_SOURCES}
|
||||
${TINYXML2_SOURCES}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/glad/glad.cpp
|
||||
)
|
||||
if(WIN32 AND NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
|
||||
add_executable(${PROJECT_NAME} WIN32
|
||||
${PROJECT_SRC}
|
||||
${IMGUI_SOURCES}
|
||||
${TINYXML2_SOURCES}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/glad/glad.cpp
|
||||
)
|
||||
else()
|
||||
add_executable(${PROJECT_NAME}
|
||||
${PROJECT_SRC}
|
||||
${IMGUI_SOURCES}
|
||||
${TINYXML2_SOURCES}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/glad/glad.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/external/SDL/include
|
||||
|
||||
@@ -6,6 +6,38 @@
|
||||
"patch": 0
|
||||
},
|
||||
"configurePresets": [
|
||||
{
|
||||
"name": "linux-debug",
|
||||
"displayName": "Linux Debug",
|
||||
"description": "Ninja Debug (Linux, native)",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/out/build/linux-debug",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Debug",
|
||||
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/linux-debug"
|
||||
},
|
||||
"condition": {
|
||||
"type": "equals",
|
||||
"lhs": "${hostSystemName}",
|
||||
"rhs": "Linux"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "linux-release",
|
||||
"displayName": "Linux Release",
|
||||
"description": "Ninja Release (Linux, native)",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/out/build/linux-release",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Release",
|
||||
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/linux-release"
|
||||
},
|
||||
"condition": {
|
||||
"type": "equals",
|
||||
"lhs": "${hostSystemName}",
|
||||
"rhs": "Linux"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "x64-Debug",
|
||||
"displayName": "x64 Debug",
|
||||
@@ -40,6 +72,14 @@
|
||||
}
|
||||
],
|
||||
"buildPresets": [
|
||||
{
|
||||
"name": "linux-debug",
|
||||
"configurePreset": "linux-debug"
|
||||
},
|
||||
{
|
||||
"name": "linux-release",
|
||||
"configurePreset": "linux-release"
|
||||
},
|
||||
{
|
||||
"name": "x64-Debug",
|
||||
"configurePreset": "x64-Debug",
|
||||
|
||||
Reference in New Issue
Block a user