Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

llvm-ar not detected #6040

Open
yh-sb opened this issue Jan 4, 2025 · 5 comments
Open

llvm-ar not detected #6040

yh-sb opened this issue Jan 4, 2025 · 5 comments
Labels

Comments

@yh-sb
Copy link
Contributor

yh-sb commented Jan 4, 2025

Xmake Version

2.9.7+20241219

Operating System Version and Architecture

macOS 15.2 arm

Describe Bug

clang and clang++ is detected from homebrew, but ar is used from AppleClang instead of llvm-ar

checking for clang ... /opt/homebrew/opt/llvm/bin/clang
checking for the c compiler (cc) ... clang
checking for /opt/homebrew/opt/llvm/bin/clang ... ok
...
checking for clang++ ... /opt/homebrew/opt/llvm/bin/clang++
checking for the linker (ld) ... clang++
checking for /opt/homebrew/opt/llvm/bin/clang++ ... ok

ar is used from AppleClang:

checking for /Library/Developer/CommandLineTools/usr/bin/ar ... ok
checking for the static library archiver (ar) ... ar

Expected Behavior

If clang is used from homebrew, then llvm-ar should be also used from homebrew. Consistent toolchain should be used.

which llvm-ar
/opt/homebrew/opt/llvm/bin/llvm-ar

llvm-ar --version
Homebrew LLVM version 19.1.6
  Optimized build.

Project Configuration

Bash is used as default shell.

In ~/.bash_profile

export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
export CC=clang
export CXX=clang++

xmake.lua

add_rules("mode.debug", "mode.release", "plugin.compile_commands.autoupdate", {outputdir = "build"})
set_defaultmode("debug")
set_targetdir("$(buildir)")

add_requires("gtest")

target("googletest-example")
    add_packages("gtest")
    add_files("main.cpp")

Delete ~/.xmake/cache and ~/.xmake/packages before the build.

Additional Information and Error Logs

xmake -vD -y
checking for platform ... macosx
checking for architecture ... arm64
checking for Xcode directory ... %s
checking for Codesign Identity of Xcode ... no
checkinfo: cannot runv(nim --version), No such file or directory
checking for nim ... no
checkinfo: cannot runv(nim --version), No such file or directory
checking for nim ... no
checking for git ... /opt/homebrew/bin/git
checking for gzip ... /usr/bin/gzip
checking for tar ... /usr/bin/tar
checking for ping ... /sbin/ping
pinging the host(gitlab.com) ... 11 ms
pinging the host(github.com) ... 33 ms
pinging the host(gitee.com) ... 306 ms
/opt/homebrew/bin/git rev-parse HEAD
finding gtest from xmake ..
checking for xmake::gtest ... no
finding gtest from brew ..
checking for brew ... /opt/homebrew/bin/brew
finding gtest from vcpkg ..
finding gtest from conan ..
finding gtest from pkgconfig ..
checkinfo: cannot runv(pkg-config --version), No such file or directory
checking for pkg-config ... no
checkinfo: cannot runv(pkgconf --version), No such file or directory
checking for pkgconf ... no
finding gtest from system ..
checking for clang ... /opt/homebrew/opt/llvm/bin/clang
checking for the c compiler (cc) ... clang
checking for /opt/homebrew/opt/llvm/bin/clang ... ok
checking for flags (-fPIC) ... ok
> clang "-fPIC" "-Qunused-arguments" "-isysroot" "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"
> /opt/homebrew/opt/llvm/bin/clang -c -Qunused-arguments -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -o /var/folders/2z/cchv7cs55v57nfmykx1x2dmw0000gn/T/.xmake501/250104/_EEFE614CABA6422088CFC2E37284FB20.o /var/folders/2z/cchv7cs55v57nfmykx1x2dmw0000gn/T/.xmake501/250104/_775FB00633BC4F66BF87D39CCDE5CF30.c
checking for flags (-fdiagnostics-color=always) ... ok
> clang "-fdiagnostics-color=always" "-Qunused-arguments" "-isysroot" "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"
checking for flags (-Wno-gnu-line-marker -Werror) ... ok
> clang "-Wno-gnu-line-marker" "-Werror" "-Qunused-arguments" "-isysroot" "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"
checking for clang++ ... /opt/homebrew/opt/llvm/bin/clang++
checking for the linker (ld) ... clang++
checking for /opt/homebrew/opt/llvm/bin/clang++ ... ok
checking for flags (-fPIC) ... ok
> clang++ "-fPIC" "-isysroot" "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" "-lz" "-isysroot" "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" "-lz"
> /opt/homebrew/opt/llvm/bin/clang++ -o /var/folders/2z/cchv7cs55v57nfmykx1x2dmw0000gn/T/.xmake501/250104/_EEFE614CABA6422088CFC2E37284FB20.b /var/folders/2z/cchv7cs55v57nfmykx1x2dmw0000gn/T/.xmake501/250104/_EEFE614CABA6422088CFC2E37284FB20.o -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -lz -lgtest
ld: library 'gtest' not found
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
> checking for c links(gtest)
> checking for c snippet(find_package/gtest)
checkinfo: ...gramdir/core/sandbox/modules/import/core/tool/linker.lua:75: @programdir/core/sandbox/modules/os.lua:378: execv(/opt/homebrew/opt/llvm/bin/clang++ -o /var/folders/2z/cchv7cs55v57nfmykx1x2dmw0000gn/T/.xmake501/250104/_EEFE614CABA6422088CFC2E37284FB20.b /var/folders/2z/cchv7cs55v57nfmykx1x2dmw0000gn/T/.xmake501/250104/_EEFE614CABA6422088CFC2E37284FB20.o -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -lz -lgtest) failed(1)
stack traceback:
    [C]: in function 'error'
    [@programdir/core/base/os.lua:1004]:
    [@programdir/core/sandbox/modules/os.lua:378]: in function 'execv'
    [@programdir/modules/core/tools/gcc.lua:599]:
    [C]: in function 'xpcall'
    [@programdir/core/base/utils.lua:244]:
    [@programdir/core/tool/linker.lua:232]: in function 'link'
    [...gramdir/core/sandbox/modules/import/core/tool/linker.lua:73]: in function 'link'
    [@programdir/modules/lib/detect/check_cxsnippets.lua:249]:
    [C]: in function 'xpcall'
    [@programdir/core/base/utils.lua:244]: in function 'trycall'
    [@programdir/core/sandbox/modules/try.lua:117]: in function 'try'
    [@programdir/modules/lib/detect/check_cxsnippets.lua:237]:
    [@programdir/modules/package/manager/system/find_package.lua:73]:
    [@programdir/modules/package/manager/find_package.lua:86]: in function '_find_package_with_builtin_rule'
    [@programdir/modules/package/manager/find_package.lua:132]: in function '_find_package'
    [@programdir/modules/package/manager/find_package.lua:196]:
    [@programdir/modules/lib/detect/find_package.lua:86]:
    [@programdir/core/package/package.lua:1905]: in function '_fetch_library'
    [@programdir/core/package/package.lua:2075]: in function 'fetch'
    [...modules/private/action/require/impl/install_packages.lua:354]: in function 'jobfunc'
    [@programdir/modules/async/runjobs.lua:241]:
    [C]: in function 'xpcall'
    [@programdir/core/base/utils.lua:244]: in function 'trycall'
    [@programdir/core/sandbox/modules/try.lua:117]: in function 'try'
    [@programdir/modules/async/runjobs.lua:224]: in function 'cotask'
    [@programdir/core/base/scheduler.lua:406]:

