summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler/XL-CXX.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-11-19 20:19:36 (GMT)
committerBrad King <brad.king@kitware.com>2020-11-19 22:06:03 (GMT)
commit30aa715fac06deba7eaa3e6167cf34eb4d2521d0 (patch)
tree6c9b7ef3a46c7473dcf04ddb1fea147e8009319c /Modules/Compiler/XL-CXX.cmake
parent1d1d78bbe1ed7113927fd0dd078741de3c722b14 (diff)
downloadCMake-30aa715fac06deba7eaa3e6167cf34eb4d2521d0.zip
CMake-30aa715fac06deba7eaa3e6167cf34eb4d2521d0.tar.gz
CMake-30aa715fac06deba7eaa3e6167cf34eb4d2521d0.tar.bz2
Revert "specify language flag when source LANGUAGE property is set"
Revert commit 74b1c9fc8e (Explicitly specify language flag when source LANGUAGE property is set, 2020-06-01, v3.19.0-rc1~722^2) and the lookup tables from its two immediate ancestors. The purpose of that change was to convert an explicit `LANGUAGE` source file property into an explicit language specification compiler flag like `-x c`. This seems reasonable since the property is documented as meaning "indicate what programming language the source file is". It is also needed to help compilers deal with non-standard source file extensions they don't recognize. However, some projects have been setting `LANGUAGE C` on `.S` assembler source files to mean "use the C compiler". Passing `-x c` for them breaks the build because the `.S` sources are not written in C. These projects should be updated to use `enable_language(ASM)`, for which CMake often chooses the C compiler as the assembler when using toolchains that support it (which would have to be the case for projects using the approach). Revert the change for now to preserve the old behavior for such projects. We can re-introduce it with a policy in a future version of CMake. Fixes: #21469 Issue: #14516, #20716
Diffstat (limited to 'Modules/Compiler/XL-CXX.cmake')
-rw-r--r--Modules/Compiler/XL-CXX.cmake5
1 files changed, 3 insertions, 2 deletions
diff --git a/Modules/Compiler/XL-CXX.cmake b/Modules/Compiler/XL-CXX.cmake
index 3b911f3..41e3e11 100644
--- a/Modules/Compiler/XL-CXX.cmake
+++ b/Modules/Compiler/XL-CXX.cmake
@@ -6,8 +6,6 @@ string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL_INIT " -DNDEBUG")
# -qthreaded = Ensures that all optimizations will be thread-safe
string(APPEND CMAKE_CXX_FLAGS_INIT " -qthreaded")
-set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -+)
-
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.1)
if(CMAKE_SYSTEM MATCHES "Linux")
set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "")
@@ -34,3 +32,6 @@ if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.1)
endif ()
__compiler_check_default_language_standard(CXX 10.1 98)
+
+set(CMAKE_CXX_COMPILE_OBJECT
+ "<CMAKE_CXX_COMPILER> -+ <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")