|
|
|
@ -31,7 +31,7 @@ option(SVGZ_ICON "Compress the SVG icon of qTox" ON)
@@ -31,7 +31,7 @@ option(SVGZ_ICON "Compress the SVG icon of qTox" ON)
|
|
|
|
|
option(ASAN "Compile with AddressSanitizer" OFF) |
|
|
|
|
option(TSAN "Compile with ThreadSanitizer" OFF) |
|
|
|
|
option(DESKTOP_NOTIFICATIONS "Use snorenotify for desktop notifications" OFF) |
|
|
|
|
option(STRICT_OPTIONS "Enable strict compile options, used by CI" OFF) |
|
|
|
|
option(STRICT_OPTIONS "Error on compile warning, used by CI" OFF) |
|
|
|
|
|
|
|
|
|
# process generated files if cmake >= 3.10 |
|
|
|
|
if(POLICY CMP0071) |
|
|
|
@ -93,27 +93,8 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti")
@@ -93,27 +93,8 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti")
|
|
|
|
|
# Hardening flags (ASLR, warnings, etc) |
|
|
|
|
set(POSITION_INDEPENDENT_CODE True) |
|
|
|
|
|
|
|
|
|
include(CheckCXXCompilerFlag) |
|
|
|
|
CHECK_CXX_COMPILER_FLAG(-Wweak-vtables COMPILER_SUPPORTS_WARNING_WEAK_VTABLES) |
|
|
|
|
if(COMPILER_SUPPORTS_WARNING_WEAK_VTABLES) |
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wweak-vtables") |
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
# Extra-strict compile options that we don't want to subject all users to by default |
|
|
|
|
if (STRICT_OPTIONS) |
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") |
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
# avoid timestamps in binary for reproducible builds, not added until GCC 4.9 |
|
|
|
|
include(CheckCXXCompilerFlag) |
|
|
|
|
CHECK_CXX_COMPILER_FLAG(-Wdate-time COMPILER_SUPPORTS_WDATE_TIME) |
|
|
|
|
if (COMPILER_SUPPORTS_WDATE_TIME) |
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wdate-time") |
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
if (NOT WIN32 AND NOT HAIKU) |
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector-all") |
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wstack-protector") |
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
if (UNIX AND NOT APPLE) |
|
|
|
@ -123,7 +104,6 @@ endif()
@@ -123,7 +104,6 @@ endif()
|
|
|
|
|
|
|
|
|
|
include(CheckAtomic) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Use ccache when available to speed up builds. |
|
|
|
|
if (USE_CCACHE) |
|
|
|
|
find_program(CCACHE_FOUND ccache) |
|
|
|
|