2021-09-14 00:13:48 +02:00
|
|
|
enable_language (OBJCXX)
|
2022-11-16 20:14:03 +01:00
|
|
|
include(CheckOBJCXXSourceCompiles)
|
2021-09-14 00:13:48 +02:00
|
|
|
|
|
|
|
set(OBJCXX 1) # test that this is tolerated
|
|
|
|
|
2022-11-16 20:14:03 +01:00
|
|
|
check_objcxx_source_compiles("I don't build in Objective-C++" SHOULD_FAIL)
|
|
|
|
if(SHOULD_FAIL)
|
|
|
|
message(SEND_ERROR "invalid OBJCXX source didn't fail.")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
check_objcxx_source_compiles([[
|
2021-09-14 00:13:48 +02:00
|
|
|
#include <vector>
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
int main() {
|
|
|
|
std::vector<int> v;
|
|
|
|
NSObject *foo;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
]] SHOULD_BUILD)
|
|
|
|
|
|
|
|
|
|
|
|
if(NOT SHOULD_BUILD)
|
|
|
|
message(SEND_ERROR "Test fail for OBJCXX source.")
|
|
|
|
endif()
|