diff --git a/CMakeLists.txt b/CMakeLists.txt index 1adad24..319aa57 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,7 +89,8 @@ if( CMAKE_BUILD_TYPE STREQUAL "Debug" ) endif() # Compiling unit tests -if( CMAKE_BUILD_TYPE STREQUAL "Debug" ) +option( OSMANIP_TESTS "Enable / disable tests." ON ) +if( CMAKE_BUILD_TYPE STREQUAL "Debug" AND OSMANIP_TESTS ) add_subdirectory( test/unit_tests ) else() message( STATUS "Skipping tests." ) diff --git a/README.md b/README.md index 72e9180..c21cec9 100644 --- a/README.md +++ b/README.md @@ -509,6 +509,7 @@ sudo cmake --build build --target install ``` > :warning: remember to install the library before launching include tests, or an error will appear. +> :warning: if you want to build the library in debug mode, but without compiling tests use also the option `-DOSMANIP_TESTS=OFF`. Tests are produced using `-Wall -Wextra -pedantic` flags. To check them you need some prerequisites: diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt index 1ef406c..7875cc8 100644 --- a/deps/CMakeLists.txt +++ b/deps/CMakeLists.txt @@ -16,6 +16,6 @@ if( EXISTS "${LOC_PATH}" ) endif() # Debug deps -if( CMAKE_BUILD_TYPE STREQUAL "Debug" ) +if( CMAKE_BUILD_TYPE STREQUAL "Debug" AND OSMANIP_TESTS ) add_subdirectory( doctest ) endif() \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 8c36be4..272eb12 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,7 +15,7 @@ services: command: > bash -c "cd /proj && rm -rf build - && cmake -B build -DCMAKE_BUILD_TYPE=Debug + && cmake -B build && cmake --build build" # gcc 10