this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Support for nested frameworks

Reexporting is also much, much easier with the new "reexport" function too.

Fixes #521

In order to nest a framework within another, set the new PARENT argument of
the darling_framework function to be the name of the framework to nest inside
(as a string, not a target name for now)

+65 -8
+17 -3
cmake/darling_framework.cmake
··· 2 2 include(darling_lib) 3 3 include(InstallSymlink) 4 4 5 + define_property(TARGET PROPERTY DYLIB_INSTALL_NAME BRIEF_DOCS "Stores the DYLIB_INSTALL_NAME of the framework's main binary" 6 + FULL_DOCS "Used to make reexporting child frameworks less painful.") 7 + 5 8 function(add_framework name) 6 - cmake_parse_arguments(FRAMEWORK "CURRENT_VERSION;FAT;PRIVATE" "VERSION;LINK_FLAGS" "SOURCES;DEPENDENCIES;CIRCULAR_DEPENDENCIES;RESOURCES" ${ARGN}) 9 + cmake_parse_arguments(FRAMEWORK "CURRENT_VERSION;FAT;PRIVATE" "VERSION;LINK_FLAGS;PARENT;PARENT_VERSION" 10 + "SOURCES;DEPENDENCIES;CIRCULAR_DEPENDENCIES;RESOURCES" ${ARGN}) 7 11 if (FRAMEWORK_CURRENT_VERSION) 8 12 set(my_name "${name}") 9 13 else (FRAMEWORK_CURRENT_VERSION) ··· 15 19 else (FRAMEWORK_PRIVATE) 16 20 set(dir_name "Frameworks") 17 21 endif (FRAMEWORK_PRIVATE) 22 + 23 + if(DEFINED FRAMEWORK_PARENT) 24 + if(NOT DEFINED FRAMEWORK_PARENT_VERSION) 25 + # 99% of the time it's version A 26 + set(FRAMEWORK_PARENT_VERSION "A") 27 + endif(NOT DEFINED FRAMEWORK_PARENT_VERSION) 28 + InstallSymlink(Versions/Current/Frameworks 29 + "${CMAKE_INSTALL_PREFIX}/libexec/darling/System/Library/${dir_name}/${FRAMEWORK_PARENT}.framework/Frameworks") 30 + set(dir_name "${dir_name}/${FRAMEWORK_PARENT}.framework/Versions/${FRAMEWORK_PARENT_VERSION}/Frameworks") 31 + endif(DEFINED FRAMEWORK_PARENT) 18 32 19 33 set(DYLIB_INSTALL_NAME "/System/Library/${dir_name}/${name}.framework/Versions/${FRAMEWORK_VERSION}/${name}") 20 - 21 34 22 35 if (FRAMEWORK_CIRCULAR_DEPENDENCIES) 23 36 if (FRAMEWORK_FAT) ··· 38 51 endif (FRAMEWORK_FAT) 39 52 40 53 endif (FRAMEWORK_CIRCULAR_DEPENDENCIES) 41 - 54 + 55 + set_property(TARGET ${my_name} PROPERTY DYLIB_INSTALL_NAME ${DYLIB_INSTALL_NAME}) 42 56 43 57 if (FRAMEWORK_CURRENT_VERSION) 44 58 add_library("${name}_${FRAMEWORK_VERSION}" ALIAS "${name}")
+14 -1
cmake/use_ld64.cmake
··· 1 + set(dylib_paths "") 1 2 FUNCTION(use_ld64 target) 3 + get_property(ld_dylib_paths GLOBAL PROPERTY ld_dylib_paths) 4 + message("dylib path is ${ld_dylib_paths}") 2 5 set_property(TARGET ${target} APPEND_STRING PROPERTY 3 6 LINK_FLAGS " -B ${CMAKE_BINARY_DIR}/src/external/cctools-port/cctools/ld64/src/ \ 4 7 -B ${CMAKE_BINARY_DIR}/src/external/cctools-port/cctools/misc/ \ ··· 58 61 -Wl,-dylib_file,/usr/lib/native/libGL.dylib:${CMAKE_BINARY_DIR}/src/native/libGL.dylib \ 59 62 -Wl,-dylib_file,/System/Library/Frameworks/CoreImage.framework/Versions/A/CoreImage:${CMAKE_BINARY_DIR}/src/CoreImage/CoreImage \ 60 63 -Wl,-dylib_file,/System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo:${CMAKE_BINARY_DIR}/src/CoreVideo/CoreVideo \ 61 - ") 64 + ${ld_dylib_paths}") 62 65 63 66 add_dependencies(${target} x86_64-apple-darwin11-ld) 64 67 65 68 ENDFUNCTION(use_ld64) 66 69 70 + function(reexport reexporter reexportee) 71 + get_property(reexportee_binary_dir TARGET ${reexportee} PROPERTY BINARY_DIR) 72 + get_property(reexportee_output_name TARGET ${reexportee} PROPERTY OUTPUT_NAME) 73 + set(reexportee_output "${reexportee_binary_dir}/${reexportee_output_name}") 74 + get_property(reexportee_install_name TARGET ${reexportee} PROPERTY DYLIB_INSTALL_NAME) 75 + set_property(TARGET ${reexporter} APPEND_STRING PROPERTY 76 + LINK_FLAGS " -Wl,-reexport_library,${reexportee_output} ") 77 + set_property(GLOBAL APPEND_STRING PROPERTY ld_dylib_paths " -Wl,-dylib_file,${reexportee_install_name}:${reexportee_output} ") 78 + add_dependencies(${reexporter} ${reexportee}) 79 + endfunction(reexport)
+34 -4
src/CoreServices/CMakeLists.txt
··· 46 46 LSApplicationProxy.m 47 47 LSApplicationWorkspace.m 48 48 constants.m 49 - 50 - src/FSEvents.c 51 - src/LaunchServices.c 52 49 ) 53 50 54 51 if (WITH_COREAUDIO) ··· 56 53 endif (WITH_COREAUDIO) 57 54 58 55 set(DYLIB_COMPAT_VERSION "1.0.0") 59 - set(DYLIB_CURRENT_VERSION "1.0.0") 56 + set(DYLIB_CURRENT_VERSION "1239.200.12") 57 + add_framework(FSEvents 58 + FAT 59 + CURRENT_VERSION 60 + VERSION "A" 61 + PARENT "CoreServices" 62 + SOURCES 63 + src/FSEvents/FSEvents.c 64 + DEPENDENCIES 65 + CoreFoundation 66 + system 67 + ) 68 + 69 + set(DYLIB_COMPAT_VERSION "1.0.0") 70 + set(DYLIB_CURRENT_VERSION "945.0.0") 71 + add_framework(LaunchServices 72 + FAT 73 + CURRENT_VERSION 74 + VERSION "A" 75 + PARENT "CoreServices" 76 + SOURCES 77 + src/LaunchServices/LaunchServices.c 78 + DEPENDENCIES 79 + CoreFoundation 80 + system 81 + ) 82 + 83 + set(DYLIB_COMPAT_VERSION "1.0.0") 84 + set(DYLIB_CURRENT_VERSION "945.0.0") 60 85 add_framework(CoreServices 61 86 FAT 62 87 CURRENT_VERSION ··· 64 89 SOURCES 65 90 ${CoreServices_SRCS} 66 91 DEPENDENCIES 92 + FSEvents 93 + LaunchServices 67 94 icucore 68 95 system 69 96 CoreFoundation ··· 72 99 Foundation 73 100 ${EXTRA_LIBS} 74 101 ) 102 + 103 + reexport(CoreServices FSEvents) 104 + reexport(CoreServices LaunchServices) 75 105 76 106 install(FILES SystemVersion.plist DESTINATION "libexec/darling/System/Library/CoreServices") 77 107
src/CoreServices/src/FSEvents.c src/CoreServices/src/FSEvents/FSEvents.c
src/CoreServices/src/LaunchServices.c src/CoreServices/src/LaunchServices/LaunchServices.c