Re: [Vala] Why valac is always called even if conditional automake clause is false?



Well your conditionals seem to be Ok.

You may try to put all code in same directory or keep in subdirs, using
conditionals avoiding build them, as a libraries to specific platform if
they are implementation of your interfaces, install per platform and use in
your code, witch I think is using, not defined in your Makefile, -D
directives to valac in order to create platform specific objects
implementing your interfaces.
El ene. 16, 2016 9:00 AM, "marcin saepia net" <marcin saepia net> escribió:

Here are definitons of my conditionals:
https://gist.github.com/mspanc/2e1432ff23f7dfb7bb20

These C files are not C files generated by vala, it's a different code.

The whole thing is that I want to avoid having them in the same file and
using conditionals because that makes code really big & unreadable. If
that's the only solution I can make it but the whole point was to keep the
platform-specific code in separate, conditionally compiled files.

m.

2016-01-16 14:51 GMT+01:00 Daniel Espinosa <esodan gmail com>:

May be if you post your configure.ac conditionals  could help.

General comments:

* you are including some subdir sources, I not sure, but may you should
rename your source files to include them in same directory.

* you include some C files that will be generated by Vala, may you need
to avoid that.

* you have interfaces files with the same name, may be an extension per
platform? If so may is better to add conditionals to VALAFLAGS per
platform, using -D, and keep all code in the same file.
El ene. 15, 2016 12:22 PM, "marcin saepia net" <marcin saepia net>
escribió:

Hello,

I have the following makefile that is responsible for conditional
compilation of one subdir of my project depending on the platform used:
https://gist.github.com/mspanc/5b31758b966fa6eab959

I am using automake's AM_CONDITIONAL to pass information about operating
system to further scripts.

It works (almost) well, the code compiles, but I've noticed that when I
call make in this subdir, it calls valac for all source files, even these
not matched by current condition:

$ make
rm -f libwhatever_common_media_audio_la_vala.stamp && echo stamp >
libwhatever_common_media_audio_la_vala.stamp-t
CDPATH="${ZSH_VERSION+.}:" && cd . && /usr/local/bin/valac --library
libwhatever-common-1.0-media-audio --vapi
libwhatever-common-1.0-media-audio.vapi -H media-audio.h
--enable-experimental --enable-experimental-non-null  -D PLATFORM_DARWIN
-C lifecycle.vala base_interface_monitor.vala
base_polling_interface_monitor.vala interface_monitor.vala
windows/lifecycle.vapi windows/interface_list.vapi
windows/interface_monitor.vala darwin/interface_list.vapi
darwin/interface_monitor.vala linux/interface_monitor.vala

(here should exclude windows/ and linux/ subdir as it was called on mac)

VALAFLAGS are set correctly, so conditionals are working fine for other
cases.

How to prevent this?

Is it a bug in automake's vala extensions or am I doing something wrong?

Thanks,

Marcin
_______________________________________________
vala-list mailing list
vala-list gnome org
https://mail.gnome.org/mailman/listinfo/vala-list





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]