1
0
Fork 0

Use BINARY_DIR and STEP_TARGETS in external_dispatch

This commit is contained in:
Ilya Fedin 2021-12-10 17:38:20 +04:00 committed by John Preston
parent 509ab07763
commit fa0200e361

View file

@ -19,10 +19,7 @@ if (DESKTOP_APP_USE_PACKAGED)
endif() endif()
add_library(external_dispatch_bundled STATIC IMPORTED) add_library(external_dispatch_bundled STATIC IMPORTED)
set(dispatch_loc ${third_party_loc}/dispatch) set(dispatch_loc ${third_party_loc}/dispatch)
set(dispatch_prefix ${CMAKE_CURRENT_BINARY_DIR}/dispatch-prefix)
set(dispatch_binary_dir ${dispatch_prefix}/src/dispatch-build)
include(ExternalProject) include(ExternalProject)
ExternalProject_Add(dispatch ExternalProject_Add(dispatch
@ -34,14 +31,16 @@ ExternalProject_Add(dispatch
-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_COMPILER=clang++
-DBUILD_SHARED_LIBS=OFF -DBUILD_SHARED_LIBS=OFF
-DBUILD_TESTING=OFF -DBUILD_TESTING=OFF
INSTALL_COMMAND : STEP_TARGETS build
EXCLUDE_FROM_ALL TRUE
BUILD_BYPRODUCTS BUILD_BYPRODUCTS
${dispatch_binary_dir}/src/libdispatch.a <BINARY_DIR>/src/libdispatch.a
${dispatch_binary_dir}/src/BlocksRuntime/libBlocksRuntime.a <BINARY_DIR>/src/BlocksRuntime/libBlocksRuntime.a
) )
ExternalProject_Get_property(jemalloc BINARY_DIR)
set_target_properties(external_dispatch_bundled PROPERTIES set_target_properties(external_dispatch_bundled PROPERTIES
IMPORTED_LOCATION "${dispatch_binary_dir}/src/libdispatch.a" IMPORTED_LOCATION "${BINARY_DIR}/src/libdispatch.a"
) )
target_include_directories(external_dispatch_bundled SYSTEM target_include_directories(external_dispatch_bundled SYSTEM
@ -51,11 +50,11 @@ INTERFACE
target_link_libraries(external_dispatch_bundled target_link_libraries(external_dispatch_bundled
INTERFACE INTERFACE
${dispatch_binary_dir}/src/BlocksRuntime/libBlocksRuntime.a ${BINARY_DIR}/src/BlocksRuntime/libBlocksRuntime.a
pthread pthread
) )
add_dependencies(external_dispatch_bundled dispatch) add_dependencies(external_dispatch_bundled dispatch-build)
target_link_libraries(external_dispatch target_link_libraries(external_dispatch
INTERFACE INTERFACE