CMake multi config issue
ypujante opened this issue · comments
Yan Pujante commented
This section in the CMakeLists.txt
if (${CMAKE_BUILD_TYPE} MATCHES "Debug")
target_compile_definitions(efsw PRIVATE DEBUG)
elseif (${CMAKE_BUILD_TYPE} MATCHES "Release")
target_compile_definitions(efsw PRIVATE NDEBUG)
endif()
is not working properly when using a multi config generator (like Xcode).
If you replace it with this:
target_compile_definitions(efsw PRIVATE $<IF:$<CONFIG:Debug>,DEBUG,NDEBUG>)
then it fixes the issue (and works in all cases).
See this CMake documentation about this problem
Martín Lucas Golini commented
Great, thanks, I'll patch it later!
Yan Pujante commented
Thank you. And thanks for your library. I am using it in my open source project: https://github.com/pongasoft/re-edit