SpartanJ / efsw

efsw is a C++ cross-platform file system watcher and notifier.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CMake multi config issue

ypujante opened this issue · comments

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

Great, thanks, I'll patch it later!

Thank you. And thanks for your library. I am using it in my open source project: https://github.com/pongasoft/re-edit