Skip to content

Commit

Permalink
Merge pull request #6 from jgaffiot/fix_cxx_std_setting
Browse files Browse the repository at this point in the history
Fix cxx std setting
  • Loading branch information
jgaffiot authored Jun 11, 2021
2 parents f358a98 + 26aef15 commit f2e7207
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,17 @@ for instance.
### Tooling installation
- `pre-commit`, as a Python tool, can be installed with:

- `pipx`
+ `pipx`

pipx install pre-commit
pipx install pre-commit

- `pip` (or `pip3` on Debian-like distribution)
+ `pip` (or `pip3` on Debian-like distribution)

pip install -U pre-commit
pip install -U pre-commit

- `snap` (system-wide)
+ `snap` (system-wide)

sudo snap install pre-commit
sudo snap install pre-commit

and perhaps from your distribution package manager.

Expand Down
19 changes: 9 additions & 10 deletions source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ else()
message(STATUS "Tools version: ${TOOLS_VERSION}")
endif()

# ------------------------------------------------------------------------------------ #
# Set default C++ standard to C++17
set(CMAKE_CXX_STANDARD 17)
# set(CMAKE_CXX_STANDARD_REQUIRED True)
# Set warnings
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Wno-long-long -Wno-vla"
)

# ------------------------------------------------------------------------------------ #
# Set compilation version
if(CMAKE_BUILD_TYPE MATCHES "Debug")
Expand Down Expand Up @@ -128,16 +137,6 @@ if(USE_ROOT)
include_directories(SYSTEM ${ROOT_INCLUDE_DIRS})
endif(USE_ROOT)

# ------------------------------------------------------------------------------------ #
# Set compiler option Set C++ 17 if not already set
if(NOT CMAKE_CXX_FLAGS MATCHES "-std=c\\+\\+")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
endif()
# Set warnings
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Wno-long-long -Wno-vla"
)

# ------------------------------------------------------------------------------------ #
# Set the headers directory
include_directories(${PROJECT_SOURCE_DIR}/inc ${PROJECT_BINARY_DIR})
Expand Down
2 changes: 1 addition & 1 deletion source/ToolsConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ get_filename_component(TOOLS_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
# ------------------------------------------------------------------------------------ #
# Provide *recommended* compiler flags used by this build of Tools. Don't mess with the
# actual CMAKE_CXX_FLAGS!!! It's up to the user what to do with these.
set(TOOLS_CXX_FLAGS " -std=c++17")
set(TOOLS_CXX_FLAGS "-std=c++17")

# ------------------------------------------------------------------------------------ #
# Configure the path to the headers
Expand Down

0 comments on commit f2e7207

Please sign in to comment.