mirror of
https://github.com/wassname/ray.git
synced 2026-07-05 13:44:47 +08:00
Add dependency between copy_ray and python extensions (#2221)
This commit is contained in:
committed by
Philipp Moritz
parent
32b9a4d3f1
commit
cb5e6e6d68
@@ -97,6 +97,16 @@ if ("${CMAKE_RAY_LANG_PYTHON}" STREQUAL "YES")
|
||||
add_custom_target(copy_ray ALL
|
||||
DEPENDS ${build_ray_file_list})
|
||||
|
||||
# Make sure that the Python extensions are built before copying the files.
|
||||
if ("${CMAKE_RAY_LANG_PYTHON}" STREQUAL "YES")
|
||||
get_local_scheduler_library("python" LOCAL_SCHEDULER_LIBRARY_LANG)
|
||||
add_dependencies(copy_ray ${LOCAL_SCHEDULER_LIBRARY_LANG})
|
||||
endif()
|
||||
if ("${CMAKE_RAY_LANG_JAVA}" STREQUAL "YES")
|
||||
get_local_scheduler_library("java" LOCAL_SCHEDULER_LIBRARY_LANG)
|
||||
add_dependencies(copy_ray ${LOCAL_SCHEDULER_LIBRARY_LANG})
|
||||
endif()
|
||||
|
||||
foreach(file ${ray_file_list})
|
||||
add_custom_command(TARGET copy_ray POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E
|
||||
|
||||
@@ -70,24 +70,29 @@ add_executable(local_scheduler_tests test/local_scheduler_tests.cc local_schedul
|
||||
target_link_libraries(local_scheduler_tests local_scheduler_client common ${HIREDIS_LIB} ${PLASMA_STATIC_LIB} ray_static ${ARROW_STATIC_LIB} -lpthread ${Boost_SYSTEM_LIBRARY})
|
||||
target_compile_options(local_scheduler_tests PUBLIC "-DLOCAL_SCHEDULER_TEST")
|
||||
|
||||
macro(get_local_scheduler_library LANG VAR)
|
||||
set(${VAR} "local_scheduler_library_${LANG}")
|
||||
endmacro()
|
||||
|
||||
macro(set_local_scheduler_library LANG)
|
||||
get_local_scheduler_library(${LANG} LOCAL_SCHEDULER_LIBRARY_LANG)
|
||||
include_directories("${CMAKE_CURRENT_LIST_DIR}/../common/lib/${LANG}/")
|
||||
|
||||
file(GLOB LOCAL_SCHEDULER_LIBRARY_${LANG}_SRC
|
||||
lib/${LANG}/*.cc
|
||||
${CMAKE_CURRENT_LIST_DIR}/../common/lib/${LANG}/*.cc)
|
||||
add_library(local_scheduler_library_${LANG} SHARED
|
||||
add_library(${LOCAL_SCHEDULER_LIBRARY_LANG} SHARED
|
||||
${LOCAL_SCHEDULER_LIBRARY_${LANG}_SRC})
|
||||
|
||||
if(APPLE)
|
||||
target_link_libraries(local_scheduler_library_${LANG} "-undefined dynamic_lookup" local_scheduler_client common ray_static ${PLASMA_STATIC_LIB} ${ARROW_STATIC_LIB} ${Boost_SYSTEM_LIBRARY})
|
||||
target_link_libraries(${LOCAL_SCHEDULER_LIBRARY_LANG} "-undefined dynamic_lookup" local_scheduler_client common ray_static ${PLASMA_STATIC_LIB} ${ARROW_STATIC_LIB} ${Boost_SYSTEM_LIBRARY})
|
||||
else(APPLE)
|
||||
target_link_libraries(local_scheduler_library_${LANG} local_scheduler_client common ray_static ${PLASMA_STATIC_LIB} ${ARROW_STATIC_LIB} ${Boost_SYSTEM_LIBRARY})
|
||||
target_link_libraries(${LOCAL_SCHEDULER_LIBRARY_LANG} local_scheduler_client common ray_static ${PLASMA_STATIC_LIB} ${ARROW_STATIC_LIB} ${Boost_SYSTEM_LIBRARY})
|
||||
endif(APPLE)
|
||||
|
||||
add_dependencies(local_scheduler_library_${LANG} gen_local_scheduler_fbs)
|
||||
add_dependencies(${LOCAL_SCHEDULER_LIBRARY_LANG} gen_local_scheduler_fbs)
|
||||
|
||||
install(TARGETS local_scheduler_library_${LANG} DESTINATION ${CMAKE_SOURCE_DIR}/local_scheduler)
|
||||
install(TARGETS ${LOCAL_SCHEDULER_LIBRARY_LANG} DESTINATION ${CMAKE_SOURCE_DIR}/local_scheduler)
|
||||
endmacro()
|
||||
|
||||
if ("${CMAKE_RAY_LANG_PYTHON}" STREQUAL "YES")
|
||||
|
||||
Reference in New Issue
Block a user