summaryrefslogtreecommitdiff
path: root/deps/gyp/test/mac/objc-arc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/gyp/test/mac/objc-arc')
-rw-r--r--deps/gyp/test/mac/objc-arc/c-file.c6
-rw-r--r--deps/gyp/test/mac/objc-arc/cc-file.cc5
-rw-r--r--deps/gyp/test/mac/objc-arc/m-file-no-arc.m5
-rw-r--r--deps/gyp/test/mac/objc-arc/m-file.m5
-rw-r--r--deps/gyp/test/mac/objc-arc/mm-file-no-arc.mm5
-rw-r--r--deps/gyp/test/mac/objc-arc/mm-file.mm5
-rw-r--r--deps/gyp/test/mac/objc-arc/test.gyp45
7 files changed, 76 insertions, 0 deletions
diff --git a/deps/gyp/test/mac/objc-arc/c-file.c b/deps/gyp/test/mac/objc-arc/c-file.c
new file mode 100644
index 0000000000..653613206e
--- /dev/null
+++ b/deps/gyp/test/mac/objc-arc/c-file.c
@@ -0,0 +1,6 @@
+#if __has_feature(objc_arc)
+#error "C files shouldn't be ARC'd!"
+#endif
+
+void c_fun() {}
+
diff --git a/deps/gyp/test/mac/objc-arc/cc-file.cc b/deps/gyp/test/mac/objc-arc/cc-file.cc
new file mode 100644
index 0000000000..95e14ea3e0
--- /dev/null
+++ b/deps/gyp/test/mac/objc-arc/cc-file.cc
@@ -0,0 +1,5 @@
+#if __has_feature(objc_arc)
+#error "C++ files shouldn't be ARC'd!"
+#endif
+
+void cc_fun() {}
diff --git a/deps/gyp/test/mac/objc-arc/m-file-no-arc.m b/deps/gyp/test/mac/objc-arc/m-file-no-arc.m
new file mode 100644
index 0000000000..8ffaabfaae
--- /dev/null
+++ b/deps/gyp/test/mac/objc-arc/m-file-no-arc.m
@@ -0,0 +1,5 @@
+#if __has_feature(objc_arc)
+#error "ObjC files without CLANG_ENABLE_OBJC_ARC should not be ARC'd!"
+#endif
+
+void m_fun() {}
diff --git a/deps/gyp/test/mac/objc-arc/m-file.m b/deps/gyp/test/mac/objc-arc/m-file.m
new file mode 100644
index 0000000000..9689b1f8e5
--- /dev/null
+++ b/deps/gyp/test/mac/objc-arc/m-file.m
@@ -0,0 +1,5 @@
+#if !__has_feature(objc_arc)
+#error "ObjC files with CLANG_ENABLE_OBJC_ARC should be ARC'd!"
+#endif
+
+void m_fun() {}
diff --git a/deps/gyp/test/mac/objc-arc/mm-file-no-arc.mm b/deps/gyp/test/mac/objc-arc/mm-file-no-arc.mm
new file mode 100644
index 0000000000..0dac539494
--- /dev/null
+++ b/deps/gyp/test/mac/objc-arc/mm-file-no-arc.mm
@@ -0,0 +1,5 @@
+#if __has_feature(objc_arc)
+#error "ObjC++ files without CLANG_ENABLE_OBJC_ARC should not be ARC'd!"
+#endif
+
+void mm_fun() {}
diff --git a/deps/gyp/test/mac/objc-arc/mm-file.mm b/deps/gyp/test/mac/objc-arc/mm-file.mm
new file mode 100644
index 0000000000..9467e96563
--- /dev/null
+++ b/deps/gyp/test/mac/objc-arc/mm-file.mm
@@ -0,0 +1,5 @@
+#if !__has_feature(objc_arc)
+#error "ObjC++ files with CLANG_ENABLE_OBJC_ARC should be ARC'd!"
+#endif
+
+void mm_fun() {}
diff --git a/deps/gyp/test/mac/objc-arc/test.gyp b/deps/gyp/test/mac/objc-arc/test.gyp
new file mode 100644
index 0000000000..59cf0e29ce
--- /dev/null
+++ b/deps/gyp/test/mac/objc-arc/test.gyp
@@ -0,0 +1,45 @@
+# Copyright (c) 2013 Google Inc. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+{
+ 'make_global_settings': [
+ ['CC', '/usr/bin/clang'],
+ ['CXX', '/usr/bin/clang++'],
+ ],
+
+ 'targets': [
+ {
+ 'target_name': 'arc_enabled',
+ 'type': 'static_library',
+ 'sources': [
+ 'c-file.c',
+ 'cc-file.cc',
+ 'm-file.m',
+ 'mm-file.mm',
+ ],
+ 'xcode_settings': {
+ 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
+ 'MACOSX_DEPLOYMENT_TARGET': '10.6',
+ 'ARCHS': [ 'x86_64' ], # For the non-fragile objc ABI.
+ 'CLANG_ENABLE_OBJC_ARC': 'YES',
+ },
+ },
+
+ {
+ 'target_name': 'arc_disabled',
+ 'type': 'static_library',
+ 'sources': [
+ 'c-file.c',
+ 'cc-file.cc',
+ 'm-file-no-arc.m',
+ 'mm-file-no-arc.mm',
+ ],
+ 'xcode_settings': {
+ 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
+ 'MACOSX_DEPLOYMENT_TARGET': '10.6',
+ 'ARCHS': [ 'x86_64' ], # For the non-fragile objc ABI.
+ },
+ },
+ ],
+}
+