aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.appveyor.yml5
-rw-r--r--docs/markdown/FAQ.md2
-rw-r--r--docs/markdown/Gnome-module.md25
-rw-r--r--mesonbuild/backend/ninjabackend.py15
-rw-r--r--mesonbuild/dependencies/dev.py2
-rw-r--r--mesonbuild/dependencies/misc.py6
-rw-r--r--mesonbuild/scripts/gettext.py5
-rwxr-xr-xmsi/createmsi.py16
-rw-r--r--test cases/vala/22 same target in directories/Subdir/Subdir2/Test.vala5
-rw-r--r--test cases/vala/22 same target in directories/Subdir/Test.vala5
-rw-r--r--test cases/vala/22 same target in directories/Subdir2/Test.vala5
-rw-r--r--test cases/vala/22 same target in directories/Test.vala5
-rw-r--r--test cases/vala/22 same target in directories/meson.build13
-rw-r--r--test cases/vala/22 same target in directories/prog.vala8
14 files changed, 79 insertions, 38 deletions
diff --git a/.appveyor.yml b/.appveyor.yml
index d150c42..c0edf5c 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -85,7 +85,10 @@ install:
- cmd: if %compiler%==cygwin ( %WRAPPER% which %PYTHON% ) else ( where %PYTHON% )
# Install additional packages needed for specific builds.
- - ps: If($Env:compiler -eq 'msys2-mingw') {(new-object Net.WebClient).DownloadFile('https://bootstrap.pypa.io/get-pip.py', 'C:\projects\meson\get-pip.py')}
+ # This was originally downloaded from http://bootstrap.pypa.io/get-pip.py,
+ # but they have a broken certificate (on Windows) and an HSTS policy that
+ # forces usage of HTTPS, so we mirror our own copy.
+ - ps: If($Env:compiler -eq 'msys2-mingw') {(new-object Net.WebClient).DownloadFile('https://nirbheek.in/files/meson/get-pip.py', 'C:\projects\meson\get-pip.py')}
- cmd: if %compiler%==msys2-mingw ( %PYTHON% "C:\projects\meson\get-pip.py" )
- cmd: if %compiler%==cygwin ( call ci\appveyor-install.bat )
- ps: |
diff --git a/docs/markdown/FAQ.md b/docs/markdown/FAQ.md
index 2d28137..2023c7e 100644
--- a/docs/markdown/FAQ.md
+++ b/docs/markdown/FAQ.md
@@ -144,7 +144,7 @@ This defaults to `c++11` on GCC compilers. Suppose you want to use `c++14` inste
project('foobar', 'cpp', default_options : ['cpp_std=c++14'])
```
-But when you recompile, it still uses `c++11`. The reason for this is that default options are only looked at when you are setting up a build directory for the very first time. After that the setting is considered to have a value and thus the default value is ignored. To change an existing build dir to `c++14`, either reconfigure your build dir with `mesonconf` or delete the build dir and recreate it from scratch.
+But when you recompile, it still uses `c++11`. The reason for this is that default options are only looked at when you are setting up a build directory for the very first time. After that the setting is considered to have a value and thus the default value is ignored. To change an existing build dir to `c++14`, either reconfigure your build dir with `meson configure` or delete the build dir and recreate it from scratch.
## Does wrap download sources behind my back?
diff --git a/docs/markdown/Gnome-module.md b/docs/markdown/Gnome-module.md
index d87e108..9697b7f 100644
--- a/docs/markdown/Gnome-module.md
+++ b/docs/markdown/Gnome-module.md
@@ -30,29 +30,19 @@ file called `foobar.h`, which you can then include in your sources.
* `c_name`: passed to the resource compiler as an argument after
`--c-name`
-
* `dependencies`: extra targets to depend upon for building
-
* `export`: (*Added 0.37.0*) if true, export the symbols of the
generated sources
-
* `extra_args`: extra command line arguments to pass to the resource
-
* `gresource_bundle`: (*Added 0.37.0*) if true, output a `.gresource`
file instead of source
-
* `install`: (*Added 0.37.0*) if true, install the gresource file
-
* `install_dir`: (*Added 0.37.0*) location to install the header or
bundle depending on previous options
-
* `install_header`: (*Added 0.37.0*) if true, install the header file
-
* `source_dir`: a list of subdirectories where the resource compiler
should look up the files, relative to the location of the XML file
- compiler
-
Returns an array containing: `[c_source, header_file]` or
`[gresource_bundle]`
@@ -64,39 +54,24 @@ keyword arguments. Many of these map directly to the `g-ir-scanner`
tool so see its documentation for more information.
* `dependencies`: deps to use during introspection scanning
-
* `extra_args`: command line arguments to pass to gir compiler
-
* `export_packages`: extra packages the gir file exports
-
* `sources`: the list of sources to be scanned for gir data
-
* `nsversion`: namespace version
-
* `namespace`: the namespace for this gir object which determines
output files
-
* `identifier_prefix`: the identifier prefix for the gir object,
e.g. `Gtk`
-
* `includes`: list of gir names to be included, can also be a GirTarget
-
* `header`: *(Added 0.43.0)* name of main c header to include for the library, e.g. `glib.h`
-
* `dependencies`: deps to use during introspection scanning
-
* `include_directories`: extra include paths to look for gir files
-
* `install`: if true, install the generated files
-
* `install_dir_gir`: (*Added 0.35.0*) which directory to install the
gir file into
-
* `install_dir_typelib`: (*Added 0.35.0*) which directory to install
the typelib file into
-
* `link_with`: list of libraries to link with
-
* `symbol_prefix`: the symbol prefix for the gir object, e.g. `gtk`
Returns an array of two elements which are: `[gir_target,
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index 2e6e351..bb281e1 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -1131,9 +1131,13 @@ int dummy;
# file is outside the build directory, the path components will be
# stripped and just the basename will be used.
if isinstance(gensrc, (build.CustomTarget, build.GeneratedList)) or gensrc.is_built:
- vala_c_file = os.path.splitext(vala_file)[0] + '.c'
- else:
vala_c_file = os.path.splitext(os.path.basename(vala_file))[0] + '.c'
+ else:
+ path_to_target = os.path.join(self.build_to_src, target.get_subdir())
+ if vala_file.startswith(path_to_target):
+ vala_c_file = os.path.splitext(os.path.relpath(vala_file, path_to_target))[0] + '.c'
+ else:
+ vala_c_file = os.path.splitext(os.path.basename(vala_file))[0] + '.c'
# All this will be placed inside the c_out_dir
vala_c_file = os.path.join(c_out_dir, vala_c_file)
vala_c_src.append(vala_c_file)
@@ -1144,13 +1148,14 @@ int dummy;
# Tell Valac to output everything in our private directory. Sadly this
# means it will also preserve the directory components of Vala sources
# found inside the build tree (generated sources).
- args += ['-d', c_out_dir]
+ args += ['--directory', c_out_dir]
+ args += ['--basedir', os.path.join(self.build_to_src, target.get_subdir())]
if not isinstance(target, build.Executable):
# Library name
- args += ['--library=' + target.name]
+ args += ['--library', target.name]
# Outputted header
hname = os.path.join(self.get_target_dir(target), target.vala_header)
- args += ['-H', hname]
+ args += ['--header', hname]
if self.is_unity(target):
# Without this the declarations will get duplicated in the .c
# files and cause a build failure when all of them are
diff --git a/mesonbuild/dependencies/dev.py b/mesonbuild/dependencies/dev.py
index 387300a..b0e54c6 100644
--- a/mesonbuild/dependencies/dev.py
+++ b/mesonbuild/dependencies/dev.py
@@ -169,7 +169,7 @@ class LLVMDependency(ExternalDependency):
self.version = out.strip().rstrip('svn')
p, out = Popen_safe(
- [self.llvmconfig, '--libs', '--ldflags', '--system-libs'])[:2]
+ [self.llvmconfig, '--libs', '--ldflags'])[:2]
if p.returncode != 0:
raise DependencyException('Could not generate libs for LLVM.')
self.link_args = shlex.split(out)
diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py
index a0d5e47..e00897d 100644
--- a/mesonbuild/dependencies/misc.py
+++ b/mesonbuild/dependencies/misc.py
@@ -82,9 +82,6 @@ class BoostDependency(ExternalDependency):
if 'BOOST_LIBRARYDIR' in os.environ:
self.libdir = os.environ['BOOST_LIBRARYDIR']
- if self.want_cross and self.boost_root is None and self.incdir is None:
- raise DependencyException('BOOST_ROOT or BOOST_INCLUDEDIR is needed while cross-compiling')
-
if self.boost_root is None:
if mesonlib.is_windows():
self.boost_roots = self.detect_win_roots()
@@ -131,7 +128,8 @@ class BoostDependency(ExternalDependency):
mlog.log('Dependency Boost (%s) found:' % module_str, mlog.green('YES'), info)
def detect_nix_roots(self):
- return ['/usr/local', '/usr']
+ return [os.path.abspath(os.path.join(x, '..'))
+ for x in self.compiler.get_default_include_dirs()]
def detect_win_roots(self):
res = []
diff --git a/mesonbuild/scripts/gettext.py b/mesonbuild/scripts/gettext.py
index ef4f42a..30ac54c 100644
--- a/mesonbuild/scripts/gettext.py
+++ b/mesonbuild/scripts/gettext.py
@@ -70,7 +70,10 @@ def update_po(src_sub, pkgname, langs):
potfile = os.path.join(src_sub, pkgname + '.pot')
for l in langs:
pofile = os.path.join(src_sub, l + '.po')
- subprocess.check_call(['msgmerge', '-q', '-o', pofile, pofile, potfile])
+ if os.path.exists(pofile):
+ subprocess.check_call(['msgmerge', '-q', '-o', pofile, pofile, potfile])
+ else:
+ subprocess.check_call(['msginit', '--input', potfile, '--output-file', pofile, '--locale', l, '--no-translator'])
return 0
def do_install(src_sub, bld_sub, dest, pkgname, langs):
diff --git a/msi/createmsi.py b/msi/createmsi.py
index dd92e50..c045a3e 100755
--- a/msi/createmsi.py
+++ b/msi/createmsi.py
@@ -47,8 +47,10 @@ class PackageGenerator:
self.staging_dirs = ['dist', 'dist2']
if self.bytesize == 64:
self.progfile_dir = 'ProgramFiles64Folder'
+ self.redist_path = 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Redist\\MSVC\\14.11.25325\\MergeModules\\Microsoft_VC141_CRT_x64.msm'
else:
self.progfile_dir = 'ProgramFilesFolder'
+ self.redist_path = 'c:\\Program Files\\Microsoft Visual Studio\\2017\\Community\\VC\\Redist\\MSVC\\14.11.25325\\MergeModules\\Microsoft_VC141_CRT_x86.msm'
self.component_num = 0
self.feature_properties = {
self.staging_dirs[0]: {
@@ -141,6 +143,12 @@ class PackageGenerator:
'Id': 'INSTALLDIR',
'Name': 'Meson',
})
+ ET.SubElement(installdir, 'Merge', {
+ 'Id': 'VCRedist',
+ 'SourceFile': self.redist_path,
+ 'DiskId': '1',
+ 'Language': '0',
+ })
ET.SubElement(product, 'Property', {
'Id': 'WIXUI_INSTALLDIR',
@@ -166,6 +174,14 @@ class PackageGenerator:
nodes[root] = cur_node
self.create_xml(nodes, sd, installdir, sd)
self.build_features(nodes, top_feature, sd)
+ vcredist_feature = ET.SubElement(top_feature, 'Feature', {
+ 'Id': 'VCRedist',
+ 'Title': 'Visual C++ runtime',
+ 'AllowAdvertise': 'no',
+ 'Display': 'hidden',
+ 'Level': '1',
+ })
+ ET.SubElement(vcredist_feature, 'MergeRef', {'Id': 'VCRedist'})
ET.ElementTree(self.root).write(self.main_xml, encoding='utf-8', xml_declaration=True)
# ElementTree can not do prettyprinting so do it manually
import xml.dom.minidom
diff --git a/test cases/vala/22 same target in directories/Subdir/Subdir2/Test.vala b/test cases/vala/22 same target in directories/Subdir/Subdir2/Test.vala
new file mode 100644
index 0000000..94e5cbc
--- /dev/null
+++ b/test cases/vala/22 same target in directories/Subdir/Subdir2/Test.vala
@@ -0,0 +1,5 @@
+public class Subdir.Subdir2.Test : GLib.Object {
+ construct {
+ stdout.printf("Test from Subdir/Subdir2/\n");
+ }
+}
diff --git a/test cases/vala/22 same target in directories/Subdir/Test.vala b/test cases/vala/22 same target in directories/Subdir/Test.vala
new file mode 100644
index 0000000..02143c4
--- /dev/null
+++ b/test cases/vala/22 same target in directories/Subdir/Test.vala
@@ -0,0 +1,5 @@
+public class Subdir.Test : GLib.Object {
+ construct {
+ stdout.printf("Test from Subdir/\n");
+ }
+}
diff --git a/test cases/vala/22 same target in directories/Subdir2/Test.vala b/test cases/vala/22 same target in directories/Subdir2/Test.vala
new file mode 100644
index 0000000..4a2d61f
--- /dev/null
+++ b/test cases/vala/22 same target in directories/Subdir2/Test.vala
@@ -0,0 +1,5 @@
+public class Subdir2.Test : GLib.Object {
+ construct {
+ stdout.printf("Test from Subdir2/\n");
+ }
+}
diff --git a/test cases/vala/22 same target in directories/Test.vala b/test cases/vala/22 same target in directories/Test.vala
new file mode 100644
index 0000000..9154e22
--- /dev/null
+++ b/test cases/vala/22 same target in directories/Test.vala
@@ -0,0 +1,5 @@
+public class Test : GLib.Object {
+ construct {
+ stdout.printf("Test from main directory\n");
+ }
+}
diff --git a/test cases/vala/22 same target in directories/meson.build b/test cases/vala/22 same target in directories/meson.build
new file mode 100644
index 0000000..6785f73
--- /dev/null
+++ b/test cases/vala/22 same target in directories/meson.build
@@ -0,0 +1,13 @@
+project('valatest', 'vala', 'c')
+
+valadeps = [dependency('glib-2.0'), dependency('gobject-2.0')]
+valafiles = files(
+ 'prog.vala',
+ 'Test.vala',
+ 'Subdir/Test.vala',
+ 'Subdir/Subdir2/Test.vala',
+ 'Subdir2/Test.vala',
+)
+
+e = executable('multidir_prog', valafiles, dependencies : valadeps)
+test('valatest', e)
diff --git a/test cases/vala/22 same target in directories/prog.vala b/test cases/vala/22 same target in directories/prog.vala
new file mode 100644
index 0000000..37cbf7a
--- /dev/null
+++ b/test cases/vala/22 same target in directories/prog.vala
@@ -0,0 +1,8 @@
+int main() {
+ var test1 = new Test ();
+ var test2 = new Subdir.Test ();
+ var test3 = new Subdir2.Test ();
+ var test4 = new Subdir.Subdir2.Test ();
+ stdout.printf("Vala is working.\n");
+ return 0;
+}