cmakelists fix
This commit is contained in:
@@ -125,21 +125,26 @@ target_include_directories(
|
|||||||
src/resource
|
src/resource
|
||||||
src/util)
|
src/util)
|
||||||
|
|
||||||
|
if(NOT CMAKE_BUILD_TYPE)
|
||||||
|
set(CMAKE_BUILD_TYPE "Release")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
|
target_compile_definitions(${PROJECT_NAME} PRIVATE DEBUG)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
enable_language(RC)
|
# Keep Release as a GUI app (no console window).
|
||||||
target_sources(${PROJECT_NAME} PRIVATE anm2ed.rc)
|
if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||||
|
if(MSVC)
|
||||||
target_compile_options(${PROJECT_NAME} PRIVATE /EHsc)
|
target_link_options(${PROJECT_NAME} PRIVATE /SUBSYSTEM:WINDOWS)
|
||||||
target_link_options(${PROJECT_NAME} PRIVATE /STACK:0xffffff)
|
else()
|
||||||
|
target_link_options(${PROJECT_NAME} PRIVATE -mwindows)
|
||||||
target_link_options(
|
endif()
|
||||||
${PROJECT_NAME}
|
endif()
|
||||||
PRIVATE "$<$<AND:$<CONFIG:Release>,$<CXX_COMPILER_ID:MSVC>>:/SUBSYSTEM:WINDOWS>"
|
|
||||||
"$<$<AND:$<CONFIG:Release>,$<NOT:$<CXX_COMPILER_ID:MSVC>>>:-mwindows>")
|
|
||||||
else()
|
else()
|
||||||
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -pedantic)
|
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -pedantic)
|
||||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
target_compile_definitions(${PROJECT_NAME} PRIVATE DEBUG)
|
|
||||||
target_compile_options(${PROJECT_NAME} PRIVATE -O0 -pg)
|
target_compile_options(${PROJECT_NAME} PRIVATE -O0 -pg)
|
||||||
else()
|
else()
|
||||||
set(CMAKE_BUILD_TYPE "Release")
|
set(CMAKE_BUILD_TYPE "Release")
|
||||||
@@ -148,10 +153,20 @@ else()
|
|||||||
target_link_libraries(${PROJECT_NAME} PRIVATE m)
|
target_link_libraries(${PROJECT_NAME} PRIVATE m)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
enable_language(RC)
|
||||||
|
target_sources(${PROJECT_NAME} PRIVATE anm2ed.rc)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
target_compile_options(${PROJECT_NAME} PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:/std:c++latest>")
|
target_compile_options(${PROJECT_NAME} PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:/std:c++latest>")
|
||||||
target_compile_options(${PROJECT_NAME} PRIVATE "$<$<CONFIG:Debug>:/Zi>")
|
target_compile_options(${PROJECT_NAME} PRIVATE /EHsc)
|
||||||
target_link_options(${PROJECT_NAME} PRIVATE "$<$<CONFIG:Debug>:/DEBUG>")
|
target_link_options(${PROJECT_NAME} PRIVATE /STACK:0xffffff)
|
||||||
|
|
||||||
|
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
|
target_compile_options(${PROJECT_NAME} PRIVATE /Zi)
|
||||||
|
target_link_options(${PROJECT_NAME} PRIVATE /DEBUG)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
/home/anon/sda/Personal/Repos/anm2ed/build/compile_commands.json
|
/home/anon/sda/Personal/Repos/anm2ed/build-cmake-nogen/compile_commands.json
|
||||||
Reference in New Issue
Block a user