Skip to content

Commit

Permalink
Turn TINK_BUILD_TESTS into an option, disable it by default.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 239196540
GitOrigin-RevId: 3c494c5339afe6ac88452fd922fd849215cf4e42
  • Loading branch information
ise-crypto authored and Tink Team committed Mar 20, 2019
1 parent c3ef5a7 commit 4dd3b07
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 3 additions & 7 deletions cmake/TinkBuildRules.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,15 @@
# 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.

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()

Expand Down Expand Up @@ -158,7 +154,7 @@ function(tink_cc_test)
"SRCS;DEPS;DATA"
)

if (NOT TINK_ENABLE_TESTS)
if (NOT TINK_BUILD_TESTS)
return()
endif()

Expand Down
1 change: 0 additions & 1 deletion examples/helloworld/cc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 4dd3b07

Please sign in to comment.