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

Better handling of FetchContent #136

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
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
15 changes: 13 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,17 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

# -------------------- Find packages --------------------------

# Used to provide
# FetchContent_MakeAvailable_ExcludeFromAll
FetchContent_Declare(
cmake_utils
GIT_REPOSITORY https://github.com/mjp41/cmake_utils
GIT_TAG 2bf98b5773ea7282197c823e205547d8c2e323c0
GIT_SHALLOW FALSE
)

FetchContent_MakeAvailable(cmake_utils)

FetchContent_Declare(
trieste
GIT_REPOSITORY https://github.com/microsoft/trieste
Expand All @@ -104,7 +115,7 @@ if (REGOCPP_SPECULATIVE_LOAD_HARDENING)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mllvm -x86-speculative-load-hardening")
endif()

FetchContent_MakeAvailable(trieste)
FetchContent_MakeAvailable_ExcludeFromAll(trieste)

if (REGOCPP_SPECULATIVE_LOAD_HARDENING)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_SAVED}")
Expand Down Expand Up @@ -177,7 +188,7 @@ set(INSTALL_CONFIGDIR cmake)
set(INSTALL_LIBDIR lib)
set(INSTALL_INCLUDEDIR include)

install(TARGETS rego
install(TARGETS rego snmalloc trieste snmallocshim-static re2
EXPORT ${PROJECT_NAME}_Targets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
Expand Down
Loading