|
|
@ -12,7 +12,7 @@ function(set_static_flags)
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++")
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endfunction(set_static_flags)
|
|
|
|
endfunction(set_static_flags)
|
|
|
|
|
|
|
|
|
|
|
|
include_directories(src contrib/epee/include external "${CMAKE_BINARY_DIR}/version")
|
|
|
|
include_directories(src contrib/epee/include external "${CMAKE_BINARY_DIR}/version")
|
|
|
|
|
|
|
|
|
|
|
|
if(APPLE)
|
|
|
|
if(APPLE)
|
|
|
@ -21,6 +21,11 @@ endif()
|
|
|
|
|
|
|
|
|
|
|
|
set(STATIC ${MSVC} CACHE BOOL "Link libraries statically")
|
|
|
|
set(STATIC ${MSVC} CACHE BOOL "Link libraries statically")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (UNIX AND NOT APPLE)
|
|
|
|
|
|
|
|
# Note that at the time of this writing the -Wstrict-prototypes flag added below will make this fail
|
|
|
|
|
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
if(MSVC)
|
|
|
|
if(MSVC)
|
|
|
|
add_definitions("/bigobj /MP /W3 /GS- /D_CRT_SECURE_NO_WARNINGS /wd4996 /wd4345 /D_WIN32_WINNT=0x0600 /DWIN32_LEAN_AND_MEAN /DGTEST_HAS_TR1_TUPLE=0 /FIinline_c.h /D__SSE4_1__")
|
|
|
|
add_definitions("/bigobj /MP /W3 /GS- /D_CRT_SECURE_NO_WARNINGS /wd4996 /wd4345 /D_WIN32_WINNT=0x0600 /DWIN32_LEAN_AND_MEAN /DGTEST_HAS_TR1_TUPLE=0 /FIinline_c.h /D__SSE4_1__")
|
|
|
|
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Dinline=__inline")
|
|
|
|
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Dinline=__inline")
|
|
|
@ -44,6 +49,11 @@ else()
|
|
|
|
else()
|
|
|
|
else()
|
|
|
|
set(WARNINGS "${WARNINGS} -Wlogical-op -Wno-error=maybe-uninitialized")
|
|
|
|
set(WARNINGS "${WARNINGS} -Wlogical-op -Wno-error=maybe-uninitialized")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# Since gcc 4.9 the LTO format is non-standard (slim), so we need the gcc-specific ar and ranlib binaries
|
|
|
|
|
|
|
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9.0))
|
|
|
|
|
|
|
|
set(CMAKE_AR "gcc-ar")
|
|
|
|
|
|
|
|
set(CMAKE_RANLIB "gcc-ranlib")
|
|
|
|
|
|
|
|
endif()
|
|
|
|
if(MINGW)
|
|
|
|
if(MINGW)
|
|
|
|
set(WARNINGS "${WARNINGS} -Wno-error=unused-value")
|
|
|
|
set(WARNINGS "${WARNINGS} -Wno-error=unused-value")
|
|
|
|
set(MINGW_FLAG "-DWIN32_LEAN_AND_MEAN")
|
|
|
|
set(MINGW_FLAG "-DWIN32_LEAN_AND_MEAN")
|
|
|
@ -70,7 +80,7 @@ else()
|
|
|
|
set(DEBUG_FLAGS "-g3 -O0")
|
|
|
|
set(DEBUG_FLAGS "-g3 -O0")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
set(RELEASE_FLAGS "-Ofast -DNDEBUG -Wno-unused-variable")
|
|
|
|
set(RELEASE_FLAGS "-Ofast -DNDEBUG -Wno-unused-variable")
|
|
|
|
if(NOT APPLE)
|
|
|
|
if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
|
|
|
# There is a clang bug that does not allow to compile code that uses AES-NI intrinsics if -flto is enabled
|
|
|
|
# There is a clang bug that does not allow to compile code that uses AES-NI intrinsics if -flto is enabled
|
|
|
|
set(RELEASE_FLAGS "${RELEASE_FLAGS} -flto")
|
|
|
|
set(RELEASE_FLAGS "${RELEASE_FLAGS} -flto")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|