From f0203307c49a902aa5a1d2262240e03c1b8fb30b Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Fri, 7 Oct 2022 08:03:03 +0300 Subject: [PATCH] 2.0.5 --- MyxCMake/MyxCMakeConfigVersion.cmake | 2 +- MyxCMake/lib/CompilerFlags.cmake | 21 ++----------------- .../macro/CheckEnableCxxCompilerFlag.cmake | 7 +++++-- README.md | 2 +- VERSION | 2 +- debian/CMakeLists.txt | 2 +- debian/changelog | 2 +- myx_setup.cmake | 4 ++-- 8 files changed, 14 insertions(+), 28 deletions(-) diff --git a/MyxCMake/MyxCMakeConfigVersion.cmake b/MyxCMake/MyxCMakeConfigVersion.cmake index 9f96b0f..811def1 100644 --- a/MyxCMake/MyxCMakeConfigVersion.cmake +++ b/MyxCMake/MyxCMakeConfigVersion.cmake @@ -1,4 +1,4 @@ -set(MYX_CMAKE_PACKAGE_VERSION "2.0.4") +set(MYX_CMAKE_PACKAGE_VERSION "2.0.5") if(MYX_CMAKE_PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) set(PACKAGE_VERSION_COMPATIBLE FALSE) else() diff --git a/MyxCMake/lib/CompilerFlags.cmake b/MyxCMake/lib/CompilerFlags.cmake index 29fb84e..7108dbc 100644 --- a/MyxCMake/lib/CompilerFlags.cmake +++ b/MyxCMake/lib/CompilerFlags.cmake @@ -8,10 +8,11 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") # cmake-format: on set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_EXTENSIONS ON) + check_enable_cxx_compiler_flag(-Wno-shadow) elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "e2k") set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_EXTENSIONS ON) - add_compile_options(-Wno-invalid-offsetof) + check_enable_cxx_compiler_flag(-Wno-invalid-offsetof) list(APPEND CMAKE_LIBRARY_PATH "/usr/lib/e2k-linux-gnu") endif() if(CMAKE_COLOR_MAKEFILE) @@ -25,21 +26,3 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") endif() endif() -option(MYX_CMAKE_WARNINGS_NORMAL "Normal level" ON) -cmake_dependent_option(MYX_CMAKE_WARNINGS_VERBOSE "Verbose level" OFF "MYX_CMAKE_WARNINGS_NORMAL" OFF) - -if(MYX_CMAKE_WARNINGS_NORMAL) - if((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR - (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")) - check_enable_cxx_compiler_flag(-Wall) - check_enable_cxx_compiler_flag(-Wextra) - endif() -endif() - -if(MYX_CMAKE_WARNINGS_VERBOSE) - if((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR - (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")) - check_enable_cxx_compiler_flag(-Wpedantic) - check_enable_cxx_compiler_flag(-Wnoexcept) - endif() -endif() diff --git a/MyxCMake/lib/macro/CheckEnableCxxCompilerFlag.cmake b/MyxCMake/lib/macro/CheckEnableCxxCompilerFlag.cmake index bc94984..c711262 100644 --- a/MyxCMake/lib/macro/CheckEnableCxxCompilerFlag.cmake +++ b/MyxCMake/lib/macro/CheckEnableCxxCompilerFlag.cmake @@ -10,16 +10,19 @@ macro(check_enable_cxx_compiler_flag flag) set(multiValueArgs) cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - set(cmake_required_quiet TRUE) + set(CMAKE_REQUIRED_QUIET TRUE) check_cxx_compiler_flag("${flag}" check_cxx_flag) - unset(cmake_required_quiet) + unset(CMAKE_REQUIRED_QUIET) if(check_cxx_flag) + myx_message_notice("'${flag}': flag is supported.") if(ARG_TARGET) target_compile_options(${ARG_TARGET} PUBLIC ${flag}) else() add_compile_options(${flag}) endif() + else() + myx_message_status("'${flag}': flag is NOT supported.") endif() unset(check_cxx_flag CACHE) diff --git a/README.md b/README.md index cc1277f..7a23ec3 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ## Установка В корневом каталоге проекта создать каталог `cmake` и распаковать в него -[архив](../../../releases/download/2.0.4/myx-cmake-local-2.0.4.tar.xz ). +[архив](../../../releases/download/2.0.5/myx-cmake-local-2.0.5.tar.xz ). ## Использование diff --git a/VERSION b/VERSION index 2165f8f..e010258 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0.4 +2.0.5 diff --git a/debian/CMakeLists.txt b/debian/CMakeLists.txt index a3bf449..a67a5e7 100644 --- a/debian/CMakeLists.txt +++ b/debian/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.6 FATAL_ERROR) -project(myx-cmake VERSION 2.0.4 LANGUAGES) +project(myx-cmake VERSION 2.0.5 LANGUAGES) include(GNUInstallDirs) file(WRITE ${CMAKE_SOURCE_DIR}/MyxCMake/MyxCMakeConfigVersion.cmake diff --git a/debian/changelog b/debian/changelog index f6f672b..d0e5bf2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -myx-cmake (2.0.4) unstable; urgency=medium +myx-cmake (2.0.5) unstable; urgency=medium * New version. diff --git a/myx_setup.cmake b/myx_setup.cmake index 101b720..8765059 100644 --- a/myx_setup.cmake +++ b/myx_setup.cmake @@ -20,11 +20,11 @@ if(ENV{MYX_CMAKE_DIR}) set(MYX_CMAKE_DIR $ENV{MYX_CMAKE_DIR}) endif() if(MYX_CMAKE_DIR) - find_package(MyxCMake 2.0.4 REQUIRED CONFIG PATHS ${MYX_CMAKE_DIR} NO_DEFAULT_PATH) + find_package(MyxCMake 2.0.5 REQUIRED CONFIG PATHS ${MYX_CMAKE_DIR} NO_DEFAULT_PATH) myx_message_notice("=== MyxCMake directory: ${MyxCMake_CONFIG} ===") else() if(MYX_CMAKE_USE_SYSTEM) - find_package(MyxCMake 2.0.4 REQUIRED) + find_package(MyxCMake 2.0.5 REQUIRED) myx_message_notice("=== MyxCMake directory: ${MyxCMake_CONFIG} ===") else() include(${PROJECT_SOURCE_DIR}/cmake/myx/MyxCMakeConfig.cmake)