@@ -67,16 +67,6 @@ if (NOT CMAKE_OSX_ARCHITECTURES)
6767 set (CMAKE_OSX_ARCHITECTURES x86_64)
6868endif ()
6969
70- # FIXME: this reports an unused architecture if only vms are built.
71- # We may not be able to avoid this for now without doing a huge rewrite
72- # of this file.
73- # FIXME: this reports an unused compiler if only vms are built.
74- # We cannot avoid this for now without doing a huge rewrite of this files
75- # since we also set useless flags using informations provided by this.
76- if (NOT (BUILD_CLIENT OR BUILD_TTY_CLIENT OR BUILD_SERVER OR BUILD_DUMMY_APP))
77- message (NOTICE "You can safely ignore the following reported architecture, it is not used." )
78- message (NOTICE "You can safely ignore the following reported compilers, they are unused." )
79- endif ()
8070include (DaemonPlatform)
8171
8272if (Daemon_OUT)
@@ -246,17 +236,8 @@ endif()
246236# Compile and link flags
247237################################################################################
248238
249- # FIXME: This sets unused flags for an unused compiler if only nacl vms
250- # are built and we are not yet running the chainloaded build. We cannot
251- # avoid this for now or we would have to do a large rewrite of that file.
252- # FIXME: This defines the try_flag function that is used in
253- # Unvanquished CMakeLists.txt even if the engine is not built,
254- # meaning we have to detect useless engine compiler to set
255- # useless engine flags when only building vms.
256239include (DaemonFlags)
257240
258- # FIXME: Once engine flags would be only set when building the engine
259- # this would be likely unused by vms as they are built by DaemonGame.
260241# Warning options (for Daemon only)
261242# Note the different scopes used for warning options:
262243# * set_c_cxx_flag(xxx) or try_c_cxx_flag(xxx) sets it for all code including dependencies
@@ -363,16 +344,9 @@ function(ADD_PRECOMPILED_HEADER Target)
363344 set (Header ${COMMON_DIR} /Common.h)
364345
365346 # Compiler-specific PCH support
366- try_c_cxx_flag(PCH "-pch" )
367-
368- if (PCH)
369- # CMAKE_CXX_COMPILER_ARG1 is used with compilers using subcommands.
370- # For example when doing: cmake -D'CMAKE_CXX_COMPILER'='zig;c++'
371- # CMAKE_CXX_COMPILER will be "zig",
372- # CMAKE_CXX_COMPILER_ARG1 will be "c++".
347+ if (CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID} " STREQUAL "Clang" OR NACL)
373348 add_custom_command (OUTPUT "${OBJ_DIR} /${Target} .h.gch"
374- COMMAND ${PNACLPYTHON_PREFIX2} ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1}
375- ${Defs} ${Flags} -x c++-header ${Header} -o "${OBJ_DIR} /${Target} .h.gch"
349+ COMMAND ${PNACLPYTHON_PREFIX2} ${CMAKE_CXX_COMPILER} ${Defs} ${Flags} -x c++-header ${Header} -o "${OBJ_DIR} /${Target} .h.gch"
376350 DEPENDS ${Header}
377351 IMPLICIT_DEPENDS CXX ${Header}
378352 )
@@ -381,10 +355,10 @@ function(ADD_PRECOMPILED_HEADER Target)
381355 add_dependencies (${Target} ${Target} -pch)
382356
383357 # PNaCl clang doesn't support -include-pch properly
384- if (DAEMON_CXX_COMPILER_NAME STREQUAL "PNaCl" )
385- set_property (TARGET ${Target} APPEND PROPERTY COMPILE_OPTIONS "-include;${OBJ_DIR} /${Target} .h;-Winvalid-pch" )
386- else ()
358+ if ("${CMAKE_CXX_COMPILER_ID} " STREQUAL "Clang" AND NOT NACL)
387359 set_property (TARGET ${Target} APPEND PROPERTY COMPILE_OPTIONS "-include-pch;${OBJ_DIR} /${Target} .h.gch" )
360+ else ()
361+ set_property (TARGET ${Target} APPEND PROPERTY COMPILE_OPTIONS "-include;${OBJ_DIR} /${Target} .h;-Winvalid-pch" )
388362 endif ()
389363 elseif (MSVC )
390364 # /Fp sets the PCH path used by either of the /Yc and /Yu options.
0 commit comments