Skip to content

Commit 0fafceb

Browse files
committedApr 13, 2023
move CMAKE_BUILD_TYPE default setting location
1 parent 7c0c3ab commit 0fafceb

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed
 

‎CMakeLists.txt

+6-9
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ if(NOT EXISTS ${PYTHON_COMMAND})
8181
endif()
8282
endif()
8383

84+
if (NOT CMAKE_BUILD_TYPE)
85+
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
86+
"Build type release is default on single-configuration build system like GNU make."
87+
FORCE)
88+
endif()
89+
8490
###############################################################################
8591
# General settings
8692
###############################################################################
@@ -144,12 +150,6 @@ if(BUILD_CPP_LIB)
144150
###############################################################################
145151
add_subdirectory(third_party)
146152

147-
if (NOT CMAKE_BUILD_TYPE)
148-
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
149-
"Build type release is default on single-configuration build system like GNU make."
150-
FORCE)
151-
endif()
152-
153153
# Flags
154154
if(MSVC)
155155
# Force to always compile with W4
@@ -342,9 +342,6 @@ if(BUILD_PYTHON_PACKAGE)
342342
# Wheel
343343
if(UNIX)
344344
if(MAKE_MANYLINUX_WHEEL)
345-
if (NOT CMAKE_BUILD_TYPE)
346-
set(CMAKE_BUILD_TYPE "Release")
347-
endif()
348345
add_custom_command(OUTPUT ${NBLA_PYTHON_OUTPUT_WHEEL}
349346
COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_BINARY_DIR}/dist/*.whl
350347
COMMAND ${CMAKE_COMMAND} -E env

0 commit comments

Comments
 (0)
Please sign in to comment.