X-Git-Url: http://wagner.pp.ru/gitweb/?a=blobdiff_plain;f=CMakeLists.txt;h=b239827810d59e3482b2e0d1b5f1603de5deb2c1;hb=ea678abc1f9ea5acfdf2d5e5d6fa1c62add0631f;hp=dfcd7743bece4f809c894179223b801c1ef2de7f;hpb=b616bb8e764ca37c9e2c45e79e875ca55aab7d37;p=openssl-gost%2Fengine.git diff --git a/CMakeLists.txt b/CMakeLists.txt index dfcd774..b239827 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,13 @@ cmake_minimum_required(VERSION 2.8) project(ccgost) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c98 -O3 -Werror -Wall") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -Werror -ggdb") +if (CMAKE_C_COMPILER_ID MATCHES "Clang") + message(STATUS "Using Clang and adding -Qunused-arguments flag") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Qunused-arguments") +endif() + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c98 -O3 -Werror -Qunused-arguments -Wno-unused-function -Wno-missing-braces -Wall") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -Werror -Wall -Wno-unused-parameter -Wno-unused-function -Wno-missing-braces -ggdb") include (TestBigEndian) TEST_BIG_ENDIAN(IS_BIG_ENDIAN) @@ -14,23 +19,6 @@ else() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DL_ENDIAN") endif() -set(GOST_INCLUDE_DIRECTORIES "${OPENSSL_PATH}/include" "${OPENSSL_PATH}/crypto/include") - -set(GOST_LINK_DIRECTORIES "${OPENSSL_PATH}") - -# module linker flags -SET (CMAKE_MODULE_LINKER_FLAGS "-L${OPENSSL_PATH}" "-L${OPENSSL_PATH}/lib" $ENV{LDFLAGS} - CACHE STRING "Flags used by the linker during the creation of modules.") -# exe linker flags -SET (CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS_INIT} $ENV{LDFLAGS} - CACHE STRING "Flags used by the linker during the creation of executables.") -# shared lib linker flags -SET (CMAKE_SHARED_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS_INIT} $ENV{LDFLAGS} - CACHE STRING "Flags used by the linker during the creation of shared libraries.") - - -include_directories("${GOST_INCLUDE_DIRECTORIES}") - set(BIN_DIRECTORY bin) set(OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/${BIN_DIRECTORY}) @@ -105,8 +93,6 @@ set(GOST_ENGINE_SOURCE_FILES gost_md2012.c gost_pmeth.c) -link_directories(${GOST_LINK_DIRECTORIES}) - add_library(gost STATIC ${GOST_LIB_SOURCE_FILES}) set_target_properties(gost PROPERTIES POSITION_INDEPENDENT_CODE ON)