checking for gtest ... no
checking for curl ... /usr/bin/curl
/usr/bin/curl -SL -A "Xmake/2.9.7+20241219 (Macintosh;Intel Mac OS X 15.2) curl/8.7.1" https://github.com/google/googletest/archive/refs/tags/v1.15.2.zip -o v1.15.2.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 1072k    0 1072k    0     0  1342k      0 --:--:-- --:--:-- --:--:-- 1342k
checking for unzip ... /usr/bin/unzip
/usr/bin/unzip -o v1.15.2.zip -d source.tmp
Archive:  v1.15.2.zip
b514bdc898e2951020cbdca1304b75f5950d1f59
   creating: source.tmp/googletest-1.15.2/
  inflating: source.tmp/googletest-1.15.2/.clang-format  
   creating: source.tmp/googletest-1.15.2/.github/
   creating: source.tmp/googletest-1.15.2/.github/ISSUE_TEMPLATE/
  inflating: source.tmp/googletest-1.15.2/.github/ISSUE_TEMPLATE/00-bug_report.yml  
  inflating: source.tmp/googletest-1.15.2/.github/ISSUE_TEMPLATE/10-feature_request.yml  
  inflating: source.tmp/googletest-1.15.2/.github/ISSUE_TEMPLATE/config.yml  
  inflating: source.tmp/googletest-1.15.2/.gitignore  
  inflating: source.tmp/googletest-1.15.2/BUILD.bazel  
  inflating: source.tmp/googletest-1.15.2/CMakeLists.txt  
  inflating: source.tmp/googletest-1.15.2/CONTRIBUTING.md  
  inflating: source.tmp/googletest-1.15.2/CONTRIBUTORS  
  inflating: source.tmp/googletest-1.15.2/LICENSE  
  inflating: source.tmp/googletest-1.15.2/MODULE.bazel  
  inflating: source.tmp/googletest-1.15.2/README.md  
  inflating: source.tmp/googletest-1.15.2/WORKSPACE  
  inflating: source.tmp/googletest-1.15.2/WORKSPACE.bzlmod  
   creating: source.tmp/googletest-1.15.2/ci/
  inflating: source.tmp/googletest-1.15.2/ci/linux-presubmit.sh  
  inflating: source.tmp/googletest-1.15.2/ci/macos-presubmit.sh  
  inflating: source.tmp/googletest-1.15.2/ci/windows-presubmit.bat  
   creating: source.tmp/googletest-1.15.2/docs/
 extracting: source.tmp/googletest-1.15.2/docs/_config.yml  
   creating: source.tmp/googletest-1.15.2/docs/_data/
  inflating: source.tmp/googletest-1.15.2/docs/_data/navigation.yml  
   creating: source.tmp/googletest-1.15.2/docs/_layouts/
  inflating: source.tmp/googletest-1.15.2/docs/_layouts/default.html  
   creating: source.tmp/googletest-1.15.2/docs/_sass/
  inflating: source.tmp/googletest-1.15.2/docs/_sass/main.scss  
  inflating: source.tmp/googletest-1.15.2/docs/advanced.md  
   creating: source.tmp/googletest-1.15.2/docs/assets/
   creating: source.tmp/googletest-1.15.2/docs/assets/css/
  inflating: source.tmp/googletest-1.15.2/docs/assets/css/style.scss  
  inflating: source.tmp/googletest-1.15.2/docs/community_created_documentation.md  
  inflating: source.tmp/googletest-1.15.2/docs/faq.md  
  inflating: source.tmp/googletest-1.15.2/docs/gmock_cheat_sheet.md  
  inflating: source.tmp/googletest-1.15.2/docs/gmock_cook_book.md  
  inflating: source.tmp/googletest-1.15.2/docs/gmock_faq.md  
  inflating: source.tmp/googletest-1.15.2/docs/gmock_for_dummies.md  
  inflating: source.tmp/googletest-1.15.2/docs/index.md  
  inflating: source.tmp/googletest-1.15.2/docs/pkgconfig.md  
  inflating: source.tmp/googletest-1.15.2/docs/platforms.md  
  inflating: source.tmp/googletest-1.15.2/docs/primer.md  
  inflating: source.tmp/googletest-1.15.2/docs/quickstart-bazel.md  
  inflating: source.tmp/googletest-1.15.2/docs/quickstart-cmake.md  
   creating: source.tmp/googletest-1.15.2/docs/reference/
  inflating: source.tmp/googletest-1.15.2/docs/reference/actions.md  
  inflating: source.tmp/googletest-1.15.2/docs/reference/assertions.md  
  inflating: source.tmp/googletest-1.15.2/docs/reference/matchers.md  
  inflating: source.tmp/googletest-1.15.2/docs/reference/mocking.md  
  inflating: source.tmp/googletest-1.15.2/docs/reference/testing.md  
  inflating: source.tmp/googletest-1.15.2/docs/samples.md  
  inflating: source.tmp/googletest-1.15.2/fake_fuchsia_sdk.bzl  
   creating: source.tmp/googletest-1.15.2/googlemock/
  inflating: source.tmp/googletest-1.15.2/googlemock/CMakeLists.txt  
  inflating: source.tmp/googletest-1.15.2/googlemock/README.md  
   creating: source.tmp/googletest-1.15.2/googlemock/cmake/
  inflating: source.tmp/googletest-1.15.2/googlemock/cmake/gmock.pc.in  
  inflating: source.tmp/googletest-1.15.2/googlemock/cmake/gmock_main.pc.in  
   creating: source.tmp/googletest-1.15.2/googlemock/docs/
  inflating: source.tmp/googletest-1.15.2/googlemock/docs/README.md  
   creating: source.tmp/googletest-1.15.2/googlemock/include/
   creating: source.tmp/googletest-1.15.2/googlemock/include/gmock/
  inflating: source.tmp/googletest-1.15.2/googlemock/include/gmock/gmock-actions.h  
  inflating: source.tmp/googletest-1.15.2/googlemock/include/gmock/gmock-cardinalities.h  
  inflating: source.tmp/googletest-1.15.2/googlemock/include/gmock/gmock-function-mocker.h  
  inflating: source.tmp/googletest-1.15.2/googlemock/include/gmock/gmock-matchers.h  
  inflating: source.tmp/googletest-1.15.2/googlemock/include/gmock/gmock-more-actions.h  
  inflating: source.tmp/googletest-1.15.2/googlemock/include/gmock/gmock-more-matchers.h  
  inflating: source.tmp/googletest-1.15.2/googlemock/include/gmock/gmock-nice-strict.h  
  inflating: source.tmp/googletest-1.15.2/googlemock/include/gmock/gmock-spec-builders.h  
  inflating: source.tmp/googletest-1.15.2/googlemock/include/gmock/gmock.h  
   creating: source.tmp/googletest-1.15.2/googlemock/include/gmock/internal/
   creating: source.tmp/googletest-1.15.2/googlemock/include/gmock/internal/custom/
  inflating: source.tmp/googletest-1.15.2/googlemock/include/gmock/internal/custom/README.md  
  inflating: source.tmp/googletest-1.15.2/googlemock/include/gmock/internal/custom/gmock-generated-actions.h  
  inflating: source.tmp/googletest-1.15.2/googlemock/include/gmock/internal/custom/gmock-matchers.h  
  inflating: source.tmp/googletest-1.15.2/googlemock/include/gmock/internal/custom/gmock-port.h  
  inflating: source.tmp/googletest-1.15.2/googlemock/include/gmock/internal/gmock-internal-utils.h  
  inflating: source.tmp/googletest-1.15.2/googlemock/include/gmock/internal/gmock-port.h  
  inflating: source.tmp/googletest-1.15.2/googlemock/include/gmock/internal/gmock-pp.h  
   creating: source.tmp/googletest-1.15.2/googlemock/src/
  inflating: source.tmp/googletest-1.15.2/googlemock/src/gmock-all.cc  
  inflating: source.tmp/googletest-1.15.2/googlemock/src/gmock-cardinalities.cc  
  inflating: source.tmp/googletest-1.15.2/googlemock/src/gmock-internal-utils.cc  
  inflating: source.tmp/googletest-1.15.2/googlemock/src/gmock-matchers.cc  
  inflating: source.tmp/googletest-1.15.2/googlemock/src/gmock-spec-builders.cc  
  inflating: source.tmp/googletest-1.15.2/googlemock/src/gmock.cc  
  inflating: source.tmp/googletest-1.15.2/googlemock/src/gmock_main.cc  
   creating: source.tmp/googletest-1.15.2/googlemock/test/
  inflating: source.tmp/googletest-1.15.2/googlemock/test/BUILD.bazel  
  inflating: source.tmp/googletest-1.15.2/googlemock/test/gmock-actions_test.cc  
  inflating: source.tmp/googletest-1.15.2/googlemock/test/gmock-cardinalities_test.cc  
  inflating: source.tmp/googletest-1.15.2/googlemock/test/gmock-function-mocker_test.cc  
  inflating: source.tmp/googletest-1.15.2/googlemock/test/gmock-internal-utils_test.cc  
  inflating: source.tmp/googletest-1.15.2/googlemock/test/gmock-matchers-arithmetic_test.cc  
  inflating: source.tmp/googletest-1.15.2/googlemock/test/gmock-matchers-comparisons_test.cc  
  inflating: source.tmp/googletest-1.15.2/googlemock/test/gmock-matchers-containers_test.cc  
  inflating: source.tmp/googletest-1.15.2/googlemock/test/gmock-matchers-misc_test.cc  
  inflating: source.tmp/googletest-1.15.2/googlemock/test/gmock-matchers_test.h  
  inflating: source.tmp/googletest-1.15.2/googlemock/test/gmock-more-actions_test.cc  
  inflating: source.tmp/googletest-1.15.2/googlemock/test/gmock-nice-strict_test.cc  
  inflating: source.tmp/googletest-1.15.2/googlemock/test/gmock-port_test.cc  
  inflating: source.tmp/googletest-1.15.2/googlemock/test/gmock-pp-string_test.cc  
  inflating: source.tmp/googletest-1.15.2/googlemock/test/gmock-pp_test.cc  
  inflating: source.tmp/googletest-1.15.2/googlemock/test/gmock-spec-builders_test.cc  
  inflating: source.tmp/googletest-1.15.2/googlemock/test/gmock_all_test.cc  
  inflating: source.tmp/googletest-1.15.2/googlemock/test/gmock_ex_test.cc  
  inflating: source.tmp/googletest-1.15.2/googlemock/test/gmock_leak_test.py  
  inflating: source.tmp/googletest-1.15.2/googlemock/test/gmock_leak_test_.cc  
  inflating: source.tmp/googletest-1.15.2/googlemock/test/gmock_link2_test.cc  
  inflating: source.tmp/googletest-1.15.2/googlemock/test/gmock_link_test.cc  
  inflating: source.tmp/googletest-1.15.2/googlemock/test/gmock_link_test.h  
  inflating: source.tmp/googletest-1.15.2/googlemock/test/gmock_output_test.py  
  inflating: source.tmp/googletest-1.15.2/googlemock/test/gmock_output_test_.cc  
  inflating: source.tmp/googletest-1.15.2/googlemock/test/gmock_output_test_golden.txt  
  inflating: source.tmp/googletest-1.15.2/googlemock/test/gmock_stress_test.cc  
  inflating: source.tmp/googletest-1.15.2/googlemock/test/gmock_test.cc  
  inflating: source.tmp/googletest-1.15.2/googlemock/test/gmock_test_utils.py  
   creating: source.tmp/googletest-1.15.2/googletest/
  inflating: source.tmp/googletest-1.15.2/googletest/CMakeLists.txt  
  inflating: source.tmp/googletest-1.15.2/googletest/README.md  
   creating: source.tmp/googletest-1.15.2/googletest/cmake/
  inflating: source.tmp/googletest-1.15.2/googletest/cmake/Config.cmake.in  
  inflating: source.tmp/googletest-1.15.2/googletest/cmake/gtest.pc.in  
  inflating: source.tmp/googletest-1.15.2/googletest/cmake/gtest_main.pc.in  
  inflating: source.tmp/googletest-1.15.2/googletest/cmake/internal_utils.cmake  
  inflating: source.tmp/googletest-1.15.2/googletest/cmake/libgtest.la.in  
   creating: source.tmp/googletest-1.15.2/googletest/docs/
  inflating: source.tmp/googletest-1.15.2/googletest/docs/README.md  
   creating: source.tmp/googletest-1.15.2/googletest/include/
   creating: source.tmp/googletest-1.15.2/googletest/include/gtest/
  inflating: source.tmp/googletest-1.15.2/googletest/include/gtest/gtest-assertion-result.h  
  inflating: source.tmp/googletest-1.15.2/googletest/include/gtest/gtest-death-test.h  
  inflating: source.tmp/googletest-1.15.2/googletest/include/gtest/gtest-matchers.h  
  inflating: source.tmp/googletest-1.15.2/googletest/include/gtest/gtest-message.h  
  inflating: source.tmp/googletest-1.15.2/googletest/include/gtest/gtest-param-test.h  
  inflating: source.tmp/googletest-1.15.2/googletest/include/gtest/gtest-printers.h  
  inflating: source.tmp/googletest-1.15.2/googletest/include/gtest/gtest-spi.h  
  inflating: source.tmp/googletest-1.15.2/googletest/include/gtest/gtest-test-part.h  
  inflating: source.tmp/googletest-1.15.2/googletest/include/gtest/gtest-typed-test.h  
  inflating: source.tmp/googletest-1.15.2/googletest/include/gtest/gtest.h  
  inflating: source.tmp/googletest-1.15.2/googletest/include/gtest/gtest_pred_impl.h  
  inflating: source.tmp/googletest-1.15.2/googletest/include/gtest/gtest_prod.h  
   creating: source.tmp/googletest-1.15.2/googletest/include/gtest/internal/
   creating: source.tmp/googletest-1.15.2/googletest/include/gtest/internal/custom/
  inflating: source.tmp/googletest-1.15.2/googletest/include/gtest/internal/custom/README.md  
  inflating: source.tmp/googletest-1.15.2/googletest/include/gtest/internal/custom/gtest-port.h  
  inflating: source.tmp/googletest-1.15.2/googletest/include/gtest/internal/custom/gtest-printers.h  
  inflating: source.tmp/googletest-1.15.2/googletest/include/gtest/internal/custom/gtest.h  
  inflating: source.tmp/googletest-1.15.2/googletest/include/gtest/internal/gtest-death-test-internal.h  
  inflating: source.tmp/googletest-1.15.2/googletest/include/gtest/internal/gtest-filepath.h  
  inflating: source.tmp/googletest-1.15.2/googletest/include/gtest/internal/gtest-internal.h  
  inflating: source.tmp/googletest-1.15.2/googletest/include/gtest/internal/gtest-param-util.h  
  inflating: source.tmp/googletest-1.15.2/googletest/include/gtest/internal/gtest-port-arch.h  
  inflating: source.tmp/googletest-1.15.2/googletest/include/gtest/internal/gtest-port.h  
  inflating: source.tmp/googletest-1.15.2/googletest/include/gtest/internal/gtest-string.h  
  inflating: source.tmp/googletest-1.15.2/googletest/include/gtest/internal/gtest-type-util.h  
   creating: source.tmp/googletest-1.15.2/googletest/samples/
  inflating: source.tmp/googletest-1.15.2/googletest/samples/prime_tables.h  
  inflating: source.tmp/googletest-1.15.2/googletest/samples/sample1.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/samples/sample1.h  
  inflating: source.tmp/googletest-1.15.2/googletest/samples/sample10_unittest.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/samples/sample1_unittest.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/samples/sample2.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/samples/sample2.h  
  inflating: source.tmp/googletest-1.15.2/googletest/samples/sample2_unittest.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/samples/sample3-inl.h  
  inflating: source.tmp/googletest-1.15.2/googletest/samples/sample3_unittest.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/samples/sample4.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/samples/sample4.h  
  inflating: source.tmp/googletest-1.15.2/googletest/samples/sample4_unittest.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/samples/sample5_unittest.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/samples/sample6_unittest.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/samples/sample7_unittest.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/samples/sample8_unittest.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/samples/sample9_unittest.cc  
   creating: source.tmp/googletest-1.15.2/googletest/src/
  inflating: source.tmp/googletest-1.15.2/googletest/src/gtest-all.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/src/gtest-assertion-result.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/src/gtest-death-test.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/src/gtest-filepath.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/src/gtest-internal-inl.h  
  inflating: source.tmp/googletest-1.15.2/googletest/src/gtest-matchers.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/src/gtest-port.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/src/gtest-printers.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/src/gtest-test-part.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/src/gtest-typed-test.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/src/gtest.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/src/gtest_main.cc  
   creating: source.tmp/googletest-1.15.2/googletest/test/
  inflating: source.tmp/googletest-1.15.2/googletest/test/BUILD.bazel  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-break-on-failure-unittest.py  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-break-on-failure-unittest_.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-catch-exceptions-test.py  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-catch-exceptions-test_.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-color-test.py  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-color-test_.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-death-test-test.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-death-test_ex_test.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-env-var-test.py  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-env-var-test_.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-failfast-unittest.py  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-failfast-unittest_.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-filepath-test.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-filter-unittest.py  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-filter-unittest_.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-global-environment-unittest.py  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-global-environment-unittest_.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-json-outfiles-test.py  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-json-output-unittest.py  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-list-tests-unittest.py  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-list-tests-unittest_.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-listener-test.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-message-test.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-options-test.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-output-test-golden-lin.txt  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-output-test.py  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-output-test_.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-param-test-invalid-name1-test.py  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-param-test-invalid-name1-test_.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-param-test-invalid-name2-test.py  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-param-test-invalid-name2-test_.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-param-test-test.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-param-test-test.h  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-param-test2-test.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-port-test.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-printers-test.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-setuptestsuite-test.py  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-setuptestsuite-test_.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-shuffle-test.py  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-shuffle-test_.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-test-part-test.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-throw-on-failure-test.py  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-throw-on-failure-test_.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-uninitialized-test.py  
  inflating: source.tmp/googletest-1.15.2/googletest/test/googletest-uninitialized-test_.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/gtest-typed-test2_test.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/gtest-typed-test_test.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/gtest-typed-test_test.h  
  inflating: source.tmp/googletest-1.15.2/googletest/test/gtest-unittest-api_test.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/gtest_all_test.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/gtest_assert_by_exception_test.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/gtest_dirs_test.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/gtest_environment_test.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/gtest_help_test.py  
  inflating: source.tmp/googletest-1.15.2/googletest/test/gtest_help_test_.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/gtest_json_test_utils.py  
  inflating: source.tmp/googletest-1.15.2/googletest/test/gtest_list_output_unittest.py  
  inflating: source.tmp/googletest-1.15.2/googletest/test/gtest_list_output_unittest_.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/gtest_main_unittest.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/gtest_no_test_unittest.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/gtest_pred_impl_unittest.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/gtest_premature_exit_test.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/gtest_prod_test.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/gtest_repeat_test.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/gtest_skip_check_output_test.py  
  inflating: source.tmp/googletest-1.15.2/googletest/test/gtest_skip_environment_check_output_test.py  
  inflating: source.tmp/googletest-1.15.2/googletest/test/gtest_skip_in_environment_setup_test.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/gtest_skip_test.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/gtest_sole_header_test.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/gtest_stress_test.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/gtest_test_macro_stack_footprint_test.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/gtest_test_utils.py  
  inflating: source.tmp/googletest-1.15.2/googletest/test/gtest_testbridge_test.py  
  inflating: source.tmp/googletest-1.15.2/googletest/test/gtest_testbridge_test_.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/gtest_throw_on_failure_ex_test.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/gtest_unittest.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/gtest_xml_outfile1_test_.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/gtest_xml_outfile2_test_.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/gtest_xml_outfiles_test.py  
  inflating: source.tmp/googletest-1.15.2/googletest/test/gtest_xml_output_unittest.py  
  inflating: source.tmp/googletest-1.15.2/googletest/test/gtest_xml_output_unittest_.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/gtest_xml_test_utils.py  
  inflating: source.tmp/googletest-1.15.2/googletest/test/production.cc  
  inflating: source.tmp/googletest-1.15.2/googletest/test/production.h  
  inflating: source.tmp/googletest-1.15.2/googletest_deps.bzl  
  => download https://github.com/google/googletest/archive/refs/tags/v1.15.2.zip .. ok
