Skip to content

Commit bd5ecae

Browse files
authored
Build libraries even when FVPs not installed (#509)
This was the intention of the previous patch, but I put the check in the wrong place, so the actual builds of the library variants which need FVPs were disabled, not just the tests. This doesn't need passing through to the add_newlib or add_llvmlibc functions because we don't run the tests for them yet.
1 parent 00c3a28 commit bd5ecae

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

CMakeLists.txt

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,7 @@ function(
708708
default_ram_addr
709709
default_ram_size
710710
default_stack_size
711+
run_tests
711712
)
712713
if(CMAKE_INSTALL_MESSAGE STREQUAL NEVER)
713714
set(MESON_INSTALL_QUIET "--quiet")
@@ -789,10 +790,12 @@ function(
789790
# only in tests step, otherwise, they would be built before install.
790791
ExternalProject_Add_StepDependencies(picolibc_${variant} test compiler_rt_${variant}-install)
791792

792-
add_custom_target(check-picolibc-${variant})
793-
add_dependencies(check-picolibc-${variant} picolibc_${variant}-test)
794-
add_dependencies(check-picolibc check-picolibc-${variant})
795-
add_dependencies(llvm-toolchain-runtimes picolibc_${variant})
793+
if(run_tests)
794+
add_custom_target(check-picolibc-${variant})
795+
add_dependencies(check-picolibc-${variant} picolibc_${variant}-test)
796+
add_dependencies(check-picolibc check-picolibc-${variant})
797+
add_dependencies(llvm-toolchain-runtimes picolibc_${variant})
798+
endif()
796799
endfunction()
797800

798801
function(
@@ -1021,6 +1024,7 @@ macro(
10211024
default_ram_addr
10221025
default_ram_size
10231026
default_stack_size
1027+
run_tests
10241028
)
10251029
# It would be nice to just pass ${ARGN} to both the underlying functions,
10261030
# but that has the side effect of expanding any list arguments (e.g.
@@ -1042,6 +1046,7 @@ macro(
10421046
"${default_ram_addr}"
10431047
"${default_ram_size}"
10441048
"${default_stack_size}"
1049+
"${run_tests}"
10451050
)
10461051
elseif(LLVM_TOOLCHAIN_C_LIBRARY STREQUAL newlib)
10471052
add_newlib(
@@ -1435,9 +1440,7 @@ function(add_library_variant target_arch)
14351440
set(have_executor TRUE)
14361441
endif()
14371442
list(JOIN lit_test_executor " " lit_test_executor)
1438-
if(NOT have_executor)
1439-
message("All library tests disabled for ${variant}, due to missing executor")
1440-
elseif(NOT PREBUILT_TARGET_LIBRARIES)
1443+
if(NOT PREBUILT_TARGET_LIBRARIES)
14411444
add_libc(
14421445
"${directory}"
14431446
"${variant}"
@@ -1452,6 +1455,7 @@ function(add_library_variant target_arch)
14521455
"${VARIANT_RAM_ADDRESS}"
14531456
"${VARIANT_RAM_SIZE}"
14541457
"${VARIANT_STACK_SIZE}"
1458+
"${have_executor}"
14551459
)
14561460
add_compiler_rt(
14571461
"${directory}"
@@ -1474,7 +1478,9 @@ function(add_library_variant target_arch)
14741478
${VARIANT_ENABLE_RTTI}
14751479
)
14761480
endif()
1477-
if(VARIANT_COMPILE_FLAGS MATCHES "-march=armv8")
1481+
if(NOT have_executor)
1482+
message("All library tests disabled for ${variant}, due to missing executor")
1483+
elseif(VARIANT_COMPILE_FLAGS MATCHES "-march=armv8")
14781484
message("C++ runtime libraries tests disabled for ${variant}")
14791485
else()
14801486
add_custom_target(check-llvm-toolchain-runtimes-${variant})

0 commit comments

Comments
 (0)