diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a4dff27fc..58a83d9021 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -879,9 +879,13 @@ function(AddApplication) target_link_libraries(test-${A_Target} GTest::gmock) endif() - if (NOSTRICTALIASING) - set_source_files_properties(${NOSTRICTALIASING} - PROPERTIES COMPILE_FLAGS -fno-strict-aliasing) + if("${CMAKE_CXX_COMPILER_ID}" STREQUAL GNU) + foreach(NOSTRICTALIASINGFILE ${NOSTRICTALIASINGLIST}) + if (${NOSTRICTALIASINGFILE} IN_LIST A_Files) + set_source_files_properties(${NOSTRICTALIASING} + PROPERTIES COMPILE_FLAGS -fno-strict-aliasing) + endif() + endforeach() endif() ADD_PRECOMPILED_HEADER(${A_Target}-objects) diff --git a/src.cmake b/src.cmake index 0b3329768b..f88bc8b51d 100644 --- a/src.cmake +++ b/src.cmake @@ -298,10 +298,6 @@ set(QCOMMONLIST ${ENGINE_DIR}/qcommon/translation.cpp ) -if("${CMAKE_CXX_COMPILER_ID}" STREQUAL GNU) - set(NOSTRICTALIASING ${ENGINE_DIR}/qcommon/msg.cpp) -endif() - if (USE_CURSES) set(ENGINELIST ${ENGINELIST} ${ENGINE_DIR}/sys/con_curses.cpp @@ -368,4 +364,9 @@ set(DEDSERVERLIST ${ENGINE_DIR}/null/null_input.cpp ) +set(NOSTRICTALIASINGLIST + ${ENGINE_DIR}/qcommon/msg.cpp + ${ENGINE_DIR}renderer/tr_bsp.cpp +) + set(WIN_RC ${ENGINE_DIR}/sys/windows-resource/icon.rc)