Skip to content

Commit 19e9b6f

Browse files
Garrett Browneigendude
authored andcommitted
CMake: Exclude test-related depends when building tests
When building without tests, GTest and GMock are not needed. This change allows build systems to continue with filecoin compilation without devoting resources to its testing infrastructure.
1 parent bdbdf7e commit 19e9b6f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

cmake/dependencies.cmake

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# hunter dependencies
22
# https://docs.hunter.sh/en/latest/packages/
33

4-
# https://docs.hunter.sh/en/latest/packages/pkg/GTest.html
5-
hunter_add_package(GTest)
6-
find_package(GTest CONFIG REQUIRED)
4+
if (TESTING)
5+
# https://docs.hunter.sh/en/latest/packages/pkg/GTest.html
6+
hunter_add_package(GTest)
7+
find_package(GTest CONFIG REQUIRED)
8+
endif()
79

810
hunter_add_package(libarchive)
911
find_package(libarchive CONFIG REQUIRED)

0 commit comments

Comments
 (0)