Explorar el Código

fix: tests target definitions should only be set when building tests

Almamu hace 9 meses
padre
commit
173cbb9825
Se han modificado 1 ficheros con 6 adiciones y 3 borrados
  1. 6 3
      CMakeLists.txt

+ 6 - 3
CMakeLists.txt

@@ -527,9 +527,12 @@ endif()
 
 target_compile_definitions(linux-wallpaperengine PUBLIC ERRORONLY=${ERRORONLY})
 target_compile_definitions(linux-wallpaperengine PUBLIC DEMOMODE=${DEMOMODE})
-# tests should give as much output as possible
-target_compile_definitions(tests PRIVATE ERRORONLY=0)
-target_compile_definitions(tests PRIVATE DEMOMODE=0)
+
+if (BUILD_TESTING)
+    # tests should give as much output as possible
+    target_compile_definitions(tests PRIVATE ERRORONLY=0)
+    target_compile_definitions(tests PRIVATE DEMOMODE=0)
+endif()
 
 if(X11_SUPPORT_FOUND)
     target_compile_definitions(linux-wallpaperengine PUBLIC ENABLE_X11)