Commit Graph

85 Commits

Author SHA1 Message Date
Nirbheek Chauhan d5f7ba862b gnome.mkenums: Use absolute paths for all commandline args
Closes #973

test cases/vala/8 generated sources/ tests this.
2016-12-15 14:58:43 +05:30
Jussi Pakkanen f62f730821 Merge pull request #1126 from mesonbuild/sharedmodule
Support for shared modules
2016-12-07 21:49:16 +02:00
Jussi Pakkanen dc1f537fb3 Skip shared module test on VS because it fails for some reason nobody understands. 2016-12-07 00:30:28 +02:00
Jussi Pakkanen 59fdb1b9ff Add unresolved symbol arg to link line in VS backends. For some
reason VS does not pick it up even though it is visible in the linker
option box.
2016-12-06 21:35:31 +02:00
Nirbheek Chauhan b9a7c0cf39 misc: Use relative imports everywhere
Using 'mesonbuild' as the module can cause it to use the
system-installed module and can also break if we rename the directory,
so avoid that by always using relative imports.
2016-12-07 00:24:17 +05:30
Thibault Saunier 85a0cd7635 Add new add_project_[link]_args functions
Fixes 979
2016-11-12 17:34:06 -05:00
Nirbheek Chauhan 00dc929b62 vs: Properly split per-compiler args into per-file options
Previously we were just dumping all defines and include directories into
the target-wide list of defines and include directories. Now we have
separate per-target and per-file (actually per-language) arguments,
defines, and include directories.
2016-11-10 00:40:16 +05:30
Nirbheek Chauhan 419b84784f CustomTarget: Use get_outputs() instead of get_filename()
get_filename() made no sense for CustomTarget since it can have multiple
outputs. Also use get_outputs() for GeneratedList since it has the same
meaning and remove unused set_generated().

As a side-effect, we now install all the outputs of a CustomTarget.
2016-10-19 20:42:11 +05:30
Elliott Sales de Andrade 4c71695e41 Use context manager for file I/O.
There are a few cases where a context manager cannot be used, such as
the logger.
2016-08-27 18:29:55 -04:00
Nirbheek Chauhan 2d05008956 vs: Fix quoting and escaping of compiler options
Target-specific compiler options should be split into pre-processor
defines, include directories, and additional options, then
escaped/quoted and added to the appropriate portions of the project
file.

