cmake: Fix extract_symbols COPY_TO
Moved the symbols list formatting to the ExtractSymbols.cmake. The resulting list of symbols is sorted and printed in a more readable way (one symbol per line). Fixed the script to copy the generated symbols. Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Этот коммит содержится в:
родитель
5b07c1aa2c
Коммит
ca925588b0
@ -85,4 +85,8 @@ endforeach()
|
|||||||
|
|
||||||
list(REMOVE_DUPLICATES symbols)
|
list(REMOVE_DUPLICATES symbols)
|
||||||
|
|
||||||
file(WRITE ${OUTPUT_PATH} "${symbols}")
|
list(SORT symbols)
|
||||||
|
|
||||||
|
string(REPLACE ";" "\n" symbols_list "${symbols}")
|
||||||
|
|
||||||
|
file(WRITE ${OUTPUT_PATH} "${symbols_list}")
|
||||||
|
@ -94,7 +94,8 @@
|
|||||||
# Where the target ``symbols`` has its property ``LIST_FILE`` set to the path to
|
# Where the target ``symbols`` has its property ``LIST_FILE`` set to the path to
|
||||||
# a file containing::
|
# a file containing::
|
||||||
#
|
#
|
||||||
# ``symbol1;symbol2``
|
# ``symbol1``
|
||||||
|
# ``symbol2``
|
||||||
#
|
#
|
||||||
# This example would result in the symbol version script to be created in
|
# This example would result in the symbol version script to be created in
|
||||||
# ``${CMAKE_CURRENT_BINARY_DIR}/lib.map`` containing the provided symbols.
|
# ``${CMAKE_CURRENT_BINARY_DIR}/lib.map`` containing the provided symbols.
|
||||||
@ -213,7 +214,8 @@
|
|||||||
# Will result in a file ``lib.symbols.list`` in ``${CMAKE_CURRENT_BINARY_DIR}``
|
# Will result in a file ``lib.symbols.list`` in ``${CMAKE_CURRENT_BINARY_DIR}``
|
||||||
# containing::
|
# containing::
|
||||||
#
|
#
|
||||||
# ``exported_func1;exported_func2``
|
# ``exported_func1``
|
||||||
|
# ``exported_func2``
|
||||||
#
|
#
|
||||||
|
|
||||||
# Search for python which is required
|
# Search for python which is required
|
||||||
@ -314,7 +316,7 @@ function(get_file_list _TARGET_NAME)
|
|||||||
|
|
||||||
if (DEFINED _get_files_list_COPY_TO)
|
if (DEFINED _get_files_list_COPY_TO)
|
||||||
# Copy the generated file back to the COPY_TO
|
# Copy the generated file back to the COPY_TO
|
||||||
add_custom_target(copy_${TARGET_NAME} ALL
|
add_custom_target(copy_${_TARGET_NAME} ALL
|
||||||
COMMAND
|
COMMAND
|
||||||
${CMAKE_COMMAND} -E copy_if_different
|
${CMAKE_COMMAND} -E copy_if_different
|
||||||
${_FILES_LIST_OUTPUT_PATH} ${_get_files_list_COPY_TO}
|
${_FILES_LIST_OUTPUT_PATH} ${_get_files_list_COPY_TO}
|
||||||
@ -376,9 +378,14 @@ function(extract_symbols _TARGET_NAME)
|
|||||||
)
|
)
|
||||||
|
|
||||||
if (DEFINED _extract_symbols_COPY_TO)
|
if (DEFINED _extract_symbols_COPY_TO)
|
||||||
file(READ "${_SYMBOLS_OUTPUT_PATH}" SYMBOL_CONTENT)
|
# Copy the generated file back to the COPY_TO
|
||||||
string(REPLACE ";" "\n" SYMBOL_CONTENT_NEW "${SYMBOL_CONTENT}")
|
add_custom_target(copy_${_TARGET_NAME} ALL
|
||||||
file(WRITE "${_extract_symbols_COPY_TO}" "${SYMBOL_CONTENT_NEW}")
|
COMMAND
|
||||||
|
${CMAKE_COMMAND} -E copy_if_different
|
||||||
|
${_SYMBOLS_OUTPUT_PATH} ${_extract_symbols_COPY_TO}
|
||||||
|
DEPENDS "${_TARGET_NAME}"
|
||||||
|
COMMENT "Copying ${_TARGET_NAME} to ${_extract_symbols_COPY_TO}"
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user