diff options
author | Thomas Bernard <tbernard@go-engineering.de> | 2020-07-28 17:48:47 (GMT) |
---|---|---|
committer | Thomas Bernard <tbernard@go-engineering.de> | 2020-07-28 17:48:47 (GMT) |
commit | 270e0d9c4d47821b884b87b4f69129d7f2b80677 (patch) | |
tree | 08f100774701c9a523292aa16606e6dfbbe5da0b /Modules/CMakeDetermineCXXCompiler.cmake | |
parent | e4e899056eca97e62d40d47bf4ee2a4871553751 (diff) | |
download | CMake-270e0d9c4d47821b884b87b4f69129d7f2b80677.zip CMake-270e0d9c4d47821b884b87b4f69129d7f2b80677.tar.gz CMake-270e0d9c4d47821b884b87b4f69129d7f2b80677.tar.bz2 |
Detect the correct target architecture for clang compilers.
During compiler identification, if CMAKE_{C,CXX}_COMPILER_TARGET is
defined, the corresponding clang target flag is used to guaranty proper
target architecture detection.
Diffstat (limited to 'Modules/CMakeDetermineCXXCompiler.cmake')
-rw-r--r-- | Modules/CMakeDetermineCXXCompiler.cmake | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake index 662b831..46f1ee1 100644 --- a/Modules/CMakeDetermineCXXCompiler.cmake +++ b/Modules/CMakeDetermineCXXCompiler.cmake @@ -83,6 +83,10 @@ else() ) endif() +if(CMAKE_CXX_COMPILER_TARGET) + list(PREPEND CMAKE_CXX_COPMILER_ID_TEST_FLAGS "-c --target=${CMAKE_CXX_COMPILER_TARGET}") +endif() + # Build a small source file to identify the compiler. if(NOT CMAKE_CXX_COMPILER_ID_RUN) set(CMAKE_CXX_COMPILER_ID_RUN 1) |