summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/XcodeProject/XcodeObjcFlags.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/XcodeProject/XcodeObjcFlags.cmake')
-rw-r--r--Tests/RunCMake/XcodeProject/XcodeObjcFlags.cmake12
1 files changed, 12 insertions, 0 deletions
diff --git a/Tests/RunCMake/XcodeProject/XcodeObjcFlags.cmake b/Tests/RunCMake/XcodeProject/XcodeObjcFlags.cmake
new file mode 100644
index 0000000000..4840276ae8
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/XcodeObjcFlags.cmake
@@ -0,0 +1,12 @@
+cmake_minimum_required(VERSION 3.15)
+project(objctest LANGUAGES C OBJC)
+
+include(CheckOBJCCompilerFlag)
+check_objc_compiler_flag(-fobjc-arc HAVE_OBJC_ARC)
+
+if(HAVE_OBJC_ARC)
+ add_compile_options(-fobjc-arc)
+ add_compile_definitions(HAVE_OBJC_ARC)
+endif()
+
+add_library(myfuncs STATIC myfuncs.m)