From 5680428009eda4cab74550fa47a1c9e90600cca0 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 19 May 2012 23:24:44 +0200 Subject: [PATCH] Changed: Fix PCH for some cases under Mac OS X --- code/CMakeModules/PCHSupport.cmake | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/code/CMakeModules/PCHSupport.cmake b/code/CMakeModules/PCHSupport.cmake index ae5b30ee2..7cd4c6c7d 100644 --- a/code/CMakeModules/PCHSupport.cmake +++ b/code/CMakeModules/PCHSupport.cmake @@ -62,9 +62,8 @@ MACRO(_PCH_GET_COMPILE_FLAGS _out_compile_flags) LIST(APPEND ${_out_compile_flags} ${_directory_definitions}) LIST(APPEND ${_out_compile_flags} ${CMAKE_CXX_FLAGS}) - # Format definitions and remove duplicates + # Format definitions SEPARATE_ARGUMENTS(${_out_compile_flags}) - LIST(REMOVE_DUPLICATES ${_out_compile_flags}) ENDMACRO(_PCH_GET_COMPILE_FLAGS) MACRO(_PCH_GET_PDB_FILENAME out_filename _target) @@ -98,9 +97,13 @@ MACRO(_PCH_GET_COMPILE_COMMAND out_command _input _inputcpp _output) IF(MSVC) _PCH_GET_PDB_FILENAME(PDB_FILE ${_PCH_current_target}) - SET(${out_command} ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} /Yc /Fp\"${_output}\" ${_inputcpp} /c /Fd\"${PDB_FILE}\") + SET(${out_command} ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} /Yc /Fp\"${_output}\" ${_inputcpp} /c /Fd\"${PDB_FILE}\") ELSE(MSVC) - SET(${out_command} ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} -x c++-header -o ${_output} -c ${_input}) + SET(HEADER_FORMAT "c++-header") + IF(APPLE) + SET(HEADER_FORMAT "objective-${HEADER_FORMAT}") + ENDIF(APPLE) + SET(${out_command} ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} -x ${HEADER_FORMAT} -o ${_output} -c ${_input}) ENDIF(MSVC) ENDMACRO(_PCH_GET_COMPILE_COMMAND)