Skip to content

Commit 3dc68bd

Browse files
committed
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 52c72eb commit 3dc68bd

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

cmake/dependencies.cmake

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
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)
7-
find_package(GMock 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+
find_package(GMock CONFIG REQUIRED)
9+
endif()
810

911
# https://docs.hunter.sh/en/latest/packages/pkg/Boost.html
1012
hunter_add_package(Boost COMPONENTS date_time filesystem random)

0 commit comments

Comments
 (0)