uchardet/src/symbols.cmake
Jehan 908f9b8ba7 src, test: rename s/uchardet_get_candidates/uchardet_get_n_candidates/.
This was badly named as this function does not return candidates, but
the number of candidates (to be actually used in other API).
2022-12-14 00:24:53 +01:00

42 lines
1.1 KiB
CMake

set(
UCHARDET_SYMBOLS
uchardet_new
uchardet_delete
uchardet_handle_data
uchardet_data_end
uchardet_reset
uchardet_get_charset
uchardet_get_n_candidates
uchardet_get_encoding
uchardet_get_confidence
uchardet_get_language
uchardet_set_default_weight
uchardet_weigh_language
)
set (LINK_FLAGS "")
if (APPLE)
# Create a symbols_list file for the Darwin linker.
string(REPLACE ";" "\n_" _symbols "${UCHARDET_SYMBOLS}")
set(_symbols_list "${CMAKE_CURRENT_BINARY_DIR}/symbols.list")
file(WRITE ${_symbols_list} "_${_symbols}\n")
set(LINK_FLAGS
"${LINK_FLAGS} -Wl,-exported_symbols_list,'${_symbols_list}'")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL GNU)
# Create a version script for the GNU ld.
set(_symbols "{ global: ${UCHARDET_SYMBOLS}; local: *; };")
set(_version_script "${CMAKE_CURRENT_BINARY_DIR}/version.script")
file(WRITE ${_version_script} "${_symbols}\n")
set(LINK_FLAGS "${LINK_FLAGS} -Wl,--version-script,\"${_version_script}\"")
endif (APPLE)
set_target_properties(
${UCHARDET_LIBRARY}
PROPERTIES
LINK_FLAGS
"${LINK_FLAGS}"
)