/opt/homebrew/bin/xmake f --diagnosis --verbose --yes -y -c --plat=macosx --arch=arm64 --mode=release --kind=static --cxflags=-fPIC --buildir=build_b1d986ed
checking for Xcode directory ... %s
checking for Codesign Identity of Xcode ... no
checkinfo: cannot runv(nim --version), No such file or directory
checking for nim ... no
checkinfo: cannot runv(nim --version), No such file or directory
checking for nim ... no
configure
{
    clean = true
    mode = release
    kind = static
    buildir = build_b1d986ed
    cxflags = -fPIC
    arch = arm64
    host = macosx
    plat = macosx
    ccache = true
    ndk_stdcxx = true
}
/opt/homebrew/bin/xmake build --diagnosis --verbose --yes
checking for clang++ ... /opt/homebrew/opt/llvm/bin/clang++
checking for the c++ compiler (cxx) ... clang++
checking for /opt/homebrew/opt/llvm/bin/clang++ ... ok
checking for flags (-fPIC) ... ok
> clang++ "-fPIC" "-Qunused-arguments" "-isysroot" "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"
[ 50%]: cache compiling.release googletest/src/gtest-all.cc
/opt/homebrew/opt/llvm/bin/clang++ -c -Qunused-arguments -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -fPIC -std=c++14 -Igoogletest/include -Igoogletest -o build_b1d986ed/.objs/gtest/macosx/arm64/release/googletest/src/gtest-all.cc.o googletest/src/gtest-all.cc
checking for flags (-MMD -MF) ... ok
> clang++ "-MMD" "-MF" "/dev/null" "-Qunused-arguments" "-isysroot" "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"
checking for flags (-fdiagnostics-color=always) ... ok
> clang++ "-fdiagnostics-color=always" "-Qunused-arguments" "-isysroot" "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"
checking for flags (-Wno-gnu-line-marker -Werror) ... ok
> clang++ "-Wno-gnu-line-marker" "-Werror" "-Qunused-arguments" "-isysroot" "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"
checking for the c++ compiler (cxx) ... clang++
[ 50%]: cache compiling.release googlemock/src/gmock-all.cc
/opt/homebrew/opt/llvm/bin/clang++ -c -Qunused-arguments -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -fPIC -std=c++14 -Igooglemock/include -Igooglemock -Igoogletest/include -Igoogletest -o build_b1d986ed/.objs/gmock/macosx/arm64/release/googlemock/src/gmock-all.cc.o googlemock/src/gmock-all.cc
checking for /Library/Developer/CommandLineTools/usr/bin/ar ... ok
checking for the static library archiver (ar) ... ar
[ 62%]: archiving.release libgtest.a
/Library/Developer/CommandLineTools/usr/bin/ar -cr build_b1d986ed/macosx/arm64/release/libgtest.a build_b1d986ed/.objs/gtest/macosx/arm64/release/googletest/src/gtest-all.cc.o
[ 87%]: archiving.release libgmock.a
/Library/Developer/CommandLineTools/usr/bin/ar -cr build_b1d986ed/macosx/arm64/release/libgmock.a build_b1d986ed/.objs/gmock/macosx/arm64/release/googlemock/src/gmock-all.cc.o

