Skip to content

Add install capabilities to top-level CMake config #101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ ExternalProject_Add(
scylla-rust-cpp-driver
DOWNLOAD_COMMAND ""
CONFIGURE_COMMAND ""
BUILD_COMMAND ./build-cmake-compat.sh $<IF:$<CONFIG:Debug>,DEBUG,RELEASE>
BUILD_COMMAND ./build-cmake-compat.sh $<IF:$<CONFIG:Debug>,DEBUG,RELEASE> $<IF:$<BOOL:${CASS_BUILD_STATIC}>,STATIC,NO_STATIC>
BINARY_DIR "${CMAKE_SOURCE_DIR}/scylla-rust-wrapper"
INSTALL_COMMAND ""
LOG_BUILD ON
Expand Down
20 changes: 20 additions & 0 deletions scylla-rust-wrapper/build-cmake-compat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,31 @@ else
exit 1
fi

COPY_STATIC=false

if [[ $2 == "STATIC" ]]
then
COPY_STATIC=true
elif [[ $2 == "NO_STATIC" ]]
then
COPY_STATIC=false
else
echo 'Invalid static build configuration: $2 (only STATIC or NO_STATIC permitted)'
exit 1
fi


create_symlinks() {
rm -rf target/$1/cmake-compat/
mkdir target/$1/cmake-compat/

cp target/$1/libscylla_cpp_driver.so target/$1/cmake-compat/libscylla-cpp-driver.so.$MAJOR.$MINOR.$PATCH

if [[ "$COPY_STATIC" == true ]]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is comparison to true necessary in Bash??

then
cp target/$1/libscylla_cpp_driver.a target/$1/cmake-compat/libscylla-cpp-driver_static.a
fi

ln -s libscylla-cpp-driver.so.$MAJOR.$MINOR.$PATCH target/$1/cmake-compat/libscylla-cpp-driver.so.$MAJOR
ln -s libscylla-cpp-driver.so.$MAJOR target/$1/cmake-compat/libscylla-cpp-driver.so
}
Expand Down