Skip to content

Commit

Permalink
Better handling of FetchContent
Browse files Browse the repository at this point in the history
This reduces the install target of projects included with FetchContent.
  • Loading branch information
mjp41 committed May 13, 2024
1 parent cb96763 commit b2131bb
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion 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

0 comments on commit b2131bb

Please sign in to comment.