aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBarnabás Pőcze <pobrn@protonmail.com>2023-03-31 01:22:17 +0200
committerEli Schwartz <eschwartz93@gmail.com>2023-03-30 22:06:31 -0400
commitd0d22f4dede8707f6fcf3414ca6a9b391d784742 (patch)
treeb93cd9f5e5aadfd17678aa0b841b296e5888ca7c
parent410f3dfc1b76ef42275a769a794503b41ea1ae29 (diff)
downloadmeson-d0d22f4dede8707f6fcf3414ca6a9b391d784742.zip
meson-d0d22f4dede8707f6fcf3414ca6a9b391d784742.tar.gz
meson-d0d22f4dede8707f6fcf3414ca6a9b391d784742.tar.bz2
backend/vs: ensure that build dir is preferred to src dir
Previously, the VS backend would add the the include directories in the reverse order that the Ninja backend does it, which means that the source directories would be preferred over the build directories. For example, this would cause the compiler to choose the file from the source directory if a file with the same name is found in both. Fixes 57ec097b5 ("vs: Use CompilerArgs() for compile and link args") Fixes #11630
-rw-r--r--mesonbuild/backend/vs2010backend.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py
index 5718004..47e19a4 100644
--- a/mesonbuild/backend/vs2010backend.py
+++ b/mesonbuild/backend/vs2010backend.py
@@ -1070,8 +1070,9 @@ class Vs2010Backend(backends.Backend):
for i in reversed(d.get_incdirs()):
curdir = os.path.join(d.get_curdir(), i)
try:
- args.append('-I' + self.relpath(curdir, target.subdir)) # build dir
+ # Add source subdir first so that the build subdir overrides it
args.append('-I' + os.path.join(proj_to_src_root, curdir)) # src dir
+ args.append('-I' + self.relpath(curdir, target.subdir)) # build dir
except ValueError:
# Include is on different drive
args.append('-I' + os.path.normpath(curdir))