/ CMakeLists.txt
CMakeLists.txt
  1  project(corefoundation)
  2  
  3  include(darling_framework)
  4  
  5  remove_sdk_framework(CoreFoundation)
  6  
  7  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fblocks -fconstant-cfstrings -fexceptions \
  8  	-include ${CMAKE_CURRENT_SOURCE_DIR}/CoreFoundation_Prefix.h \
  9  	-include ${CMAKE_CURRENT_SOURCE_DIR}/macros.h \
 10  	-Wno-bridge-cast \
 11  	-mmacosx-version-min=10.10")
 12  
 13  include_directories(
 14  	${CMAKE_CURRENT_SOURCE_DIR}
 15  	${CMAKE_SOURCE_DIR}/src/external/foundation/src
 16  )
 17  
 18  add_definitions(-DCF_BUILDING_CF
 19  	-DDEPLOYMENT_TARGET_MACOSX=1
 20  	-DU_SHOW_DRAFT_API=1
 21  	-DU_SHOW_CPLUSPLUS_API=0
 22  	-DINCLUDE_OBJC
 23  	-DDISPATCH_SUPPORT=1
 24  	-D__CONSTANT_CFSTRINGS__=1
 25  	-D__CONSTANT_STRINGS__=1
 26  	-DOBJC_OLD_DISPATCH_PROTOTYPES=1
 27  
 28  	-w
 29  	-nostdinc
 30  )
 31  
 32  set(cf_c_sources
 33  	CFApplicationPreferences.c
 34  	CFArray.c
 35  	CFAttributedString.c
 36  	CFBag.c
 37  	CFBase.c
 38  	CFBasicHash.c
 39  	CFBigNumber.c
 40  	CFBinaryHeap.c
 41  	CFBinaryPList.c
 42  	CFBitVector.c
 43  	CFBuiltinConverters.c
 44  	CFBundle_Binary.c
 45  	CFBundle.c
 46  	CFBundle_Grok.c
 47  	CFBundle_InfoPlist.c
 48  	CFBundle_Locale.c
 49  	CFBundle_Resources.c
 50  	CFBundle_Strings.c
 51  	CFBurstTrie.c
 52  	CFCalendar.c
 53  	CFConcreteStreams.c
 54  	CFData.c
 55  	CFDate.c
 56  	CFDateFormatter.c
 57  	CFDictionary.c
 58  	CFError.c
 59  	CFFileUtilities.c
 60  	CFCharacterSet.c
 61  	CFICUConverters.c
 62  	CFLocale.c
 63  	CFLocaleIdentifier.c
 64  	CFLocaleKeys.c
 65  	CFMachPort.c
 66  	CFMessagePort.c
 67  	CFNotificationCenter.c
 68  	CFNumber.c
 69  	CFNumberFormatter.c
 70  	CFOldStylePList.c
 71  	CFPlatform.c
 72  	CFPlatformConverters.c
 73  	CFPlugIn.c
 74  	CFPlugIn_Factory.c
 75  	CFPlugIn_Instance.c
 76  	CFPlugIn_PlugIn.c
 77  	CFPreferences.c
 78  	CFPropertyList.c
 79  	CFRunLoop.c
 80  	CFRuntime.c
 81  	CFSet.c
 82  	CFSocket.c
 83  	CFSocketStream.c
 84  	CFSortFunctions.c
 85  	CFStorage.c
 86  	CFStream.c
 87  	CFString.c
 88  	CFStringEncodingConverter.c
 89  	CFStringEncodingDatabase.c
 90  	CFStringEncodings.c
 91  	CFStringScanner.c
 92  	CFStringTokenizer.c
 93  	CFStringTransform.c
 94  	CFStringUtilities.c
 95  	CFSystemDirectories.c
 96  	CFTimeZone.c
 97  	CFTree.c
 98  	CFUnicodeDecomposition.c
 99  	CFUnicodePrecomposition.c
100  	CFUniChar.c
101  	CFURLAccess.c
102  	CFURL.c
103  	CFURLConstants.c
104  	CFUserNotification.c
105  	CFUtilities.c
106  	CFUUID.c
107  	CFVersion.c
108  	CFXMLInputStream.c
109  	CFXMLNode.c
110  	CFXMLParser.c
111  	CFXMLPreferencesDomain.c
112  	CFXMLTree.c
113  	CFURLEnumerator.c
114  	CFXPCBridge.c
115  )
116  
117  set(cf_sources
118  	${cf_c_sources}
119  	# CFStubs.m
120  	NSArray.m
121  	NSAttributedString.m
122  	NSBlock.m
123  	NSCache.m
124  	NSCalendar.m
125  	NSCFType.m
126  	NSConstantString.m
127  	NSData.m
128  	NSDateComponents.m
129  	NSDate.m
130  	NSDictionary.m
131  	NSEnumerator.m
132  	NSError.m
133  	NSException.m
134  	NSFastEnumerationEnumerator.m
135  	NSForwarding.m
136  	NSGenericDeallocHandler.m
137  	NSCharacterSet.m
138  	NSInputStream.m
139  	NSInvocation.m
140  	NSInvoke-x86.S
141  	NSLocale.m
142  	NSMessageBuilder.m
143  	NSMethodSignature.m
144  	NSNull.m
145  	NSNumber.m
146  	NSObjCRuntime.m
147  	NSObject.m
148  	NSOrderedSet.m
149  	NSOutputStream.m
150  	NSPropertyList.m
151  	NSRunLoop.m
152  	NSSet.m
153  	NSSharedKeyDictionary.m
154  	NSSharedKeySet.m
155  	NSStream.m
156  	NSString.m
157  	NSTimer.m
158  	NSTimeZone.m
159  	NSURL.m
160      NSUserDefaults.m
161  	NSZombie.m
162  	CFForwardingPrep.S
163  	FoundationExceptions.m
164  	NSRunLoopModes.m
165  	NSFileSecurity.m
166  	NSBlockInvocation.m
167  )
168  
169  set(FRAMEWORK_VERSION "A")
170  
171  generate_sdk_framework(CoreFoundation
172      VERSION ${FRAMEWORK_VERSION}
173      HEADER "include/CoreFoundation"
174  )
175  
176  add_separated_framework(CoreFoundation
177  	CURRENT_VERSION
178  	SOURCES
179  		${cf_sources}
180  	VERSION ${FRAMEWORK_VERSION}
181  	DEPENDENCIES
182  		objc
183  		system
184  		icucore
185  	LINK_FLAGS
186  		"-Wl,-init,___CFInitialize \
187  		-Wl,-compatibility_version,150 \
188  		-Wl,-current_version,1153.18 \
189  		-Wl,-alias_list,${CMAKE_CURRENT_SOURCE_DIR}/SymbolAliases \
190  		-Wl,-sectcreate,__UNICODE,__csbitmaps,${CMAKE_CURRENT_SOURCE_DIR}/CFCharacterSetBitmaps.bitmap \
191  		-Wl,-sectcreate,__UNICODE,__properties,${CMAKE_CURRENT_SOURCE_DIR}/CFUniCharPropertyDatabase.data \
192  		-Wl,-sectcreate,__UNICODE,__data,${CMAKE_CURRENT_SOURCE_DIR}/CFUnicodeData-L.mapping \
193  		-Wl,-segprot,__UNICODE,r,r"
194  )
195  
196  if (TARGET_i386)
197  set_property(TARGET CoreFoundation_i386 APPEND_STRING PROPERTY
198    LINK_FLAGS " -Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/reexport_i386.exp \
199  	-Wl,-alias,.objc_class_name___NSCFConstantString,___CFConstantStringClassReference")
200  endif (TARGET_i386)
201  if (TARGET_x86_64)
202  set_property(TARGET CoreFoundation_x86_64 APPEND_STRING PROPERTY
203    LINK_FLAGS " -Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/reexport_x86_64.exp \
204  	-Wl,-alias,_OBJC_CLASS_\\$___NSCFConstantString,___CFConstantStringClassReference")
205  endif (TARGET_x86_64)
206  
207  set_source_files_properties(${cf_c_sources} PROPERTIES COMPILE_FLAGS "-x objective-c")
208  
209  add_darling_executable(plconvert plconvert.c)
210  target_link_libraries(plconvert CoreFoundation)
211  install(TARGETS plconvert DESTINATION libexec/darling/usr/bin)