Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
7087cba
ADD CLP_NO_NEED_X and CLP_NO_BUILD_X options for most libraries
gibber9809 Jun 2, 2025
139300b
Bump minimum required cmake version to 3.21
gibber9809 Jun 2, 2025
929a6d8
Add CLP_NO_BUILD_CLP_{REGEX_UTILS,STRING_UTILS} flags
gibber9809 Jun 2, 2025
3bdb6f8
Add missing newline
gibber9809 Jun 2, 2025
53d3e1b
Record new options using options(...) in cmake/Options/options.cmake
gibber9809 Jun 2, 2025
e87511e
Merge remote-tracking branch 'upstream/main' into external-project-su…
gibber9809 Jun 6, 2025
5737411
Merge remote-tracking branch 'upstream/main' into external-project-su…
gibber9809 Jun 9, 2025
40b2491
Merge remote-tracking branch 'upstream/main' into external-project-su…
gibber9809 Jun 13, 2025
040623f
Refactor options to infer necessary library dependencies
gibber9809 Jun 18, 2025
f2eae7e
Fix issue with returning CLP_NEED variables from functions
gibber9809 Jun 18, 2025
1400ba5
Merge remote-tracking branch 'upstream/main' into external-project-su…
gibber9809 Jun 18, 2025
76c603d
Fix bug where no NEED variables were forwarded correctly
gibber9809 Jun 18, 2025
e7a8f1b
Set options for kql library correctly
gibber9809 Jun 18, 2025
d578098
Address rabbit comments
gibber9809 Jun 18, 2025
f6682e5
Simplify options.cmake by iterating over lists of flags in places whe…
gibber9809 Jun 20, 2025
18bf970
Address rabbit comment
gibber9809 Jun 20, 2025
adf275c
Rename validate_dependencies_for_target to validated_clp_dependencies…
gibber9809 Jun 20, 2025
7e5d308
Merge remote-tracking branch 'upstream/main' into external-project-su…
gibber9809 Jun 20, 2025
0c69ee9
Add set_clp_need_flags function
gibber9809 Jun 22, 2025
7f00ead
Simplify validate_clp_dependencies_for_target function
gibber9809 Jun 22, 2025
20f4152
Address rabbit comment
gibber9809 Jun 22, 2025
cb1c6ce
Apply suggestions from code review
gibber9809 Jun 23, 2025
ae0a90b
Apply suggestions from code review
gibber9809 Jun 23, 2025
c5f4caf
Address review comments
gibber9809 Jun 23, 2025
4b77022
Address more review comments
gibber9809 Jun 23, 2025
b76d03a
Address rabbit comment
gibber9809 Jun 23, 2025
828843e
Remove one unnecessary dependency
gibber9809 Jun 23, 2025
064f158
Address review comments
gibber9809 Jun 24, 2025
4dca942
Merge remote-tracking branch 'upstream/main' into external-project-su…
gibber9809 Jun 24, 2025
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
336 changes: 192 additions & 144 deletions components/core/CMakeLists.txt

Large diffs are not rendered by default.

211 changes: 211 additions & 0 deletions components/core/cmake/Options/options.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
# Build Target Options
option(
CLP_NO_BUILD_BINARIES
"Do not build any binaries."
OFF
)

option(
CLP_NO_BUILD_TESTS
"Do not build any tests."
OFF
)

option(
CLP_NO_BUILD_CLP_REGEX_UTILS
"Do not build clp::regex_utils."
OFF
)

option(
CLP_NO_BUILD_CLP_STRING_UTILS
"Do not build clp::string_utils."
OFF
)

option(
CLP_NO_BUILD_CLP_S_ARCHIVEREADER
"Do not build clp_s::archive_reader."
OFF
)

option(
CLP_NO_BUILD_CLP_S_ARCHIVEWRITER
"Do not build clp_s::archive_writer."
OFF
)

option(
CLP_NO_BUILD_CLP_S_CLP_DEPENDENCIES
"Do not build clp_s::clp_dependencies."
OFF
)

option(
CLP_NO_BUILD_CLP_S_IO
"Do not build clp_s::io."
OFF
)

option(
CLP_NO_BUILD_CLP_S_JSONCONSTRUCTOR
"Do not build clp_s::json_constructor."
OFF
)

option(
CLP_NO_BUILD_CLP_S_REDUCER_DEPENDENCIES
"Do not build clp_s::reducer_dependencies."
OFF
)

option(
CLP_NO_BUILD_CLP_S_SEARCH
"Do not build clp_s::search."
OFF
)

option(
CLP_NO_BUILD_CLP_S_SEARCH_AST
"Do not build clp_s::search::ast."
OFF
)

option(
CLP_NO_BUILD_CLP_S_SEARCH_KQL
"Do not build clp_s::search::kql."
OFF
)

option(
CLP_NO_BUILD_CLP_S_SEARCH_SQL
"Do not build clp_s::search::sql."
OFF
)

option(
CLP_NO_BUILD_CLP_S_TIMESTAMPPATTERN
"Do not build clp_s::timestamp_pattern."
OFF
)

# Dependency Options
option(
CLP_NO_NEED_ABSL
"Do not include abseil in the build."
OFF
)

option(
CLP_NO_NEED_ANTLR
"Do not include ANTLR in the build."
OFF
)

option(
CLP_NO_NEED_BOOST
"Do not include boost in the build."
OFF
)

option(
CLP_NO_NEED_CURL
"Do not include CURL in the build."
OFF
)

option(
CLP_NO_NEED_DATE
"Do not include date in the build."
OFF
)