build cache stats:
cache directory: /Users/yhsb/.xmake/cache/packages/2501/g/gtest/v1.15.2/source/build_b1d986ed/.build_cache
cache hit rate: 0%
cache hit: 0
cache hit total time: 0.000s
cache miss: 2
cache miss total time: 0.001s
new cached files: 2
remote cache hit: 0
remote new cached files: 0
preprocess failed: 0
compile fallback count: 0
compile total time: 1.167s

[100%]: build ok, spent 1.036s
/opt/homebrew/bin/xmake install -y --nopkgs -o /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8 --diagnosis --verbose --yes
installing gmock ..
installing gmock to /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8 ..
> copy build_b1d986ed/macosx/arm64/release/libgmock.a to /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/lib
> copy googlemock/include/gmock/gmock-matchers.h to /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/include/gmock/gmock-matchers.h
> copy googlemock/include/gmock/gmock-more-actions.h to /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/include/gmock/gmock-more-actions.h
> copy googlemock/include/gmock/internal/gmock-port.h to /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/include/gmock/internal/gmock-port.h
> copy googlemock/include/gmock/internal/gmock-internal-utils.h to /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/include/gmock/internal/gmock-internal-utils.h
> copy googlemock/include/gmock/internal/gmock-pp.h to /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/include/gmock/internal/gmock-pp.h
> copy googlemock/include/gmock/internal/custom/gmock-port.h to /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/include/gmock/internal/custom/gmock-port.h
> copy googlemock/include/gmock/internal/custom/gmock-matchers.h to /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/include/gmock/internal/custom/gmock-matchers.h
> copy googlemock/include/gmock/internal/custom/gmock-generated-actions.h to /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/include/gmock/internal/custom/gmock-generated-actions.h
> copy googlemock/include/gmock/gmock-function-mocker.h to /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/include/gmock/gmock-function-mocker.h
> copy googlemock/include/gmock/gmock-more-matchers.h to /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/include/gmock/gmock-more-matchers.h
> copy googlemock/include/gmock/gmock-cardinalities.h to /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/include/gmock/gmock-cardinalities.h
> copy googlemock/include/gmock/gmock-spec-builders.h to /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/include/gmock/gmock-spec-builders.h
> copy googlemock/include/gmock/gmock-nice-strict.h to /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/include/gmock/gmock-nice-strict.h
> copy googlemock/include/gmock/gmock.h to /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/include/gmock/gmock.h
> copy googlemock/include/gmock/gmock-actions.h to /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/include/gmock/gmock-actions.h
installing gtest ..
installing gtest to /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8 ..
> copy build_b1d986ed/macosx/arm64/release/libgtest.a to /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/lib
> copy googletest/include/gtest/gtest-matchers.h to /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/include/gtest/gtest-matchers.h
> copy googletest/include/gtest/gtest-death-test.h to /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/include/gtest/gtest-death-test.h
> copy googletest/include/gtest/gtest-spi.h to /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/include/gtest/gtest-spi.h
> copy googletest/include/gtest/gtest-assertion-result.h to /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/include/gtest/gtest-assertion-result.h
> copy googletest/include/gtest/internal/gtest-string.h to /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/include/gtest/internal/gtest-string.h
> copy googletest/include/gtest/internal/gtest-death-test-internal.h to /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/include/gtest/internal/gtest-death-test-internal.h
> copy googletest/include/gtest/internal/gtest-port.h to /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/include/gtest/internal/gtest-port.h
> copy googletest/include/gtest/internal/gtest-port-arch.h to /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/include/gtest/internal/gtest-port-arch.h
> copy googletest/include/gtest/internal/gtest-internal.h to /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/include/gtest/internal/gtest-internal.h
> copy googletest/include/gtest/internal/gtest-param-util.h to /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/include/gtest/internal/gtest-param-util.h
> copy googletest/include/gtest/internal/gtest-type-util.h to /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/include/gtest/internal/gtest-type-util.h
> copy googletest/include/gtest/internal/gtest-filepath.h to /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/include/gtest/internal/gtest-filepath.h
> copy googletest/include/gtest/internal/custom/gtest-port.h to /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/include/gtest/internal/custom/gtest-port.h
> copy googletest/include/gtest/internal/custom/gtest.h to /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/include/gtest/internal/custom/gtest.h
> copy googletest/include/gtest/internal/custom/gtest-printers.h to /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/include/gtest/internal/custom/gtest-printers.h
> copy googletest/include/gtest/gtest-message.h to /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/include/gtest/gtest-message.h
> copy googletest/include/gtest/gtest-param-test.h to /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/include/gtest/gtest-param-test.h
> copy googletest/include/gtest/gtest-typed-test.h to /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/include/gtest/gtest-typed-test.h
> copy googletest/include/gtest/gtest_pred_impl.h to /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/include/gtest/gtest_pred_impl.h
> copy googletest/include/gtest/gtest_prod.h to /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/include/gtest/gtest_prod.h
> copy googletest/include/gtest/gtest-test-part.h to /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/include/gtest/gtest-test-part.h
> copy googletest/include/gtest/gtest.h to /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/include/gtest/gtest.h
> copy googletest/include/gtest/gtest-printers.h to /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/include/gtest/gtest-printers.h
install ok!
finding gtest from xmake ..
checking for xmake::gtest ... gtest v1.15.2
{ 
  sysincludedirs = { 
    "/Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/include" 
  },
  static = true,
  version = "v1.15.2",
  license = "BSD-3",
  linkdirs = { 
    "/Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/lib" 
  },
  libfiles = { 
    "/Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/lib/libgtest.a",
    "/Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/lib/libgmock.a" 
  },
  links = { 
    "gtest",
    "gmock" 
  } 
}

