From 04cda6a6d6af82f2b64d2f3bfadaf0c0426bdc3c Mon Sep 17 00:00:00 2001 From: dave Date: Tue, 10 Mar 2020 17:56:15 -0700 Subject: [PATCH 1/5] Add a (mostly) working mac build to travis.yml --- .travis.yml | 61 +++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 48 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index 19737022..acb35a7b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,24 +1,59 @@ -dist: bionic -sudo: false language: cpp -addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - gcc-snapshot - - doxygen - install: - pip install --user conan cmake +jobs: + include: + - os: osx + compiler: gcc + osx_image: xcode11.2 # includes gcc-9 by default + env: + # Conan is at: ${HOME}/Library/Python/2.7/bin: we need this in the path + - PATH="${HOME}/Library/Python/2.7/bin:${PATH}" + - GCC_VER="9" + - MATRIX_EVAL="CC=gcc-${GCC_VER} && CXX=g++-${GCC_VER}" + after_script: + - bash <(curl -s https://codecov.io/bash) -x /usr/bin/gcov-${GCC_VER} + - os: osx + compiler: clang + osx_image: xcode11.2 + env: + - PATH="${HOME}/Library/Python/2.7/bin:${PATH}" + - MATRIX_EVAL="" + - os: linux + dist: bionic + compiler: gcc + env: + - GCC_VER="9" + - MATRIX_EVAL="CC=gcc-${GCC_VER} && CXX=g++-${GCC_VER}" + + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + # I couldn't get ${GCC_VER} in here successfully + - gcc-9 + - g++-9 + - doxygen + after_script: + - bash <(curl -s https://codecov.io/bash) -x /usr/bin/gcov-${GCC_VER} + - os: linux + dist: bionic + compiler: clang + env: + - MATRIX_EVAL="CC=clang && CXX=clang++" + addons: { apt: { packages: ['doxygen'] } } + + +before_script: + - eval "${MATRIX_EVAL}" script: - - CXX=/usr/bin/gcc-10 CC=/usr/bin/g++-10 cmake -D ENABLE_COVERAGE:BOOL=TRUE . - - cmake --build . -- -j2 + - cmake -D ENABLE_COVERAGE:BOOL=TRUE . + - cmake --build . -- -j2 - ctest -j2 - - bash <(curl -s https://codecov.io/bash) -x /usr/bin/gcov-5 From 15a6678bff6184cde08f41430ca7b358ade0a7de Mon Sep 17 00:00:00 2001 From: Valerio Formato Date: Thu, 27 Feb 2020 11:00:52 +0100 Subject: [PATCH 2/5] Fix compiler detection for AppleClang and compiler flags for catch_main on OSX --- cmake/CompilerWarnings.cmake | 2 +- test/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/CompilerWarnings.cmake b/cmake/CompilerWarnings.cmake index c0b442e4..219465fb 100644 --- a/cmake/CompilerWarnings.cmake +++ b/cmake/CompilerWarnings.cmake @@ -79,7 +79,7 @@ function(set_project_warnings project_name) if(MSVC) set(PROJECT_WARNINGS ${MSVC_WARNINGS}) - elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + elseif(CMAKE_CXX_COMPILER_ID MATCHES ".*Clang") set(PROJECT_WARNINGS ${CLANG_WARNINGS}) else() set(PROJECT_WARNINGS ${GCC_WARNINGS}) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 6644f18d..0b55b10f 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -8,6 +8,7 @@ endif() add_library(catch_main STATIC catch_main.cpp) target_link_libraries(catch_main PUBLIC CONAN_PKG::catch2) +target_link_libraries(catch_main PRIVATE project_options) add_executable(tests tests.cpp) target_link_libraries(tests PRIVATE project_warnings project_options From 970404bc82539fe3255a5ff2a186630d4248f942 Mon Sep 17 00:00:00 2001 From: Valerio Formato Date: Tue, 3 Mar 2020 09:45:31 +0100 Subject: [PATCH 3/5] Fix compiler detection for AppleClang in Sanitizers.cmake --- cmake/Sanitizers.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/Sanitizers.cmake b/cmake/Sanitizers.cmake index 9faf76fd..fd21cd6b 100644 --- a/cmake/Sanitizers.cmake +++ b/cmake/Sanitizers.cmake @@ -1,7 +1,7 @@ function(enable_sanitizers project_name) - if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL - "Clang") + if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES + ".*Clang") option(ENABLE_COVERAGE "Enable coverage reporting for gcc/clang" FALSE) if(ENABLE_COVERAGE) From 8d07c20b720227122e91f0913c89ac6bfd79acd1 Mon Sep 17 00:00:00 2001 From: dave Date: Tue, 10 Mar 2020 20:02:47 -0700 Subject: [PATCH 4/5] update fmt to 6.1.2 --- cmake/Conan.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Conan.cmake b/cmake/Conan.cmake index ac7a05fb..6ad8c11b 100644 --- a/cmake/Conan.cmake +++ b/cmake/Conan.cmake @@ -18,7 +18,7 @@ conan_cmake_run( ${CONAN_EXTRA_REQUIRES} catch2/2.11.0 docopt.cpp/0.6.2 - fmt/6.0.0 + fmt/6.1.2 spdlog/1.5.0 OPTIONS ${CONAN_EXTRA_OPTIONS} From f9834370180fd962c67197323b8f68324e60eed1 Mon Sep 17 00:00:00 2001 From: dave Date: Tue, 10 Mar 2020 20:28:27 -0700 Subject: [PATCH 5/5] attempt to fix windows build --- appveyor.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 5aed41b1..d7a4e6b1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,15 +1,19 @@ image: - - Visual Studio 2017 + - Visual Studio 2019 clone_folder: c:\projects\source build_script: - cmd: >- mkdir build cd build - - cmake c:\projects\source -G "Visual Studio 15" - - cmake --build . --config "Debug" + + pip install --user conan + + set PATH=%PATH%;C:\Users\appveyor\AppData\Roaming\Python\Scripts + + cmake c:\projects\source -G "Visual Studio 16 2019" -DCMAKE_BUILD_TYPE:STRING=Release + + cmake --build . --config "Release" test_script: - cmd: ctest -C Debug