aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClausKlein <claus.klein@arcormail.de>2020-03-13 08:44:22 +0100
committerJussi Pakkanen <jpakkane@gmail.com>2020-03-19 19:11:10 +0200
commitf72c990bfd7416931508afd85a7b96d6049bada2 (patch)
treeccc80cdb3bad0416d45cb5e45bffe7aa1c8b7ce5
parent12fa8d06e214223157ba281efea4e71dc5d0997e (diff)
downloadmeson-f72c990bfd7416931508afd85a7b96d6049bada2.zip
meson-f72c990bfd7416931508afd85a7b96d6049bada2.tar.gz
meson-f72c990bfd7416931508afd85a7b96d6049bada2.tar.bz2
Use os.path.normpath() for include paths
This make relative pathes shorter an too give a chance to de-duplicate -isystem flags just like -I flags. Fix common test case 203 for OSX build host too
-rw-r--r--mesonbuild/backend/ninjabackend.py9
-rw-r--r--mesonbuild/mesonlib.py2
-rw-r--r--test cases/common/203 function attributes/meson.build2
3 files changed, 9 insertions, 4 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index c80d832..68af1af 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -2013,7 +2013,8 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485'''))
# own target build dir.
if not isinstance(i, (build.CustomTarget, build.CustomTargetIndex)):
continue
- idir = self.get_target_dir(i)
+ # NOTE: if we want to use os.path.realpath() for include path only! CK
+ idir = os.path.normpath(self.get_target_dir(i))
if not idir:
idir = '.'
if idir not in custom_target_include_dirs:
@@ -2027,10 +2028,12 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485'''))
def generate_inc_dir(self, compiler, d, basedir, is_system):
# Avoid superfluous '/.' at the end of paths when d is '.'
if d not in ('', '.'):
- expdir = os.path.join(basedir, d)
+ # NOTE: if we want to use os.path.realpath() for include path only! CK
+ expdir = os.path.normpath(os.path.join(basedir, d))
else:
expdir = basedir
- srctreedir = os.path.join(self.build_to_src, expdir)
+ # NOTE: if we want to use os.path.realpath() for include path only! CK
+ srctreedir = os.path.normpath(os.path.join(self.build_to_src, expdir))
sargs = compiler.get_include_args(srctreedir, is_system)
# There may be include dirs where a build directory has not been
# created for some source dir. For example if someone does this:
diff --git a/mesonbuild/mesonlib.py b/mesonbuild/mesonlib.py
index e215dcd..b3f1629 100644
--- a/mesonbuild/mesonlib.py
+++ b/mesonbuild/mesonlib.py
@@ -270,8 +270,10 @@ class File:
def rel_to_builddir(self, build_to_src: str) -> str:
if self.is_built:
return self.relative_name()
+ #NO! return os.path.realpath(self.relative_name())
else:
return os.path.join(build_to_src, self.subdir, self.fname)
+ #NO! return os.path.realpath(os.path.join(build_to_src, self.subdir, self.fname))
@lru_cache(maxsize=None)
def absolute_path(self, srcdir: str, builddir: str) -> str:
diff --git a/test cases/common/203 function attributes/meson.build b/test cases/common/203 function attributes/meson.build
index 69228e6..9ec948f 100644
--- a/test cases/common/203 function attributes/meson.build
+++ b/test cases/common/203 function attributes/meson.build
@@ -31,7 +31,6 @@ expected_result = not ['msvc', 'clang-cl', 'intel-cl'].contains(c.get_id())
# figure that out except by running the code we're trying to test.
attributes = [
'aligned',
- 'alloc_size',
'always_inline',
'cold',
'const',
@@ -65,6 +64,7 @@ endif
if host_machine.system() != 'darwin'
attributes += 'alias'
attributes += 'visibility'
+ attributes += 'alloc_size'
endif
if ['gcc', 'intel'].contains(c.get_id())