fix some warnings

This commit is contained in:
BlackMATov
2021-08-06 03:24:08 +07:00
parent 694cdb5819
commit 2e007f721e
7 changed files with 35 additions and 7 deletions

View File

@@ -8,6 +8,8 @@ jobs:
name: "coverage"
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install lcov by Homebrew
run: brew install lcov
- name: Build && Test && Upload

View File

@@ -16,6 +16,8 @@ jobs:
name: "xcode-${{matrix.config.xcode}}"
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Select Xcode
run: sudo xcode-select --switch "/Applications/Xcode_${{matrix.config.xcode}}.app"
- name: Build && Test

View File

@@ -14,6 +14,7 @@ jobs:
- { os: "ubuntu-20.04", cc: "gcc-8", cxx: "g++-8" }
- { os: "ubuntu-20.04", cc: "gcc-9", cxx: "g++-9" }
- { os: "ubuntu-20.04", cc: "gcc-10", cxx: "g++-10" }
- { os: "ubuntu-20.04", cc: "clang-7", cxx: "clang++-7" }
- { os: "ubuntu-20.04", cc: "clang-8", cxx: "clang++-8" }
- { os: "ubuntu-20.04", cc: "clang-9", cxx: "clang++-9" }
- { os: "ubuntu-20.04", cc: "clang-10", cxx: "clang++-10" }
@@ -23,6 +24,8 @@ jobs:
run: sudo apt-get -y install "${{matrix.config.cc}}" "${{matrix.config.cxx}}"
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Build && Test
run: .ci/build_linux.sh
env: { CC: "${{matrix.config.cc}}", CXX: "${{matrix.config.cxx}}" }

View File

@@ -17,5 +17,7 @@ jobs:
name: "${{matrix.config.vs}} ${{matrix.config.arch}}"
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Build && Test
run: .ci\build_windows_${{matrix.config.arch}}.bat

View File

@@ -3,6 +3,8 @@ cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
if(NOT DEFINED PROJECT_NAME)
set(BUILD_AS_STANDALONE ON)
else()
set(BUILD_AS_STANDALONE OFF)
endif()
project(vmath.hpp)
@@ -15,6 +17,26 @@ add_library(${PROJECT_NAME}.singles INTERFACE)
target_compile_features(${PROJECT_NAME}.singles INTERFACE cxx_std_17)
target_include_directories(${PROJECT_NAME}.singles INTERFACE singles)
target_compile_options(${PROJECT_NAME}
INTERFACE
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:
-Wno-c++98-compat-pedantic
-Wno-ctad-maybe-unsupported
-Wno-double-promotion
-Wno-float-equal
-Wno-shadow
-Wno-unknown-warning-option>)
target_compile_options(${PROJECT_NAME}.singles
INTERFACE
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:
-Wno-c++98-compat-pedantic
-Wno-ctad-maybe-unsupported
-Wno-double-promotion
-Wno-float-equal
-Wno-shadow
-Wno-unknown-warning-option>)
if(BUILD_AS_STANDALONE)
option(BUILD_WITH_UNTESTS "Build with unit tests" ON)
if(BUILD_WITH_UNTESTS)

View File

@@ -28,7 +28,7 @@
## Requirements
- [gcc](https://www.gnu.org/software/gcc/) **>= 7**
- [clang](https://clang.llvm.org/) **>= 5.0**
- [clang](https://clang.llvm.org/) **>= 7**
- [msvc](https://visualstudio.microsoft.com/) **>= 2017**
## Installation

View File

@@ -23,15 +23,12 @@ target_link_libraries(${PROJECT_NAME} vmath.hpp.singles)
target_compile_options(${PROJECT_NAME}
PRIVATE
$<$<CXX_COMPILER_ID:MSVC>:
/W4>
/WX /W4>
PRIVATE
$<$<CXX_COMPILER_ID:GNU>:
-Wall -Wextra -Wpedantic>
-Werror -Wall -Wextra -Wpedantic>
PRIVATE
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:
-Weverything -Wno-unknown-warning-option
-Wconversion -Wimplicit-int-float-conversion
-Wno-c++98-compat-pedantic -Wno-ctad-maybe-unsupported
-Wno-float-equal -Wno-double-promotion -Wno-shadow-field-in-constructor>)
-Werror -Weverything -Wconversion>)
add_test(${PROJECT_NAME} ${PROJECT_NAME})