From 6b2326d0b61d588a7b9d1a8a1b2ca434cda1799f Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Mon, 8 Jan 2018 15:34:11 +0100 Subject: Fixed bugs with QDockWidgets - QDockWidgets are now deleted on close - Opening a new BookmarksWidget no longer leaves an empty dock widget - Fixed crash with deleting dock widgets --- CMakeLists.txt | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 600ac8e..fdc3b2e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.1.0) project(smolbote) # Options +option(CompilerWarnings "Compiler warnings" ON) +option(QtDeprecatedWarnings "Qt deprecated warnings" ON) option(UseLibCpp "Use libc++ over stdlibc++ (requires clang)" OFF) option(CLikeConfig "Use a C-like style for the config" ON) @@ -20,7 +22,19 @@ set(CMAKE_AUTORCC ON) # Global C++ settings set(CMAKE_CXX_STANDARD 17) -add_definitions(-DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050900) + +if(CompilerWarnings) + if(CMAKE_COMPILER_IS_GNUCC) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") + endif() + if(MSVC) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") + endif() +endif(CompilerWarnings) + +if(QtDeprecatedWarnings) + add_definitions(-DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050900) +endif(QtDeprecatedWarnings) # link to libc++ if (UseLibCpp) -- cgit v1.2.1