summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorCristian Adam <cristian.adam@gmail.com>2020-09-29 15:24:27 (GMT)
committerBrad King <brad.king@kitware.com>2020-09-29 16:35:49 (GMT)
commit8a2977ba55367c91f2f66055ea2cc1304e1a42b1 (patch)
treecdae0c1c41a4d58f14ff0949c5fe9ee708c7d123 /Modules
parent7d4e9a3a3a579db66b2850beee9b70cd8e5fa6fa (diff)
downloadCMake-8a2977ba55367c91f2f66055ea2cc1304e1a42b1.zip
CMake-8a2977ba55367c91f2f66055ea2cc1304e1a42b1.tar.gz
CMake-8a2977ba55367c91f2f66055ea2cc1304e1a42b1.tar.bz2
OBJCXX: Fix regression for compiling cpp files as objcxx
In commit 8d61294c3e (PCH: Mark CMake PCH source files as -x <lang>-header, 2020-09-04, v3.18.3~14^2) we removed the explicit `-x objective-c++` flag. This broke cases with custom source extensions. Restore the explicit `-x objective-c[++]` flag and put it before the `<FLAGS>` placeholder. The latter will contain the proper `-x objective-c[++]-header` value and will override the `-x objective-c[++]` value set before. Fixes: #21234
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeOBJCInformation.cmake2
-rw-r--r--Modules/CMakeOBJCXXInformation.cmake2
2 files changed, 2 insertions, 2 deletions
diff --git a/Modules/CMakeOBJCInformation.cmake b/Modules/CMakeOBJCInformation.cmake
index b3da82d..d530191 100644
--- a/Modules/CMakeOBJCInformation.cmake
+++ b/Modules/CMakeOBJCInformation.cmake
@@ -170,7 +170,7 @@ endif()
# compile an Objective-C file into an object file
if(NOT CMAKE_OBJC_COMPILE_OBJECT)
set(CMAKE_OBJC_COMPILE_OBJECT
- "<CMAKE_OBJC_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -x objective-c -o <OBJECT> -c <SOURCE>")
+ "<CMAKE_OBJC_COMPILER> <DEFINES> <INCLUDES> -x objective-c <FLAGS> -o <OBJECT> -c <SOURCE>")
endif()
if(NOT CMAKE_OBJC_LINK_EXECUTABLE)
diff --git a/Modules/CMakeOBJCXXInformation.cmake b/Modules/CMakeOBJCXXInformation.cmake
index 4be9762..7a3b9d7 100644
--- a/Modules/CMakeOBJCXXInformation.cmake
+++ b/Modules/CMakeOBJCXXInformation.cmake
@@ -263,7 +263,7 @@ endif()
# compile an Objective-C++ file into an object file
if(NOT CMAKE_OBJCXX_COMPILE_OBJECT)
set(CMAKE_OBJCXX_COMPILE_OBJECT
- "<CMAKE_OBJCXX_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")
+ "<CMAKE_OBJCXX_COMPILER> <DEFINES> <INCLUDES> -x objective-c++ <FLAGS> -o <OBJECT> -c <SOURCE>")
endif()
if(NOT CMAKE_OBJCXX_LINK_EXECUTABLE)