Land #329, modify symbol exports for Darwin with cmake builds
This commit is contained in:
commit
e53af8da67
@ -10,7 +10,13 @@ macro(export_symbol TARGET FILENAME)
|
||||
target_sources(${TARGET} PRIVATE ${DEF_FILENAME})
|
||||
|
||||
elseif(APPLE)
|
||||
set(FLAG "-exported_symbols_list ${FILENAME}")
|
||||
file(READ ${FILENAME} SYMBOLS)
|
||||
string(REGEX REPLACE "\n$" "" SYMBOLS ${SYMBOLS})
|
||||
string(REPLACE "\n" "\n_" SYMBOLS ${SYMBOLS})
|
||||
string(REGEX REPLACE "(.)$" "\\1\\n" SYMBOLS ${SYMBOLS})
|
||||
string(REPLACE ".sym" ".exp" EXP_FILENAME ${FILENAME})
|
||||
file(WRITE ${EXP_FILENAME} "_${SYMBOLS}")
|
||||
set(FLAG "-exported_symbols_list ${EXP_FILENAME}")
|
||||
set_target_properties(${TARGET} PROPERTIES LINK_FLAGS ${FLAG})
|
||||
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "HP-UX")
|
||||
|
Loading…
x
Reference in New Issue
Block a user