Skip to content
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

Build library as part of another product without conflicts #386

Merged
merged 3 commits into from
Sep 10, 2024
Merged
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
8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ INCLUDE (subdirs)
INCLUDE (openssl)
INCLUDE (version)

OPTION (BUILD_BENCHMARK "Build benchmark" OFF)
OPTION (BUILD_TESTS "Build tests" OFF)
OPTION (BUILD_SHARED_LIBS "Build shared libs" OFF)
IF (NOT CHCPP_EMBEDDED_BUILD)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe you need to have a corresponding option declaration clause (OPTION(CHCPP_EMBEDDED_BUILD ...)) before this if just to explain intention and simplify user's life.

Copy link
Collaborator

@Enmk Enmk Sep 6, 2024

Choose a reason for hiding this comment

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

Also, please consider changing option name to CLICKHOUSE_CPP_EMBEDDED_BUILD, like we have in 3.0: https://github.com/ClickHouse/clickhouse-cpp/blob/3.0/CMakeLists.txt

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for answers and pieces of advice. I found another solution. It is not visible to user and handled automatically by build system.
I think, it will be better than new option.

OPTION (BUILD_BENCHMARK "Build benchmark" OFF)
OPTION (BUILD_TESTS "Build tests" OFF)
OPTION (BUILD_SHARED_LIBS "Build shared libs" OFF)
ENDIF ()
OPTION (WITH_OPENSSL "Use OpenSSL for TLS connections" OFF)
OPTION (WITH_SYSTEM_ABSEIL "Use system ABSEIL" OFF)
OPTION (WITH_SYSTEM_LZ4 "Use system LZ4" OFF)
Expand Down
Loading