mirror of
https://github.com/monero-project/monero.git
synced 2025-01-26 00:25:57 -05:00
cmake: add different parameters to add_monero_library.
1. LINKS flag, will link publicly the libraries provided. 2. PRIVATE_LINKS flag, will link privately the libraries provided. 3. INCLUDES flag, will includes publicly the dirs provided. 4. PRIVATE_INCLUDES flag, will include privately the libraries provided.
This commit is contained in:
parent
5074a543a4
commit
b91ead9025
@ -643,7 +643,7 @@ function (monero_add_library name)
|
||||
endfunction()
|
||||
|
||||
function (monero_add_library_with_deps)
|
||||
cmake_parse_arguments(MONERO_ADD_LIBRARY "" "NAME" "DEPENDS;SOURCES" ${ARGN})
|
||||
cmake_parse_arguments(MONERO_ADD_LIBRARY "" "NAME" "DEPENDS;LINKS;PRIVATE_LINKS;INCLUDES;PRIVATE_INCLUDES;SOURCES" ${ARGN})
|
||||
source_group("${MONERO_ADD_LIBRARY_NAME}" FILES ${MONERO_ADD_LIBRARY_SOURCES})
|
||||
|
||||
# Define a ("virtual") object library and an actual library that links those
|
||||
@ -658,6 +658,22 @@ function (monero_add_library_with_deps)
|
||||
if (MONERO_ADD_LIBRARY_DEPENDS)
|
||||
add_dependencies(${objlib} ${MONERO_ADD_LIBRARY_DEPENDS})
|
||||
endif()
|
||||
if (MONERO_ADD_LIBRARY_LINKS)
|
||||
target_link_libraries(${objlib} PUBLIC ${MONERO_ADD_LIBRARY_LINKS})
|
||||
target_link_libraries(${MONERO_ADD_LIBRARY_NAME} PUBLIC ${MONERO_ADD_LIBRARY_LINKS})
|
||||
endif()
|
||||
if (MONERO_ADD_LIBRARY_PRIVATE_LINKS)
|
||||
target_link_libraries(${objlib} PRIVATE ${MONERO_ADD_LIBRARY_PRIVATE_LINKS})
|
||||
target_link_libraries(${MONERO_ADD_LIBRARY_NAME} PRIVATE ${MONERO_ADD_LIBRARY_PRIVATE_LINKS})
|
||||
endif()
|
||||
if (MONERO_ADD_LIBRARY_INCLUDES)
|
||||
target_include_directories(${objlib} PUBLIC ${MONERO_ADD_LIBRARY_INCLUDES})
|
||||
target_include_directories(${MONERO_ADD_LIBRARY_NAME} PUBLIC ${MONERO_ADD_LIBRARY_INCLUDES})
|
||||
endif()
|
||||
if (MONERO_ADD_LIBRARY_PRIVATE_INCLUDES)
|
||||
target_include_directories(${objlib} PRIVATE ${MONERO_ADD_LIBRARY_PRIVATE_INCLUDES})
|
||||
target_include_directories(${MONERO_ADD_LIBRARY_NAME} PRIVATE ${MONERO_ADD_LIBRARY_PRIVATE_INCLUDES})
|
||||
endif()
|
||||
set_property(TARGET "${MONERO_ADD_LIBRARY_NAME}" PROPERTY FOLDER "libs")
|
||||
target_compile_definitions(${objlib}
|
||||
PRIVATE $<TARGET_PROPERTY:${MONERO_ADD_LIBRARY_NAME},INTERFACE_COMPILE_DEFINITIONS>)
|
||||
|
Loading…
x
Reference in New Issue
Block a user