From fcb061fdde69cbd9148d9af3fd3129a21e7c2177 Mon Sep 17 00:00:00 2001 From: Dmitry Belyavskiy Date: Thu, 15 Dec 2016 13:57:19 +0300 Subject: [PATCH] Endianess test --- CMakeLists.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7c87c91..4b50a42 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,17 @@ 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") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -Werror -ggdb") + +include (TestBigEndian) +TEST_BIG_ENDIAN(IS_BIG_ENDIAN) +if(IS_BIG_ENDIAN) + message(STATUS "BIG_ENDIAN") +else() + message(STATUS "LITTLE_ENDIAN") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c98 -O3 -Werror -Wall") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DL_ENDIAN") +endif() set(GOST_INCLUDE_DIRECTORIES "${OPENSSL_PATH}/include" "${OPENSSL_PATH}/crypto/include") -- 2.39.5