File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,6 +8,13 @@ project(notonlymodbusscope
88
99set (SCOPESOURCE ScopeSource)
1010
11+ if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES )
12+ set (CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build type" FORCE )
13+ set_property (CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "RelWithDebInfo" "MinSizeRel" )
14+ endif ()
15+
16+ message (STATUS "Build type: ${CMAKE_BUILD_TYPE} " )
17+
1118set (CMAKE_POSITION_INDEPENDENT_CODE ON )
1219
1320set (CMAKE_CXX_STANDARD 20)
Original file line number Diff line number Diff line change 44mkdir -p release
55cd release
66
7- cmake -GNinja ..
7+ cmake -GNinja -DCMAKE_BUILD_TYPE=Release ..
88ninja
99
1010ctest --output-on-failure
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ echo %PATH%
88
99g++ -v
1010
11- cmake -G " Ninja" ..
11+ cmake -G " Ninja" -DCMAKE_BUILD_TYPE=Release ..
1212IF ERRORLEVEL 1 GOTO errorHandling
1313
1414ninja
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ SINGLE_FILE="${1:-}"
77
88echo " === Configuring (compile_commands.json) ==="
99cmake -GNinja \
10+ -DCMAKE_BUILD_TYPE=Debug \
1011 -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
1112 -DCMAKE_PREFIX_PATH=" ${QT_PREFIX} " \
1213 -B " ${BUILD_DIR} "
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ SINGLE_FILE="${1:-}"
77
88echo " === Configuring (compile_commands.json) ==="
99cmake -GNinja \
10+ -DCMAKE_BUILD_TYPE=Debug \
1011 -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
1112 -DCMAKE_PREFIX_PATH=" ${QT_PREFIX} " \
1213 -B " ${BUILD_DIR} "
Original file line number Diff line number Diff line change @@ -23,7 +23,9 @@ file(GLOB_RECURSE UIS CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/*.ui") #all
2323
2424qt_add_library (${SCOPESOURCE} STATIC ${SRCS} ${UIS} )
2525
26- target_compile_definitions (${SCOPESOURCE} PRIVATE DEBUG )
26+ if (CMAKE_BUILD_TYPE STREQUAL "Debug" )
27+ target_compile_definitions (${SCOPESOURCE} PRIVATE DEBUG )
28+ endif ()
2729
2830target_include_directories (${SCOPESOURCE} PUBLIC
2931 ${CMAKE_CURRENT_SOURCE_DIR}
You can’t perform that action at this time.
0 commit comments