Skip to content

Commit 86e32ce

Browse files
authored
Merge pull request godotengine#1786 from marcmarmir/CMake-message-improvement
Fix: Add STATUS to CMake message commands missing them
2 parents c8053df + 0c2e66e commit 86e32ce

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

cmake/common_compiler_flags.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ by default, we need to test for it. ]]
4747
function(compiler_detection)
4848
if(${CMAKE_CXX_COMPILER_ID} STREQUAL Clang)
4949
if(${CMAKE_CXX_COMPILER_FRONTEND_VARIANT} STREQUAL MSVC)
50-
message("Using clang-cl")
50+
message(STATUS "Using clang-cl")
5151
set(IS_CLANG "0" PARENT_SCOPE)
5252
set(IS_MSVC "1" PARENT_SCOPE)
5353
set(NOT_MSVC "0" PARENT_SCOPE)

cmake/godotcpp.cmake

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/windows.cmake)
2929
# Detect number of processors
3030
include(ProcessorCount)
3131
ProcessorCount(PROC_MAX)
32-
message("Auto-detected ${PROC_MAX} CPU cores available for build parallelism.")
32+
message(STATUS "Auto-detected ${PROC_MAX} CPU cores available for build parallelism.")
3333

3434
# List of known platforms
3535
set(PLATFORM_LIST
@@ -197,15 +197,21 @@ function(godotcpp_generate)
197197
another compiler simulating the Visual C++ cl command-line syntax. ]]
198198
if(MSVC)
199199
math(EXPR PROC_N "(${PROC_MAX}-1) | (${X}-2)>>31 & 1")
200-
message("Using ${PROC_N} cores for multi-threaded compilation.")
200+
message(STATUS "Using ${PROC_N} cores for multi-threaded compilation.")
201201
# TODO You can override it at configure time with ...." )
202202
else()
203+
if(CMAKE_BUILD_PARALLEL_LEVEL)
204+
set(_cores "${CMAKE_BUILD_PARALLEL_LEVEL}")
205+
else()
206+
set(_cores "all")
207+
endif()
203208
message(
204-
"Using ${CMAKE_BUILD_PARALLEL_LEVEL} cores, You can override"
205-
" it at configure time by using -j <n> or --parallel <n> on the build"
209+
STATUS
210+
"Using ${_cores} cores. You can override"
211+
" this at configure time by using -j <n> or --parallel <n> in the build"
206212
" command."
207213
)
208-
message(" eg. cmake --build . -j 7 ...")
214+
message(STATUS " eg. cmake --build . -j 7 ...")
209215
endif()
210216

211217
#[[ GODOTCPP_SYMBOL_VISIBLITY
@@ -245,8 +251,8 @@ function(godotcpp_generate)
245251
# Build Profile
246252
if(GODOTCPP_BUILD_PROFILE)
247253
message(STATUS "Using build profile to trim api file")
248-
message("\tBUILD_PROFILE = '${GODOTCPP_BUILD_PROFILE}'")
249-
message("\tAPI_SOURCE = '${GODOTCPP_GDEXTENSION_API_FILE}'")
254+
message(STATUS "\tBUILD_PROFILE = '${GODOTCPP_BUILD_PROFILE}'")
255+
message(STATUS "\tAPI_SOURCE = '${GODOTCPP_GDEXTENSION_API_FILE}'")
250256
build_profile_generate_trimmed_api(
251257
"${GODOTCPP_BUILD_PROFILE}"
252258
"${GODOTCPP_GDEXTENSION_API_FILE}"

0 commit comments

Comments
 (0)