aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt2
-rw-r--r--cmake/TinkBuildRules.cmake10
-rw-r--r--examples/helloworld/cc/CMakeLists.txt1
3 files changed, 5 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bccfa821b..b69692224 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,6 +6,8 @@ include(tink_version.cmake)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
+option(TINK_BUILD_TESTS "Build Tink tests" OFF)
+
include(TinkWorkspace)
include(TinkBuildRules)
include(TinkUtil)
diff --git a/cmake/TinkBuildRules.cmake b/cmake/TinkBuildRules.cmake
index 59af78871..beb4deb5f 100644
--- a/cmake/TinkBuildRules.cmake
+++ b/cmake/TinkBuildRules.cmake
@@ -25,7 +25,7 @@
# TINK_GENFILE_DIR generated content root, such pb.{cc,h} files.
# TINK_INCLUDE_DIRS list of global include paths.
# TINK_CXX_STANDARD C++ standard to enforce, 11 for now.
-# TINK_ENABLE_TESTS flag, set to false to disable tests (default true).
+# TINK_BUILD_TESTS flag, set to false to disable tests (default false).
#
# Sensible defaults are provided for all variables, except TINK_MODULE, which is
# defined by calls to tink_module(). Please don't alter it directly.
@@ -33,11 +33,7 @@
include(CMakeParseArguments)
include(GoogleTest)
-if (NOT DEFINED TINK_ENABLE_TESTS)
- set(TINK_ENABLE_TESTS true)
-endif()
-
-if (TINK_ENABLE_TESTS)
+if (TINK_BUILD_TESTS)
enable_testing()
endif()
@@ -158,7 +154,7 @@ function(tink_cc_test)
"SRCS;DEPS;DATA"
)
- if (NOT TINK_ENABLE_TESTS)
+ if (NOT TINK_BUILD_TESTS)
return()
endif()
diff --git a/examples/helloworld/cc/CMakeLists.txt b/examples/helloworld/cc/CMakeLists.txt
index 897824b1b..3bc38ef30 100644
--- a/examples/helloworld/cc/CMakeLists.txt
+++ b/examples/helloworld/cc/CMakeLists.txt
@@ -3,7 +3,6 @@ cmake_minimum_required(VERSION 3.5)
project(TinkHelloWorld CXX)
set(CMAKE_BUILD_TYPE Release)
-set(TINK_ENABLE_TESTS false)
# Import Tink as an in-tree dependency.
add_subdirectory(../../.. "${CMAKE_CURRENT_BINARY_DIR}/tink")