Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f4fc782

Browse filesBrowse files
committed
Updated CMake to force at least C++11
For all compilers.
1 parent 42ada08 commit f4fc782
Copy full SHA for f4fc782

File tree

Expand file treeCollapse file tree

1 file changed

+19
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+19
-2
lines changed

‎CMakeLists.txt

Copy file name to clipboardExpand all lines: CMakeLists.txt
+19-2Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
11
cmake_minimum_required(VERSION 3.2)
22
project(UnicodeHpp)
33

4+
# GCC
5+
if(CMAKE_COMPILER_IS_GNUCXX AND NOT COMPILER_FLAGS_SET)
6+
set(COMPILER_FLAGS_SET ON)
7+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Weffc++")
8+
endif()
9+
10+
# C++17
11+
set(CMAKE_CXX_STANDARD 11)
12+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
13+
set(CMAKE_CXX_EXTENSIONS OFF)
14+
15+
if (MSVC_VERSION GREATER_EQUAL "1900" AND CMAKE_VERSION LESS 3.10)
16+
include(CheckCXXCompilerFlag)
17+
CHECK_CXX_COMPILER_FLAG("/std:c++11" _cpp_latest_flag_supported)
18+
if (_cpp_latest_flag_supported)
19+
add_compile_options("/std:c++11")
20+
endif()
21+
endif()
22+
423
# Clang Tools
524
file(GLOB_RECURSE ALL_CXX_SOURCE_FILES
625
${PROJECT_SOURCE_DIR}/src/*.[ch]pp
@@ -47,7 +66,5 @@ if(CLANG_TIDY)
4766
add_dependencies(tidy ${PROJECT_NAME}_tidy)
4867
endif()
4968

50-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
51-
5269
add_executable(UnicodeHpp src/unicode_cpp_generator.cpp)
5370
target_include_directories(UnicodeHpp PUBLIC ext)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.