cmake: TOPLEVELTYPES declared as target property

TOPLEVELTYPES is not intended to be configurable by the user, rather is a reflection
on the types defined by the source. This changes the TOPLEVELTYPES argument to be
a property, allowing it to be constructed as a generator expression when generating
BF files. By being a property, and not something like a global property, it removes
the need to ensure that additions to TOPLEVELTYPES are done prior to any bitfield
target definitions.
This commit is contained in:
Adrian Danis
2017-11-15 10:50:20 +11:00
parent 9134ae3ee4
commit 9a89cbe4c6
2 changed files with 7 additions and 5 deletions

View File

@@ -20,16 +20,20 @@ config_set(KernelIsMaster KERNEL_MASTER ON)
# Proof based configuration variables
set(CSPEC_DIR "." CACHE PATH "")
set(SKIP_MODIFIES ON CACHE BOOL "")
set(TOPLEVELTYPES "cte_C;tcb_C;endpoint_C;notification_C;asid_pool_C;pte_C;pde_C;user_data_C;user_data_device_C" CACHE STRING "")
set(SORRY_BITFIELD_PROOFS OFF CACHE BOOL "")
find_file(UMM_TYPES umm_types.txt CMAKE_FIND_ROOT_PATH_BOTH)
set(force FORCE)
if(KernelVerificationBuild)
set(force CLEAR)
endif()
mark_as_advanced(${force} CSPEC_DIR SKIP_MODIFIES TOPLEVELTYPES SORRY_BITFIELD_PROOFS UMM_TYPES)
mark_as_advanced(${force} CSPEC_DIR SKIP_MODIFIES SORRY_BITFIELD_PROOFS UMM_TYPES)
# Use a custom target for collecting information during generation that we need during build
add_custom_target(kernel_config_target)
# Put our common top level types in
set_property(TARGET kernel_config_target APPEND PROPERTY TOPLEVELTYPES
cte_C tcb_C endpoint_C notification_C asid_pool_C pte_C pde_C user_data_C
user_data_device_C
)
########################
# Architecture selection

View File

@@ -151,9 +151,7 @@ function(GenProofsBFTarget target_name target_file pbf_path pbf_target prunes de
if(SORRY_BITFIELD_PROOFS)
list(APPEND args "--sorry_lemmas")
endif()
foreach(type IN LISTS TOPLEVELTYPES)
list(APPEND args "--toplevel" "${type}")
endforeach()
list(APPEND args "--toplevel;$<JOIN:$<TARGET_PROPERTY:kernel_config_target,TOPLEVELTYPES>,;--toplevel;>")
list(APPEND deps "${UMM_TYPES}")
GenThyBFTarget("${args}" "${target_name}" "${target_file}" "${pbf_path}" "${pbf_target}" "${prunes}" "${deps}")
endfunction(GenProofsBFTarget)