diff --git a/CMakeLists.txt b/CMakeLists.txt index b8942842..416ce5dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -150,9 +150,14 @@ option( "During checkout, apply optional downstream patches to llvm-project to improve performance." ) +option( + ENABLE_QEMU_TESTING + "Enable tests that use QEMU. This option is ON by default." + ON +) option( ENABLE_FVP_TESTING - "Tests using FVP need to be explictly enabled." + "Enable tests that use FVPs. This option is OFF by default." ) set( FVP_INSTALL_DIR @@ -596,6 +601,7 @@ if(NOT PREBUILT_TARGET_LIBRARIES) -DENABLE_VARIANTS=${ENABLE_VARIANTS_PASSTHROUGH} -DLIBC_HDRGEN=${LIBC_HDRGEN} -DFVP_INSTALL_DIR=${FVP_INSTALL_DIR} + -DENABLE_QEMU_TESTING=${ENABLE_QEMU_TESTING} -DENABLE_FVP_TESTING=${ENABLE_FVP_TESTING} -DFVP_CONFIG_DIR=${CMAKE_CURRENT_SOURCE_DIR}/fvp/config -DFETCHCONTENT_SOURCE_DIR_LLVMPROJECT=${FETCHCONTENT_SOURCE_DIR_LLVMPROJECT} diff --git a/arm-multilib/CMakeLists.txt b/arm-multilib/CMakeLists.txt index 50df2c33..027332fa 100644 --- a/arm-multilib/CMakeLists.txt +++ b/arm-multilib/CMakeLists.txt @@ -33,9 +33,14 @@ set(C_LIBRARY "picolibc" CACHE STRING "Which C library to use.") set_property(CACHE C_LIBRARY PROPERTY STRINGS picolibc newlib llvmlibc) set(LLVM_BINARY_DIR "" CACHE PATH "Path to LLVM toolchain build or install root.") set(LIBC_HDRGEN "" CACHE PATH "Path to prebuilt lbc-hdrgen if not included in LLVM binaries set by LLVM_BINARY_DIR") +option( + ENABLE_QEMU_TESTING + "Enable tests that use QEMU. This option is ON by default." + ON +) option( ENABLE_FVP_TESTING - "Tests using FVP need to be explictly enabled." + "Enable tests that use FVPs. This option is OFF by default." ) set( FVP_INSTALL_DIR @@ -162,9 +167,9 @@ foreach(lib_idx RANGE ${lib_count_dec}) file(READ ${variant_json_file} variant_json_str) string(JSON test_executor GET ${variant_json_str} "args" "common" "TEST_EXECUTOR") - # FVP testing should default to off, so override any - # settings from the JSON. - if(test_executor STREQUAL "fvp" AND NOT ${ENABLE_FVP_TESTING}) + # 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})) list(APPEND additional_cmake_args "-DENABLE_LIBC_TESTS=OFF" "-DENABLE_COMPILER_RT_TESTS=OFF" "-DENABLE_LIBCXX_TESTS=OFF") set(read_ENABLE_LIBC_TESTS "OFF") set(read_ENABLE_COMPILER_RT_TESTS "OFF") diff --git a/docs/building-from-source.md b/docs/building-from-source.md index 6b70487c..e1efefa3 100644 --- a/docs/building-from-source.md +++ b/docs/building-from-source.md @@ -36,6 +36,10 @@ $ brew install llvm python3 git make ninja qemu cmake $ pip install meson ``` +Testing with QEMU is enabled by default, but can be disabled using the +`-DENABLE_QEMU_TESTING=OFF` CMake option if testing is not required or QEMU is +not installed. + Some recent targets are not supported by QEMU, for these the Arm FVP models are used instead. These models are available free-of-change but are not open-source, and come with their own licenses.