Permalink
Browse files
vala: Only add --use-header for unity builds
- Loading branch information...
|
|
@@ -1100,7 +1100,13 @@ def generate_vala_compile(self, target, outfile): |
|
|
args += ['--library=' + target.name]
|
|
|
# Outputted header
|
|
|
hname = os.path.join(self.get_target_dir(target), target.vala_header)
|
|
|
- args += ['-H', hname, '--use-header']
|
|
|
+ args += ['-H', 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
|
|
|
+ # #include-d in one .c file.
|
|
|
+ # https://github.com/mesonbuild/meson/issues/1969
|
|
|
+ args += ['--use-header']
|
|
|
valac_outputs.append(hname)
|
|
|
# Outputted vapi file
|
|
|
vapiname = os.path.join(self.get_target_dir(target), target.vala_vapi)
|
|
|
|
|
|
@@ -1,4 +1,12 @@ |
|
|
-l = shared_library('valalib', 'mylib.vala', dependencies : valadeps)
|
|
|
+args = []
|
|
|
+# https://github.com/mesonbuild/meson/issues/1969
|
|
|
+if get_option('unity') == 'on'
|
|
|
+ vala_args = ['-H', 'mylib.h']
|
|
|
+endif
|
|
|
+
|
|
|
+l = shared_library('valalib', 'mylib.vala',
|
|
|
+ vala_args : args,
|
|
|
+ dependencies : valadeps)
|
|
|
|
|
|
shared_library('installed_vala_lib', 'mylib.vala',
|
|
|
dependencies : valadeps,
|
|
|
|
0 comments on commit
185808b