diff options
| author | Alexey Gavrilov <alexey.gavrilov@mail.com> | 2026-03-30 17:54:13 +0700 |
|---|---|---|
| committer | Alexey Gavrilov <alexey.gavrilov@mail.com> | 2026-03-30 17:54:13 +0700 |
| commit | 6cdf09f651586135b7cf7a8a05ba4a96cb6b3b97 (patch) | |
| tree | cd6710114934270d7a68fa254613e0cbfb3807b0 | |
| parent | e5eb32a5123920d18a55819bcea8a23b3a3e0f4d (diff) | |
Move to CHECK_START messages
More convenient requirements checks way by CHECK_START message
argument.
Signed-off-by: Alexey Gavrilov <alexey.gavrilov@mail.com>
| -rw-r--r-- | CMakeLists.txt | 21 | ||||
| -rw-r--r-- | libgcc/CMakeLists.txt | 9 |
2 files changed, 20 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index d9e5643..7cd67be 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ # which include farther subprojects source codes # Expected input variables: -# ObjectiveProject_ARCHITECTURE: type of architecture +# ObjectiveProject_ARCHITECTURE: type of architecture cmake_minimum_required(VERSION 3.25) @@ -10,11 +10,16 @@ list(APPEND CMAKE_MESSAGE_CONTEXT ObjectiveProject) project(ObjectiveProject LANGUAGES CXX ASM_NASM) # Check on supported compiler +message(CHECK_START "Checking compiler support") +list(APPEND CMAKE_MESSAGE_INDENT " ") if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU") - message(STATUS "${CMAKE_CXX_COMPILER_ID} compiler is supported") + message(CHECK_PASS "Found") + message(STATUS "${CMAKE_CXX_COMPILER_ID} found compiler") else() - message(FATAL_ERROR "${CMAKE_CXX_COMPILER_ID} compiler isn't supported") + message(CHECK_PASS "Not Found") + message(STATUS "${CMAKE_CXX_COMPILER_ID} compiler isn't supported") endif() +list(POP_BACK CMAKE_MESSAGE_INDENT) set(ObjectiveProject_CXX_FLAGS $<$<CONFIG:Debug>:-Wall -Wextra -ggdb -g3 -O0> @@ -44,17 +49,21 @@ set(CMAKE_CXX_EXTENSIONS OFF) add_executable(Objective) # Set architecture by default if not present +message(CHECK_START "Checking architecture support") +list(APPEND CMAKE_MESSAGE_INDENT " ") if(NOT ObjectiveProject_ARCHITECTURE IN_LIST OBJECTIVE_SUPPORTED_PROCESSORS) if(ObjectiveProject_ARCHITECTURE STREQUAL "" OR NOT DEFINED ObjectiveProject_ARCHITECTURE) + message(CHECK_FAIL "not set") message(FATAL_ERROR "Architecture isn't set") else() + message(CHECK_FAIL "unknown") message(FATAL_ERROR "${ObjectiveProject_ARCHITECTURE} - unknown architecture") endif() - list(GET OBJECTIVE_SUPPORTED_PROCESSORS 0 ObjectiveProject_ARCHITECTURE) - message(STATUS "Set up architecture by default - ${ObjectiveProject_ARCHITECTURE}") else() - message(STATUS "${ObjectiveProject_ARCHITECTURE} - choosed architecture") + message(CHECK_FAIL "ok") + message(STATUS "${ObjectiveProject_ARCHITECTURE} - chosen architecture") endif() +list(POP_BACK CMAKE_MESSAGE_INDENT) # Create targets with compilers requirements (include directories, flags and etc) add_library(CXX_COMPILER_REQUIREMENTS INTERFACE) diff --git a/libgcc/CMakeLists.txt b/libgcc/CMakeLists.txt index 6fd97b6..d32ba04 100644 --- a/libgcc/CMakeLists.txt +++ b/libgcc/CMakeLists.txt @@ -1,7 +1,8 @@ list(APPEND CMAKE_MESSAGE_CONTEXT libgcc) -message(STATUS "Searching CRT objects") macro(setup_crt_object_file object_file target_name) + message(CHECK_START "Searching ${object_file} object") + list(APPEND CMAKE_MESSAGE_INDENT " ") execute_process( COMMAND ${CMAKE_CXX_COMPILER} --print-file-name=${object_file} OUTPUT_STRIP_TRAILING_WHITESPACE @@ -11,20 +12,20 @@ macro(setup_crt_object_file object_file target_name) ) if(RESULT) + message(CHECK_FAIL "internal error") message(FATAL_ERROR ${ERROR_MESSAGE}) endif() - message(STATUS "${object_file} was found at the ${PATH} path") + message(CHECK_PASS "found") add_library(${target_name} OBJECT IMPORTED GLOBAL) set_target_properties(${target_name} PROPERTIES IMPORTED_OBJECTS ${PATH} ) - + list(POP_BACK CMAKE_MESSAGE_INDENT) endmacro() # TODO: set platform specific CRT objects setup_crt_object_file(crtbegin.o CRTBEGIN) setup_crt_object_file(crtend.o CRTEND) -message(STATUS "The CRT objects were found") add_subdirectory(${ObjectiveProject_ARCHITECTURE}) |
