aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorambrosin <ambrosin@google.com>2023-02-08 01:11:57 -0800
committerCopybara-Service <copybara-worker@google.com>2023-02-08 01:12:54 -0800
commit5dc5dd7e624f9742bbd06e3214357d793e324dc9 (patch)
tree0095d6fc2b195238149de21a150fd9744564f40c /cmake
parent7948b63128d47ed2ccd613e35f4917630bd108b6 (diff)
downloadtink-5dc5dd7e624f9742bbd06e3214357d793e324dc9.tar.gz
Use a tag to exclude targets on Windows when building with CMake
PiperOrigin-RevId: 508006914
Diffstat (limited to 'cmake')
-rw-r--r--cmake/TinkBuildRules.cmake17
1 files changed, 13 insertions, 4 deletions
diff --git a/cmake/TinkBuildRules.cmake b/cmake/TinkBuildRules.cmake
index b97c24c18..d64e7acc1 100644
--- a/cmake/TinkBuildRules.cmake
+++ b/cmake/TinkBuildRules.cmake
@@ -54,6 +54,7 @@ list(APPEND TINK_INCLUDE_DIRS "${TINK_GENFILE_DIR}")
set(TINK_IDE_FOLDER "Tink")
set(TINK_TARGET_EXCLUDE_IF_OPENSSL "exclude_if_openssl")
+set(TINK_TARGET_EXCLUDE_IF_WINDOWS "exclude_if_windows")
# Declare the beginning of a new Tink library namespace.
#
@@ -104,12 +105,16 @@ function(tink_cc_library)
"TINK_MODULE not defined, perhaps you are missing a tink_module() statement?")
endif()
- # Check if this target must be skipped. Currently the only reason for this to
- # happen is incompatibility with OpenSSL, when used.
+ # Check if this target must be skipped.
foreach(_tink_cc_library_tag ${tink_cc_library_TAGS})
+ # Exclude if we use OpenSSL.
if (${_tink_cc_library_tag} STREQUAL ${TINK_TARGET_EXCLUDE_IF_OPENSSL} AND TINK_USE_SYSTEM_OPENSSL)
return()
endif()
+ # Exclude if building on Windows.
+ if (${_tink_cc_library_tag} STREQUAL ${TINK_TARGET_EXCLUDE_IF_WINDOWS} AND WIN32)
+ return()
+ endif()
endforeach()
# We replace :: with __ in targets, because :: may not appear in target names.
@@ -180,12 +185,16 @@ function(tink_cc_test)
message(FATAL_ERROR "TINK_MODULE not defined")
endif()
- # Check if this target must be skipped. Currently the only reason for this to
- # happen is incompatibility with OpenSSL, when used.
+ # Check if this target must be skipped.
foreach(_tink_cc_test_tag ${tink_cc_test_TAGS})
+ # Exclude if we use OpenSSL.
if (${_tink_cc_test_tag} STREQUAL ${TINK_TARGET_EXCLUDE_IF_OPENSSL} AND TINK_USE_SYSTEM_OPENSSL)
return()
endif()
+ # Exclude if building on Windows.
+ if (${_tink_cc_test_tag} STREQUAL ${TINK_TARGET_EXCLUDE_IF_WINDOWS} AND WIN32)
+ return()
+ endif()
endforeach()
# We replace :: with __ in targets, because :: may not appear in target names.