|
|
@@ -268,15 +268,24 @@ endfunction ()
|
|
|
# Macro for precompiled headers
|
|
|
macro (enable_pch)
|
|
|
if (MSVC)
|
|
|
- foreach(FILE ${SOURCE_FILES})
|
|
|
- if (${FILE} MATCHES "[A-Za-z0-9 _/]*[.]cpp")
|
|
|
- if (${FILE} MATCHES "Precompiled.cpp$")
|
|
|
+ foreach (FILE ${SOURCE_FILES})
|
|
|
+ if (${FILE} MATCHES \\.cpp$)
|
|
|
+ if (${FILE} MATCHES Precompiled\\.cpp$)
|
|
|
set_source_files_properties(${FILE} PROPERTIES COMPILE_FLAGS "/YcPrecompiled.h")
|
|
|
else ()
|
|
|
set_source_files_properties(${FILE} PROPERTIES COMPILE_FLAGS "/YuPrecompiled.h")
|
|
|
endif ()
|
|
|
endif ()
|
|
|
endforeach ()
|
|
|
+ else ()
|
|
|
+ # TODO: to enable usage of precompiled header in GCC, for now just make sure the correct Precompiled.h is found in the search
|
|
|
+ foreach (FILE ${SOURCE_FILES})
|
|
|
+ if (${FILE} MATCHES Precompiled\\.h$)
|
|
|
+ get_filename_component (PATH ${FILE} PATH)
|
|
|
+ include_directories (${PATH})
|
|
|
+ break ()
|
|
|
+ endif ()
|
|
|
+ endforeach ()
|
|
|
endif ()
|
|
|
endmacro ()
|
|
|
|