Browse Source

Merge pull request #8834 from Chocobo1/cmake

Improve cmake script
adaptive-webui-19844
Mike Tzou 7 years ago committed by GitHub
parent
commit
0f8127a897
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      CMakeLists.txt
  2. 15
      cmake/Modules/MacroQbtCompilerSettings.cmake

2
CMakeLists.txt

@ -1,6 +1,8 @@
cmake_minimum_required(VERSION 3.5) cmake_minimum_required(VERSION 3.5)
cmake_policy(VERSION 3.5) cmake_policy(VERSION 3.5)
message(WARNING "No official support for cmake build system. If it is broken, please submit patches!")
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules)
include(FunctionReadVersion) include(FunctionReadVersion)

15
cmake/Modules/MacroQbtCompilerSettings.cmake

@ -11,18 +11,17 @@ macro(qbt_set_compiler_options)
#-Wshadow -Wconversion ? #-Wshadow -Wconversion ?
set(_GCC_COMMON_C_AND_CXX_FLAGS "-Wall -Wextra" set(_GCC_COMMON_C_AND_CXX_FLAGS "-Wall -Wextra"
"-Wfloat-equal -Wcast-qual -Wcast-align" "-Wfloat-equal -Wcast-qual -Wcast-align"
"-Wsign-conversion -Winvalid-pch -Werror=return-type -Wno-long-long" "-Wsign-conversion -Winvalid-pch -Wno-long-long"
# -fstack-protector-all #"-fstack-protector-all"
"-Werror -Wno-error=deprecated-declarations" #"-Werror -Wno-error=deprecated-declarations"
) )
set (_GCC_COMMON_CXX_FLAGS "-fexceptions -frtti" set(_GCC_COMMON_CXX_FLAGS "-fexceptions -frtti"
"-Woverloaded-virtual -Wold-style-cast" "-Woverloaded-virtual -Wold-style-cast"
"-Wnon-virtual-dtor -Wfloat-equal -Wcast-qual -Wcast-align" "-Wnon-virtual-dtor -Wfloat-equal -Wcast-qual -Wcast-align"
"-Werror=overloaded-virtual" #"-Weffc++"
# "-Weffc++" #"-Werror -Wno-error=cpp"
"-Werror -Wno-error=cpp"
# we should modify code to make these ones obsolete # we should modify code to make these ones obsolete
"-Wno-error=sign-conversion -Wno-error=float-equal" #"-Wno-error=sign-conversion -Wno-error=float-equal"
) )
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9) if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9)

Loading…
Cancel
Save