xmake-io / xmake

🔥 A cross-platform build utility based on Lua
https://xmake.io
Apache License 2.0
10.14k stars 782 forks source link

wrong include flag when using system llvm #5468

Closed ilobilo closed 3 months ago

ilobilo commented 3 months ago

Xmake Version

2.9.3

Operating System Version and Architecture

Fedora 40

Describe Bug

when using add_requires("llvm") and add_packages("llvm") in a target, during C++ module dependency scanning, xmake adds -isystem /usr/include to compiler flags (because llvm headers are located there), that causes the compilation to fail on both libstdcxx and libcxx. Example: image image

Expected Behavior

do not add -isystem /usr/include

Project Configuration

-- ...
add_requires("llvm", { system = true, kind = "library" })
-- ...
target("...")
-- ...
    add_packages("llvm")
-- ...

Additional Information and Error Logs

screenshots provided above

waruqi commented 3 months ago

you can set system = false to disable system library. or set external = false to use -I/usr/include instead of -isystem

ilobilo commented 3 months ago

external = false did the trick, thanks!