Skip to content

Conversation

@amykhuang
Copy link
Collaborator

@amykhuang amykhuang commented Jul 11, 2025

For some reason cmake usually turns this path into an absolute path, but sometimes
it doesn't do it and stays as a relative path, which means the command will fail.
Specify it as an absolute path always so this doesn't happen any more.

@llvmbot
Copy link
Member

llvmbot commented Jul 11, 2025

@llvm/pr-subscribers-libc

Author: Amy Huang (amykhuang)

Changes

For some reason cmake usually turns this path into an absolute path, which works, but sometimes
doesn't. Force it to be an absolute path always.


Full diff: https://github.com/llvm/llvm-project/pull/148315.diff

1 Files Affected:

  • (modified) libc/cmake/modules/LLVMLibCTestRules.cmake (+1-1)
diff --git a/libc/cmake/modules/LLVMLibCTestRules.cmake b/libc/cmake/modules/LLVMLibCTestRules.cmake
index 1cd09816e223f..11937c8c8ab08 100644
--- a/libc/cmake/modules/LLVMLibCTestRules.cmake
+++ b/libc/cmake/modules/LLVMLibCTestRules.cmake
@@ -327,7 +327,7 @@ function(create_libc_unittest fq_target_name)
   if(NOT LIBC_UNITTEST_NO_RUN_POSTBUILD)
     add_custom_target(
       ${fq_target_name}
-      COMMAND ${LIBC_UNITTEST_ENV} ${CMAKE_CROSSCOMPILING_EMULATOR} ${fq_build_target_name}
+      COMMAND ${LIBC_UNITTEST_ENV} ${CMAKE_CROSSCOMPILING_EMULATOR} ${CMAKE_CURRENT_BINARY_DIR}/${fq_build_target_name}
       COMMENT "Running unit test ${fq_target_name}"
       DEPENDS ${fq_build_target_name}
     )

@amykhuang amykhuang merged commit bc2cc8b into llvm:main Jul 12, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants