Skip to content

Commit

Permalink
WIP add debug messages
Browse files Browse the repository at this point in the history
Signed-off-by: Axel Heider <[email protected]>
  • Loading branch information
axel-h committed Aug 13, 2023
1 parent bf3c7c2 commit 844ea29
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
27 changes: 25 additions & 2 deletions configs/seL4Config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -151,16 +151,25 @@ function(declare_platform name arch_list)
# "_". That's all what is needed for the platform names currently in use,
# new names may require additional sanitizing. We also capitalize all
# letters to have the C define and the CMake variable aligned closely.
message(STATUS "${name} (KernelPlatform='${KernelPlatform}')")
sanitize_str_for_var(name_as_var "${name}")

if(NOT DEFINED PARAM_CAMKE_VAR)
if(DEFINED PARAM_CAMKE_VAR)
message(STATUS " CAMKE_VAR: KernelPlatform_${name_as_var} -> ${PARAM_CAMKE_VAR}")
else()
set(PARAM_CAMKE_VAR "KernelPlatform_${name_as_var}")
endif()

if(NOT DEFINED PARAM_C_DEFINE)
if(DEFINED PARAM_C_DEFINE)
message(STATUS " C_DEFINE: PLAT_${name_as_var} -> ${PARAM_C_DEFINE}")
else()
set(PARAM_C_DEFINE "PLAT_${name_as_var}")
endif()

if(PARAM_NO_DEFAULT_DTS)
message(STATUS " DTS: (none by default)")
endif()

# disable any CMake variables by default
set(${PARAM_CAMKE_VAR} OFF CACHE INTERNAL "" FORCE)
foreach(plat_cmake_var IN LISTS PLAT_CAMKE_VARS PARAM_CAMKE_VAR)
Expand Down Expand Up @@ -206,15 +215,20 @@ function(declare_platform name arch_list)
string(REPLACE "," ";" board_descr "${board}")
list(LENGTH board_descr cnt)
list(GET board_descr 0 board_name)

message(STATUS " board: ${board_name}")

list(APPEND board_names "${board_name}")
sanitize_str_for_var(board_name_as_var "${board_name}")
set(board_cmake_var "KernelPlatform_${board_name_as_var}")
set(board_c_define "PLAT_${board_name_as_var}")

if(cnt GREATER 1)
list(GET board_descr 1 board_cmake_var)
message(STATUS " CAMKE_VAR: KernelPlatform_${board_name_as_var} -> ${board_cmake_var}")
if(cnt GREATER 2)
list(GET board_descr 2 board_c_define)
message(STATUS " C_DEFINE: PLAT_${board_name_as_var} -> ${board_c_define}")
endif()
endif()

Expand All @@ -236,6 +250,7 @@ function(declare_platform name arch_list)
set(KernelPlatform "${name}")
elseif(NOT KernelPlatform STREQUAL "${name}")
# We are done here if this is not the currently selected platform.
message(STATUS " OFF")
return()
elseif(board_names)
# first board is the default if nothing else is set
Expand Down Expand Up @@ -320,13 +335,18 @@ function(declare_platform name arch_list)
endif()

if(DEFINED PARAM_SOURCES)
foreach(f IN LISTS PARAM_SOURCES)
message(STATUS " add: ${f}")
endforeach()

add_sources(CFILES "${PARAM_SOURCES}")
set(c_sources "${c_sources}" PARENT_SCOPE)
set(asm_sources "${asm_sources}" PARENT_SCOPE)
endif()

if(DEFINED PARAM_FLAGS)
foreach(f IN LISTS PARAM_FLAGS)
message(STATUS " add: ${f}=ON")
set(${f} ON PARENT_SCOPE)
endforeach()
endif()
Expand All @@ -343,6 +363,9 @@ function(declare_platform name arch_list)

# ensure the parent sees all the changes that e.g. config_set() made
set(configure_string "${configure_string}" PARENT_SCOPE)

message(STATUS " ON")

endfunction()


Expand Down
1 change: 1 addition & 0 deletions tools/helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,7 @@ function(config_choice optionname configname doc)
# We create a new variable because cmake doesn't support arbitrary properties on cache variables.
set(${optionname}_all_strings ${all_strings} CACHE INTERNAL "" FORCE)
set(configure_string "${local_config_string}" PARENT_SCOPE)
message("config_choice: ${local_config_string}")
endfunction(config_choice)

# Defines a target for a 'configuration' library, which generates a header based
Expand Down

0 comments on commit 844ea29

Please sign in to comment.