6 changes: 5 additions & 1 deletion cmake/modules/KstPchSupport.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ macro(kst_add_pch_rule _header _sources _lib_type)
list(APPEND _args ${CMAKE_SHARED_LIBRARY_CXX_FLAGS})
endif()
if(_definitions_type)
list(APPEND _args -D${_definitions_type})
if(CMAKE_MAJOR_VERSION LESS 3)
list(APPEND _args "-D${_definitions_type}")
else()
list(APPEND _args "$<$<BOOL:${_definitions_type}>:-D${_definitions_type}>")
endif()
endif()
#message(STATUS "pch: ${_args}")

Expand Down
Loading