[CI] Simplify CMake build with modern CMake techniques (#5871)
* [CI] Simplify CMake build * Make sure that plugins can be built * [CI] Install lz4 on Mac
This commit is contained in:
committed by
GitHub
parent
22a31b1faa
commit
0d411b0397
@@ -7,7 +7,7 @@ SHELL ["/bin/bash", "-c"] # Use Bash as shell
|
||||
# Install all basic requirements
|
||||
RUN \
|
||||
apt-get update && \
|
||||
apt-get install -y tar unzip wget git build-essential doxygen graphviz llvm libasan2 libidn11 && \
|
||||
apt-get install -y tar unzip wget git build-essential doxygen graphviz llvm libasan2 libidn11 liblz4-dev && \
|
||||
# CMake
|
||||
wget -nv -nc https://cmake.org/files/v3.13/cmake-3.13.0-Linux-x86_64.sh --no-check-certificate && \
|
||||
bash cmake-3.13.0-Linux-x86_64.sh --skip-license --prefix=/usr && \
|
||||
|
||||
@@ -12,8 +12,9 @@ if (USE_CUDA)
|
||||
file(GLOB_RECURSE CUDA_TEST_SOURCES "*.cu")
|
||||
list(APPEND TEST_SOURCES ${CUDA_TEST_SOURCES})
|
||||
endif (USE_CUDA)
|
||||
add_executable(testxgboost ${TEST_SOURCES} ${XGBOOST_OBJ_SOURCES}
|
||||
add_executable(testxgboost ${TEST_SOURCES}
|
||||
${xgboost_SOURCE_DIR}/plugin/example/custom_obj.cc)
|
||||
target_link_libraries(testxgboost PRIVATE objxgboost)
|
||||
|
||||
if (USE_CUDA)
|
||||
# OpenMP is mandatory for CUDA
|
||||
@@ -73,10 +74,8 @@ set_target_properties(
|
||||
CXX_STANDARD_REQUIRED ON)
|
||||
target_link_libraries(testxgboost
|
||||
PRIVATE
|
||||
${GTEST_LIBRARIES}
|
||||
${LINKED_LIBRARIES_PRIVATE})
|
||||
${GTEST_LIBRARIES})
|
||||
|
||||
target_compile_definitions(testxgboost PRIVATE ${XGBOOST_DEFINITIONS})
|
||||
set_output_directory(testxgboost ${xgboost_BINARY_DIR})
|
||||
|
||||
# This grouping organises source files nicely in visual studio
|
||||
|
||||
Reference in New Issue
Block a user