X-Git-Url: http://wagner.pp.ru/gitweb/?a=blobdiff_plain;f=CMakeLists.txt;h=a92e1b88613d385eb8a9f55558c6e0e7f1dbe92d;hb=10bc636b2ad4c9df49ee63934628cab89b6aa2e2;hp=ad7457d38b95805663e292a7bea6840a126d145f;hpb=759caad8600bab0e4c8e6639a32fd3e6c0cac856;p=openssl-gost%2Fengine.git diff --git a/CMakeLists.txt b/CMakeLists.txt index ad7457d..a92e1b8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,33 +49,37 @@ 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) +if (NOT CMAKE_CROSSCOMPILING) + 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() endif() -check_c_source_runs(" - int main(void) { - char buf[16] = { 0, 1, 2 }; - int *p = (int *)(buf + 1); - int *q = (int *)(buf + 2); - return (*p == *q); - } - " RELAXED_ALIGNMENT) -if (NOT RELAXED_ALIGNMENT) - add_definitions(-DSTRICT_ALIGNMENT) +if (NOT CMAKE_CROSSCOMPILING) + check_c_source_runs(" + int main(void) { + char buf[16] = { 0, 1, 2 }; + int *p = (int *)(buf + 1); + int *q = (int *)(buf + 2); + return (*p == *q); + } + " RELAXED_ALIGNMENT) + if (NOT RELAXED_ALIGNMENT) + add_definitions(-DSTRICT_ALIGNMENT) + endif() endif() set(BIN_DIRECTORY bin) @@ -178,8 +182,6 @@ set(GOST_ENGINE_SOURCE_FILES gost_md.c gost_md2012.c gost_pmeth.c - gost_omac.c - gost_omac_acpkm.c ) add_executable(test_digest test_digest.c) @@ -188,7 +190,7 @@ add_test(NAME digest COMMAND test_digest) add_executable(test_curves test_curves.c) -target_link_libraries(test_curves gost_engine) +target_link_libraries(test_curves gost_engine OpenSSL::Crypto) add_test(NAME curves COMMAND test_curves) @@ -208,18 +210,18 @@ add_test(NAME TLS COMMAND test_tls) add_executable(test_context test_context.c) -target_link_libraries(test_context gost_engine) +target_link_libraries(test_context gost_engine OpenSSL::Crypto) add_test(NAME context COMMAND test_context) add_executable(test_grasshopper test_grasshopper.c) -target_link_libraries(test_grasshopper gost_engine) +target_link_libraries(test_grasshopper gost_engine OpenSSL::Crypto) add_test(NAME grasshopper COMMAND test_grasshopper) add_executable(test_keyexpimp test_keyexpimp.c) #target_compile_definitions(test_keyexpimp PUBLIC -DOPENSSL_LOAD_CONF) -target_link_libraries(test_keyexpimp gost_engine) +target_link_libraries(test_keyexpimp gost_engine OpenSSL::Crypto) add_test(NAME keyexpimp COMMAND test_keyexpimp)