Skip to content

readme: document most important CMake options #307

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

Merged
merged 2 commits into from
Jun 2, 2025

Conversation

muzarski
Copy link
Contributor

Pre-review checklist

  • I have split my patch into logically separate commits.
  • All commit messages clearly explain what they change and why.
  • PR description sums up the changes and reasons why they should be introduced.
  • I have implemented Rust unit tests for the features/changes introduced.
  • I have enabled appropriate tests in .github/workflows/build.yml in gtest_filter.
  • I have enabled appropriate tests in .github/workflows/cassandra.yml in gtest_filter.

@muzarski muzarski self-assigned this May 28, 2025
@muzarski muzarski added the documentation Improvements or additions to documentation label May 28, 2025
@muzarski muzarski added this to the 0.5 milestone May 28, 2025
@muzarski muzarski requested a review from wprzytula May 28, 2025 15:10
@muzarski muzarski mentioned this pull request May 28, 2025
6 tasks
Comment on lines +17 to +23
For example, to build a shared driver library (no static library) in release mode and integration tests you can do:
```shell
mkdir build
cd build
cmake -DCASS_BUILD_STATIC=OFF -DCASS_BUILD_INTEGRATION_TESTS=ON -DCMAKE_BUILD_TYPE=Release ..
make
```
Copy link
Collaborator

Choose a reason for hiding this comment

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

❓ Can you confirm that the following builds a static driver library (no shared) in release mode and links it against integration tests?

mkdir build
cd build
cmake -DCASS_BUILD_SHARED=OFF -DCASS_BUILD_INTEGRATION_TESTS=ON -DCASS_USE_STATIC_LIBS=ON -DCMAKE_BUILD_TYPE=Release ..
make

Copy link
Collaborator

Choose a reason for hiding this comment

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

If so, let's add this as another example.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, just by looking at the command I would confirm. However, when I checked by running it - it does not work.. It's because it does not work even with just -DCASS_BUILD_SHARED=OFF in general..

The error:

CMake Error at scylla-rust-wrapper/CMakeLists.txt:16 (add_custom_command):
  Error evaluating generator expression:

    $<TARGET_FILE:scylla_cpp_driver_shared>

  No target "scylla_cpp_driver_shared"
Call Stack (most recent call first):
  scylla-rust-wrapper/CMakeLists.txt:52 (create_copy)


CMake Error at scylla-rust-wrapper/CMakeLists.txt:16 (add_custom_command):
  Error evaluating generator expression:

    $<TARGET_FILE:scylla_cpp_driver_shared>

  No target "scylla_cpp_driver_shared"
Call Stack (most recent call first):
  scylla-rust-wrapper/CMakeLists.txt:52 (create_copy)


CMake Error at scylla-rust-wrapper/CMakeLists.txt:16 (add_custom_command):
  Error evaluating generator expression:

    $<TARGET_FILE:scylla_cpp_driver_shared>

  No target "scylla_cpp_driver_shared"
Call Stack (most recent call first):
  scylla-rust-wrapper/CMakeLists.txt:52 (create_copy)


CMake Error at scylla-rust-wrapper/CMakeLists.txt:16 (add_custom_command):
  Error evaluating generator expression:

    $<TARGET_FILE:scylla_cpp_driver_shared>

  No target "scylla_cpp_driver_shared"
Call Stack (most recent call first):
  scylla-rust-wrapper/CMakeLists.txt:52 (create_copy)

This needs to be investigated. I'll open an issue.

However, if you execute the command you provided while removing -DCASS_BUILD_SHARED_LIBS=OFF, it works as expected - it builds integration tests library linked against static driver library. The only difference is that shared library is still being built.

Copy link
Collaborator

@wprzytula wprzytula left a comment

Choose a reason for hiding this comment

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

Merging this one. If the issue upon build with shared lib turned off is not solved soon, I'll mention it in MAINTENANCE.md in a separate PR.

@wprzytula wprzytula merged commit 86a9cc0 into scylladb:master Jun 2, 2025
12 checks passed
@wprzytula wprzytula mentioned this pull request Jun 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants