File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change 1
- cmake_minimum_required (VERSION 3.6 )
1
+ cmake_minimum_required (VERSION 3.15 )
2
2
if (COMMAND cmake_policy)
3
3
cmake_policy (SET CMP0003 NEW)
4
4
endif (COMMAND cmake_policy)
5
5
6
+ # MSVC runtime library flags are selected by an abstraction.
7
+ if (COMMAND cmake_policy AND POLICY CMP0091)
8
+ cmake_policy (SET CMP0091 NEW)
9
+ endif ()
10
+
6
11
set (CMAKE_CXX_STANDARD 11)
7
12
set (CMAKE_CXX_STANDARD_REQUIRED ON )
8
13
set (CMAKE_CXX_EXTENSIONS OFF )
9
14
10
- set (PROTOBUF_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR} /deps/protobuf)
11
- add_subdirectory (${PROTOBUF_ROOT_DIR} /cmake deps/protobuf)
12
-
13
15
set (protobuf_BUILD_TESTS OFF CACHE BOOL "Build protobuf tests" )
14
16
set (protobuf_WITH_ZLIB OFF CACHE BOOL "Build protobuf with zlib." )
17
+ set (PROTOBUF_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR} /deps/protobuf)
18
+ add_subdirectory (${PROTOBUF_ROOT_DIR} /cmake deps/protobuf)
15
19
16
20
set (CMAKE_EXE_LINKER_FLAGS "-static-libstdc++" )
17
21
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-stack-protector" )
@@ -22,7 +26,7 @@ add_executable(grpc_node_plugin
22
26
)
23
27
24
28
if (MSVC )
25
- add_definitions (/MTd )
29
+ set (CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded$<$<CONFIG:Debug>:Debug> )
26
30
endif (MSVC )
27
31
28
32
target_include_directories (grpc_node_plugin
@@ -34,4 +38,4 @@ target_include_directories(grpc_node_plugin
34
38
target_link_libraries (grpc_node_plugin
35
39
libprotoc
36
40
libprotobuf
37
- )
41
+ )
You can’t perform that action at this time.
0 commit comments