File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change 22cmake_minimum_required (VERSION 3.17)
33project (Torch-TensorRT LANGUAGES CXX)
44
5- # use c++14
5+ # use c++17
66set (CMAKE_CXX_STANDARD 17)
77
88# Build the libraries with -fPIC
@@ -12,6 +12,7 @@ if (DEFINED CMAKE_MODULE_PATH)
1212 set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} CACHE PATH "Path to the folder containing finders" )
1313endif ()
1414
15+ include (cmake/build_options.cmake)
1516include (cmake/dependencies.cmake)
1617include (cmake/paths .cmake)
1718if (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