aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTink Team <tink-dev@google.com>2019-03-19 08:39:12 -0700
committerTink Team <noreply@google.com>2019-03-20 11:40:55 -0400
commit4dd3b07a0ae92a790ae2183c58b83902f2f41964 (patch)
tree8ef074069888622284884d964d3923dc39adf196
parentc3ef5a791cccff0334da45aa92b7aea3df3a35b9 (diff)
downloadtink-4dd3b07a0ae92a790ae2183c58b83902f2f41964.tar.gz
Turn TINK_BUILD_TESTS into an option, disable it by default.
PiperOrigin-RevId: 239196540 GitOrigin-RevId: 3c494c5339afe6ac88452fd922fd849215cf4e42
-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")