The "115 spaces backslash" test now checks that backslashes and spaces
now work properly in all three places.
2016-07-29 19:51:10 +05:30
Nirbheek Chauhan 129ce6800c vs: Fix visual studio version in solution file (#648) 2016-07-18 23:59:09 +03:00
Nirbheek Chauhan 6660837953 vs: Target platform is not always Win32
It depends on the target machine. Without this building for 64-bit fails
when using external dependencies.
2016-07-11 17:11:49 +05:30
Nirbheek Chauhan 6bb9805749 vs: Don't re-add pre-existing include dirs
Reduces noise in the vcxproj files
2016-07-01 20:50:47 +05:30
Nirbheek Chauhan afca987e94 vs: Fix usage of mesonlib.File.rel_to_builddir with generated files
It should always be passed build_to_src otherwise the path for generated
files will always be wrong. Passing the vcxproj path as the build_to_src
only works for files in the source tree.
2016-07-01 20:50:47 +05:30
Nirbheek Chauhan 2535364751 vs: Explain path-conversion variables
It's not easy to understand what these variables mean and what they're
used for without some comments
2016-07-01 20:50:47 +05:30
Nirbheek Chauhan 761ac8d8c4 vs: Add support for the 'vs_module_defs' shared_library kwarg 2016-07-01 20:50:47 +05:30
Nirbheek Chauhan f54e07bcd8 vs: Fix the path of customtarget generated sources
The path is relative to the vcxproj file, not relative to the build root
2016-07-01 20:50:47 +05:30
Nirbheek Chauhan 23d29ffb14 vs: Set all compiler/linker options correctly
These need to be set via XML tags and not passed directly as
AdditionalOptions. Otherwise the project will end up with inconsistent
compiler options and the build will fail.

Since Meson internals assume that these will be set via a command-line
invocation, we need to detect the presence of various flags in
buildtype_args and buildtype_link_args and set the correct options in
the vcxproj file.

Note that this means different configurations (debug/release/etc) cannot
be enumerated in the vcxproj/sln files and chosen by the user at build
time because arbitrary build characteristics can depend on that. The
only way to support that is by doing a full parse and conversion of
Meson build files (for all build options) to vcxproj files.
2016-07-01 20:50:47 +05:30
Nirbheek Chauhan 2f8eaa6ed4 vs: Fix paths of internal library dependencies
They are relative to the path of the vcxproj file, not relative to build root
2016-07-01 20:50:47 +05:30
Nirbheek Chauhan 1481715618 vs: Add libraries, library paths, and link args needed by dependencies
The link arguments for each dependency are split into these three and
added to the vcxproj file. Without this targets cannot find the external
dependencies.
2016-07-01 20:50:47 +05:30
Nirbheek Chauhan f564bf9af0 vs: Add include dirs required by dependencies
Also ensure that they're translated from UNIX to native as required
2016-07-01 20:50:47 +05:30
Nirbheek Chauhan 80486563bf vs: Set TargetName/TargetExt correctly
Without this the filename set by the user and Meson is completely ignored
2016-07-01 20:50:47 +05:30
Nirbheek Chauhan 0143c32c7c Overhaul versioning and naming of libraries
This commit contains several changes to the naming and versioning of
shared and static libraries. The details are documented at:
https://github.com/mesonbuild/meson/pull/417

Here's a brief summary:

* The results of binary and compiler detection via environment functions
  are now cached so that they can be called repeatedly without
  performance penalty. This is necessary because every
  build.SharedLibrary object has to know whether the compiler is MSVC or
  not (output filenames depend on that), and so the compiler detection
  has to be called for each object instantiation.

* Linux shared libraries don't always have a library version. Sometimes
  only soversions are specified (and vice-versa), so support both.

* Don't use versioned filenames when generating DLLs, DLLs are never
  versioned using the suffix in the way that .so libraries are. Hence,
  they don't use "aliases". Only Linux shared libraries use those.

* OS X dylibs do not use filename aliases at all. They only use the
  soversion in the dylib name (libfoo.X.dylib), and that's it. If
  there's no soversion specified, the dylib is called libfoo.dylib.
  Further versioning in dylibs is supposed to be done with the
  -current_version argument to clang, but this is TBD.

  https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/DynamicLibraryDesignGuidelines.html#//apple_ref/doc/uid/TP40002013-SW23

* Install DLLs into bindir and import libraries into libdir

* Static libraries are now always called libfoo.a, even with MSVC

* .lib import libraries are always generated when building with MSVC

* .dll.a import libraries are always generated when building with
  MinGW/GCC or MinGW/clang

* TODO: Use dlltool if available to generate .dll.a when .lib is
  generated and vice-versa.

* Library and executable suffix/prefixes are now always correctly
  overriden by the values of the 'name_prefix' and 'name_suffix' keyword
  arguments.
2016-07-01 20:50:47 +05:30
Nirbheek Chauhan b1077dded7 vs backends: Translate unix link and compile flags (#603) 2016-06-17 22:24:43 +03:00
Nicolas Schneider fba749fcb7 extract vs2015backend into own file 2016-05-30 22:00:20 +02:00
Nicolas Schneider d34d85b0f5 vs2015: fix object generators 2016-05-30 21:49:37 +02:00
Nicolas Schneider 3bedca0257 add vs2015 backend 2016-05-30 21:49:35 +02:00
Nicolas Schneider a29d9c2c33 vs: fix generators that use indexed output replacements (like @OUTPUT0@) 2016-05-26 13:08:33 +02:00
Jussi Pakkanen 2e2df70dd0 Merge branch 'centricular-customtarget-path-windows' 2016-05-01 18:39:45 +03:00
Nicolas Schneider 985ea50944 vs2010: add object files from custom_target to project
Object files from a custom_target are like external objects and must be
added to the project.
Object files from a generator are automatically used by MSBuild, since they
are part of the CustomBuildStep and thus part of the same project as the
current build target.
2016-04-19 23:25:45 +02:00
Nicolas Schneider 060f195fe0 vs2010: add generated libs as link dependencies 2016-04-19 23:25:45 +02:00
Nicolas Schneider 1ccb4b3a51 vs2010: add dirs of custom_target generated files to include dirs 2016-04-19 23:25:45 +02:00
Nirbheek Chauhan 86aa51232e backends: Don't duplicate test setup data file name
Instead, return the values of the test and benchmark setup data files so
that the ninja/osx/vs backends can use those filenames instead of
hard-coding them.
2016-04-15 05:49:42 +05:30
Jussi Pakkanen cab5ce4fc0 Merge pull request #438 from trhd/testing_options
New options for controlling test output.
2016-04-06 23:10:20 +03:00
Nicolas Schneider 536edb65d6 vs2010: replace " with \" in /D command line args
The /D switch strips any quotes except when they are escaped.
2016-04-06 22:10:29 +03:00
Hemmo Nieminen 336904b553 Move MesonException from coredata to mesonlib. 2016-04-01 00:52:45 +03:00
Jussi Pakkanen 5bb94b901d Merge pull request #486 from nioncode/vs-transitivedeps
vs2010: fix transitive dependencies
2016-03-31 22:20:19 +03:00
Nicolas Schneider b970ef692f vs2010: add extra_files to project 2016-03-30 12:38:28 +02:00
Nicolas Schneider 33e842e50a vs2010: fix transitive dependencies 2016-03-30 00:35:07 +02:00
Jussi Pakkanen f3386d10c3 Merge branch 'vs-privinc' 2016-03-29 22:50:15 +03:00
Jussi Pakkanen 833520afb5 Merge branch 'vs-fixinclude' 2016-03-29 22:45:45 +03:00
Jussi Pakkanen 1d89d091f8 Merge branch 'vs-extraargs' 2016-03-29 22:32:48 +03:00
Jussi Pakkanen 5ea24bafdd Merge branch 'samename' 2016-03-29 22:25:16 +03:00
Nicolas Schneider a33d9d56cf vs2010: support EXTRA_ARGS for generators 2016-03-29 12:08:34 +02:00
Nicolas Schneider c2a9f81b68 vs2010: fix generated files' path
Generated files should always come with the correct relative path set,
so we don't have to modify it at all.
2016-03-29 12:08:34 +02:00
Nicolas Schneider ba8b650cda vs2010: fix relative path to target private dir for generators
backend.get_target_private_dir() includes the target directory in the path.
However, we want to treat all paths relative from the target directory,
because that's where our VS project file lives in.
2016-03-29 12:08:34 +02:00
Nicolas Schneider 330be891c1 vs2010: fix generator command
A shebang line on Windows will be resolved to [binary, script_path].
Thus, we need to use both instead of just taking the first element of the
command.
2016-03-29 12:08:09 +02:00
Nicolas Schneider 30e2a5feae vs2010: fix include directories
Everything in the VS project file is relative to the project file itself.
The project file gets put in the target.subdir, so to include files from
there we just need to use '.'. To include from the private dir, we
need to use the relative path from the target dir to the target private
dir.
2016-03-29 11:50:50 +02:00
Nicolas Schneider 9c17f0cd93 vs2010: support private include dirs 2016-03-29 11:49:40 +02:00
Nicolas Schneider fd8180ddcb move source file conflict detection into Vs2010 backend 2016-03-28 14:42:52 +02:00