patching /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/lib/pkgconfig/gtest.pc ..
checking for clang++ ... /opt/homebrew/opt/llvm/bin/clang++
checking for the c++ compiler (cxx) ... clang++
checking for flags (-fPIC) ... ok
> clang++ "-fPIC" "-Qunused-arguments" "-isysroot" "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"
> /opt/homebrew/opt/llvm/bin/clang++ -c -Qunused-arguments -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -std=c++14 -isystem /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/include -o /var/folders/2z/cchv7cs55v57nfmykx1x2dmw0000gn/T/.xmake501/250104/_B0924073488F40008B9FAFF729165B30.o /var/folders/2z/cchv7cs55v57nfmykx1x2dmw0000gn/T/.xmake501/250104/_F72D0DB4AF9D4E99818D2014786874A6.cpp
checking for flags (-fdiagnostics-color=always) ... ok
> clang++ "-fdiagnostics-color=always" "-Qunused-arguments" "-isysroot" "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"
checking for flags (-Wno-gnu-line-marker -Werror) ... ok
> clang++ "-Wno-gnu-line-marker" "-Werror" "-Qunused-arguments" "-isysroot" "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"
> /opt/homebrew/opt/llvm/bin/clang++ -o /var/folders/2z/cchv7cs55v57nfmykx1x2dmw0000gn/T/.xmake501/250104/_B0924073488F40008B9FAFF729165B30.b /var/folders/2z/cchv7cs55v57nfmykx1x2dmw0000gn/T/.xmake501/250104/_B0924073488F40008B9FAFF729165B30.o -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -lz -L/Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/lib -lgtest -lgmock
> checking for c++ includes(gtest/gtest.h)
> checking for c++ links(gtest, gmock)
> checking for c++ snippet(test)
> /opt/homebrew/opt/llvm/bin/clang++ -c -Qunused-arguments -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -std=c++14 -isystem /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/include -o /var/folders/2z/cchv7cs55v57nfmykx1x2dmw0000gn/T/.xmake501/250104/_D83A403921DD4800876845877879B120.o /var/folders/2z/cchv7cs55v57nfmykx1x2dmw0000gn/T/.xmake501/250104/_CA8C579F8AC24724939F57B859E34B6D.cpp
> /opt/homebrew/opt/llvm/bin/clang++ -o /var/folders/2z/cchv7cs55v57nfmykx1x2dmw0000gn/T/.xmake501/250104/_D83A403921DD4800876845877879B120.b /var/folders/2z/cchv7cs55v57nfmykx1x2dmw0000gn/T/.xmake501/250104/_D83A403921DD4800876845877879B120.o -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -lz -L/Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/lib -lgtest -lgmock
> checking for c++ includes(gtest/gtest.h, gmock/gmock.h)
> checking for c++ links(gtest, gmock)
> checking for c++ snippet(test)
  => install gtest v1.15.2 .. ok
