Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/updates #29

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 8 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,33 +28,26 @@ matrix:
packages:
- g++-6
env: COMPILER=gcc GCC=6

- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.6
packages:
- clang-3.6
env: COMPILER=clang CLANG=3.6
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.7
- llvm-toolchain-xenial-5.0
packages:
- clang-3.7
env: COMPILER=clang CLANG=3.7
- g++-4.9
- clang-5.0
env: COMPILER=clang CLANG=5.0
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.9
- llvm-toolchain-xenial-6.0
packages:
- clang-3.9
env: COMPILER=clang CLANG=3.9
- clang-6.0
env: COMPILER=clang CLANG=6.0
- os: osx
osx_image: xcode8
compiler: clang
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

- job: macOS
pool:
vmImage: 'xcode9-macos10.13'
vmImage: 'macOS-10.15'
strategy:
maxParallel: 2
variables:
Expand Down
2 changes: 1 addition & 1 deletion cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"cpp_namespace": "{{ cookiecutter.package_name }}",
"cpp_root_folder_name": "{{ cookiecutter.package_name }}",
"cpp_macro_prefix": "{{ cookiecutter.project_name|upper|replace(' ', '_')|replace('-', '_') }}",
"cpp_standart": ["C++14", "C++11", "NotSpecified"],
"cpp_standart": ["C++20", "C++17", "C++14", "C++11", "NotSpecified"],
"cmake_project_name": "{{ cookiecutter.package_name }}",
"cmake_interface_library_name": "{{ cookiecutter.package_name }}",
"github_project_name": "{{ cookiecutter.project_slug }}",
Expand Down
22 changes: 21 additions & 1 deletion {{cookiecutter.github_project_name}}/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,27 @@ set(PROJECT_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
set(CPP_ROOT_FOLDER_NAME {{cookiecutter.cpp_root_folder_name}})
include_directories(${PROJECT_INCLUDE_DIR})

{% if cookiecutter.cpp_standart == 'C++14' -%}
{% if cookiecutter.cpp_standart == 'C++20' -%}
include(CheckCXXCompilerFlag)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Intel")
CHECK_CXX_COMPILER_FLAG("-std=c++20" HAS_CPP20_FLAG)
if (HAS_CPP20_FLAG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++20")
else()
message(FATAL_ERROR "Unsupported compiler -- C++20 support required!")
endif()
endif()
{% elif cookiecutter.cpp_standart == 'C++17' -%}
include(CheckCXXCompilerFlag)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Intel")
CHECK_CXX_COMPILER_FLAG("-std=c++17" HAS_CPP17_FLAG)
if (HAS_CPP17_FLAG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
else()
message(FATAL_ERROR "Unsupported compiler -- C++17 support required!")
endif()
endif()
{% elif cookiecutter.cpp_standart == 'C++14' -%}
# C++ 14
# ===========
include(CheckCXXCompilerFlag)
Expand Down