File tree 2 files changed +30
-1
lines changed
2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change 2
2
cmake_minimum_required (VERSION 3.17)
3
3
project (Torch-TensorRT LANGUAGES CXX)
4
4
5
- # use c++14
5
+ # use c++17
6
6
set (CMAKE_CXX_STANDARD 17)
7
7
8
8
# Build the libraries with -fPIC
@@ -12,6 +12,7 @@ if (DEFINED CMAKE_MODULE_PATH)
12
12
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} CACHE PATH "Path to the folder containing finders" )
13
13
endif ()
14
14
15
+ include (cmake/build_options.cmake)
15
16
include (cmake/dependencies.cmake)
16
17
include (cmake/paths .cmake)
17
18
if (MSVC )
Original file line number Diff line number Diff line change
1
+ # set CMAKE_BUILD_TYPE default value
2
+ if (NOT CMAKE_CONFIGURATION_TYPES )
3
+ if ("${CMAKE_BUILD_TYPE} " STREQUAL "" )
4
+ set (CMAKE_BUILD_TYPE
5
+ "Release"
6
+ CACHE STRING "Build configuration" FORCE)
7
+ endif ()
8
+ endif ()
9
+
10
+ # validate CMAKE_BUILD_TYPE against default CMake build types
11
+ set (VALID_BUILD_TYPES "Release" "Debug" "RelWithDebInfo" "MinSizeRel" )
12
+ if (NOT CMAKE_CONFIGURATION_TYPES )
13
+ list (FIND VALID_BUILD_TYPES "${CMAKE_BUILD_TYPE} " INDEX)
14
+ if (${INDEX} MATCHES -1)
15
+ message (
16
+ FATAL_ERROR
17
+ "Invalid build type. Valid types are [${VALID_BUILD_TYPES} ]" )
18
+ endif ()
19
+ endif ()
20
+
21
+ if (NOT CMAKE_CONFIGURATION_TYPES )
22
+ if (DEFINED CMAKE_BUILD_TYPE )
23
+ set_property (CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
24
+ ${VALID_BUILD_TYPES} )
25
+ endif ()
26
+ endif ()
27
+
28
+
You can’t perform that action at this time.
0 commit comments