From 0d7738dce5f2dac9fd4732f1b79456f2c5871018 Mon Sep 17 00:00:00 2001 From: Julius Michaelis Date: Thu, 4 Oct 2018 08:33:31 +0200 Subject: [PATCH] Drop broken GCC precompiled header support --- CMakeLists.txt | 15 -------- cmake/GccPchSupport.cmake | 72 --------------------------------------- 2 files changed, 87 deletions(-) delete mode 100644 cmake/GccPchSupport.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 66107204f..b52f29a12 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1439,21 +1439,6 @@ if(CMAKE_GENERATOR MATCHES "^Visual Studio 14 2015") ) endif() -############################################################################ -# Precompiled header support, gcc part (it needs the cxx flags) -############################################################################ - -if(CMAKE_COMPILER_IS_GNUCXX) - include(GccPchSupport) - option(USE_GCC_PCH "Use GCC precompiled headers" OFF) -endif() -if(USE_GCC_PCH) - add_precompiled_header(libmisc src/C4Include.h) - add_precompiled_header(libc4script src/C4Include.h) - add_precompiled_header(openclonk src/C4Include.h) - add_precompiled_header(openclonk-server src/C4Include.h) -endif() - ############################################################################ # installation ############################################################################ diff --git a/cmake/GccPchSupport.cmake b/cmake/GccPchSupport.cmake deleted file mode 100644 index 5311bddf1..000000000 --- a/cmake/GccPchSupport.cmake +++ /dev/null @@ -1,72 +0,0 @@ -#Copied from http://www.mail-archive.com/cmake@cmake.org/msg04394.html which copied it from the rosengarden project -#see also: http://gcc.gnu.org/onlinedocs/gcc-4.0.4/gcc/Precompiled-Headers.html - -MACRO(ADD_PRECOMPILED_HEADER _targetName _input) - - # Prepare environment - GET_FILENAME_COMPONENT(_name ${_input} NAME) - SET(_pchdir "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${_targetName}_pch.dir") - MAKE_DIRECTORY(${_pchdir}) - SET(_source "${CMAKE_CURRENT_SOURCE_DIR}/${_input}") - SET(_includeput "${_pchdir}/${_name}") - SET(_output "${_includeput}.gch") - - # Assemble the compiler command with which future stuff will be built - STRING(TOUPPER "CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}" _flags_var_name) # Don't worry: CMake won't use any of the R/D/RWDI/MSR vars if the build type is not defined - if(CMAKE_CXX_COMPILER_ARG1) # please, know what you're doing if you rely on this... - STRING(STRIP ${CMAKE_CXX_COMPILER_ARG1} _ccache_tweak) - SET(_ccache_tweak "\"${_ccache_tweak}\"") - endif() - SET(_compiler_FLAGS ${_ccache_tweak} ${CMAKE_CXX_FLAGS} ${${_flags_var_name}}) - if(CMAKE_BUILD_TYPE) - if(${CMAKE_BUILD_TYPE} STREQUAL "Debug") - LIST(APPEND _compiler_FLAGS "-D_DEBUG") - endif() - endif() - GET_TARGET_PROPERTY(_compile_defines ${_targetName} COMPILE_DEFINITIONS) - if(_compile_defines) - FOREACH(item ${_compile_defines}) - STRING(REPLACE "\"" "\\\"" item ${item}) - LIST(APPEND _compiler_FLAGS "-D${item}") - ENDFOREACH(item) - endif() - GET_TARGET_PROPERTY(_compile_defines ${_targetName} COMPILE_DEFINITIONS_${CMAKE_BUILD_TYPE}) - if(_compile_defines) - FOREACH(item ${_compile_defines}) - STRING(REPLACE "\"" "\\\"" item ${item}) - LIST(APPEND _compiler_FLAGS "$<$>:-D${item}>") - ENDFOREACH(item) - endif() - GET_DIRECTORY_PROPERTY(_compile_defines COMPILE_DEFINITIONS) - if(_compile_defines) - FOREACH(item ${_compile_defines}) - STRING(REPLACE "\"" "\\\"" item ${item}) - LIST(APPEND _compiler_FLAGS "$<$>:-D${item}>") - ENDFOREACH(item) - endif() - GET_DIRECTORY_PROPERTY(_compile_defines COMPILE_DEFINITIONS_${CMAKE_BUILD_TYPE}) - if(_compile_defines) - FOREACH(item ${_compile_defines}) - STRING(REPLACE "\"" "\\\"" item ${item}) - LIST(APPEND _compiler_FLAGS "$<$>:-D${item}>") - ENDFOREACH(item) - endif() - GET_DIRECTORY_PROPERTY(_directory_flags INCLUDE_DIRECTORIES) - FOREACH(item ${_directory_flags}) - LIST(APPEND _compiler_FLAGS "-I\"${item}\"") - ENDFOREACH(item) - SEPARATE_ARGUMENTS(_compiler_FLAGS) - list(REMOVE_DUPLICATES _compiler_FLAGS) - # Add a target with the pch - ADD_CUSTOM_COMMAND( - OUTPUT ${_output} - COMMAND "${CMAKE_CXX_COMPILER}" - ${_compiler_FLAGS} -x c++-header -o ${_output} ${_source} - IMPLICIT_DEPENDS CXX ${_source} - ) - FILE(WRITE "${_pchdir}/${_name}" "#ifdef __cplusplus\n#warning Precompiled header not used. Turn off or fix!\n#endif") # This file is added so the cc-units don't stumble over not being able to include the file - ADD_CUSTOM_TARGET(${_targetName}_pch DEPENDS ${_output}) - ADD_DEPENDENCIES(${_targetName} ${_targetName}_pch) - SET_TARGET_PROPERTIES(${_targetName} PROPERTIES COMPILE_FLAGS "-include ${_includeput}") - -ENDMACRO(ADD_PRECOMPILED_HEADER)