summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCristian Adam <cristian.adam@gmail.com>2019-11-06 14:26:38 (GMT)
committerCristian Adam <cristian.adam@gmail.com>2019-11-06 15:21:45 (GMT)
commit9a7b4f47aa3cf4ce03aad117d2e1de893c34acb0 (patch)
treec610caadadaf5d3b95d594ae30a4e1433b2975e7
parente0ec13059a04491c601e158c137cddc0802a410c (diff)
downloadCMake-9a7b4f47aa3cf4ce03aad117d2e1de893c34acb0.zip
CMake-9a7b4f47aa3cf4ce03aad117d2e1de893c34acb0.tar.gz
CMake-9a7b4f47aa3cf4ce03aad117d2e1de893c34acb0.tar.bz2
ObjC: Mark explicitly the language for compilation
This way you can have .cpp files compiled as ObjC++. Fixes: #19926
-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 2baad4a..cb61cb8 100644
--- a/Modules/CMakeOBJCInformation.cmake
+++ b/Modules/CMakeOBJCInformation.cmake
@@ -165,7 +165,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> -o <OBJECT> -c <SOURCE>")
+ "<CMAKE_OBJC_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -x objective-c -o <OBJECT> -c <SOURCE>")
endif()
if(NOT CMAKE_OBJC_LINK_EXECUTABLE)
diff --git a/Modules/CMakeOBJCXXInformation.cmake b/Modules/CMakeOBJCXXInformation.cmake
index 3f55b01..71ac26a 100644
--- a/Modules/CMakeOBJCXXInformation.cmake
+++ b/Modules/CMakeOBJCXXInformation.cmake
@@ -258,7 +258,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> <FLAGS> -x objective-c++ -o <OBJECT> -c <SOURCE>")
endif()
if(NOT CMAKE_OBJCXX_LINK_EXECUTABLE)