Cherry-pick some cmake commits (#24720)

* Build system: Support  new in cmake 3.17 Ninja Multi-Config generator

(cherry picked from commit 369b618d4f160816818681ed7e41063e2d9ba5b5)

* Build system: Fixed PCH with MSVC & Ninja generator

(cherry picked from commit d669f46b6d5190dabc686a35656e8b03f5ec325b)

* Core: Fix clang 10 warnings

(cherry picked from commit 7272508cb4b51ec5591b6f0e542ea29091db7546)

* Build system: Set -Wno-deprecated-copy only for clang 10

(cherry picked from commit 7fdeb259ba398d5d9343a5dcd1a89562dfcbe981)

* Core/Misc: GCC build and warning fixes

(cherry picked from commit 4d69cc1c567180b408ddbadb9edf26859cf4c006)

* Build system: Print found git version when warning about it being too old

(cherry picked from commit 1ae72db201189877c1b863fac140eb4b0a45c5bb)

* Build system: Removed hard requirement on BOOST_ROOT being set as environment variable, it can now be also passed as command line argument to cmake and fix compile warning with boost 1.73

(cherry picked from commit 161944b7643c62f9e7705c64e42d42e5d07f1959)

* Remove some code that was already removed from 335 and then cherry-picked into master

Co-authored-by: Shauren <shauren.trinity@gmail.com>
(cherry picked from commit 8c09b6e58b0e4f33b7a8e376a28709e693cf2914)
This commit is contained in:
Giacomo Pozzoni authored and funjoker committed 2020-06-11 20:24:00 +02:00
1 parent 928abcbfdc
commit 9fdf598792
16 files changed
+46 -55

No files matched your search

+13 -4
View File
@@ -2259,12 +2259,19 @@ function (cotire_generate_target_script _language _configurations _target _targe
set (${_targetConfigScriptVar} "${_targetCotireConfigScript}" PARENT_SCOPE)
endfunction()
function (cotire_setup_pch_file_compilation _language _target _targetScript _prefixFile _pchFile _hostFile)
function (cotire_setup_pch_file_compilation _language _target _targetScript _prefixFile _pchFile _prefixFileWasGenerated _hostFile)
set (_sourceFiles ${ARGN})
if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
# for Visual Studio and Intel, we attach the precompiled header compilation to the host file
# the remaining files include the precompiled header, see cotire_setup_pch_file_inclusion
if (_sourceFiles)
# unlike MSBuild, Ninja does not automatically create the directory for /Fp file
# so we have to do it ourselves to avoid C1083
if (${CMAKE_GENERATOR} STREQUAL "Ninja Multi-Config")
cotire_get_intermediate_dir(_baseDir)
add_custom_command (OUTPUT "${_baseDir}/.mkdir" COMMAND ${CMAKE_COMMAND} -E touch "${_baseDir}/.mkdir")
set_property (SOURCE ${_hostFile} APPEND PROPERTY OBJECT_DEPENDS "${_baseDir}/.mkdir")
endif()
set (_flags "")
cotire_add_pch_compilation_flags(
"${_language}" "${CMAKE_${_language}_COMPILER_ID}" "${CMAKE_${_language}_COMPILER_VERSION}"
@@ -2272,7 +2279,9 @@ function (cotire_setup_pch_file_compilation _language _target _targetScript _pre
set_property (SOURCE ${_hostFile} APPEND_STRING PROPERTY COMPILE_FLAGS " ${_flags} ")
set_property (SOURCE ${_hostFile} APPEND PROPERTY OBJECT_OUTPUTS "${_pchFile}")
# make object file generated from host file depend on prefix header
set_property (SOURCE ${_hostFile} APPEND PROPERTY OBJECT_DEPENDS "${_prefixFile}")
if (_prefixFileWasGenerated)
set_property (SOURCE ${_hostFile} APPEND PROPERTY OBJECT_DEPENDS "${_prefixFile}")
endif()
# mark host file as cotired to prevent it from being used in another cotired target
set_property (SOURCE ${_hostFile} PROPERTY COTIRE_TARGET "${_target}")
endif()
@@ -2355,7 +2364,7 @@ function (cotire_setup_prefix_file_inclusion _language _target _prefixFile _pref
if (_prefixFileWasGenerated)
# make object files generated from source files depend on prefix header
set_property (SOURCE ${_sourceFiles} APPEND PROPERTY OBJECT_DEPENDS "${_prefixFile}")
endif()
endif()
endfunction()
function (cotire_get_first_set_property_value _propertyValueVar _type _object)
@@ -2899,7 +2908,7 @@ function (cotire_process_target_language _language _configurations _target _whol
if (_pchFile)
# first file in _sourceFiles is passed as the host file
cotire_setup_pch_file_compilation(
${_language} ${_target} "${_targetConfigScript}" "${_prefixFile}" "${_pchFile}" ${_sourceFiles})
${_language} ${_target} "${_targetConfigScript}" "${_prefixFile}" "${_pchFile}" ${_prefixFileWasGenerated} ${_sourceFiles})
cotire_setup_pch_file_inclusion(
${_language} ${_target} ${_wholeTarget} "${_prefixFile}" "${_pchFile}" ${_sourceFiles})
endif()