mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
cmake: add a dummy c++ file to force linkage
The hs dylib when built with Xcode wasn't being linked to C++ runtime libs. Fixes #69
This commit is contained in:
parent
3fa1236f09
commit
3d235f4474
@ -1271,22 +1271,39 @@ if (NOT BUILD_SHARED_LIBS)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (BUILD_STATIC_AND_SHARED OR BUILD_SHARED_LIBS)
|
if (BUILD_STATIC_AND_SHARED OR BUILD_SHARED_LIBS)
|
||||||
if (NOT FAT_RUNTIME)
|
set(hs_shared_SRCS
|
||||||
add_library(hs_shared SHARED src/hs_version.c src/hs_valid_platform.c
|
src/hs_version.c
|
||||||
$<TARGET_OBJECTS:hs_compile_shared> $<TARGET_OBJECTS:hs_exec_shared>)
|
src/hs_valid_platform.c
|
||||||
else()
|
$<TARGET_OBJECTS:hs_compile_shared>)
|
||||||
add_library(hs_shared SHARED src/hs_version.c src/hs_valid_platform.c
|
|
||||||
$<TARGET_OBJECTS:hs_compile_shared> $<TARGET_OBJECTS:hs_exec_common_shared>
|
if (XCODE)
|
||||||
${RUNTIME_SHLIBS})
|
# force this lib to use C++ linkage
|
||||||
|
add_custom_command(OUTPUT empty.cxx
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E touch empty.cxx)
|
||||||
|
set (hs_shared_SRCS ${hs_shared_SRCS} empty.cxx)
|
||||||
|
endif (XCODE)
|
||||||
|
|
||||||
|
if (NOT FAT_RUNTIME)
|
||||||
|
set(hs_shared_SRCS
|
||||||
|
${hs_shared_SRCS}
|
||||||
|
$<TARGET_OBJECTS:hs_exec_shared>)
|
||||||
|
else ()
|
||||||
|
set(hs_shared_SRCS
|
||||||
|
${hs_shared_SRCS}
|
||||||
|
$<TARGET_OBJECTS:hs_exec_common_shared>
|
||||||
|
${RUNTIME_SHLIBS})
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
add_library(hs_shared SHARED ${hs_shared_SRCS})
|
||||||
|
|
||||||
endif()
|
|
||||||
add_dependencies(hs_shared ragel_Parser)
|
add_dependencies(hs_shared ragel_Parser)
|
||||||
set_target_properties(hs_shared PROPERTIES
|
set_target_properties(hs_shared PROPERTIES
|
||||||
OUTPUT_NAME hs
|
OUTPUT_NAME hs
|
||||||
VERSION ${LIB_VERSION}
|
VERSION ${LIB_VERSION}
|
||||||
SOVERSION ${LIB_SOVERSION}
|
SOVERSION ${LIB_SOVERSION}
|
||||||
MACOSX_RPATH ON)
|
MACOSX_RPATH ON)
|
||||||
install(TARGETS hs_shared
|
|
||||||
|
install(TARGETS hs_shared
|
||||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user