From 83d4569e13b9bf8d194771db19fee1c999cf2b22 Mon Sep 17 00:00:00 2001 From: Denis Koronchik Date: Wed, 21 Jul 2021 18:37:20 +0200 Subject: Add possibility to disable test and benchmark compilation --- CMakeLists.txt | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ad989ba838..dfbf7d7f2a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,8 @@ option(MBGL_WITH_SANITIZER "Use [address|thread|undefined] here" OFF) option(MBGL_WITH_RTTI "Compile with runtime type information" OFF) option(MBGL_WITH_OPENGL "Build with OpenGL renderer" ON) option(MBGL_WITH_WERROR "Make all compilation warnings errors" ON) +option(MBGL_WITH_TESTS "Enable tests compilation" ON) +option(MBGL_WITH_BENCHMARK "Enable benchmark compilation" ON) add_library( mbgl-compiler-options INTERFACE @@ -1044,9 +1046,15 @@ else() message(FATAL_ERROR "Unsupported target platform: " ${CMAKE_SYSTEM_NAME}) endif() -add_subdirectory(${PROJECT_SOURCE_DIR}/test) -add_subdirectory(${PROJECT_SOURCE_DIR}/benchmark) -add_subdirectory(${PROJECT_SOURCE_DIR}/render-test) +if (${MBGL_WITH_TESTS}) + add_subdirectory(${PROJECT_SOURCE_DIR}/test) + add_subdirectory(${PROJECT_SOURCE_DIR}/render-test) +endif() + +if (${MBGL_WITH_BENCHMARK}) + add_subdirectory(${PROJECT_SOURCE_DIR}/benchmark) +endif() + if(EXISTS ${PROJECT_SOURCE_DIR}/internal/internal.cmake) include(${PROJECT_SOURCE_DIR}/internal/internal.cmake) -- cgit v1.2.1