File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed
Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ option(SOURCEMETA_CORE_DOCS "Build the Sourcemeta Core docs" OFF)
1717option (SOURCEMETA_CORE_INSTALL "Install the Sourcemeta Core library" ON )
1818option (SOURCEMETA_CORE_ADDRESS_SANITIZER "Build Sourcemeta Core with an address sanitizer" OFF )
1919option (SOURCEMETA_CORE_UNDEFINED_SANITIZER "Build Sourcemeta Core with an undefined behavior sanitizer" OFF )
20+ option (SOURCEMETA_CORE_CONTRIB_GOOGLETEST "Build the GoogleTest library for downstream consumers" OFF )
21+ option (SOURCEMETA_CORE_CONTRIB_GOOGLEBENCHMARK "Build the GoogleBenchmark library for downstream consumers" OFF )
2022
2123include (Sourcemeta)
2224
@@ -94,9 +96,17 @@ if(PROJECT_IS_TOP_LEVEL)
9496endif ()
9597
9698# Testing
99+
100+ if (SOURCEMETA_CORE_CONTRIB_GOOGLETEST OR SOURCEMETA_CORE_TESTS)
101+ find_package (GoogleTest REQUIRED)
102+ endif ()
103+
104+ if (SOURCEMETA_CORE_CONTRIB_GOOGLEBENCHMARK OR SOURCEMETA_CORE_BENCHMARK)
105+ find_package (GoogleBenchmark REQUIRED)
106+ endif ()
107+
97108if (SOURCEMETA_CORE_TESTS)
98109 enable_testing ()
99- find_package (GoogleTest REQUIRED)
100110
101111 if (SOURCEMETA_CORE_REGEX)
102112 add_subdirectory (test /regex )
@@ -137,9 +147,8 @@ if(SOURCEMETA_CORE_TESTS)
137147 add_subdirectory (test /packaging)
138148 endif ()
139149 endif ()
150+ endif ()
140151
141- if (SOURCEMETA_CORE_BENCHMARK)
142- find_package (GoogleBenchmark REQUIRED)
143- add_subdirectory (benchmark)
144- endif ()
152+ if (SOURCEMETA_CORE_BENCHMARK)
153+ add_subdirectory (benchmark)
145154endif ()
You can’t perform that action at this time.
0 commit comments