File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +19
-2
lines changed
Original file line number Diff line number Diff line change 1
1
cmake_minimum_required (VERSION 3.2)
2
2
project (UnicodeHpp)
3
3
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
+
4
23
# Clang Tools
5
24
file (GLOB_RECURSE ALL_CXX_SOURCE_FILES
6
25
${PROJECT_SOURCE_DIR} /src/*.[ch]pp
@@ -47,7 +66,5 @@ if(CLANG_TIDY)
47
66
add_dependencies (tidy ${PROJECT_NAME} _tidy)
48
67
endif ()
49
68
50
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14" )
51
-
52
69
add_executable (UnicodeHpp src/unicode_cpp_generator.cpp)
53
70
target_include_directories (UnicodeHpp PUBLIC ext )
You can’t perform that action at this time.
0 commit comments