blob: c64ba8e5a92225790c3a3f0e72ebf8d7d9de841a [file] [log] [blame]
David Benjamind0b66c72021-03-22 17:30:02 -04001cmake_minimum_required(VERSION 3.5)
David Benjamin6979c7e2017-12-04 17:19:49 -05002
David Benjamin6b34d542016-02-05 21:58:39 -05003# Defer enabling C and CXX languages.
David Benjamine6fd1252018-08-10 10:30:55 -05004project(BoringSSL NONE)
David Benjamin6b34d542016-02-05 21:58:39 -05005
6if(WIN32)
7 # On Windows, prefer cl over gcc if both are available. By default most of
8 # the CMake generators prefer gcc, even on Windows.
9 set(CMAKE_GENERATOR_CC cl)
10endif()
11
David Benjamin3ecd0a52017-05-19 15:26:18 -040012include(sources.cmake)
13
David Benjamin6b34d542016-02-05 21:58:39 -050014enable_language(C)
15enable_language(CXX)
Adam Langley95c29f32014-06-20 12:00:00 -070016
Joshua Liebow-Feeser8c7c6352018-08-26 18:53:36 -070017# This is a dummy target which all other targets depend on (manually - see other
18# CMakeLists.txt files). This gives us a hook to add any targets which need to
19# run before all other targets.
20add_custom_target(global_target)
21
Adam Langley843ab662015-04-28 17:46:58 -070022if(ANDROID)
23 # Android-NDK CMake files reconfigure the path and so Go and Perl won't be
24 # found. However, ninja will still find them in $PATH if we just name them.
Tamas Berghammer5693e422016-05-19 14:28:14 +010025 if(NOT PERL_EXECUTABLE)
26 set(PERL_EXECUTABLE "perl")
27 endif()
28 if(NOT GO_EXECUTABLE)
29 set(GO_EXECUTABLE "go")
30 endif()
Adam Langley843ab662015-04-28 17:46:58 -070031else()
32 find_package(Perl REQUIRED)
33 find_program(GO_EXECUTABLE go)
34endif()
David Benjamin3ce3c362015-02-23 13:06:19 -050035
David Benjaminf36c3ad2019-01-15 12:45:57 -060036if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT CMAKE_CROSSCOMPILING)
Adam Langley9dfaf252019-01-04 07:53:25 -080037 find_package(PkgConfig QUIET)
38 if (PkgConfig_FOUND)
39 pkg_check_modules(LIBUNWIND libunwind-generic)
40 if(LIBUNWIND_FOUND)
41 add_definitions(-DBORINGSSL_HAVE_LIBUNWIND)
42 else()
43 message("libunwind not found. Disabling unwind tests.")
44 endif()
David Benjamin17d553d2018-12-21 17:58:36 -060045 else()
Adam Langley9dfaf252019-01-04 07:53:25 -080046 message("pkgconfig not found. Disabling unwind tests.")
David Benjamin17d553d2018-12-21 17:58:36 -060047 endif()
48endif()
49
David Benjamine6fd1252018-08-10 10:30:55 -050050if(NOT GO_EXECUTABLE)
David Benjamind27eda02015-03-05 01:19:27 -050051 message(FATAL_ERROR "Could not find Go")
52endif()
53
David Benjamine6fd1252018-08-10 10:30:55 -050054if(USE_CUSTOM_LIBCXX)
David Benjamine9ae99b2018-08-09 15:33:07 -050055 set(BORINGSSL_ALLOW_CXX_RUNTIME 1)
56endif()
Joshua Liebow-Feeser8c7c6352018-08-26 18:53:36 -070057
David Benjamine6fd1252018-08-10 10:30:55 -050058if(BORINGSSL_ALLOW_CXX_RUNTIME)
David Benjamin2507d9e2017-07-26 11:39:38 -040059 add_definitions(-DBORINGSSL_ALLOW_CXX_RUNTIME)
60endif()
61
David Benjamin0de64a72019-09-26 15:59:40 -040062string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER)
63if(NOT FIPS)
64 if(CMAKE_BUILD_TYPE_LOWER STREQUAL "relwithassert" OR
65 NOT CMAKE_BUILD_TYPE_LOWER MATCHES "rel")
66 add_definitions(-DBORINGSSL_DISPATCH_TEST)
67 # CMake automatically connects include_directories to the NASM
68 # command-line, but not add_definitions.
69 set(CMAKE_ASM_NASM_FLAGS "${CMAKE_ASM_NASM_FLAGS} -DBORINGSSL_DISPATCH_TEST")
70 endif()
Adam Langleyc1615712018-11-27 14:07:12 -080071endif()
72
David Benjaminc47f7932019-01-22 19:49:35 -060073# Add a RelWithAsserts build configuration. It is the same as Release, except it
74# does not define NDEBUG, so asserts run.
75foreach(VAR CMAKE_C_FLAGS CMAKE_CXX_FLAGS CMAKE_ASM_FLAGS)
76 string(REGEX REPLACE "(^| )[/-]DNDEBUG( |$)" " " "${VAR}_RELWITHASSERTS"
77 "${${VAR}_RELEASE}")
78endforeach()
79
Joshua Liebow-Feeser8c7c6352018-08-26 18:53:36 -070080if(BORINGSSL_PREFIX AND BORINGSSL_PREFIX_SYMBOLS)
81 add_definitions(-DBORINGSSL_PREFIX=${BORINGSSL_PREFIX})
David Benjamin8c23d3a2018-11-25 15:58:02 -060082 # CMake automatically connects include_directories to the NASM command-line,
83 # but not add_definitions.
84 set(CMAKE_ASM_NASM_FLAGS "${CMAKE_ASM_NASM_FLAGS} -DBORINGSSL_PREFIX=${BORINGSSL_PREFIX}")
Joshua Liebow-Feeser8c7c6352018-08-26 18:53:36 -070085
86 # Use "symbol_prefix_include" to store generated header files
87 include_directories(${CMAKE_CURRENT_BINARY_DIR}/symbol_prefix_include)
88 add_custom_command(
89 OUTPUT symbol_prefix_include/boringssl_prefix_symbols.h
90 symbol_prefix_include/boringssl_prefix_symbols_asm.h
91 symbol_prefix_include/boringssl_prefix_symbols_nasm.inc
92 COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/symbol_prefix_include
93 COMMAND ${GO_EXECUTABLE} run ${CMAKE_CURRENT_SOURCE_DIR}/util/make_prefix_headers.go -out ${CMAKE_CURRENT_BINARY_DIR}/symbol_prefix_include ${BORINGSSL_PREFIX_SYMBOLS}
94 DEPENDS util/make_prefix_headers.go
95 ${CMAKE_BINARY_DIR}/${BORINGSSL_PREFIX_SYMBOLS})
96
97 # add_dependencies needs a target, not a file, so we add an intermediate
98 # target.
99 add_custom_target(
100 boringssl_prefix_symbols
101 DEPENDS symbol_prefix_include/boringssl_prefix_symbols.h
102 symbol_prefix_include/boringssl_prefix_symbols_asm.h
103 symbol_prefix_include/boringssl_prefix_symbols_nasm.inc)
104 add_dependencies(global_target boringssl_prefix_symbols)
105elseif(BORINGSSL_PREFIX OR BORINGSSL_PREFIX_SYMBOLS)
106 message(FATAL_ERROR "Must specify both or neither of BORINGSSL_PREFIX and BORINGSSL_PREFIX_SYMBOLS")
107endif()
108
David Benjamin02afbd32017-10-05 15:04:08 -0400109if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
110 set(CLANG 1)
111endif()
Vincent Batts60931e22017-09-20 11:51:54 -0400112
Alexei Lozovsky356a9a02019-04-10 14:50:55 +0300113if(CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
114 set(EMSCRIPTEN 1)
115endif()
116
David Benjamin02afbd32017-10-05 15:04:08 -0400117if(CMAKE_COMPILER_IS_GNUCXX OR CLANG)
118 # Note clang-cl is odd and sets both CLANG and MSVC. We base our configuration
David Benjamin8d67f6f2018-01-05 15:43:09 -0500119 # primarily on our normal Clang one.
David Benjamina603c822021-08-16 16:15:17 -0400120 set(C_CXX_FLAGS "-Werror -Wformat=2 -Wsign-compare -Wmissing-field-initializers -Wwrite-strings -Wvla -Wshadow")
David Benjamin02afbd32017-10-05 15:04:08 -0400121 if(MSVC)
David Benjamin8d67f6f2018-01-05 15:43:09 -0500122 # clang-cl sets different default warnings than clang. It also treats -Wall
123 # as -Weverything, to match MSVC. Instead -W3 is the alias for -Wall.
124 # See http://llvm.org/viewvc/llvm-project?view=revision&revision=319116
125 set(C_CXX_FLAGS "${C_CXX_FLAGS} -W3 -Wno-unused-parameter -fmsc-version=1900")
David Benjamin02afbd32017-10-05 15:04:08 -0400126 # googletest suppresses warning C4996 via a pragma, but clang-cl does not
127 # honor it. Suppress it here to compensate. See https://crbug.com/772117.
128 set(C_CXX_FLAGS "${C_CXX_FLAGS} -Wno-deprecated-declarations")
129 else()
Alexei Lozovsky356a9a02019-04-10 14:50:55 +0300130 if(EMSCRIPTEN)
131 # emscripten's emcc/clang does not accept the "-ggdb" flag.
132 set(C_CXX_FLAGS "${C_CXX_FLAGS} -g")
133 else()
134 set(C_CXX_FLAGS "${C_CXX_FLAGS} -ggdb")
135 endif()
136
137 set(C_CXX_FLAGS "${C_CXX_FLAGS} -Wall -fvisibility=hidden -fno-common")
David Benjamin02afbd32017-10-05 15:04:08 -0400138 endif()
139
140 if(CLANG)
David Benjamin9fb6fea2017-07-31 14:03:38 -0400141 set(C_CXX_FLAGS "${C_CXX_FLAGS} -Wnewline-eof -fcolor-diagnostics")
Adam Langley5c38c052017-04-28 14:47:06 -0700142 else()
143 # GCC (at least 4.8.4) has a bug where it'll find unreachable free() calls
144 # and declare that the code is trying to free a stack pointer.
145 set(C_CXX_FLAGS "${C_CXX_FLAGS} -Wno-free-nonheap-object")
David Benjamin9b7d8362016-08-29 14:59:31 -0400146 endif()
Vincent Batts60931e22017-09-20 11:51:54 -0400147
David Benjamin02afbd32017-10-05 15:04:08 -0400148 if(CLANG OR NOT "7.0.0" VERSION_GREATER CMAKE_C_COMPILER_VERSION)
Vincent Batts60931e22017-09-20 11:51:54 -0400149 set(C_CXX_FLAGS "${C_CXX_FLAGS} -Wimplicit-fallthrough")
150 endif()
151
David Benjamind7936c22021-12-15 17:25:10 -0500152 if(CMAKE_COMPILER_IS_GNUCXX)
153 set(C_CXX_FLAGS "${C_CXX_FLAGS} -Wformat-signedness")
154 endif()
155
Adam Langley01867872016-06-30 14:16:59 -0700156 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${C_CXX_FLAGS} -Wmissing-prototypes -Wold-style-definition -Wstrict-prototypes")
David Benjamin02afbd32017-10-05 15:04:08 -0400157 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${C_CXX_FLAGS} -Wmissing-declarations")
David Benjamin2507d9e2017-07-26 11:39:38 -0400158
David Benjamin02afbd32017-10-05 15:04:08 -0400159 if(NOT MSVC)
160 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
Daniel Wagner-Hall3b358b22017-10-16 20:58:08 +0100161 if(APPLE)
162 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
163 endif()
David Benjamin02afbd32017-10-05 15:04:08 -0400164 if(NOT BORINGSSL_ALLOW_CXX_RUNTIME)
165 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -fno-rtti")
166 endif()
David Benjamin2507d9e2017-07-26 11:39:38 -0400167 endif()
168
David Benjamin4a8d1f32017-07-13 17:53:07 -0400169 # In GCC, -Wmissing-declarations is the C++ spelling of -Wmissing-prototypes
170 # and using the wrong one is an error. In Clang, -Wmissing-prototypes is the
171 # spelling for both and -Wmissing-declarations is some other warning.
172 #
173 # https://gcc.gnu.org/onlinedocs/gcc-7.1.0/gcc/Warning-Options.html#Warning-Options
174 # https://clang.llvm.org/docs/DiagnosticsReference.html#wmissing-prototypes
175 # https://clang.llvm.org/docs/DiagnosticsReference.html#wmissing-declarations
David Benjamin02afbd32017-10-05 15:04:08 -0400176 if(CLANG)
Vincent Batts60931e22017-09-20 11:51:54 -0400177 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wmissing-prototypes")
David Benjamin4a8d1f32017-07-13 17:53:07 -0400178 endif()
Adam Langley95c29f32014-06-20 12:00:00 -0700179elseif(MSVC)
Brian Smithefed2212015-01-28 16:20:02 -0800180 set(MSVC_DISABLED_WARNINGS_LIST
David Benjamin96628432017-01-19 19:05:47 -0500181 "C4061" # enumerator 'identifier' in switch of enum 'enumeration' is not
182 # explicitly handled by a case label
183 # Disable this because it flags even when there is a default.
Brian Smithefed2212015-01-28 16:20:02 -0800184 "C4100" # 'exarg' : unreferenced formal parameter
185 "C4127" # conditional expression is constant
186 "C4200" # nonstandard extension used : zero-sized array in
187 # struct/union.
David Benjaminffb11072016-11-13 10:32:10 +0900188 "C4204" # nonstandard extension used: non-constant aggregate initializer
189 "C4221" # nonstandard extension used : 'identifier' : cannot be
190 # initialized using address of automatic variable
Brian Smithefed2212015-01-28 16:20:02 -0800191 "C4242" # 'function' : conversion from 'int' to 'uint8_t',
192 # possible loss of data
193 "C4244" # 'function' : conversion from 'int' to 'uint8_t',
194 # possible loss of data
David Benjamin3673be72015-02-11 15:12:05 -0500195 "C4267" # conversion from 'size_t' to 'int', possible loss of data
David Benjamin3673be72015-02-11 15:12:05 -0500196 "C4371" # layout of class may have changed from a previous version of the
197 # compiler due to better packing of member '...'
198 "C4388" # signed/unsigned mismatch
Brian Smithefed2212015-01-28 16:20:02 -0800199 "C4296" # '>=' : expression is always true
200 "C4350" # behavior change: 'std::_Wrap_alloc...'
201 "C4365" # '=' : conversion from 'size_t' to 'int',
202 # signed/unsigned mismatch
203 "C4389" # '!=' : signed/unsigned mismatch
David Benjamin7acd6bc2016-05-02 12:57:01 -0400204 "C4464" # relative include path contains '..'
Brian Smithefed2212015-01-28 16:20:02 -0800205 "C4510" # 'argument' : default constructor could not be generated
206 "C4512" # 'argument' : assignment operator could not be generated
207 "C4514" # 'function': unreferenced inline function has been removed
208 "C4548" # expression before comma has no effect; expected expression with
209 # side-effect" caused by FD_* macros.
210 "C4610" # struct 'argument' can never be instantiated - user defined
211 # constructor required.
David Benjamin7acd6bc2016-05-02 12:57:01 -0400212 "C4623" # default constructor was implicitly defined as deleted
David Benjamin3673be72015-02-11 15:12:05 -0500213 "C4625" # copy constructor could not be generated because a base class
214 # copy constructor is inaccessible or deleted
215 "C4626" # assignment operator could not be generated because a base class
216 # assignment operator is inaccessible or deleted
David Benjaminbe7006a2019-04-09 18:05:02 -0500217 "C4628" # digraphs not supported with -Ze
David Benjamin96628432017-01-19 19:05:47 -0500218 "C4668" # 'symbol' is not defined as a preprocessor macro, replacing with
219 # '0' for 'directives'
220 # Disable this because GTest uses it everywhere.
Brian Smithefed2212015-01-28 16:20:02 -0800221 "C4706" # assignment within conditional expression
222 "C4710" # 'function': function not inlined
223 "C4711" # function 'function' selected for inline expansion
224 "C4800" # 'int' : forcing value to bool 'true' or 'false'
225 # (performance warning)
226 "C4820" # 'bytes' bytes padding added after construct 'member_name'
David Benjamin96628432017-01-19 19:05:47 -0500227 "C5026" # move constructor was implicitly defined as deleted
David Benjamin7acd6bc2016-05-02 12:57:01 -0400228 "C5027" # move assignment operator was implicitly defined as deleted
Adam Vartanian189270c2018-05-22 13:50:44 +0100229 "C5045" # Compiler will insert Spectre mitigation for memory load if
230 # /Qspectre switch specified
David Benjamin7acd6bc2016-05-02 12:57:01 -0400231 )
232 set(MSVC_LEVEL4_WARNINGS_LIST
233 # See https://connect.microsoft.com/VisualStudio/feedback/details/1217660/warning-c4265-when-using-functional-header
234 "C4265" # class has virtual functions, but destructor is not virtual
235 )
Brian Smithefed2212015-01-28 16:20:02 -0800236 string(REPLACE "C" " -wd" MSVC_DISABLED_WARNINGS_STR
237 ${MSVC_DISABLED_WARNINGS_LIST})
David Benjamin7acd6bc2016-05-02 12:57:01 -0400238 string(REPLACE "C" " -w4" MSVC_LEVEL4_WARNINGS_STR
239 ${MSVC_LEVEL4_WARNINGS_LIST})
sphawk3ab1a692018-03-11 19:20:51 +0900240 set(CMAKE_C_FLAGS "-utf-8 -Wall -WX ${MSVC_DISABLED_WARNINGS_STR} ${MSVC_LEVEL4_WARNINGS_STR}")
241 set(CMAKE_CXX_FLAGS "-utf-8 -Wall -WX ${MSVC_DISABLED_WARNINGS_STR} ${MSVC_LEVEL4_WARNINGS_STR}")
David Benjamine2568c42017-08-16 15:25:27 -0400242endif()
243
244if(WIN32)
Adam Langley4a0f0c42015-01-28 16:37:10 -0800245 add_definitions(-D_HAS_EXCEPTIONS=0)
Brian Smitha87de9b2015-01-28 20:34:47 -0800246 add_definitions(-DWIN32_LEAN_AND_MEAN)
David Benjamin0e434b92015-04-02 13:20:01 -0400247 add_definitions(-DNOMINMAX)
David Benjamin9b6ff442017-06-15 20:44:30 -0400248 # Allow use of fopen.
249 add_definitions(-D_CRT_SECURE_NO_WARNINGS)
Adam Langleyf7b830d2019-09-06 08:49:28 -0700250 # VS 2017 and higher supports STL-only warning suppressions.
251 # A bug in CMake < 3.13.0 may cause the space in this value to
252 # cause issues when building with NASM. In that case, update CMake.
253 add_definitions("-D_STL_EXTRA_DISABLED_WARNINGS=4774 4987")
Adam Langley95c29f32014-06-20 12:00:00 -0700254endif()
255
David Benjamin2e8ba2d2016-06-09 16:22:26 -0400256if(CMAKE_COMPILER_IS_GNUCXX)
David Benjamin49f03292021-03-22 17:35:06 -0400257 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11")
David Benjamin2e8ba2d2016-06-09 16:22:26 -0400258endif()
259
David Benjamin387f8202022-01-25 12:16:48 -0500260# pthread_rwlock_t on Linux requires a feature flag. We limit this to Linux
261# because, on Apple platforms, it instead disables APIs we use. See compat(5)
262# and sys/cdefs.h. Reportedly, FreeBSD also breaks when this is set. See
263# https://crbug.com/boringssl/471.
264if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
David Benjamin2e8ba2d2016-06-09 16:22:26 -0400265 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE=700")
Adam Langley6f2e7332015-05-15 12:01:29 -0700266endif()
267
Adam Langley9a4beb82015-11-09 13:57:26 -0800268if(FUZZ)
David Benjamin02afbd32017-10-05 15:04:08 -0400269 if(NOT CLANG)
Alessandro Ghedinib6f69272016-09-28 22:14:01 +0100270 message(FATAL_ERROR "You need to build with Clang for fuzzing to work")
Adam Langley9a4beb82015-11-09 13:57:26 -0800271 endif()
272
Adam Langley9c969bf2018-08-24 10:46:01 -0700273 if(CMAKE_C_COMPILER_VERSION VERSION_LESS "6.0.0")
274 message(FATAL_ERROR "You need Clang ≥ 6.0.0")
275 endif()
276
David Benjaminec978dd2016-11-04 18:59:33 -0400277 add_definitions(-DBORINGSSL_UNSAFE_DETERMINISTIC_MODE)
278 set(RUNNER_ARGS "-deterministic")
279
280 if(NOT NO_FUZZER_MODE)
281 add_definitions(-DBORINGSSL_UNSAFE_FUZZER_MODE)
282 set(RUNNER_ARGS ${RUNNER_ARGS} "-fuzzer" "-shim-config" "fuzzer_mode.json")
283 endif()
David Benjaminbc5b2a22016-03-01 22:57:32 -0500284
Adam Langley9c969bf2018-08-24 10:46:01 -0700285 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address,fuzzer-no-link -fsanitize-coverage=edge,indirect-calls")
286 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address,fuzzer-no-link -fsanitize-coverage=edge,indirect-calls")
Adam Langley9a4beb82015-11-09 13:57:26 -0800287endif()
288
Adam Langleyeb7d2ed2014-07-30 16:02:14 -0700289add_definitions(-DBORINGSSL_IMPLEMENTATION)
290
David Benjamine6fd1252018-08-10 10:30:55 -0500291if(BUILD_SHARED_LIBS)
Adam Langley4a0f0c42015-01-28 16:37:10 -0800292 add_definitions(-DBORINGSSL_SHARED_LIBRARY)
293 # Enable position-independent code globally. This is needed because
294 # some library targets are OBJECT libraries.
295 set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
David Benjamin507c1ee2015-01-28 00:50:21 -0500296endif()
297
David Benjamine6fd1252018-08-10 10:30:55 -0500298if(MSAN)
David Benjamin02afbd32017-10-05 15:04:08 -0400299 if(NOT CLANG)
Adam Langley1bcd10c2016-12-16 10:48:23 -0800300 message(FATAL_ERROR "Cannot enable MSAN unless using Clang")
301 endif()
302
David Benjamine6fd1252018-08-10 10:30:55 -0500303 if(ASAN)
Adam Langley1bcd10c2016-12-16 10:48:23 -0800304 message(FATAL_ERROR "ASAN and MSAN are mutually exclusive")
305 endif()
306
307 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer")
308 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer")
Adam Langleye77c27d2018-09-07 11:20:23 -0700309 set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer")
Adam Langley1bcd10c2016-12-16 10:48:23 -0800310endif()
311
David Benjamine6fd1252018-08-10 10:30:55 -0500312if(ASAN)
David Benjamin02afbd32017-10-05 15:04:08 -0400313 if(NOT CLANG)
Adam Langley1bcd10c2016-12-16 10:48:23 -0800314 message(FATAL_ERROR "Cannot enable ASAN unless using Clang")
315 endif()
316
David Benjamin0d3c9632017-02-28 14:58:00 -0500317 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fsanitize-address-use-after-scope -fno-omit-frame-pointer")
318 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fsanitize-address-use-after-scope -fno-omit-frame-pointer")
Adam Langley1bcd10c2016-12-16 10:48:23 -0800319endif()
320
David Benjaminc367ee52017-11-21 08:16:42 -0500321if(CFI)
322 if(NOT CLANG)
323 message(FATAL_ERROR "Cannot enable CFI unless using Clang")
324 endif()
325
David Benjamin66508982018-09-22 16:19:15 -0500326 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=cfi -fno-sanitize-trap=cfi -flto=thin")
327 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=cfi -fno-sanitize-trap=cfi -flto=thin")
David Benjaminc367ee52017-11-21 08:16:42 -0500328 # We use Chromium's copy of clang, which requires -fuse-ld=lld if building
329 # with -flto. That, in turn, can't handle -ggdb.
330 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=lld")
331 string(REPLACE "-ggdb" "-g" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
332 string(REPLACE "-ggdb" "-g" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
333 # -flto causes object files to contain LLVM bitcode. Mixing those with
334 # assembly output in the same static library breaks the linker.
335 set(OPENSSL_NO_ASM "1")
336endif()
337
David Benjamin5852cfc2018-07-19 17:50:45 -0400338if(TSAN)
339 if(NOT CLANG)
340 message(FATAL_ERROR "Cannot enable TSAN unless using Clang")
341 endif()
342
343 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=thread")
344 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=thread")
345 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=thread")
346endif()
347
David Benjaminfc27a192019-01-21 07:25:12 +0000348if(UBSAN)
349 if(NOT CLANG)
350 message(FATAL_ERROR "Cannot enable UBSAN unless using Clang")
351 endif()
352
353 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=undefined")
354 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined")
355 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=undefined")
356
357 if(NOT UBSAN_RECOVER)
358 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-sanitize-recover=undefined")
359 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-sanitize-recover=undefined")
360 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fno-sanitize-recover=undefined")
361 endif()
362endif()
363
David Benjamine6fd1252018-08-10 10:30:55 -0500364if(GCOV)
David Benjamind035ab32016-12-27 12:15:56 -0500365 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
366 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
367endif()
368
David Benjaminaff72a32017-04-06 23:26:04 -0400369if(FIPS)
370 add_definitions(-DBORINGSSL_FIPS)
Adam Langleyf64a6ee2017-05-17 13:05:50 -0700371 if(FIPS_BREAK_TEST)
372 add_definitions("-DBORINGSSL_FIPS_BREAK_${FIPS_BREAK_TEST}=1")
373 endif()
Adam Langleyd72e47f2019-05-09 16:39:49 -0700374 # The FIPS integrity check does not work for ASan and MSan builds.
Adam Langleyf64a6ee2017-05-17 13:05:50 -0700375 if(NOT ASAN AND NOT MSAN)
Adam Langleyd72e47f2019-05-09 16:39:49 -0700376 if(BUILD_SHARED_LIBS)
377 set(FIPS_SHARED "1")
378 else()
379 set(FIPS_DELOCATE "1")
380 endif()
Adam Langleyf64a6ee2017-05-17 13:05:50 -0700381 endif()
David Benjamine481d942019-10-18 16:43:12 -0400382 if(FIPS_SHARED)
383 # The Android CMake files set -ffunction-sections and -fdata-sections,
384 # which is incompatible with FIPS_SHARED.
385 set(CMAKE_C_FLAGS
386 "${CMAKE_C_FLAGS} -fno-function-sections -fno-data-sections")
387 set(CMAKE_CXX_FLAGS
388 "${CMAKE_CXX_FLAGS} -fno-function-sections -fno-data-sections")
389 endif()
David Benjaminaff72a32017-04-06 23:26:04 -0400390endif()
391
David Benjamin6291af42018-03-23 13:49:27 -0400392if(OPENSSL_SMALL)
393 add_definitions(-DOPENSSL_SMALL)
394endif()
395
Adam Langleya6a049a2018-12-06 17:15:58 -0800396if(CONSTANT_TIME_VALIDATION)
397 add_definitions(-DBORINGSSL_CONSTANT_TIME_VALIDATION)
398 # Asserts will often test secret data.
399 add_definitions(-DNDEBUG)
400endif()
401
David Benjamin5baee452018-09-13 16:37:28 -0500402function(go_executable dest package)
403 set(godeps "${CMAKE_SOURCE_DIR}/util/godeps.go")
David Benjamin7e265972021-08-04 14:28:55 -0400404 if(CMAKE_VERSION VERSION_LESS "3.7" OR NOT CMAKE_GENERATOR STREQUAL "Ninja")
David Benjamin5baee452018-09-13 16:37:28 -0500405 # The DEPFILE parameter to add_custom_command is new as of CMake 3.7 and
406 # only works with Ninja. Query the sources at configure time. Additionally,
407 # everything depends on go.mod. That affects what external packages to use.
408 execute_process(COMMAND ${GO_EXECUTABLE} run ${godeps} -format cmake
409 -pkg ${package}
410 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
411 OUTPUT_VARIABLE sources
412 RESULT_VARIABLE godeps_result)
413 add_custom_command(OUTPUT ${dest}
414 COMMAND ${GO_EXECUTABLE} build
415 -o ${CMAKE_CURRENT_BINARY_DIR}/${dest} ${package}
416 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
417 DEPENDS ${sources} ${CMAKE_SOURCE_DIR}/go.mod)
418 else()
419 # Ninja expects the target in the depfile to match the output. This is a
420 # relative path from the build directory.
421 string(LENGTH "${CMAKE_BINARY_DIR}" root_dir_length)
422 math(EXPR root_dir_length "${root_dir_length} + 1")
423 string(SUBSTRING "${CMAKE_CURRENT_BINARY_DIR}" ${root_dir_length} -1 target)
424 set(target "${target}/${dest}")
425
426 set(depfile "${CMAKE_CURRENT_BINARY_DIR}/${dest}.d")
427 add_custom_command(OUTPUT ${dest}
428 COMMAND ${GO_EXECUTABLE} build
429 -o ${CMAKE_CURRENT_BINARY_DIR}/${dest} ${package}
430 COMMAND ${GO_EXECUTABLE} run ${godeps} -format depfile
431 -target ${target} -pkg ${package} -out ${depfile}
432 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
433 DEPENDS ${godeps} ${CMAKE_SOURCE_DIR}/go.mod
434 DEPFILE ${depfile})
435 endif()
436endfunction()
437
David Benjaminaff72a32017-04-06 23:26:04 -0400438# CMake's iOS support uses Apple's multiple-architecture toolchain. It takes an
439# architecture list from CMAKE_OSX_ARCHITECTURES, leaves CMAKE_SYSTEM_PROCESSOR
440# alone, and expects all architecture-specific logic to be conditioned within
441# the source files rather than the build. This does not work for our assembly
442# files, so we fix CMAKE_SYSTEM_PROCESSOR and only support single-architecture
443# builds.
David Benjamine6fd1252018-08-10 10:30:55 -0500444if(NOT OPENSSL_NO_ASM AND CMAKE_OSX_ARCHITECTURES)
David Benjaminaff72a32017-04-06 23:26:04 -0400445 list(LENGTH CMAKE_OSX_ARCHITECTURES NUM_ARCHES)
David Benjamin7e265972021-08-04 14:28:55 -0400446 if(NOT NUM_ARCHES EQUAL 1)
David Benjaminaff72a32017-04-06 23:26:04 -0400447 message(FATAL_ERROR "Universal binaries not supported.")
448 endif()
449 list(GET CMAKE_OSX_ARCHITECTURES 0 CMAKE_SYSTEM_PROCESSOR)
450endif()
451
David Benjamin6887d5e2019-12-17 13:56:30 -0500452if(OPENSSL_NO_SSE2_FOR_TESTING)
453 add_definitions(-DOPENSSL_NO_SSE2_FOR_TESTING)
454endif()
455
David Benjamine6fd1252018-08-10 10:30:55 -0500456if(OPENSSL_NO_ASM)
David Benjamin27b08e92015-05-04 15:16:57 -0400457 add_definitions(-DOPENSSL_NO_ASM)
458 set(ARCH "generic")
David Benjamin7e265972021-08-04 14:28:55 -0400459elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
David Benjaminaff72a32017-04-06 23:26:04 -0400460 set(ARCH "x86_64")
David Benjamin7e265972021-08-04 14:28:55 -0400461elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64")
David Benjaminaff72a32017-04-06 23:26:04 -0400462 set(ARCH "x86_64")
David Benjamin7e265972021-08-04 14:28:55 -0400463elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64")
David Benjaminaff72a32017-04-06 23:26:04 -0400464 # cmake reports AMD64 on Windows, but we might be building for 32-bit.
David Benjamin884614c2020-06-16 10:59:58 -0400465 if(CMAKE_SIZEOF_VOID_P EQUAL 8)
David Benjaminaff72a32017-04-06 23:26:04 -0400466 set(ARCH "x86_64")
467 else()
468 set(ARCH "x86")
469 endif()
David Benjamin7e265972021-08-04 14:28:55 -0400470elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86")
David Benjaminaff72a32017-04-06 23:26:04 -0400471 set(ARCH "x86")
David Benjamin7e265972021-08-04 14:28:55 -0400472elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "i386")
David Benjaminaff72a32017-04-06 23:26:04 -0400473 set(ARCH "x86")
David Benjamin7e265972021-08-04 14:28:55 -0400474elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "i686")
David Benjaminaff72a32017-04-06 23:26:04 -0400475 set(ARCH "x86")
David Benjamin7e265972021-08-04 14:28:55 -0400476elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
David Benjaminaff72a32017-04-06 23:26:04 -0400477 set(ARCH "aarch64")
David Benjamin7e265972021-08-04 14:28:55 -0400478elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64")
Anthony Robertsafd5dba2020-10-19 12:27:51 +0100479 set(ARCH "aarch64")
David Benjamin7e265972021-08-04 14:28:55 -0400480elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
David Benjaminaff72a32017-04-06 23:26:04 -0400481 set(ARCH "aarch64")
Junghoon Jange8ba1e32018-11-15 10:20:42 +0900482# Apple A12 Bionic chipset which is added in iPhone XS/XS Max/XR uses arm64e architecture.
David Benjamin7e265972021-08-04 14:28:55 -0400483elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64e")
Junghoon Jange8ba1e32018-11-15 10:20:42 +0900484 set(ARCH "aarch64")
David Benjamin7e265972021-08-04 14:28:55 -0400485elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm*")
David Benjaminaff72a32017-04-06 23:26:04 -0400486 set(ARCH "arm")
David Benjamin7e265972021-08-04 14:28:55 -0400487elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "mips")
David Benjaminaff72a32017-04-06 23:26:04 -0400488 # Just to avoid the “unknown processor” error.
489 set(ARCH "generic")
David Benjamin7e265972021-08-04 14:28:55 -0400490elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "ppc64le")
David Benjaminaff72a32017-04-06 23:26:04 -0400491 set(ARCH "ppc64le")
492else()
493 message(FATAL_ERROR "Unknown processor:" ${CMAKE_SYSTEM_PROCESSOR})
David Benjamin27b08e92015-05-04 15:16:57 -0400494endif()
495
David Benjamin7e265972021-08-04 14:28:55 -0400496if(ANDROID AND NOT ANDROID_NDK_REVISION AND ARCH STREQUAL "arm")
David Benjamin9894ee92017-12-13 18:08:47 -0500497 # The third-party Android-NDK CMake files somehow fail to set the -march flag
498 # for assembly files. Without this flag, the compiler believes that it's
David Benjaminaff72a32017-04-06 23:26:04 -0400499 # building for ARMv5.
David Benjamin9894ee92017-12-13 18:08:47 -0500500 set(CMAKE_ASM_FLAGS "-march=${CMAKE_SYSTEM_PROCESSOR} ${CMAKE_ASM_FLAGS}")
David Benjaminaff72a32017-04-06 23:26:04 -0400501endif()
502
David Benjamine6fd1252018-08-10 10:30:55 -0500503if(USE_CUSTOM_LIBCXX)
504 if(NOT CLANG)
David Benjamine9ae99b2018-08-09 15:33:07 -0500505 message(FATAL_ERROR "USE_CUSTOM_LIBCXX only supported with Clang")
506 endif()
507
508 # CMAKE_CXX_FLAGS ends up in the linker flags as well, so use
509 # add_compile_options. There does not appear to be a way to set
510 # language-specific compile-only flags.
511 add_compile_options("-nostdinc++")
512 set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -nostdlib++")
513 include_directories(
514 SYSTEM
David Benjamin16b3af72021-10-26 17:07:39 -0400515 util/bot/libcxx-config
David Benjamine9ae99b2018-08-09 15:33:07 -0500516 util/bot/libcxx/include
517 util/bot/libcxxabi/include
518 )
519
520 # This is patterned after buildtools/third_party/libc++/BUILD.gn and
521 # buildtools/third_party/libc++abi/BUILD.gn in Chromium.
522
523 file(GLOB LIBCXX_SOURCES "util/bot/libcxx/src/*.cpp")
524 file(GLOB LIBCXXABI_SOURCES "util/bot/libcxxabi/src/*.cpp")
525
526 # This file is meant for exception-less builds.
527 list(REMOVE_ITEM LIBCXXABI_SOURCES "trunk/src/cxa_noexception.cpp")
528 # libc++ also defines new and delete.
529 list(REMOVE_ITEM LIBCXXABI_SOURCES "trunk/src/stdlib_new_delete.cpp")
David Benjamine6fd1252018-08-10 10:30:55 -0500530 if(TSAN)
David Benjamine9ae99b2018-08-09 15:33:07 -0500531 # ThreadSanitizer tries to intercept these symbols. Skip them to avoid
532 # symbol conflicts.
533 list(REMOVE_ITEM LIBCXXABI_SOURCES "trunk/src/cxa_guard.cpp")
534 endif()
535
536 add_library(libcxxabi ${LIBCXXABI_SOURCES})
537 target_compile_definitions(
538 libcxxabi PRIVATE
539 -D_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS
540 )
541 set_target_properties(libcxxabi PROPERTIES COMPILE_FLAGS "-Wno-missing-prototypes -Wno-implicit-fallthrough")
David Benjamin16b3af72021-10-26 17:07:39 -0400542 # libc++abi depends on libc++ internal headers.
543 set_property(TARGET libcxxabi APPEND PROPERTY INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR}/util/bot/libcxx/src")
David Benjamine9ae99b2018-08-09 15:33:07 -0500544
545 add_library(libcxx ${LIBCXX_SOURCES})
David Benjamine6fd1252018-08-10 10:30:55 -0500546 if(ASAN OR MSAN OR TSAN)
David Benjamine9ae99b2018-08-09 15:33:07 -0500547 # Sanitizers try to intercept new and delete.
548 target_compile_definitions(
549 libcxx PRIVATE
550 -D_LIBCPP_DISABLE_NEW_DELETE_DEFINITIONS
551 )
552 endif()
553 target_compile_definitions(
554 libcxx PRIVATE
555 -D_LIBCPP_BUILDING_LIBRARY
556 -DLIBCXX_BUILDING_LIBCXXABI
557 )
558 target_link_libraries(libcxx libcxxabi)
559endif()
560
David Benjamin96628432017-01-19 19:05:47 -0500561# Add minimal googletest targets. The provided one has many side-effects, and
562# googletest has a very straightforward build.
Marek Gilbert11850d52018-01-03 23:07:58 -0800563add_library(boringssl_gtest third_party/googletest/src/gtest-all.cc)
564target_include_directories(boringssl_gtest PRIVATE third_party/googletest)
David Benjamin96628432017-01-19 19:05:47 -0500565
566include_directories(third_party/googletest/include)
567
David Benjamin301afaf2015-10-14 21:34:40 -0400568# Declare a dummy target to build all unit tests. Test targets should inject
569# themselves as dependencies next to the target definition.
570add_custom_target(all_tests)
571
David Benjamincbac9c32020-06-18 16:14:24 -0400572# On Windows, CRYPTO_TEST_DATA is too long to fit in command-line limits.
573# TODO(davidben): CMake 3.12 has a list(JOIN) command. Use that when we've
574# updated the minimum version.
575set(EMBED_TEST_DATA_ARGS "")
576foreach(arg ${CRYPTO_TEST_DATA})
577 set(EMBED_TEST_DATA_ARGS "${EMBED_TEST_DATA_ARGS}${arg}\n")
578endforeach()
579file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/embed_test_data_args.txt"
580 "${EMBED_TEST_DATA_ARGS}")
581
David Benjamin3ecd0a52017-05-19 15:26:18 -0400582add_custom_command(
583 OUTPUT crypto_test_data.cc
David Benjamincbac9c32020-06-18 16:14:24 -0400584 COMMAND ${GO_EXECUTABLE} run util/embed_test_data.go -file-list
585 "${CMAKE_CURRENT_BINARY_DIR}/embed_test_data_args.txt" >
586 "${CMAKE_CURRENT_BINARY_DIR}/crypto_test_data.cc"
David Benjamin3ecd0a52017-05-19 15:26:18 -0400587 DEPENDS util/embed_test_data.go ${CRYPTO_TEST_DATA}
588 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
589
590add_library(crypto_test_data OBJECT crypto_test_data.cc)
591
Adam Langley95c29f32014-06-20 12:00:00 -0700592add_subdirectory(crypto)
593add_subdirectory(ssl)
594add_subdirectory(ssl/test)
595add_subdirectory(tool)
Adam Langley60cc4d42019-07-01 14:27:30 -0700596add_subdirectory(util/fipstools/cavp)
Adam Langleyb7f0c1b2019-07-09 18:02:14 -0700597add_subdirectory(util/fipstools/acvp/modulewrapper)
Adam Langleyc004dfc2015-02-03 10:45:12 -0800598add_subdirectory(decrepit)
David Benjamin301afaf2015-10-14 21:34:40 -0400599
Adam Langley9a4beb82015-11-09 13:57:26 -0800600if(FUZZ)
David Benjamin6c597be2019-01-07 15:13:04 -0600601 if(LIBFUZZER_FROM_DEPS)
602 file(GLOB LIBFUZZER_SOURCES "util/bot/libFuzzer/*.cpp")
603 add_library(Fuzzer STATIC ${LIBFUZZER_SOURCES})
604 # libFuzzer does not pass our aggressive warnings. It also must be built
605 # without -fsanitize-coverage options or clang crashes.
606 set_target_properties(Fuzzer PROPERTIES COMPILE_FLAGS "-Wno-shadow -Wno-format-nonliteral -Wno-missing-prototypes -fsanitize-coverage=0")
607 endif()
608
Adam Langley9a4beb82015-11-09 13:57:26 -0800609 add_subdirectory(fuzz)
610endif()
611
Benjamin Brittainea46caf2022-01-20 15:50:12 -0500612if(RUST_BINDINGS)
613 find_program(BINDGEN_EXECUTABLE bindgen)
614 if(NOT BINDGEN_EXECUTABLE)
615 message(FATAL_ERROR "Could not find bindgen but was asked to generate Rust bindings.")
616 else()
617 add_subdirectory(rust)
618 endif()
619endif()
620
David Benjamin0f4454c2022-01-26 14:17:08 -0500621if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
David Benjamin17dc94e2018-08-10 09:05:20 -0500622 set(HANDSHAKER_ARGS "-handshaker-path" $<TARGET_FILE:handshaker>)
623endif()
624
Adam Langley4f75b762020-12-17 14:06:25 -0800625if(FIPS)
626 add_custom_target(
627 acvp_tests
628 COMMAND ${GO_EXECUTABLE} build -o ${CMAKE_BINARY_DIR}/acvptool
629 boringssl.googlesource.com/boringssl/util/fipstools/acvp/acvptool
630 COMMAND ${GO_EXECUTABLE} build -o ${CMAKE_BINARY_DIR}/testmodulewrapper
631 boringssl.googlesource.com/boringssl/util/fipstools/acvp/acvptool/testmodulewrapper
632 COMMAND cd util/fipstools/acvp/acvptool/test &&
633 ${GO_EXECUTABLE} run check_expected.go
634 -tool ${CMAKE_BINARY_DIR}/acvptool
635 -module-wrappers modulewrapper:$<TARGET_FILE:modulewrapper>,testmodulewrapper:${CMAKE_BINARY_DIR}/testmodulewrapper
636 -tests tests.json
637 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
638 DEPENDS modulewrapper
639 USES_TERMINAL)
640
641 add_custom_target(
642 fips_specific_tests_if_any
643 DEPENDS acvp_tests
644 )
645else()
646 add_custom_target(fips_specific_tests_if_any)
647endif()
648
David Benjamin301afaf2015-10-14 21:34:40 -0400649add_custom_target(
650 run_tests
651 COMMAND ${GO_EXECUTABLE} run util/all_tests.go -build-dir
652 ${CMAKE_BINARY_DIR}
Adam Langleyd5c72c82016-09-23 16:43:17 -0700653 COMMAND cd ssl/test/runner &&
654 ${GO_EXECUTABLE} test -shim-path $<TARGET_FILE:bssl_shim>
David Benjamin17dc94e2018-08-10 09:05:20 -0500655 ${HANDSHAKER_ARGS} ${RUNNER_ARGS}
David Benjamin301afaf2015-10-14 21:34:40 -0400656 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
Adam Langley4f75b762020-12-17 14:06:25 -0800657 DEPENDS all_tests bssl_shim handshaker fips_specific_tests_if_any
David Benjamin81a998a2020-05-26 11:35:58 -0400658 USES_TERMINAL)