ci: fix linux CI (#321)

This commit is contained in:
Eric Wasylishen 2021-09-12 16:40:56 -06:00 committed by GitHub
parent f284b96375
commit 28b4ec7f3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 9 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
BUILD_DIR=build BUILD_DIR=build-linux
if [ -d "$BUILD_DIR" ]; then if [ -d "$BUILD_DIR" ]; then
echo "$BUILD_DIR already exists, remove it first" echo "$BUILD_DIR already exists, remove it first"
@ -11,15 +11,20 @@ cmake --version
mkdir "$BUILD_DIR" mkdir "$BUILD_DIR"
cd "$BUILD_DIR" cd "$BUILD_DIR"
wget https://github.com/embree/embree/releases/download/v2.17.7/embree-2.17.7.x86_64.linux.tar.gz -O embree.tgz wget -q https://github.com/embree/embree/releases/download/v3.13.1/embree-3.13.1.x86_64.linux.tar.gz -O embree.tgz
wget https://github.com/intel/tbb/releases/download/2017_U7/tbb2017_20170604oss_lin.tgz -O tbb.tgz wget -q https://github.com/oneapi-src/oneTBB/releases/download/v2021.3.0/oneapi-tbb-2021.3.0-lin.tgz -O tbb.tgz
tar xf embree.tgz tar xf embree.tgz
tar xf tbb.tgz tar xf tbb.tgz
cmake .. -DCMAKE_BUILD_TYPE=Release -Dembree_DIR="$(pwd)/embree-2.17.7.x86_64.linux" -DTBB_DIR="$(pwd)/tbb2017_20170604oss/cmake"
make -j8 VERBOSE=1 EMBREE_CMAKE_DIR="$(pwd)/embree-3.13.1.x86_64.linux/lib/cmake/embree-3.13.1"
make -j8 VERBOSE=1 testlight TBB_CMAKE_DIR="$(pwd)/oneapi-tbb-2021.3.0/lib/cmake"
make -j8 VERBOSE=1 testqbsp
cpack cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$EMBREE_CMAKE_DIR;$TBB_CMAKE_DIR"
make -j8 VERBOSE=1 || exit 1
make -j8 VERBOSE=1 testlight || exit 1
make -j8 VERBOSE=1 testqbsp || exit 1
cpack || exit 1
# run tests # run tests
./light/testlight || exit 1 ./light/testlight || exit 1

View File

@ -83,8 +83,23 @@ if (embree_FOUND)
add_custom_command(TARGET light POST_BUILD add_custom_command(TARGET light POST_BUILD
COMMAND bash ARGS -c \"install_name_tool -add_rpath @loader_path $<TARGET_FILE:light> || true\") COMMAND bash ARGS -c \"install_name_tool -add_rpath @loader_path $<TARGET_FILE:light> || true\")
endif() endif()
install(FILES $<TARGET_FILE:embree> DESTINATION bin)
# install TBB
if(UNIX)
# HACK: preferred method is installing the symlink instead of the actual .so
get_target_property(TBB_SO_FILE_SYMLINK TBB::tbb IMPORTED_LOCATION_RELEASE)
get_filename_component(TBB_SO_FILE "${TBB_SO_FILE_SYMLINK}" REALPATH)
message(STATUS "TBB .so file: ${TBB_SO_FILE}")
install(FILES ${TBB_SO_FILE} DESTINATION bin)
else()
# preferred method
install(FILES $<TARGET_FILE:TBB::tbb> DESTINATION bin)
endif()
install(FILES "$<TARGET_FILE:embree>" "$<TARGET_FILE:TBB::tbb>" DESTINATION bin)
install(FILES ${EMBREE_LICENSE} DESTINATION bin RENAME LICENSE-embree.txt) install(FILES ${EMBREE_LICENSE} DESTINATION bin RENAME LICENSE-embree.txt)
endif(embree_FOUND) endif(embree_FOUND)