X-Git-Url: http://wagner.pp.ru/gitweb/?a=blobdiff_plain;f=CMakeLists.txt;h=8036d342f192ebd36140897d1c441cb1e41551c0;hb=7e6ed644cf97385a95544fcc889e2eb16bcc93ed;hp=36613f1c74b07331b86a4cfb8fbaae05a3618c6a;hpb=46da0131e71906a5ec206a0c2b7fb60f74bb6844;p=openssl-gost%2Fengine.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 36613f1..8036d34 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,7 @@ project(gost-engine LANGUAGES C) include(GNUInstallDirs) include(CheckLibraryExists) include(CheckFunctionExists) +include(CheckCSourceRuns) enable_testing() @@ -13,7 +14,7 @@ include_directories(${OPENSSL_INCLUDE_DIR}) if (CMAKE_C_COMPILER_ID MATCHES "Clang") add_compile_options(-O2 -Werror -Wall -Wno-unused-parameter -Wno-unused-function -Wno-missing-braces -ggdb -Qunused-arguments) elseif(CMAKE_C_COMPILER_ID MATCHES "GNU") - add_compile_options(-O2 -Werror -Wall -Wno-unused-parameter -Wno-unused-function -Wno-missing-braces -ggdb) + add_compile_options(-O2 -Werror -Wall -Wno-unused-parameter -Wno-unused-function -Wno-missing-braces -ggdb -Wno-error=unknown-pragmas) elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC") add_definitions(-D_CRT_SECURE_NO_WARNINGS) add_definitions(-D_CRT_DEPRECATED_NO_WARNINGS) @@ -26,6 +27,11 @@ if (ASAN) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -g3 -fno-omit-frame-pointer") endif() +# DEPRECATEDIN_3_0 CMAC +set_source_files_properties(gost_omac.c PROPERTIES COMPILE_FLAGS -Wno-error=deprecated-declarations) +# DEPRECATEDIN_3_0 HMAC +set_source_files_properties(gost_keyexpimp.c PROPERTIES COMPILE_FLAGS -Wno-error=deprecated-declarations) + set(CMAKE_C_STANDARD 90) CHECK_FUNCTION_EXISTS(clock_gettime HAVE_CLOCK_GETTIME_C) CHECK_LIBRARY_EXISTS(rt clock_gettime "" HAVE_CLOCK_GETTIME_RT) @@ -42,6 +48,23 @@ else() add_definitions(-DL_ENDIAN) endif() +check_c_source_runs(" + #ifdef _MSC_VER + # include + #else + # include + #endif + int main(void) { + unsigned long long x = -1, y = 1, r; + unsigned char cf; + cf = _addcarry_u64(1, x, y, &r); + return !(cf == 1 && r == 1); + } + " ADDCARRY_U64) +if (ADDCARRY_U64) + add_definitions(-DHAVE_ADDCARRY_U64) +endif() + set(BIN_DIRECTORY bin) # Same soversion as OpenSSL