Skip to content

Commit f2e7207

Browse files
authored
Merge pull request #6 from jgaffiot/fix_cxx_std_setting
Fix cxx std setting
2 parents f358a98 + 26aef15 commit f2e7207

File tree

3 files changed

+16
-17
lines changed

3 files changed

+16
-17
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,17 +104,17 @@ for instance.
104104
### Tooling installation
105105
- `pre-commit`, as a Python tool, can be installed with:
106106

107-
- `pipx`
107+
+ `pipx`
108108

109-
pipx install pre-commit
109+
pipx install pre-commit
110110

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

113-
pip install -U pre-commit
113+
pip install -U pre-commit
114114

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

117-
sudo snap install pre-commit
117+
sudo snap install pre-commit
118118

119119
and perhaps from your distribution package manager.
120120

source/CMakeLists.txt

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,15 @@ else()
4848
message(STATUS "Tools version: ${TOOLS_VERSION}")
4949
endif()
5050

51+
# ------------------------------------------------------------------------------------ #
52+
# Set default C++ standard to C++17
53+
set(CMAKE_CXX_STANDARD 17)
54+
# set(CMAKE_CXX_STANDARD_REQUIRED True)
55+
# Set warnings
56+
set(CMAKE_CXX_FLAGS
57+
"${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Wno-long-long -Wno-vla"
58+
)
59+
5160
# ------------------------------------------------------------------------------------ #
5261
# Set compilation version
5362
if(CMAKE_BUILD_TYPE MATCHES "Debug")
@@ -128,16 +137,6 @@ if(USE_ROOT)
128137
include_directories(SYSTEM ${ROOT_INCLUDE_DIRS})
129138
endif(USE_ROOT)
130139

131-
# ------------------------------------------------------------------------------------ #
132-
# Set compiler option Set C++ 17 if not already set
133-
if(NOT CMAKE_CXX_FLAGS MATCHES "-std=c\\+\\+")
134-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
135-
endif()
136-
# Set warnings
137-
set(CMAKE_CXX_FLAGS
138-
"${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Wno-long-long -Wno-vla"
139-
)
140-
141140
# ------------------------------------------------------------------------------------ #
142141
# Set the headers directory
143142
include_directories(${PROJECT_SOURCE_DIR}/inc ${PROJECT_BINARY_DIR})

source/ToolsConfig.cmake.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ get_filename_component(TOOLS_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
1515
# ------------------------------------------------------------------------------------ #
1616
# Provide *recommended* compiler flags used by this build of Tools. Don't mess with the
1717
# actual CMAKE_CXX_FLAGS!!! It's up to the user what to do with these.
18-
set(TOOLS_CXX_FLAGS " -std=c++17")
18+
set(TOOLS_CXX_FLAGS "-std=c++17")
1919

2020
# ------------------------------------------------------------------------------------ #
2121
# Configure the path to the headers

0 commit comments

Comments
 (0)