summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CompilerArgs/C.cmake
diff options
context:
space:
mode:
authorKlein, Thorsten (BSH) <thorsten.klein@bshg.com>2022-03-28 11:01:08 (GMT)
committerBrad King <brad.king@kitware.com>2022-03-29 14:36:28 (GMT)
commit211a9deac1d4144c7d7ce18ecb6c5d21c4854eaa (patch)
treea2d1fc22e1fb674146983bf29a486c273638bc7f /Tests/RunCMake/CompilerArgs/C.cmake
parentb4de4217aefedaf46cbb1d700cbd463c3d2d8914 (diff)
downloadCMake-211a9deac1d4144c7d7ce18ecb6c5d21c4854eaa.zip
CMake-211a9deac1d4144c7d7ce18ecb6c5d21c4854eaa.tar.gz
CMake-211a9deac1d4144c7d7ce18ecb6c5d21c4854eaa.tar.bz2
Preserve CMAKE_${lang}_COMPILER_ARG1 from existing CMakeCache.txt
`CMAKE_<LANG>_COMPILER` may be a list if it was defined by a toolchain file. In this case we move the args to `CMAKE_<LANG>_COMPILER_ARG1`. If `CMAKE_<LANG>_COMPILER` is not a list, then it might have been cached by a previous run that split the `CC` or `CXX` environment variable into `CMAKE_<LANG>_COMPILER` and `CMAKE_<LANG>_COMPILER_ARG1`. In this latter case, avoid clobbering `CMAKE_<LANG>_COMPILER_ARG1`. Fixes: #23358
Diffstat (limited to 'Tests/RunCMake/CompilerArgs/C.cmake')
-rw-r--r--Tests/RunCMake/CompilerArgs/C.cmake1
1 files changed, 1 insertions, 0 deletions
diff --git a/Tests/RunCMake/CompilerArgs/C.cmake b/Tests/RunCMake/CompilerArgs/C.cmake
index 96b004b..0fbfdd2 100644
--- a/Tests/RunCMake/CompilerArgs/C.cmake
+++ b/Tests/RunCMake/CompilerArgs/C.cmake
@@ -1,3 +1,4 @@
enable_language(C)
set(CMAKE_VERBOSE_MAKEFILE TRUE)
+message(STATUS "CMAKE_C_COMPILER_ARG1='${CMAKE_C_COMPILER_ARG1}'")
add_executable(main main.c)