X-Git-Url: https://wagner.pp.ru/gitweb/?a=blobdiff_plain;f=CMakeLists.txt;h=a6bb1785e8555bc0fbab6d99360b44a7f6588921;hb=0321ed4fa2544e18001d8c50f852e676864aa980;hp=6ba5a974c5f77ad28e1c7824c49572f4aba09276;hpb=3881226ccc975666346f88d00c1f1917e9ccfd91;p=openssl-gost%2Fengine.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 6ba5a97..a6bb178 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,14 +15,20 @@ message("-- Found OpenSSL application: ${OPENSSL_PROGRAM}") 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 -Wno-deprecated-declarations) + set(CMAKE_C_FLAGS_RELEASE -O2) + set(CMAKE_C_FLAGS_DEBUG "-O0 -ggdb") + set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -ggdb") + add_compile_options(-Werror -Wall -Wno-unused-parameter -Wno-unused-function -Wno-missing-braces -Qunused-arguments -Wno-deprecated-declarations) elseif(CMAKE_C_COMPILER_ID MATCHES "GNU") - add_compile_options(-O2 -Werror -Wall -Wno-unused-parameter -Wno-unused-function -Wno-missing-braces -ggdb -Wno-error=unknown-pragmas -Wno-error=pragmas -Wno-deprecated-declarations) + set(CMAKE_C_FLAGS_RELEASE -O2) + set(CMAKE_C_FLAGS_DEBUG "-O0 -ggdb") + set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -ggdb") + add_compile_options(-Werror -Wall -Wno-unused-parameter -Wno-unused-function -Wno-missing-braces -Wno-error=unknown-pragmas -Wno-error=pragmas -Wno-deprecated-declarations) elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC") - add_definitions(-D_CRT_SECURE_NO_WARNINGS) - add_definitions(-D_CRT_DEPRECATED_NO_WARNINGS) - add_definitions(-D_CRT_NONSTDC_NO_WARNINGS) - add_compile_options(/MP /WX /W4 /wd4100 /wd4267 /wd4206 /wd4706 /wd4244 /wd4115) + add_definitions(-D_CRT_SECURE_NO_WARNINGS) + add_definitions(-D_CRT_DEPRECATED_NO_WARNINGS) + add_definitions(-D_CRT_NONSTDC_NO_WARNINGS) + add_compile_options(/MP /WX /W4 /wd4100 /wd4267 /wd4206 /wd4706 /wd4244 /wd4115) endif() if (ASAN) @@ -231,16 +237,16 @@ target_link_libraries(test_context ${OPENSSL_CRYPTO_LIBRARY}) add_test(NAME context COMMAND test_context) set_tests_properties(context PROPERTIES ENVIRONMENT "${TEST_ENVIRONMENT}") +# test_keyexpimp is an internals testing program, it doesn't need a test env add_executable(test_keyexpimp test_keyexpimp.c) #target_compile_definitions(test_keyexpimp PUBLIC -DOPENSSL_LOAD_CONF) target_link_libraries(test_keyexpimp gost_core ${OPENSSL_CRYPTO_LIBRARY}) -add_test(NAME keyexpimp - COMMAND test_keyexpimp) +add_test(NAME keyexpimp COMMAND test_keyexpimp) +# test_gost89 is an internals testing program, it doesn't need a test env add_executable(test_gost89 test_gost89.c) target_link_libraries(test_gost89 gost_core ${OPENSSL_CRYPTO_LIBRARY}) -add_test(NAME gost89 - COMMAND test_gost89) +add_test(NAME gost89 COMMAND test_gost89) if(NOT SKIP_PERL_TESTS) execute_process(COMMAND perl -MTest2::V0 -e ""