mirror of
https://github.com/BlackMATov/invoke.hpp.git
synced 2025-12-13 05:56:31 +07:00
update CI scripts
This commit is contained in:
@@ -1,12 +1,45 @@
|
|||||||
version: "{build}"
|
|
||||||
shallow_clone: true
|
|
||||||
image:
|
image:
|
||||||
- Visual Studio 2015
|
- Visual Studio 2015
|
||||||
- Visual Studio 2017
|
- Visual Studio 2017
|
||||||
- Visual Studio 2019 Preview
|
|
||||||
platform:
|
platform:
|
||||||
- Win32
|
- x86
|
||||||
- x64
|
- x64
|
||||||
build_script:
|
|
||||||
- scripts\build_all.bat
|
configuration:
|
||||||
test: off
|
- Debug
|
||||||
|
- Release
|
||||||
|
|
||||||
|
for:
|
||||||
|
|
||||||
|
-
|
||||||
|
matrix:
|
||||||
|
only:
|
||||||
|
- platform: x86
|
||||||
|
configuration: Debug
|
||||||
|
build_script:
|
||||||
|
- scripts\build_debug_x86.bat
|
||||||
|
|
||||||
|
-
|
||||||
|
matrix:
|
||||||
|
only:
|
||||||
|
- platform: x64
|
||||||
|
configuration: Debug
|
||||||
|
build_script:
|
||||||
|
- scripts\build_debug_x64.bat
|
||||||
|
|
||||||
|
-
|
||||||
|
matrix:
|
||||||
|
only:
|
||||||
|
- platform: x86
|
||||||
|
configuration: Release
|
||||||
|
build_script:
|
||||||
|
- scripts\build_release_x86.bat
|
||||||
|
|
||||||
|
-
|
||||||
|
matrix:
|
||||||
|
only:
|
||||||
|
- platform: x64
|
||||||
|
configuration: Release
|
||||||
|
build_script:
|
||||||
|
- scripts\build_release_x64.bat
|
||||||
|
|||||||
198
.travis.yml
198
.travis.yml
@@ -1,81 +1,159 @@
|
|||||||
language: cpp
|
language: cpp
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
|
|
||||||
|
#
|
||||||
|
# windows (MSVC 2017)
|
||||||
|
#
|
||||||
|
|
||||||
|
- os: windows
|
||||||
|
stage: windows
|
||||||
|
name: debug, MSVC 2017, x86
|
||||||
|
script: ./scripts/build_debug_x86.bat
|
||||||
|
|
||||||
|
- os: windows
|
||||||
|
stage: windows
|
||||||
|
name: release, MSVC 2017, x86
|
||||||
|
script: ./scripts/build_release_x86.bat
|
||||||
|
|
||||||
|
- os: windows
|
||||||
|
stage: windows
|
||||||
|
name: debug, MSVC 2017, x64
|
||||||
|
script: ./scripts/build_debug_x64.bat
|
||||||
|
|
||||||
|
- os: windows
|
||||||
|
stage: windows
|
||||||
|
name: release, MSVC 2017, x64
|
||||||
|
script: ./scripts/build_release_x64.bat
|
||||||
|
|
||||||
|
#
|
||||||
|
# linux (g++-4.9)
|
||||||
|
#
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
dist: trusty
|
dist: xenial
|
||||||
addons: { apt: { sources: ubuntu-toolchain-r-test, packages: ["xorg-dev", "g++-4.9"] } }
|
stage: linux
|
||||||
env: MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9"
|
name: debug, g++-4.9
|
||||||
|
addons: { apt: { sources: ["ubuntu-toolchain-r-test"], packages: ["g++-4.9"] } }
|
||||||
|
env: CC=gcc-4.9 CXX=g++-4.9
|
||||||
|
script: ./scripts/build_debug.sh
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
dist: trusty
|
dist: xenial
|
||||||
addons: { apt: { sources: ubuntu-toolchain-r-test, packages: ["xorg-dev", "g++-5"] } }
|
stage: linux
|
||||||
env: MATRIX_EVAL="CC=gcc-5 && CXX=g++-5"
|
name: release, g++-4.9
|
||||||
|
addons: { apt: { sources: ["ubuntu-toolchain-r-test"], packages: ["g++-4.9"] } }
|
||||||
|
env: CC=gcc-4.9 CXX=g++-4.9
|
||||||
|
script: ./scripts/build_release.sh
|
||||||
|
|
||||||
|
#
|
||||||
|
# linux (g++-5)
|
||||||
|
#
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
dist: trusty
|
dist: xenial
|
||||||
addons: { apt: { sources: ubuntu-toolchain-r-test, packages: ["xorg-dev", "g++-6"] } }
|
stage: linux
|
||||||
env: MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
|
name: debug, g++-5
|
||||||
|
addons: { apt: { sources: ["ubuntu-toolchain-r-test"], packages: ["g++-5"] } }
|
||||||
|
env: CC=gcc-5 CXX=g++-5
|
||||||
|
script: ./scripts/build_debug.sh
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
dist: trusty
|
dist: xenial
|
||||||
addons: { apt: { sources: ubuntu-toolchain-r-test, packages: ["xorg-dev", "g++-7"] } }
|
stage: linux
|
||||||
env: MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
|
name: release, g++-5
|
||||||
|
addons: { apt: { sources: ["ubuntu-toolchain-r-test"], packages: ["g++-5"] } }
|
||||||
|
env: CC=gcc-5 CXX=g++-5
|
||||||
|
script: ./scripts/build_release.sh
|
||||||
|
|
||||||
|
#
|
||||||
|
# linux (clang++-3.8)
|
||||||
|
#
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
dist: trusty
|
dist: xenial
|
||||||
addons: { apt: { sources: ubuntu-toolchain-r-test, packages: ["xorg-dev", "g++-8"] } }
|
stage: linux
|
||||||
env: MATRIX_EVAL="CC=gcc-8 && CXX=g++-8"
|
name: debug, clang++-3.8
|
||||||
|
addons: { apt: { sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-xenial-3.8"], packages: ["g++-4.9", "clang-3.8"] } }
|
||||||
|
env: CC=clang-3.8 CXX=clang++-3.8
|
||||||
|
script: ./scripts/build_debug.sh
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
dist: trusty
|
dist: xenial
|
||||||
addons: { apt: { sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-precise-3.8"], packages: ["xorg-dev", "clang-3.8", "g++-5"] } }
|
stage: linux
|
||||||
env: MATRIX_EVAL="CC=clang-3.8 && CXX=clang++-3.8"
|
name: release, clang++-3.8
|
||||||
|
addons: { apt: { sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-xenial-3.8"], packages: ["g++-4.9", "clang-3.8"] } }
|
||||||
|
env: CC=clang-3.8 CXX=clang++-3.8
|
||||||
|
script: ./scripts/build_release.sh
|
||||||
|
|
||||||
|
#
|
||||||
|
# linux (clang++-4.0)
|
||||||
|
#
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
dist: trusty
|
dist: xenial
|
||||||
addons: { apt: { sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-precise-3.9"], packages: ["xorg-dev", "clang-3.9", "g++-5"] } }
|
stage: linux
|
||||||
env: MATRIX_EVAL="CC=clang-3.9 && CXX=clang++-3.9"
|
name: debug, clang++-4.0
|
||||||
|
addons: { apt: { sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-xenial-4.0"], packages: ["g++-4.9", "clang-4.0"] } }
|
||||||
|
env: CC=clang-4.0 CXX=clang++-4.0
|
||||||
|
script: ./scripts/build_debug.sh
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
dist: trusty
|
dist: xenial
|
||||||
addons: { apt: { sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-trusty-4.0"], packages: ["xorg-dev", "clang-4.0", "g++-5"] } }
|
stage: linux
|
||||||
env: MATRIX_EVAL="CC=clang-4.0 && CXX=clang++-4.0"
|
name: release, clang++-4.0
|
||||||
- os: linux
|
addons: { apt: { sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-xenial-4.0"], packages: ["g++-4.9", "clang-4.0"] } }
|
||||||
dist: trusty
|
env: CC=clang-4.0 CXX=clang++-4.0
|
||||||
addons: { apt: { sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-trusty-5.0"], packages: ["xorg-dev", "clang-5.0", "g++-7"] } }
|
script: ./scripts/build_release.sh
|
||||||
env: MATRIX_EVAL="CC=clang-5.0 && CXX=clang++-5.0"
|
|
||||||
- os: linux
|
#
|
||||||
dist: trusty
|
# macosx (xcode10)
|
||||||
addons: { apt: { sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-trusty-6.0"], packages: ["xorg-dev", "clang-6.0", "g++-7"] } }
|
#
|
||||||
env: MATRIX_EVAL="CC=clang-6.0 && CXX=clang++-6.0"
|
|
||||||
- os: osx
|
|
||||||
osx_image: xcode8.3
|
|
||||||
compiler: clang
|
|
||||||
- os: osx
|
|
||||||
osx_image: xcode9
|
|
||||||
compiler: clang
|
|
||||||
- os: osx
|
|
||||||
osx_image: xcode9.1
|
|
||||||
compiler: clang
|
|
||||||
- os: osx
|
|
||||||
osx_image: xcode9.2
|
|
||||||
compiler: clang
|
|
||||||
- os: osx
|
|
||||||
osx_image: xcode9.3
|
|
||||||
compiler: clang
|
|
||||||
- os: osx
|
|
||||||
osx_image: xcode9.4
|
|
||||||
compiler: clang
|
|
||||||
- os: osx
|
- os: osx
|
||||||
osx_image: xcode10
|
osx_image: xcode10
|
||||||
compiler: clang
|
stage: macosx
|
||||||
|
name: debug, xcode10
|
||||||
|
script: ./scripts/build_debug.sh
|
||||||
|
|
||||||
|
- os: osx
|
||||||
|
osx_image: xcode10
|
||||||
|
stage: macosx
|
||||||
|
name: release, xcode10
|
||||||
|
script: ./scripts/build_release.sh
|
||||||
|
|
||||||
|
#
|
||||||
|
# macosx (xcode11)
|
||||||
|
#
|
||||||
|
|
||||||
|
- os: osx
|
||||||
|
osx_image: xcode11
|
||||||
|
stage: macosx
|
||||||
|
name: debug, xcode11
|
||||||
|
script: ./scripts/build_debug.sh
|
||||||
|
|
||||||
|
- os: osx
|
||||||
|
osx_image: xcode11
|
||||||
|
stage: macosx
|
||||||
|
name: release, xcode11
|
||||||
|
script: ./scripts/build_release.sh
|
||||||
|
|
||||||
|
#
|
||||||
|
# coverage
|
||||||
|
#
|
||||||
|
|
||||||
|
- os: osx
|
||||||
|
osx_image: xcode11
|
||||||
|
stage: coverage
|
||||||
|
name: coverage, xcode11
|
||||||
addons: { homebrew: { packages: ["lcov"] } }
|
addons: { homebrew: { packages: ["lcov"] } }
|
||||||
after_success: ./scripts/upload_coverage.sh
|
script: ./scripts/upload_coverage.sh
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- eval "${MATRIX_EVAL}"
|
|
||||||
- if [ "$TRAVIS_OS_NAME" == 'osx' ]; then
|
|
||||||
brew update;
|
|
||||||
brew upgrade cmake;
|
|
||||||
brew install git-lfs;
|
|
||||||
fi
|
|
||||||
- if [ "$TRAVIS_OS_NAME" == 'linux' ]; then
|
- if [ "$TRAVIS_OS_NAME" == 'linux' ]; then
|
||||||
mkdir $HOME/cmake;
|
mkdir $HOME/cmake;
|
||||||
export PATH="$HOME/cmake/bin:$PATH";
|
export PATH="$HOME/cmake/bin:$PATH";
|
||||||
travis_retry wget -q https://cmake.org/files/v3.11/cmake-3.11.4-Linux-x86_64.sh;
|
travis_retry wget -q https://cmake.org/files/v3.11/cmake-3.11.4-Linux-x86_64.sh;
|
||||||
sh cmake-3.11.4-Linux-x86_64.sh --prefix=$HOME/cmake --exclude-subdir --skip-license;
|
sh cmake-3.11.4-Linux-x86_64.sh --prefix=$HOME/cmake --exclude-subdir --skip-license;
|
||||||
fi
|
fi
|
||||||
script:
|
|
||||||
- ./scripts/build_all.sh
|
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ endif()
|
|||||||
project(invoke.hpp)
|
project(invoke.hpp)
|
||||||
|
|
||||||
add_library(${PROJECT_NAME} INTERFACE)
|
add_library(${PROJECT_NAME} INTERFACE)
|
||||||
target_include_directories(${PROJECT_NAME} INTERFACE headers)
|
|
||||||
target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_14)
|
target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_14)
|
||||||
|
target_include_directories(${PROJECT_NAME} INTERFACE headers)
|
||||||
|
|
||||||
if(BUILD_AS_STANDALONE)
|
if(BUILD_AS_STANDALONE)
|
||||||
option(BUILD_WITH_UNTESTS "Build with unit tests" ON)
|
option(BUILD_WITH_UNTESTS "Build with unit tests" ON)
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
@echo off
|
@echo off
|
||||||
set SCRIPT_DIR=%~dp0%
|
set SCRIPT_DIR=%~dp0%
|
||||||
call %SCRIPT_DIR%\build_debug.bat || goto :error
|
call %SCRIPT_DIR%\build_debug_x86.bat || goto :error
|
||||||
call %SCRIPT_DIR%\build_release.bat || goto :error
|
call %SCRIPT_DIR%\build_debug_x64.bat || goto :error
|
||||||
|
call %SCRIPT_DIR%\build_release_x86.bat || goto :error
|
||||||
|
call %SCRIPT_DIR%\build_release_x64.bat || goto :error
|
||||||
|
|
||||||
goto :EOF
|
goto :EOF
|
||||||
|
|
||||||
|
|||||||
9
scripts/build_clear.bat
Normal file
9
scripts/build_clear.bat
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
@echo off
|
||||||
|
set BUILD_DIR=%~dp0%\..\build
|
||||||
|
rmdir /s /q %BUILD_DIR% || goto :error
|
||||||
|
|
||||||
|
goto :EOF
|
||||||
|
|
||||||
|
:error
|
||||||
|
echo Failed with error #%errorlevel%.
|
||||||
|
exit /b %errorlevel%
|
||||||
4
scripts/build_clear.sh
Executable file
4
scripts/build_clear.sh
Executable file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
BUILD_DIR=`dirname "$BASH_SOURCE"`/../build
|
||||||
|
rm -rf $BUILD_DIR
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
BUILD_DIR=`dirname "$BASH_SOURCE"`/../build
|
BUILD_DIR=`dirname "$BASH_SOURCE"`/../build
|
||||||
mkdir -p $BUILD_DIR/debug
|
mkdir -p $BUILD_DIR/Debug
|
||||||
cd $BUILD_DIR/debug
|
pushd $BUILD_DIR/Debug
|
||||||
cmake -DCMAKE_BUILD_TYPE=Debug ../..
|
cmake -DCMAKE_BUILD_TYPE=Debug ../..
|
||||||
cmake --build . -- -j8
|
cmake --build .
|
||||||
ctest --verbose
|
ctest --verbose
|
||||||
cd ../..
|
popd
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
@echo off
|
@echo off
|
||||||
set BUILD_DIR=%~dp0%\..\build
|
set BUILD_DIR=%~dp0%\..\build
|
||||||
mkdir %BUILD_DIR%\debug || goto :error
|
mkdir %BUILD_DIR%\Debug\x64 || goto :error
|
||||||
cd %BUILD_DIR%\debug || goto :error
|
pushd %BUILD_DIR%\Debug\x64 || goto :error
|
||||||
cmake ../.. || goto :error
|
cmake ..\..\.. -A x64 || goto :error
|
||||||
cmake --build . --config Debug || goto :error
|
cmake --build . --config Debug || goto :error
|
||||||
ctest --verbose || goto :error
|
ctest --verbose || goto :error
|
||||||
cd ..\.. || goto :error
|
popd || goto :error
|
||||||
|
|
||||||
goto :EOF
|
goto :EOF
|
||||||
|
|
||||||
14
scripts/build_debug_x86.bat
Normal file
14
scripts/build_debug_x86.bat
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
@echo off
|
||||||
|
set BUILD_DIR=%~dp0%\..\build
|
||||||
|
mkdir %BUILD_DIR%\Debug\x86 || goto :error
|
||||||
|
pushd %BUILD_DIR%\Debug\x86 || goto :error
|
||||||
|
cmake ..\..\.. -A Win32 || goto :error
|
||||||
|
cmake --build . --config Debug || goto :error
|
||||||
|
ctest --verbose || goto :error
|
||||||
|
popd || goto :error
|
||||||
|
|
||||||
|
goto :EOF
|
||||||
|
|
||||||
|
:error
|
||||||
|
echo Failed with error #%errorlevel%.
|
||||||
|
exit /b %errorlevel%
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
BUILD_DIR=`dirname "$BASH_SOURCE"`/../build
|
BUILD_DIR=`dirname "$BASH_SOURCE"`/../build
|
||||||
mkdir -p $BUILD_DIR/release
|
mkdir -p $BUILD_DIR/Release
|
||||||
cd $BUILD_DIR/release
|
pushd $BUILD_DIR/Release
|
||||||
cmake -DCMAKE_BUILD_TYPE=Release ../..
|
cmake -DCMAKE_BUILD_TYPE=Release ../..
|
||||||
cmake --build . -- -j8
|
cmake --build .
|
||||||
ctest --verbose
|
ctest --verbose
|
||||||
cd ../..
|
popd
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
@echo off
|
@echo off
|
||||||
set BUILD_DIR=%~dp0%\..\build
|
set BUILD_DIR=%~dp0%\..\build
|
||||||
mkdir %BUILD_DIR%\release || goto :error
|
mkdir %BUILD_DIR%\Release\x64 || goto :error
|
||||||
cd %BUILD_DIR%\release || goto :error
|
pushd %BUILD_DIR%\Release\x64 || goto :error
|
||||||
cmake ../.. || goto :error
|
cmake ..\..\.. -A x64 || goto :error
|
||||||
cmake --build . --config Release || goto :error
|
cmake --build . --config Release || goto :error
|
||||||
ctest --verbose || goto :error
|
ctest --verbose || goto :error
|
||||||
cd ..\.. || goto :error
|
popd || goto :error
|
||||||
|
|
||||||
goto :EOF
|
goto :EOF
|
||||||
|
|
||||||
14
scripts/build_release_x86.bat
Normal file
14
scripts/build_release_x86.bat
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
@echo off
|
||||||
|
set BUILD_DIR=%~dp0%\..\build
|
||||||
|
mkdir %BUILD_DIR%\Release\x86 || goto :error
|
||||||
|
pushd %BUILD_DIR%\Release\x86 || goto :error
|
||||||
|
cmake ..\..\.. -A Win32 || goto :error
|
||||||
|
cmake --build . --config Release || goto :error
|
||||||
|
ctest --verbose || goto :error
|
||||||
|
popd || goto :error
|
||||||
|
|
||||||
|
goto :EOF
|
||||||
|
|
||||||
|
:error
|
||||||
|
echo Failed with error #%errorlevel%.
|
||||||
|
exit /b %errorlevel%
|
||||||
@@ -5,13 +5,13 @@ BUILD_DIR=`dirname "$BASH_SOURCE"`/../build
|
|||||||
mkdir -p $BUILD_DIR/coverage
|
mkdir -p $BUILD_DIR/coverage
|
||||||
cd $BUILD_DIR/coverage
|
cd $BUILD_DIR/coverage
|
||||||
cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_WITH_COVERAGE=ON ../..
|
cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_WITH_COVERAGE=ON ../..
|
||||||
cmake --build . -- -j8
|
cmake --build .
|
||||||
|
|
||||||
lcov -d . -z
|
lcov -d . -z
|
||||||
ctest --verbose
|
ctest --verbose
|
||||||
|
|
||||||
lcov -d . -c -o "coverage.info"
|
lcov -d . -c -o "coverage.info"
|
||||||
lcov -r "coverage.info" "*/usr/*" "*/catch.hpp" "*/catch_main.cpp" "*_tests.cpp" -o "coverage.info"
|
lcov -r "coverage.info" "*/usr/*" "*/catch.hpp" "*/catch_main.cpp" "*_tests.cpp" "*_examples.cpp" -o "coverage.info"
|
||||||
lcov -l "coverage.info"
|
lcov -l "coverage.info"
|
||||||
|
|
||||||
bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"
|
bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"
|
||||||
|
|||||||
@@ -3,18 +3,9 @@ cmake_minimum_required(VERSION 3.11 FATAL_ERROR)
|
|||||||
|
|
||||||
project(invoke.hpp.untests)
|
project(invoke.hpp.untests)
|
||||||
|
|
||||||
set(CATCH_BUILD_TESTING OFF CACHE BOOL "" FORCE)
|
#
|
||||||
|
# coverage
|
||||||
include(FetchContent)
|
#
|
||||||
FetchContent_Declare(
|
|
||||||
catch2
|
|
||||||
GIT_REPOSITORY https://github.com/catchorg/catch2)
|
|
||||||
|
|
||||||
FetchContent_GetProperties(catch2)
|
|
||||||
if(NOT catch2_POPULATED)
|
|
||||||
FetchContent_Populate(catch2)
|
|
||||||
add_subdirectory(${catch2_SOURCE_DIR} ${catch2_BINARY_DIR})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
option(BUILD_WITH_COVERAGE "Build with coverage" OFF)
|
option(BUILD_WITH_COVERAGE "Build with coverage" OFF)
|
||||||
if(BUILD_WITH_COVERAGE AND (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang"))
|
if(BUILD_WITH_COVERAGE AND (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang"))
|
||||||
@@ -24,11 +15,14 @@ if(BUILD_WITH_COVERAGE AND (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang"))
|
|||||||
set(CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} ${COVERAGE_FLAGS}")
|
set(CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} ${COVERAGE_FLAGS}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
#
|
||||||
|
# executable
|
||||||
|
#
|
||||||
|
|
||||||
file(GLOB UNTESTS_SOURCES "*.cpp" "*.hpp")
|
file(GLOB UNTESTS_SOURCES "*.cpp" "*.hpp")
|
||||||
add_executable(${PROJECT_NAME} ${UNTESTS_SOURCES})
|
add_executable(${PROJECT_NAME} ${UNTESTS_SOURCES})
|
||||||
target_link_libraries(${PROJECT_NAME}
|
target_link_libraries(${PROJECT_NAME} invoke.hpp)
|
||||||
Catch2
|
|
||||||
invoke.hpp)
|
|
||||||
target_compile_options(${PROJECT_NAME}
|
target_compile_options(${PROJECT_NAME}
|
||||||
PRIVATE
|
PRIVATE
|
||||||
$<$<CXX_COMPILER_ID:MSVC>:
|
$<$<CXX_COMPILER_ID:MSVC>:
|
||||||
@@ -36,4 +30,21 @@ target_compile_options(${PROJECT_NAME}
|
|||||||
PRIVATE
|
PRIVATE
|
||||||
$<$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:
|
$<$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:
|
||||||
-Wall -Wextra -Wpedantic>)
|
-Wall -Wextra -Wpedantic>)
|
||||||
|
|
||||||
add_test(${PROJECT_NAME} ${PROJECT_NAME})
|
add_test(${PROJECT_NAME} ${PROJECT_NAME})
|
||||||
|
|
||||||
|
#
|
||||||
|
# catchorg/catch2
|
||||||
|
#
|
||||||
|
|
||||||
|
include(FetchContent)
|
||||||
|
FetchContent_Declare(
|
||||||
|
catchorg_catch2
|
||||||
|
GIT_REPOSITORY https://github.com/catchorg/catch2)
|
||||||
|
|
||||||
|
FetchContent_GetProperties(catchorg_catch2)
|
||||||
|
if(NOT catchorg_catch2_POPULATED)
|
||||||
|
FetchContent_Populate(catchorg_catch2)
|
||||||
|
target_include_directories(${PROJECT_NAME}
|
||||||
|
PRIVATE ${catchorg_catch2_SOURCE_DIR}/single_include)
|
||||||
|
endif()
|
||||||
|
|||||||
Reference in New Issue
Block a user