diff options
author | Brad King <brad.king@kitware.com> | 2020-09-30 12:05:52 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-09-30 12:06:57 (GMT) |
commit | 848eb295de4985faaac74fccf4628ca152744f0d (patch) | |
tree | eb7dd02f9295292ceb8fe117e278c9644e145133 | |
parent | d4c149a738cec00a01c65a5a24d9aa73a1dc5fd8 (diff) | |
parent | 8a2977ba55367c91f2f66055ea2cc1304e1a42b1 (diff) | |
download | CMake-848eb295de4985faaac74fccf4628ca152744f0d.zip CMake-848eb295de4985faaac74fccf4628ca152744f0d.tar.gz CMake-848eb295de4985faaac74fccf4628ca152744f0d.tar.bz2 |
Merge topic 'cxx-as-objcxx' into release-3.18
8a2977ba55 OBJCXX: Fix regression for compiling cpp files as objcxx
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5296
-rw-r--r-- | Modules/CMakeOBJCInformation.cmake | 2 | ||||
-rw-r--r-- | Modules/CMakeOBJCXXInformation.cmake | 2 | ||||
-rw-r--r-- | Tests/ObjCXX/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Tests/ObjCXX/cxx-as-objcxx/CMakeLists.txt | 5 | ||||
-rw-r--r-- | Tests/ObjCXX/cxx-as-objcxx/main.cpp | 6 |
5 files changed, 14 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) diff --git a/Tests/ObjCXX/CMakeLists.txt b/Tests/ObjCXX/CMakeLists.txt index a2a907a..cf03771 100644 --- a/Tests/ObjCXX/CMakeLists.txt +++ b/Tests/ObjCXX/CMakeLists.txt @@ -2,3 +2,4 @@ ADD_TEST_MACRO(ObjCXX.ObjC++ ObjC++) ADD_TEST_MACRO(ObjCXX.simple-build-test simple-build-test) ADD_TEST_MACRO(ObjCXX.cxx-file-extension-test cxx-file-extension-test) ADD_TEST_MACRO(ObjCXX.objcxx-file-extension-test objcxx-file-extension-test) +ADD_TEST_MACRO(ObjCXX.cxx-as-objcxx cxx-as-objcxx) diff --git a/Tests/ObjCXX/cxx-as-objcxx/CMakeLists.txt b/Tests/ObjCXX/cxx-as-objcxx/CMakeLists.txt new file mode 100644 index 0000000..23f6891 --- /dev/null +++ b/Tests/ObjCXX/cxx-as-objcxx/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 3.18) +project(cxx-as-objcxx LANGUAGES OBJCXX) + +add_executable(cxx-as-objcxx main.cpp) +set_source_files_properties(main.cpp PROPERTIES LANGUAGE OBJCXX) diff --git a/Tests/ObjCXX/cxx-as-objcxx/main.cpp b/Tests/ObjCXX/cxx-as-objcxx/main.cpp new file mode 100644 index 0000000..701c567 --- /dev/null +++ b/Tests/ObjCXX/cxx-as-objcxx/main.cpp @@ -0,0 +1,6 @@ +#import <Foundation/Foundation.h> + +int main(int argc, char* argv[]) +{ + return 0; +} |