checking for the c++ compiler (cxx) ... clang++
checking for flags (-fvisibility-inlines-hidden) ... ok
> clang++ "-fvisibility-inlines-hidden" "-Qunused-arguments" "-isysroot" "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"
checking for flags (-O0) ... ok
> clang++ "-O0" "-Qunused-arguments" "-isysroot" "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"
checking for flags (-std=c++20) ... ok
> clang++ "-std=c++20" "-Qunused-arguments" "-isysroot" "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"
[ 50%]: cache compiling.debug main.cpp
/opt/homebrew/opt/llvm/bin/clang++ -c -Qunused-arguments -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -g -O0 -std=c++20 -isystem /Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/include -o build/.objs/googletest-example/macosx/arm64/debug/main.cpp.o main.cpp
checking for flags (-MMD -MF) ... ok
> clang++ "-MMD" "-MF" "/dev/null" "-Qunused-arguments" "-isysroot" "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"
checking for the linker (ld) ... clang++
[ 75%]: linking.debug googletest-example
/opt/homebrew/opt/llvm/bin/clang++ -o build/googletest-example build/.objs/googletest-example/macosx/arm64/debug/main.cpp.o -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -lz -L/Users/yhsb/.xmake/packages/g/gtest/v1.15.2/b1d986ed9e4e4fad87d9ee0063ede5e8/lib -lgtest -lgmock

