summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Poelen <[email protected]>2020-11-09 01:44:36 +0100
committerJonathan Poelen <[email protected]>2020-11-09 01:44:36 +0100
commitebfe302398df1dbe74f214e06b0b45184e84bf2b (patch)
treec09766ed86829d78de5c8578ea0b00b3df00f6ec
parent6f58d347401697543a16d0a7f93cb5b401908fb0 (diff)
toolchain: remove includedirs and linkdirs of system path
/usr/{local/,}include and /usr/{local/,}lib are in the default configuration of the compilers and forcing them to be added (before any other includes) conflicts with the project files.
-rw-r--r--xmake/toolchains/clang/xmake.lua14
-rw-r--r--xmake/toolchains/gcc/xmake.lua14
-rw-r--r--xmake/toolchains/icc/load.lua12
-rw-r--r--xmake/toolchains/xcode/load_macosx.lua5
4 files changed, 0 insertions, 45 deletions
diff --git a/xmake/toolchains/clang/xmake.lua b/xmake/toolchains/clang/xmake.lua
index b459139ac..c8e90d4e7 100644
--- a/xmake/toolchains/clang/xmake.lua
+++ b/xmake/toolchains/clang/xmake.lua
@@ -62,18 +62,4 @@ toolchain("clang")
toolchain:add("ldflags", march)
toolchain:add("shflags", march)
end
-
- -- add includedirs and linkdirs
- if not toolchain:is_plat("windows") and os.isdir("/usr") then
- for _, includedir in ipairs({"/usr/local/include", "/usr/include"}) do
- if os.isdir(includedir) then
- toolchain:add("includedirs", includedir)
- end
- end
- for _, linkdir in ipairs({"/usr/local/lib", "/usr/lib"}) do
- if os.isdir(linkdir) then
- toolchain:add("linkdirs", linkdir)
- end
- end
- end
end)
diff --git a/xmake/toolchains/gcc/xmake.lua b/xmake/toolchains/gcc/xmake.lua
index 71887a374..9365fc38b 100644
--- a/xmake/toolchains/gcc/xmake.lua
+++ b/xmake/toolchains/gcc/xmake.lua
@@ -62,18 +62,4 @@ toolchain("gcc")
toolchain:add("ldflags", march)
toolchain:add("shflags", march)
end
-
- -- add includedirs and linkdirs
- if not toolchain:is_plat("windows") and os.isdir("/usr") then
- for _, includedir in ipairs({"/usr/local/include", "/usr/include"}) do
- if os.isdir(includedir) then
- toolchain:add("includedirs", includedir)
- end
- end
- for _, linkdir in ipairs({"/usr/local/lib", "/usr/lib"}) do
- if os.isdir(linkdir) then
- toolchain:add("linkdirs", linkdir)
- end
- end
- end
end)
diff --git a/xmake/toolchains/icc/load.lua b/xmake/toolchains/icc/load.lua
index b3dbf589f..0792869e8 100644
--- a/xmake/toolchains/icc/load.lua
+++ b/xmake/toolchains/icc/load.lua
@@ -103,18 +103,6 @@ function _load_intel_on_linux(toolchain)
toolchain:add("ldflags", march)
toolchain:add("shflags", march)
end
-
- -- add includedirs and linkdirs
- for _, includedir in ipairs({"/usr/local/include", "/usr/include"}) do
- if os.isdir(includedir) then
- toolchain:add("includedirs", includedir)
- end
- end
- for _, linkdir in ipairs({"/usr/local/lib", "/usr/lib"}) do
- if os.isdir(linkdir) then
- toolchain:add("linkdirs", linkdir)
- end
- end
end
-- main entry
diff --git a/xmake/toolchains/xcode/load_macosx.lua b/xmake/toolchains/xcode/load_macosx.lua
index 1357b8c08..8b5241b45 100644
--- a/xmake/toolchains/xcode/load_macosx.lua
+++ b/xmake/toolchains/xcode/load_macosx.lua
@@ -47,11 +47,6 @@ function main(toolchain)
if xcode_sdkdir then
toolchain:add("cxflags", "-isysroot " .. xcode_sdkdir)
toolchain:add("ldflags", "-isysroot " .. xcode_sdkdir)
- else
- toolchain:add("includedirs", "/usr/local/include")
- toolchain:add("includedirs", "/usr/include")
- toolchain:add("linkdirs", "/usr/local/lib")
- toolchain:add("linkdirs", "/usr/lib")
end
toolchain:add("ldflags", "-stdlib=libc++")
toolchain:add("syslinks", "z")