[libc-commits] [libc] [libc] Add ${CMAKE_CROSSCOMPILING_EMULATOR} to custom test cmdlines (PR #66565)

via libc-commits libc-commits at lists.llvm.org
Fri Sep 15 18:08:43 PDT 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

<details>
<summary>Changes</summary>

${CMAKE_CROSSCOMPILING_EMULATOR} will be used in the new rv32 buildbot and is prepended automatically when we call add_custom_target in CMake, except when we use a custom command.

There are two places where custom commands are used in libc, so we explicitly add the ${CMAKE_CROSSCOMPILING_EMULATOR} variable there. Other systems that don't use ${CMAKE_CROSSCOMPILING_EMULATOR} are unaffected
---
Full diff: https://github.com/llvm/llvm-project/pull/66565.diff


1 Files Affected:

- (modified) libc/cmake/modules/LLVMLibCTestRules.cmake (+2-2) 


``````````diff
diff --git a/libc/cmake/modules/LLVMLibCTestRules.cmake b/libc/cmake/modules/LLVMLibCTestRules.cmake
index e1286b4ab963189..552cbd739628deb 100644
--- a/libc/cmake/modules/LLVMLibCTestRules.cmake
+++ b/libc/cmake/modules/LLVMLibCTestRules.cmake
@@ -561,7 +561,7 @@ function(add_integration_test test_name)
   # to expand the list (by including the option COMMAND_EXPAND_LISTS). This
   # makes `add_custom_target` construct the correct command and execute it.
   set(test_cmd
-      ${INTEGRATION_TEST_ENV}
+      ${CMAKE_CROSSCOMPILING_EMULATOR} ${INTEGRATION_TEST_ENV}
       $<$<BOOL:${LIBC_TARGET_ARCHITECTURE_IS_GPU}>:${gpu_loader_exe}>
       ${INTEGRATION_TEST_LOADER_ARGS}
       $<TARGET_FILE:${fq_build_target_name}> ${INTEGRATION_TEST_ARGS})
@@ -728,7 +728,7 @@ function(add_libc_hermetic_test test_name)
 
   set(test_cmd ${HERMETIC_TEST_ENV}
       $<$<BOOL:${LIBC_TARGET_ARCHITECTURE_IS_GPU}>:${gpu_loader_exe}> ${HERMETIC_TEST_LOADER_ARGS}
-      $<TARGET_FILE:${fq_build_target_name}> ${HERMETIC_TEST_ARGS})
+      ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:${fq_build_target_name}> ${HERMETIC_TEST_ARGS})
   add_custom_target(
     ${fq_target_name}
     COMMAND ${test_cmd}

``````````

</details>


https://github.com/llvm/llvm-project/pull/66565


More information about the libc-commits mailing list