option(
CLP_NO_NEED_FMT
"Do not include fmt in the build."
OFF
)

option(
CLP_NO_NEED_LIBARCHIVE
"Do not include libarchive in the build."
OFF
)

option(
CLP_NO_NEED_LOG_SURGEON
"Do not include log-surgeon in the build."
OFF
)

option(
CLP_NO_NEED_LZMA
"Do not include lzma in the build."
OFF
)

option(
CLP_NO_NEED_MARIADB
"Do not include mariadb in the build."
OFF
)

option(
CLP_NO_NEED_MONGOCXX
"Do not include mongo-cxx in the build."
OFF
)

option(
CLP_NO_NEED_MSGPACKCXX
"Do not include msgpack-cxx in the build."
OFF
)

option(
CLP_NO_NEED_NLOHMANN_JSON
"Do not include nlohmann_json in the build."
OFF
)

option(
CLP_NO_NEED_OPENSSL
"Do not include openssl in the build."
OFF
)

option(
CLP_NO_NEED_SIMDJSON
"Do not include simdjson in the build."
OFF
)

option(
CLP_NO_NEED_SPDLOG
"Do not include spdlog in the build."
OFF
)

option(
CLP_NO_NEED_SQLITE
"Do not include sqlite in the build."
OFF
)

option(
CLP_NO_NEED_YAMLCPP
"Do not include yaml-cpp in the build."
OFF
)

option(
CLP_NO_NEED_YSTDLIB
"Do not include ystdlib in the build."
OFF
)

option(
CLP_NO_NEED_ZSTD
"Do not include zstd in the build."
OFF
)
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
60 changes: 31 additions & 29 deletions components/core/src/clp/clg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,32 +123,34 @@ set(
CommandLineArguments.hpp
)

add_executable(clg ${CLG_SOURCES})
target_compile_features(clg PRIVATE cxx_std_20)
target_include_directories(clg
PRIVATE
"${CLP_SQLITE3_INCLUDE_DIRECTORY}"
)
target_link_libraries(clg
PRIVATE
Boost::filesystem Boost::program_options
date::date
fmt::fmt
log_surgeon::log_surgeon
MariaDBClient::MariaDBClient
nlohmann_json::nlohmann_json
spdlog::spdlog
${sqlite_LIBRARY_DEPENDENCIES}
${STD_FS_LIBS}
clp::string_utils
yaml-cpp
ystdlib::containers
ystdlib::error_handling
ZStd::ZStd
)
# Put the built executable at the root of the build directory
set_target_properties(
clg
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}"
)
if(NOT CLP_NO_BUILD_BINARIES)
add_executable(clg ${CLG_SOURCES})
target_compile_features(clg PRIVATE cxx_std_20)
target_include_directories(clg
PRIVATE
"${CLP_SQLITE3_INCLUDE_DIRECTORY}"
)
target_link_libraries(clg
PRIVATE
Boost::filesystem Boost::program_options
date::date
fmt::fmt
log_surgeon::log_surgeon
MariaDBClient::MariaDBClient
nlohmann_json::nlohmann_json
spdlog::spdlog
${sqlite_LIBRARY_DEPENDENCIES}
${STD_FS_LIBS}
clp::string_utils
yaml-cpp
ystdlib::containers
ystdlib::error_handling
ZStd::ZStd
)
# Put the built executable at the root of the build directory
set_target_properties(
clg
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}"
)
endif()
60 changes: 31 additions & 29 deletions components/core/src/clp/clo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -151,32 +151,34 @@ set(
../../reducer/types.hpp
)

add_executable(clo ${CLO_SOURCES} ${REDUCER_SOURCES})
target_compile_features(clo PRIVATE cxx_std_20)
target_include_directories(clo
PRIVATE
"${CLP_SQLITE3_INCLUDE_DIRECTORY}"
)
target_link_libraries(clo
PRIVATE
Boost::filesystem Boost::program_options
date::date
fmt::fmt
log_surgeon::log_surgeon
${MONGOCXX_TARGET}
msgpack-cxx
nlohmann_json::nlohmann_json
spdlog::spdlog
${sqlite_LIBRARY_DEPENDENCIES}
${STD_FS_LIBS}
clp::string_utils
ystdlib::containers
ystdlib::error_handling
ZStd::ZStd
)
# Put the built executable at the root of the build directory
set_target_properties(
clo
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}"
)
if(NOT CLP_NO_BUILD_BINARIES)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we want to control each individual binary?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah it could be worthwhile. I think it doesn't matter for the immediate use-case (exposing enough options so that external projects can pull in individual libraries without needing to pull in all of our targets and dependencies), but it could be useful e.g. to create more targeted installs of clp.

add_executable(clo ${CLO_SOURCES} ${REDUCER_SOURCES})
target_compile_features(clo PRIVATE cxx_std_20)
target_include_directories(clo
PRIVATE
"${CLP_SQLITE3_INCLUDE_DIRECTORY}"
)
target_link_libraries(clo
PRIVATE
Boost::filesystem Boost::program_options
date::date
fmt::fmt
log_surgeon::log_surgeon
${MONGOCXX_TARGET}
msgpack-cxx
nlohmann_json::nlohmann_json
spdlog::spdlog
${sqlite_LIBRARY_DEPENDENCIES}
${STD_FS_LIBS}
clp::string_utils
ystdlib::containers
ystdlib::error_handling
ZStd::ZStd
)
# Put the built executable at the root of the build directory
set_target_properties(
clo
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}"
)
endif()
Loading