File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed
Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -292,6 +292,27 @@ target_compile_definitions(${PROJECT_NAME}
292292 $<$<C_COMPILER_ID:MSVC >:_CRT_SECURE_NO_WARNINGS>
293293)
294294
295+ # No generator expression for CMAKE_C_COMPILER_FRONTEND_VARIANT until CMake 3.30:
296+ # https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9538
297+ if (CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC" )
298+ target_compile_definitions (${PROJECT_NAME}
299+ PRIVATE
300+ _CRT_SECURE_NO_WARNINGS
301+ )
302+
303+ # Special manual feature-handling for clang-cl.
304+ target_compile_options (${PROJECT_NAME}
305+ PUBLIC
306+ # blake2b-compress-avx2
307+ -mavx2
308+ PRIVATE
309+ # aead_aes256gcm_aesni
310+ -maes
311+ -mpclmul
312+ -mssse3
313+ )
314+ endif ()
315+
295316# Variables that need to be exported to version.h.in
296317set (VERSION 1.0.20)
297318set (SODIUM_LIBRARY_VERSION_MAJOR 26)
Original file line number Diff line number Diff line change @@ -18,6 +18,14 @@ function(make_test name)
1818 $<$<C_COMPILER_ID:MSVC >:_CRT_SECURE_NO_WARNINGS>
1919 )
2020
21+ if (CMAKE_C_COMPILER_ID STREQUAL "Clang"
22+ AND CMAKE_C_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC" )
23+ target_compile_definitions (${name}
24+ PRIVATE
25+ _CRT_SECURE_NO_WARNINGS
26+ )
27+ endif ()
28+
2129 add_test (
2230 NAME ${name}
2331 COMMAND ${name}
You can’t perform that action at this time.
0 commit comments