llvm-project/llvm/cmake/modules
Martin Storsjö 93010544a8 [CMake] Don't pass CMAKE_C(XX)_COMPILER to the nested NATIVE build when cross compiling
Originally, the nested build was set up with the CMake command
`execute_process` which implicitly passes CC/CXX variables for
the configured compiler, which then was picked up by the nested
CMake. (This CMake behaviour, to implicitly pass such variables
is up for discussion and might change in the future; see
https://gitlab.kitware.com/cmake/cmake/-/issues/21378.)

How the nested cmake build is set up was changed in
aa7d6db5c8 / D40229 - the old behaviour
was brought along by manually passing
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} to the nested cmake
configuration. This was then later made optional in
f5f0fffea5 / D40947. But still,
the default if the user doesn't pass
CROSS_TOOLCHAIN_FLAGS_${target_name} (e.g. CROSS_TOOLCHAIN_FLAGS_NATIVE)
is to pass in the surrounding build's compiler - which usually
doesn't work, and is quite non-obvious to figure out.

Just drop the default passing of the outer compiler, when cross
compiling. This should avoid surprising cases of using the cross
compiler for the native build for essentially all new users trying
to cross compile, until they've discovered CROSS_TOOLCHAIN_FLAGS_NATIVE.

Keep passing these when not cross compiling, e.g. if building with
optimized tablegen.

This was already suggested at the end in D40229, but apparently never
acted upon.

Differential Revision: https://reviews.llvm.org/D126313
2022-06-22 09:33:50 +03:00
..
AddLLVM.cmake Revert "[cmake] Don't export `LLVM_TOOLS_INSTALL_DIR` anymore" 2022-06-10 19:26:12 +00:00
AddLLVMDefinitions.cmake
AddOCaml.cmake Add .cmt and .cmti files for OCaml bindings 2021-10-05 19:36:12 +05:30
AddSphinxTarget.cmake [docs] Remove hard-coded version numbers from sphinx configs 2022-02-01 23:14:12 -08:00
CMakeLists.txt Revert "[cmake] Don't export `LLVM_TOOLS_INSTALL_DIR` anymore" 2022-06-10 19:26:12 +00:00
CheckAtomic.cmake [AIX][cmake] Set atomics related macros when build with xlclang 2021-10-18 09:18:05 +00:00
CheckCompilerVersion.cmake Bump minimum toolchain version 2022-04-08 09:05:33 +02:00
CheckProblematicConfigurations.cmake [CMake] Check for problematic MSVC + /arch:AVX configuration 2022-04-21 09:46:44 +02:00
ChooseMSVCCRT.cmake
CoverageReport.cmake [CMake] Add targets for generating coverage reports 2021-09-03 10:45:55 -05:00
CrossCompile.cmake [CMake] Don't pass CMAKE_C(XX)_COMPILER to the nested NATIVE build when cross compiling 2022-06-22 09:33:50 +03:00
DetermineGCCCompatible.cmake
FindFFI.cmake [CMake] Installable find modules for terminfo and libffi 2021-12-05 14:46:23 -05:00
FindGRPC.cmake [CMake] Fix `FindGRPC.cmake` for setting up gRPC related libraries for macOS+homebrew context 2022-06-15 16:11:37 -07:00
FindLibpfm.cmake
FindOCaml.cmake
FindSphinx.cmake
FindTerminfo.cmake [CMake] Installable find modules for terminfo and libffi 2021-12-05 14:46:23 -05:00
FindZ3.cmake Fix FindZ3.cmake to support static libraries and Windows 2021-07-29 10:55:44 +02:00
GenerateVersionFromVCS.cmake
GetErrcMessages.cmake [CMake] Add explicit return to GetErrcMessages test program 2022-01-19 17:42:56 +00:00
GetHostTriple.cmake [CMake] Make the vendor part of default mingw triples consistent 2021-08-12 13:27:09 +03:00
GetLibraryName.cmake
HandleLLVMOptions.cmake [CMake][MSVC] Compile with `/permissive-` 2022-06-20 12:42:51 -07:00
HandleLLVMStdlib.cmake [CMake][llvm] avoid conflict w/ (and use when available) new builtin check_linker_flag 2021-04-27 16:41:28 -07:00
LLVM-Build.cmake
LLVM-Config.cmake [MCA] Moving the target specific CustomBehaviour impl. from /tools/llvm-mca/ to /lib/Target/. 2021-07-28 11:23:18 -07:00
LLVMCheckLinkerFlag.cmake [cmake] Partially deduplicate `{llvm,compiler_rt}_check_linker_flag` for runtime libs and llvm 2022-01-29 06:07:24 +00:00
LLVMConfig.cmake.in Revert "[cmake] Don't export `LLVM_TOOLS_INSTALL_DIR` anymore" 2022-06-10 19:26:12 +00:00
LLVMConfigVersion.cmake.in Revert "[CMake] Use write_basic_package_version_file for LLVM" 2021-03-29 13:07:39 -07:00
LLVMDistributionSupport.cmake [cmake] Loosen multi-distribution restrictions 2022-04-13 20:33:28 -07:00
LLVMExternalProjectUtils.cmake cmake fill `cmake_args` when cross-compiling external project with non-clang compiler 2022-06-02 21:02:58 +00:00
LLVMInstallSymlink.cmake Revert "[llvm][cmake] Make `llvm_install_symlink` robust to absolute dirs." 2022-01-21 02:48:10 +00:00
LLVMProcessSources.cmake
TableGen.cmake Revert "[cmake] Don't export `LLVM_TOOLS_INSTALL_DIR` anymore" 2022-06-10 19:26:12 +00:00
TensorFlowCompile.cmake TensorFlowCompile: Add object file to list of sources rather than LINK_LIBS 2022-06-01 09:04:48 -07:00
UseLibtool.cmake
VersionFromVCS.cmake
llvm-driver-template.cpp.in [cmake] Export driver template to fix standalone build 2022-06-10 09:50:23 +02:00