فهرست منبع

enable ARC in cmake

require ARC in cmake
James Robert 4 سال پیش
والد
کامیت
ad0e6fa0ac
2فایلهای تغییر یافته به همراه10 افزوده شده و 0 حذف شده
  1. 6 0
      src/CMakeLists.txt
  2. 4 0
      src/macos/NSURLClient.mm

+ 6 - 0
src/CMakeLists.txt

@@ -96,6 +96,12 @@ if (USE_SCHANNEL_BACKEND)
 endif ()
 endif ()
 
 
 if (USE_NSURL_BACKEND)
 if (USE_NSURL_BACKEND)
+	set_target_properties(
+		https-nsurl
+		PROPERTIES
+		MACOSX_BUNDLE YES
+		XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES  
+	)
 	target_link_libraries (https "-framework Foundation")
 	target_link_libraries (https "-framework Foundation")
 	target_link_libraries (https https-nsurl)
 	target_link_libraries (https https-nsurl)
 endif ()
 endif ()

+ 4 - 0
src/macos/NSURLClient.mm

@@ -2,6 +2,10 @@
 
 
 #include "NSURLClient.h"
 #include "NSURLClient.h"
 
 
+#if ! __has_feature(objc_arc)
+#error "ARC is off"
+#endif
+
 bool NSURLClient::valid() const
 bool NSURLClient::valid() const
 {
 {
 	return true;
 	return true;