Skip to content
Merged
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
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ os: linux

matrix:
include:
- env: COMPILER=g++-4.9
- env: COMPILER=g++-5
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.9
- g++-5

- env: COMPILER=clang++-3.8
addons:
Expand All @@ -21,6 +21,7 @@ matrix:
- llvm-toolchain-precise-3.8
packages:
- clang-3.8
- g++-5

- env:
- COMPILER=clang++-7
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.1.3)
cmake_minimum_required(VERSION 3.5.1)
project(exercism CXX)

set(alt_exercise_tree ${CMAKE_CURRENT_SOURCE_DIR}/build_exercises)
Expand Down
35 changes: 13 additions & 22 deletions docs/INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The C++ language track requires that you have the following software
installed on your system:
* a modern C++11 compiler
* a modern C++14 compiler
* the CMake cross-platform build system

We use [Catch2](https://github.com/catchorg/Catch2) for testing, which is a
Expand All @@ -13,15 +13,15 @@ issues setting it up you will find many helpful resources online.

Many IDE's, including Microsoft's Visual Studio, Apple's Xcode, and JetBrains'
CLion bundle a compiler and CMake together, so you should only need to install
the IDE.
the IDE.

### A Modern C++11 Compiler
### A Modern C++14 Compiler

This language track requires a compiler with [C++11](http://en.wikipedia.org/wiki/C%2B%2B11)
support, which was released in 2011. All major compilers released in the last few years should
This language track requires a compiler with [C++14](http://en.wikipedia.org/wiki/C%2B%2B14)
support, which was released in 2014. All major compilers released in the last few years should
be compatible, so as long as you are on a fairly recent version you should be fine.
Specifically, GCC version 5.1 or later, Clang version 3.8 or later, or Visual
Studio 2015 or later.
Specifically, GCC version 5 or later, Clang version 3.8 or later, or Visual
Studio 2017 or later.

### CMake

Expand All @@ -45,7 +45,7 @@ systems. If you encounter any problems with the supplied CMake recipe,
please [report the issue](https://github.com/exercism/cpp/issues) so we can
improve the CMake support.

[CMake 3.1.3 or later](http://www.cmake.org/) is required to use the provided build recipe.
[CMake 3.5.1 or later](http://www.cmake.org/) is required to use the provided build recipe.

## Windows

Expand All @@ -64,8 +64,9 @@ You should be able to use other integrated IDE's such as JetBrains' CLion in a s

## Linux

All recent Linux distribution releases have compatible C++11 compilers, you
should be able to install it using your package manager.
All recent Linux distribution releases have compatible C++14 compilers, you
should be able to install it using your package manager. The versions we support
are the default installed versions in Ubuntu LTS 16.04.

For example, on Ubuntu you would use the following command to install gcc.

Expand All @@ -75,18 +76,8 @@ $ gcc --version
```

If you are on an older distribution, you might not have a compiler that
supports C++11. In that case you will need to install it through an alternate
method. For example, Ubuntu 15.10 or earlier don't provide compatible compilers
in the package manager, so if you are using that version you will need to use
the following:

```bash
$ sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
$ sudo apt-get -qq -d update
$ sudo apt-get -qq install g++-5
$ # make g++ 5 the default g++ executable
$ sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 90
```
supports C++14. If that's the case, you'll need to work with your distribution
to figure out how to install the minimum compiler version.

## MacOS

Expand Down
4 changes: 2 additions & 2 deletions exercises/acronym/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
get_filename_component(exercise ${CMAKE_CURRENT_SOURCE_DIR} NAME)

# Basic CMake project
cmake_minimum_required(VERSION 3.1.3)
cmake_minimum_required(VERSION 3.5.1)

# Name the project after the exercise
project(${exercise} CXX)
Expand All @@ -27,7 +27,7 @@ else()
endif()

set_target_properties(${exercise} PROPERTIES
CXX_STANDARD 11
CXX_STANDARD 14
CXX_STANDARD_REQUIRED OFF
CXX_EXTENSIONS OFF
)
Expand Down
4 changes: 2 additions & 2 deletions exercises/all-your-base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
get_filename_component(exercise ${CMAKE_CURRENT_SOURCE_DIR} NAME)

# Basic CMake project
cmake_minimum_required(VERSION 3.1.3)
cmake_minimum_required(VERSION 3.5.1)

# Name the project after the exercise
project(${exercise} CXX)
Expand All @@ -27,7 +27,7 @@ else()
endif()

set_target_properties(${exercise} PROPERTIES
CXX_STANDARD 11
CXX_STANDARD 14
CXX_STANDARD_REQUIRED OFF
CXX_EXTENSIONS OFF
)
Expand Down
4 changes: 2 additions & 2 deletions exercises/allergies/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
get_filename_component(exercise ${CMAKE_CURRENT_SOURCE_DIR} NAME)

# Basic CMake project
cmake_minimum_required(VERSION 3.1.3)
cmake_minimum_required(VERSION 3.5.1)

# Name the project after the exercise
project(${exercise} CXX)
Expand All @@ -27,7 +27,7 @@ else()
endif()

set_target_properties(${exercise} PROPERTIES
CXX_STANDARD 11
CXX_STANDARD 14
CXX_STANDARD_REQUIRED OFF
CXX_EXTENSIONS OFF
)
Expand Down
2 changes: 1 addition & 1 deletion exercises/allergies/allergies_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ TEST_CASE("allergic_to_eggs_and_other_stuff")
TEST_CASE("allergic_to_nothing")
{
allergies::allergy_test score(0);
const std::unordered_set<std::string> no_allergies;
const std::unordered_set<std::string> no_allergies{};

REQUIRE(no_allergies == score.get_allergies());
}
Expand Down
4 changes: 2 additions & 2 deletions exercises/anagram/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
get_filename_component(exercise ${CMAKE_CURRENT_SOURCE_DIR} NAME)

# Basic CMake project
cmake_minimum_required(VERSION 3.1.3)
cmake_minimum_required(VERSION 3.5.1)

# Name the project after the exercise
project(${exercise} CXX)
Expand All @@ -27,7 +27,7 @@ else()
endif()

set_target_properties(${exercise} PROPERTIES
CXX_STANDARD 11
CXX_STANDARD 14
CXX_STANDARD_REQUIRED OFF
CXX_EXTENSIONS OFF
)
Expand Down
6 changes: 3 additions & 3 deletions exercises/armstrong-numbers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
get_filename_component(exercise ${CMAKE_CURRENT_SOURCE_DIR} NAME)

# Basic CMake project
cmake_minimum_required(VERSION 3.1.3)
cmake_minimum_required(VERSION 3.5.1)

# Name the project after the exercise
project(${exercise} CXX)
Expand All @@ -27,7 +27,7 @@ else()
endif()

set_target_properties(${exercise} PROPERTIES
CXX_STANDARD 11
CXX_STANDARD 14
CXX_STANDARD_REQUIRED OFF
CXX_EXTENSIONS OFF
)
Expand All @@ -50,4 +50,4 @@ if(${MSVC})
endif()

# Run the tests on every build
add_custom_target(test_${exercise} ALL DEPENDS ${exercise} COMMAND ${exercise})
add_custom_target(test_${exercise} ALL DEPENDS ${exercise} COMMAND ${exercise})
4 changes: 2 additions & 2 deletions exercises/atbash-cipher/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
get_filename_component(exercise ${CMAKE_CURRENT_SOURCE_DIR} NAME)

# Basic CMake project
cmake_minimum_required(VERSION 3.1.3)
cmake_minimum_required(VERSION 3.5.1)

# Name the project after the exercise
project(${exercise} CXX)
Expand All @@ -27,7 +27,7 @@ else()
endif()

set_target_properties(${exercise} PROPERTIES
CXX_STANDARD 11
CXX_STANDARD 14
CXX_STANDARD_REQUIRED OFF
CXX_EXTENSIONS OFF
)
Expand Down
4 changes: 2 additions & 2 deletions exercises/beer-song/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
get_filename_component(exercise ${CMAKE_CURRENT_SOURCE_DIR} NAME)

# Basic CMake project
cmake_minimum_required(VERSION 3.1.3)
cmake_minimum_required(VERSION 3.5.1)

# Name the project after the exercise
project(${exercise} CXX)
Expand All @@ -27,7 +27,7 @@ else()
endif()

set_target_properties(${exercise} PROPERTIES
CXX_STANDARD 11
CXX_STANDARD 14
CXX_STANDARD_REQUIRED OFF
CXX_EXTENSIONS OFF
)
Expand Down
4 changes: 2 additions & 2 deletions exercises/binary-search-tree/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
get_filename_component(exercise ${CMAKE_CURRENT_SOURCE_DIR} NAME)

# Basic CMake project
cmake_minimum_required(VERSION 3.1.3)
cmake_minimum_required(VERSION 3.5.1)

# Name the project after the exercise
project(${exercise} CXX)
Expand All @@ -27,7 +27,7 @@ else()
endif()

set_target_properties(${exercise} PROPERTIES
CXX_STANDARD 11
CXX_STANDARD 14
CXX_STANDARD_REQUIRED OFF
CXX_EXTENSIONS OFF
)
Expand Down
4 changes: 2 additions & 2 deletions exercises/binary-search/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
get_filename_component(exercise ${CMAKE_CURRENT_SOURCE_DIR} NAME)

# Basic CMake project
cmake_minimum_required(VERSION 3.1.3)
cmake_minimum_required(VERSION 3.5.1)

# Name the project after the exercise
project(${exercise} CXX)
Expand All @@ -27,7 +27,7 @@ else()
endif()

set_target_properties(${exercise} PROPERTIES
CXX_STANDARD 11
CXX_STANDARD 14
CXX_STANDARD_REQUIRED OFF
CXX_EXTENSIONS OFF
)
Expand Down
4 changes: 2 additions & 2 deletions exercises/binary/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
get_filename_component(exercise ${CMAKE_CURRENT_SOURCE_DIR} NAME)

# Basic CMake project
cmake_minimum_required(VERSION 3.1.3)
cmake_minimum_required(VERSION 3.5.1)

# Name the project after the exercise
project(${exercise} CXX)
Expand All @@ -27,7 +27,7 @@ else()
endif()

set_target_properties(${exercise} PROPERTIES
CXX_STANDARD 11
CXX_STANDARD 14
CXX_STANDARD_REQUIRED OFF
CXX_EXTENSIONS OFF
)
Expand Down
4 changes: 2 additions & 2 deletions exercises/bob/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
get_filename_component(exercise ${CMAKE_CURRENT_SOURCE_DIR} NAME)

# Basic CMake project
cmake_minimum_required(VERSION 3.1.3)
cmake_minimum_required(VERSION 3.5.1)

# Name the project after the exercise
project(${exercise} CXX)
Expand All @@ -27,7 +27,7 @@ else()
endif()

set_target_properties(${exercise} PROPERTIES
CXX_STANDARD 11
CXX_STANDARD 14
CXX_STANDARD_REQUIRED OFF
CXX_EXTENSIONS OFF
)
Expand Down
4 changes: 2 additions & 2 deletions exercises/clock/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
get_filename_component(exercise ${CMAKE_CURRENT_SOURCE_DIR} NAME)

# Basic CMake project
cmake_minimum_required(VERSION 3.1.3)
cmake_minimum_required(VERSION 3.5.1)

# Name the project after the exercise
project(${exercise} CXX)
Expand All @@ -27,7 +27,7 @@ else()
endif()

set_target_properties(${exercise} PROPERTIES
CXX_STANDARD 11
CXX_STANDARD 14
CXX_STANDARD_REQUIRED OFF
CXX_EXTENSIONS OFF
)
Expand Down
4 changes: 2 additions & 2 deletions exercises/crypto-square/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
get_filename_component(exercise ${CMAKE_CURRENT_SOURCE_DIR} NAME)

# Basic CMake project
cmake_minimum_required(VERSION 3.1.3)
cmake_minimum_required(VERSION 3.5.1)

# Name the project after the exercise
project(${exercise} CXX)
Expand All @@ -27,7 +27,7 @@ else()
endif()

set_target_properties(${exercise} PROPERTIES
CXX_STANDARD 11
CXX_STANDARD 14
CXX_STANDARD_REQUIRED OFF
CXX_EXTENSIONS OFF
)
Expand Down
4 changes: 2 additions & 2 deletions exercises/difference-of-squares/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
get_filename_component(exercise ${CMAKE_CURRENT_SOURCE_DIR} NAME)

# Basic CMake project
cmake_minimum_required(VERSION 3.1.3)
cmake_minimum_required(VERSION 3.5.1)

# Name the project after the exercise
project(${exercise} CXX)
Expand All @@ -27,7 +27,7 @@ else()
endif()

set_target_properties(${exercise} PROPERTIES
CXX_STANDARD 11
CXX_STANDARD 14
CXX_STANDARD_REQUIRED OFF
CXX_EXTENSIONS OFF
)
Expand Down
4 changes: 2 additions & 2 deletions exercises/etl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
get_filename_component(exercise ${CMAKE_CURRENT_SOURCE_DIR} NAME)

# Basic CMake project
cmake_minimum_required(VERSION 3.1.3)
cmake_minimum_required(VERSION 3.5.1)

# Name the project after the exercise
project(${exercise} CXX)
Expand All @@ -27,7 +27,7 @@ else()
endif()

set_target_properties(${exercise} PROPERTIES
CXX_STANDARD 11
CXX_STANDARD 14
CXX_STANDARD_REQUIRED OFF
CXX_EXTENSIONS OFF
)
Expand Down
Loading