Commit 1556567
committed
cmake: only build tst fixtures when ENABLE_TESTS is on
The tst_base fixture library links GTest::gtest, but that imported
target only exists when find_package(GTest) runs, which is guarded by
ENABLE_TESTS. add_subdirectory(tst) was unconditional, so a -no-tests
build failed at generate time with 'Target tst_base links to
GTest::gtest but the target was not found'.
Guard add_subdirectory(tst) with ENABLE_TESTS. This is safe because
every consumer of tst/tst_base/tst_integrated_fixture lives in a
test/cpp directory that is itself gated by ENABLE_TESTS.
Signed-off-by: Matt Liberty <mliberty@precisioninno.com>1 parent 0db7e18 commit 1556567
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
258 | | - | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
259 | 263 | | |
260 | 264 | | |
261 | 265 | | |
| |||
0 commit comments