Refactor native build to remove the compiler-override files (#23897)
authorJeremy Koritzinsky <jkoritzinsky@gmail.com>
Wed, 29 May 2019 21:40:31 +0000 (14:40 -0700)
committerGitHub <noreply@github.com>
Wed, 29 May 2019 21:40:31 +0000 (14:40 -0700)
commit38f121b06910b25080b5f3259152effc0fe3c672
treead313488576479428681f18678be4b3f7962735f
parent3ac776125f4b9182de05abb1daccb98221509cc1
Refactor native build to remove the compiler-override files (#23897)

* On systems that have both cmake 2 and cmake 3, use cmake 3.

Move CMAKE_EXPORT_COMPILE_COMMANDS to top level instead of in gen-buildsys-*. Define the CMake install prefix in gen-buildsys-* instead of pulling from an environment variable.

Define C++ standard as CMake property instead of as flag.

Move CLR_DEFINES_*_INIT out of overrides and into configurecompiler.cmake

Move flags that generate debug info into configurecompiler.cmake

Remove the CMAKE_USER_RULES_OVERRIDE files.

Add cmake version output for determining what cmake versions each CI system has.

Fix syntax in gen-buildsys-clang.

Change add_compile_definitions back to add_definitions

Add -D prefix for adding definitions via add_definitions

Remove extraneous double-quote

Change default config definition adding to the syntax in master

Switch back to old CMAKE_<LANG>_FLAGS way of setting the language standards and try to go back to 2.8.12 minimum

Switch back setting compile definitions for non-Windows branch too.

Use SET with CMAKE_<LANG>_FLAGS. Convert some usages of appending to CMAKE_<LANG>_FLAGS to add_compile_options where possible.

Set CMAKE_<LANG>_FLAGS_INIT instead of CMAKE_<LANG>_FLAGS

Make sure configureopimitzation.cmake is included correctly in test build.

Try to add brackets to get the Linux ARM compilation working correctly.

Define standard language version in configurecompiler.cmake instead of root CMakeLists (so tests get it)

Try to move langauge standard check to configure.cmake

define language standard in each root CMakeLists.txt

Fix off-Windows test build.

Set CMAKE_EXPORT_COMPILE_COMMANDS after the project() call

* Set CMAKE_USER_MAKE_RULES_OVERRIDE to "" to not break incremental builds after building on a branch that had it set to a path.

* Remove CMake version output.

* Move comment outside of multiline command.

* Retry setting CMAKE_USER_MAKE_RULES_OVERRIDE

* Remove unnecessary variable wrappers.

* Simplify cmake 3 resolution.

* Explicitly use CMAKE_CXX_FLAGS for C++-only flags that GCC complains about on C files.

* Set -Wall via CMAKE_<LANG>_FLAGS until we can move all flag settings to add_compile_options

* Fix typos

* Another temporary precedence issue.

* include configureoptimization.cmake in configurecompiler.cmake

* Move setting CMAKE_EXPORT_COMPILE_COMMANDS to configurecompiler.cmake.

* Rename configure.cmake -> verify_lto.cmake.

* Fix path to verify-lto

* Try using CMAKE_<LANG>_FLAGS instead of CMAKE_<LANG>_FLAGS_INIT.

* Revert name change to configure.camek
13 files changed:
CMakeLists.txt
configurecompiler.cmake
configureoptimization.cmake [new file with mode: 0644]
src/dlls/mscorpe/CMakeLists.txt
src/jit/CMakeLists.txt
src/pal/tools/clang-compiler-override-arm.txt [deleted file]
src/pal/tools/clang-compiler-override.txt [deleted file]
src/pal/tools/gcc-compiler-override.txt [deleted file]
src/pal/tools/gen-buildsys-clang.sh
src/pal/tools/gen-buildsys-gcc.sh
src/pal/tools/gen-buildsys-win.bat
src/pal/tools/windows-compiler-override.txt [deleted file]
tests/CMakeLists.txt