build cache stats:
cache directory: /Users/yhsb/Documents/dev/cpp/cpp-examples/examples/googletest/build/.build_cache
cache hit rate: 0%
cache hit: 0
cache hit total time: 0.000s
cache miss: 4
cache miss total time: 0.003s
new cached files: 4
remote cache hit: 0
remote new cached files: 0
preprocess failed: 0
compile fallback count: 0
compile total time: 1.155s

create ok!
compile_commands.json updated!
[100%]: build ok, spent 0.777s
@yh-sb yh-sb added the bug label Jan 4, 2025
@waruqi
Copy link
Member

waruqi commented Jan 4, 2025

you should use xmake f --toolchain=llvm to switch to llvm-ar

@yh-sb
Copy link
Contributor Author

yh-sb commented Jan 8, 2025

Don't you think that, if xmake detects toolchain from /opt/homebrew/opt/llvm/bin then archiver also should be used from it? Not the external one from different toolchain.

@waruqi
Copy link
Member

waruqi commented Jan 8, 2025

xmake has many toolchains that use clang, such as llvm, clang, mingw/clang, and they all have some differences in use.

You cannot accurately determine what toolchain to use by setting $CC/$CXX. In xmake, if you set environment variables such as $CC, it means that you need complete fine-grained control of all toolchains. You need to specify $AR yourself to configure and use ar or llvm-ar. .

If you want to use toolchains such as llvm-ar llvm/clang, use --toolchain=llvm to switch the entire toolchain. Instead of switching through $CC.

@yh-sb
Copy link
Contributor Author

yh-sb commented Jan 8, 2025

Will you approve the pull request if it includes the following logic:

Take the path to the detected toolchain (CC or CXX), and when attempting to locate ar or another executable, first look for it in the same directory as the detected toolchain?

@waruqi
Copy link
Member

waruqi commented Jan 9, 2025

But this is difficult to implement, currently the parsing of $CC is delayed. We can't handle them in on_load.

https://github.com/xmake-io/xmake/blob/dev/xmake/toolchains/envs/xmake.lua

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants