Mach-O build

This commit is contained in:
Lubos Dolezel 2017-01-17 18:55:50 +01:00
parent f5a33eaeb7
commit 56c183f8e3

View File

@ -9,7 +9,6 @@ endif(COMMAND cmake_policy)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -nostdinc -D__DARWIN_UNIX03 -fPIC -w")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -nostdinc -nostdinc++ -D__DARWIN_UNIX03 -fPIC -w")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -nostdlib -Wl,--unresolved-symbols=ignore-all -Wl,--version-script=${DARLING_TOP_DIRECTORY}/darwin.map")
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/pcre)
add_definitions(-DHAVE_CONFIG_H)
@ -38,14 +37,29 @@ set(pcre_SRCS
)
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/darling")
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
add_library(pcre SHARED ${pcre_SRCS})
set(DYLIB_INSTALL_NAME "/usr/lib/libpcre.0.dylib")
add_darling_library(pcre SHARED ${pcre_SRCS})
set_target_properties(pcre PROPERTIES OUTPUT_NAME "pcre.0")
target_link_libraries(pcre system)
install(TARGETS pcre DESTINATION ${CMAKE_INSTALL_LIBDIR}/darling)
InstallSymlink("libpcre.0.dylib" "${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/lib/libpcre.dylib")
install(TARGETS pcre DESTINATION libexec/darling/usr/lib)
add_darling_executable(pcregrep pcre/pcregrep.c)
target_link_libraries(pcregrep system pcre)
add_darling_executable(pcretest pcre/pcretest.c)
target_link_libraries(pcretest system pcre)
set(DYLIB_INSTALL_NAME "/usr/lib/libpcreposix.0.dylib")
add_darling_library(pcreposix SHARED pcre/pcreposix.c)
set_target_properties(pcreposix PROPERTIES OUTPUT_NAME "pcreposix.0")
target_link_libraries(pcreposix system pcre)
InstallSymlink("libpcreposix.0.dylib" "${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/lib/libpcreposix.dylib")
install(TARGETS pcreposix DESTINATION libexec/darling/usr/lib)
install(TARGETS pcregrep pcretest DESTINATION libexec/darling/usr/bin)
install(FILES
pcre/doc/pcre-config.1