Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 52 additions & 14 deletions arm-software/embedded/arm-multilib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,17 @@ foreach(lib_idx RANGE ${lib_count_dec})
# Read info from the variant specific json.
file(READ ${variant_json_file} variant_json_str)
string(JSON test_executor GET ${variant_json_str} "args" "common" "TEST_EXECUTOR")
if(C_LIBRARY MATCHES "^newlib")
# Treat newlib variants as newlib for library compatibility.
set(json_c_library newlib)
else()
set(json_c_library ${C_LIBRARY})
endif()

set(enable_vars
ENABLE_CXX_LIBS
ENABLE_COMPILER_RT_LIBS
)
# The multilib project can be configured to disable QEMU and/or FVP
# testing, which will need to override the settings from the json.
if((test_executor STREQUAL "qemu" AND NOT ${ENABLE_QEMU_TESTING}) OR (test_executor STREQUAL "fvp" AND NOT ${ENABLE_FVP_TESTING}))
Expand All @@ -229,20 +239,47 @@ foreach(lib_idx RANGE ${lib_count_dec})
set(read_ENABLE_COMPILER_RT_TESTS "OFF")
set(read_ENABLE_LIBCXX_TESTS "OFF")
else()
# From the json, check which tests are enabled.
foreach(test_enable_var
list(APPEND enable_vars
ENABLE_LIBC_TESTS
ENABLE_COMPILER_RT_TESTS
ENABLE_LIBCXX_TESTS
)
string(JSON read_${test_enable_var} ERROR_VARIABLE json_error GET ${variant_json_str} "args" ${C_LIBRARY} ${test_enable_var})
if(read_${test_enable_var} STREQUAL "json-NOTFOUND")
string(JSON read_${test_enable_var} ERROR_VARIABLE json_error GET ${variant_json_str} "args" "common" ${test_enable_var})
if(read_${test_enable_var} STREQUAL "json-NOTFOUND")
set(read_${test_enable_var} "OFF")
endif()
endif()

# From the json, check which library builds and tests are enabled.
foreach(enable_var IN LISTS enable_vars)
string(JSON read_${enable_var} ERROR_VARIABLE json_error GET ${variant_json_str} "args" ${json_c_library} ${enable_var})
if(read_${enable_var} STREQUAL "json-NOTFOUND")
string(JSON read_${enable_var} ERROR_VARIABLE json_error GET ${variant_json_str} "args" "common" ${enable_var})
if(read_${enable_var} STREQUAL "json-NOTFOUND")
set(read_${enable_var} "OFF")
endif()
endforeach()
endif()
endforeach()

# Only schedule subtargets that the variant build actually creates.
set(variant_subtargets)
if(read_ENABLE_COMPILER_RT_LIBS)
list(APPEND variant_subtargets
compiler_rt-configure
compiler_rt-build
)
endif()
list(APPEND variant_subtargets
clib-configure
clib-build
)
if(read_ENABLE_COMPILER_RT_LIBS)
list(APPEND variant_subtargets
compiler_rt_profile-configure
compiler_rt_profile-build
)
endif()
if(read_ENABLE_CXX_LIBS)
list(APPEND variant_subtargets
cxxlibs-configure
cxxlibs-build
)
endif()

if(NUMERICAL_BUILD_NAMES)
Expand Down Expand Up @@ -286,12 +323,13 @@ foreach(lib_idx RANGE ${lib_count_dec})
# configuration steps can be run in parallel.
# Each step should depend on the previous, with the first depending on the pre-defined
# 'configure' step, and the pre-defined 'build' step depending on the last.
set(subtarget_deps configure ${subtargets} build)
list(SUBLIST subtarget_deps 0 ${subtarget_count} subtarget_dependees)
list(SUBLIST subtarget_deps 2 ${subtarget_count} subtarget_dependers)
list(LENGTH variant_subtargets variant_subtarget_count)
set(subtarget_deps configure ${variant_subtargets} build)
list(SUBLIST subtarget_deps 0 ${variant_subtarget_count} subtarget_dependees)
list(SUBLIST subtarget_deps 2 ${variant_subtarget_count} subtarget_dependers)

# First loop to add the steps and targets.
foreach(subtarget subtarget_dependee IN ZIP_LISTS subtargets subtarget_dependees)
foreach(subtarget subtarget_dependee IN ZIP_LISTS variant_subtargets subtarget_dependees)
# Enabling USES_TERMINAL puts the step in Ninja's "console" job pool, which
# prevents the steps from being run in parallel since each must be given
# exclusive access to the terminal. When disabled, the console won't be updated
Expand All @@ -317,7 +355,7 @@ foreach(lib_idx RANGE ${lib_count_dec})
endforeach()

# Second loop to set the steps that will depend on the new targets.
foreach(subtarget subtarget_depender IN ZIP_LISTS subtargets subtarget_dependers)
foreach(subtarget subtarget_depender IN ZIP_LISTS variant_subtargets subtarget_dependers)
ExternalProject_Add_StepDependencies(
runtimes-${variant}
${subtarget_depender}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,21 @@
},
"picolibc": {
"ENABLE_CXX_LIBS": "ON",
"ENABLE_COMPILER_RT_LIBS": "ON",
"ENABLE_LIBC_TESTS": "ON",
"ENABLE_COMPILER_RT_TESTS": "ON",
"ENABLE_LIBCXX_TESTS": "ON"
},
"newlib": {
"ENABLE_CXX_LIBS": "ON",
"ENABLE_COMPILER_RT_LIBS": "ON",
"ENABLE_LIBC_TESTS": "OFF",
"ENABLE_COMPILER_RT_TESTS": "OFF",
"ENABLE_LIBCXX_TESTS": "OFF"
},
"llvmlibc": {
"ENABLE_CXX_LIBS": "ON",
"ENABLE_COMPILER_RT_LIBS": "ON",
"ENABLE_LIBC_TESTS": "ON",
"ENABLE_COMPILER_RT_TESTS": "OFF",
"ENABLE_LIBCXX_TESTS": "OFF"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,21 @@
},
"picolibc": {
"ENABLE_CXX_LIBS": "ON",
"ENABLE_COMPILER_RT_LIBS": "ON",
"ENABLE_LIBC_TESTS": "ON",
"ENABLE_COMPILER_RT_TESTS": "ON",
"ENABLE_LIBCXX_TESTS": "ON"
},
"newlib": {
"ENABLE_CXX_LIBS": "ON",
"ENABLE_COMPILER_RT_LIBS": "ON",
"ENABLE_LIBC_TESTS": "OFF",
"ENABLE_COMPILER_RT_TESTS": "OFF",
"ENABLE_LIBCXX_TESTS": "OFF"
},
"llvmlibc": {
"ENABLE_CXX_LIBS": "ON",
"ENABLE_COMPILER_RT_LIBS": "ON",
"ENABLE_LIBC_TESTS": "ON",
"ENABLE_COMPILER_RT_TESTS": "OFF",
"ENABLE_LIBCXX_TESTS": "OFF"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,21 @@
},
"picolibc": {
"ENABLE_CXX_LIBS": "ON",
"ENABLE_COMPILER_RT_LIBS": "ON",
"ENABLE_LIBC_TESTS": "ON",
"ENABLE_COMPILER_RT_TESTS": "ON",
"ENABLE_LIBCXX_TESTS": "ON"
},
"newlib": {
"ENABLE_CXX_LIBS": "ON",
"ENABLE_COMPILER_RT_LIBS": "ON",
"ENABLE_LIBC_TESTS": "OFF",
"ENABLE_COMPILER_RT_TESTS": "OFF",
"ENABLE_LIBCXX_TESTS": "OFF"
},
"llvmlibc": {
"ENABLE_CXX_LIBS": "ON",
"ENABLE_COMPILER_RT_LIBS": "ON",
"ENABLE_LIBC_TESTS": "ON",
"ENABLE_COMPILER_RT_TESTS": "OFF",
"ENABLE_LIBCXX_TESTS": "OFF"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,21 @@
},
"picolibc": {
"ENABLE_CXX_LIBS": "ON",
"ENABLE_COMPILER_RT_LIBS": "ON",
"ENABLE_LIBC_TESTS": "ON",
"ENABLE_COMPILER_RT_TESTS": "ON",
"ENABLE_LIBCXX_TESTS": "ON"
},
"newlib": {
"ENABLE_CXX_LIBS": "ON",
"ENABLE_COMPILER_RT_LIBS": "ON",
"ENABLE_LIBC_TESTS": "OFF",
"ENABLE_COMPILER_RT_TESTS": "OFF",
"ENABLE_LIBCXX_TESTS": "OFF"
},
"llvmlibc": {
"ENABLE_CXX_LIBS": "ON",
"ENABLE_COMPILER_RT_LIBS": "ON",
"ENABLE_LIBC_TESTS": "OFF",
"ENABLE_COMPILER_RT_TESTS": "OFF",
"ENABLE_LIBCXX_TESTS": "OFF"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,21 @@
},
"picolibc": {
"ENABLE_CXX_LIBS": "ON",
"ENABLE_COMPILER_RT_LIBS": "ON",
"ENABLE_LIBC_TESTS": "ON",
"ENABLE_COMPILER_RT_TESTS": "ON",
"ENABLE_LIBCXX_TESTS": "ON"
},
"newlib": {
"ENABLE_CXX_LIBS": "ON",
"ENABLE_COMPILER_RT_LIBS": "ON",
"ENABLE_LIBC_TESTS": "OFF",
"ENABLE_COMPILER_RT_TESTS": "OFF",
"ENABLE_LIBCXX_TESTS": "OFF"
},
"llvmlibc": {
"ENABLE_CXX_LIBS": "ON",
"ENABLE_COMPILER_RT_LIBS": "ON",
"ENABLE_LIBC_TESTS": "OFF",
"ENABLE_COMPILER_RT_TESTS": "OFF",
"ENABLE_LIBCXX_TESTS": "OFF"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,21 @@
},
"picolibc": {
"ENABLE_CXX_LIBS": "ON",
"ENABLE_COMPILER_RT_LIBS": "ON",
"ENABLE_LIBC_TESTS": "ON",
"ENABLE_COMPILER_RT_TESTS": "ON",
"ENABLE_LIBCXX_TESTS": "ON"
},
"newlib": {
"ENABLE_CXX_LIBS": "ON",
"ENABLE_COMPILER_RT_LIBS": "ON",
"ENABLE_LIBC_TESTS": "OFF",
"ENABLE_COMPILER_RT_TESTS": "OFF",
"ENABLE_LIBCXX_TESTS": "OFF"
},
"llvmlibc": {
"ENABLE_CXX_LIBS": "ON",
"ENABLE_COMPILER_RT_LIBS": "ON",
"ENABLE_LIBC_TESTS": "ON",
"ENABLE_COMPILER_RT_TESTS": "OFF",
"ENABLE_LIBCXX_TESTS": "OFF"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,21 @@
},
"picolibc": {
"ENABLE_CXX_LIBS": "ON",
"ENABLE_COMPILER_RT_LIBS": "ON",
"ENABLE_LIBC_TESTS": "ON",
"ENABLE_COMPILER_RT_TESTS": "ON",
"ENABLE_LIBCXX_TESTS": "OFF"
},
"newlib": {
"ENABLE_CXX_LIBS": "ON",
"ENABLE_COMPILER_RT_LIBS": "ON",
"ENABLE_LIBC_TESTS": "OFF",
"ENABLE_COMPILER_RT_TESTS": "OFF",
"ENABLE_LIBCXX_TESTS": "OFF"
},
"llvmlibc": {
"ENABLE_CXX_LIBS": "ON",
"ENABLE_COMPILER_RT_LIBS": "ON",
"ENABLE_LIBC_TESTS": "ON",
"ENABLE_COMPILER_RT_TESTS": "OFF",
"ENABLE_LIBCXX_TESTS": "OFF"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,21 @@
},
"picolibc": {
"ENABLE_CXX_LIBS": "ON",
"ENABLE_COMPILER_RT_LIBS": "ON",
"ENABLE_LIBC_TESTS": "ON",
"ENABLE_COMPILER_RT_TESTS": "ON",
"ENABLE_LIBCXX_TESTS": "OFF"
},
"newlib": {
"ENABLE_CXX_LIBS": "ON",
"ENABLE_COMPILER_RT_LIBS": "ON",
"ENABLE_LIBC_TESTS": "OFF",
"ENABLE_COMPILER_RT_TESTS": "OFF",
"ENABLE_LIBCXX_TESTS": "OFF"
},
"llvmlibc": {
"ENABLE_CXX_LIBS": "ON",
"ENABLE_COMPILER_RT_LIBS": "ON",
"ENABLE_LIBC_TESTS": "OFF",
"ENABLE_COMPILER_RT_TESTS": "OFF",
"ENABLE_LIBCXX_TESTS": "OFF"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,21 @@
},
"picolibc": {
"ENABLE_CXX_LIBS": "ON",
"ENABLE_COMPILER_RT_LIBS": "ON",
"ENABLE_LIBC_TESTS": "ON",
"ENABLE_COMPILER_RT_TESTS": "ON",
"ENABLE_LIBCXX_TESTS": "OFF"
},
"newlib": {
"ENABLE_CXX_LIBS": "ON",
"ENABLE_COMPILER_RT_LIBS": "ON",
"ENABLE_LIBC_TESTS": "OFF",
"ENABLE_COMPILER_RT_TESTS": "OFF",
"ENABLE_LIBCXX_TESTS": "OFF"
},
"llvmlibc": {
"ENABLE_CXX_LIBS": "ON",
"ENABLE_COMPILER_RT_LIBS": "ON",
"ENABLE_LIBC_TESTS": "OFF",
"ENABLE_COMPILER_RT_TESTS": "OFF",
"ENABLE_LIBCXX_TESTS": "OFF"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,21 @@
},
"picolibc": {
"ENABLE_CXX_LIBS": "ON",
"ENABLE_COMPILER_RT_LIBS": "ON",
"ENABLE_LIBC_TESTS": "ON",
"ENABLE_COMPILER_RT_TESTS": "ON",
"ENABLE_LIBCXX_TESTS": "OFF"
},
"newlib": {
"ENABLE_CXX_LIBS": "ON",
"ENABLE_COMPILER_RT_LIBS": "ON",
"ENABLE_LIBC_TESTS": "OFF",
"ENABLE_COMPILER_RT_TESTS": "OFF",
"ENABLE_LIBCXX_TESTS": "OFF"
},
"llvmlibc": {
"ENABLE_CXX_LIBS": "ON",
"ENABLE_COMPILER_RT_LIBS": "ON",
"ENABLE_LIBC_TESTS": "ON",
"ENABLE_COMPILER_RT_TESTS": "OFF",
"ENABLE_LIBCXX_TESTS": "OFF"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,21 @@
},
"picolibc": {
"ENABLE_CXX_LIBS": "ON",
"ENABLE_COMPILER_RT_LIBS": "ON",
"ENABLE_LIBC_TESTS": "ON",
"ENABLE_COMPILER_RT_TESTS": "ON",
"ENABLE_LIBCXX_TESTS": "ON"
},
"newlib": {
"ENABLE_CXX_LIBS": "ON",
"ENABLE_COMPILER_RT_LIBS": "ON",
"ENABLE_LIBC_TESTS": "OFF",
"ENABLE_COMPILER_RT_TESTS": "OFF",
"ENABLE_LIBCXX_TESTS": "OFF"
},
"llvmlibc": {
"ENABLE_CXX_LIBS": "ON",
"ENABLE_COMPILER_RT_LIBS": "ON",
"ENABLE_LIBC_TESTS": "ON",
"ENABLE_COMPILER_RT_TESTS": "OFF",
"ENABLE_LIBCXX_TESTS": "OFF"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,21 @@
},
"picolibc": {
"ENABLE_CXX_LIBS": "ON",
"ENABLE_COMPILER_RT_LIBS": "ON",
"ENABLE_LIBC_TESTS": "ON",
"ENABLE_COMPILER_RT_TESTS": "ON",
"ENABLE_LIBCXX_TESTS": "ON"
},
"newlib": {
"ENABLE_CXX_LIBS": "ON",
"ENABLE_COMPILER_RT_LIBS": "ON",
"ENABLE_LIBC_TESTS": "OFF",
"ENABLE_COMPILER_RT_TESTS": "OFF",
"ENABLE_LIBCXX_TESTS": "OFF"
},
"llvmlibc": {
"ENABLE_CXX_LIBS": "ON",
"ENABLE_COMPILER_RT_LIBS": "ON",
"ENABLE_LIBC_TESTS": "ON",
"ENABLE_COMPILER_RT_TESTS": "OFF",
"ENABLE_LIBCXX_TESTS": "OFF"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,21 @@
},
"picolibc": {
"ENABLE_CXX_LIBS": "ON",
"ENABLE_COMPILER_RT_LIBS": "ON",
"ENABLE_LIBC_TESTS": "ON",
"ENABLE_COMPILER_RT_TESTS": "ON",
"ENABLE_LIBCXX_TESTS": "ON"
},
"newlib": {
"ENABLE_CXX_LIBS": "ON",
"ENABLE_COMPILER_RT_LIBS": "ON",
"ENABLE_LIBC_TESTS": "OFF",
"ENABLE_COMPILER_RT_TESTS": "OFF",
"ENABLE_LIBCXX_TESTS": "OFF"
},
"llvmlibc": {
"ENABLE_CXX_LIBS": "ON",
"ENABLE_COMPILER_RT_LIBS": "ON",
"ENABLE_LIBC_TESTS": "ON",
"ENABLE_COMPILER_RT_TESTS": "OFF",
"ENABLE_LIBCXX_TESTS": "OFF"
Expand Down
Loading