mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-07 06:09:52 -06:00
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
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
5
Tests/ObjCXX/cxx-as-objcxx/CMakeLists.txt
Normal file
5
Tests/ObjCXX/cxx-as-objcxx/CMakeLists.txt
Normal file
@@ -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)
|
||||
6
Tests/ObjCXX/cxx-as-objcxx/main.cpp
Normal file
6
Tests/ObjCXX/cxx-as-objcxx/main.cpp
Normal file
@@ -0,0 +1,6 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user