@@ -6,6 +6,13 @@ project("mpw-shell")
6
6
set (PROJECT_TYPE "CXX" )
7
7
set (PROJECT_NAME "MPW Shell" )
8
8
9
+
10
+ # -std=c++14
11
+ set (CMAKE_CXX_STANDARD 14)
12
+ set (CMAKE_CXX_STANDARD_REQUIRED TRUE )
13
+ set (CMAKE_CXX_EXTENSIONS FALSE )
14
+
15
+
9
16
#
10
17
# build config.h
11
18
#
@@ -24,22 +31,20 @@ CHECK_LIBRARY_EXISTS(history add_history "" HAVE_LIBHISTORY)
24
31
CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR} /config.h.in ${CMAKE_CURRENT_BINARY_DIR} /config.h)
25
32
26
33
27
-
28
-
29
- set (CMAKE_CXX_FLAGS "-g -Wall -Wno-unused-variable -Wno-multichar -O1" )
34
+ add_compile_options (-g -Wall -Wno-unused-variable -Wno-multichar -O1)
30
35
31
36
if (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang" )
32
- set ( CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} -Wno-unused-const-variable " )
37
+ add_compile_options ( -Wno-unused-const-variable )
33
38
endif ()
34
39
35
40
36
41
if (${CMAKE_CXX_COMPILER_ID} MATCHES "GNU" )
37
- set ( CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} -Wno-unused-but-set-variable" )
42
+ add_compile_options ( -Wno-unused-but-set-variable )
38
43
endif ()
39
44
40
45
41
-
42
- add_definitions (-I ${CMAKE_SOURCE_DIR} / -I ${ CMAKE_CURRENT_BINARY_DIR}/ )
46
+ include_directories ( ${CMAKE_SOURCE_DIR} )
47
+ include_directories ( ${ CMAKE_CURRENT_BINARY_DIR} )
43
48
44
49
# from https://github.com/gsauthof/cmake-ragel
45
50
macro (RAGEL_TARGET Name Input Output )
@@ -117,10 +122,6 @@ elseif(HAVE_LIBREADLINE)
117
122
endif ()
118
123
119
124
120
- # all this for -std=c++14
121
- set_property (TARGET mpw-shell PROPERTY CXX_STANDARD 14)
122
- set_property (TARGET mpw-shell PROPERTY CXX_STANDARD_REQUIRED TRUE )
123
- set_property (TARGET mpw-shell PROPERTY CXX_EXTENSIONS FALSE )
124
125
125
126
# create a symlink for mpw-make
126
127
add_custom_command (
0 commit comments