Commit Graph

2276 Commits

Author SHA1 Message Date
Jussi Pakkanen 64919b1c74 Merge pull request #417 from nirbheek/dll-paths
Fix filenames and paths used in DLL shared library generation
2016-07-13 22:18:50 +03:00
Nirbheek Chauhan f8d7588372 test 60 install script: Don't install any files when using msvc
The test is stricter now and our install script doesn't work without
bash
2016-07-13 16:32:11 +05:30
Nirbheek Chauhan cc4826b85f run_tests.py: Make 'no-installed-files' stricter
When the file 'no-installed-files' is installed, require that the test
not install any other files. A test for this is pending.
2016-07-13 01:17:46 +05:30
Jussi Pakkanen 38a896ae51 Create a log file of all files installed. 2016-07-12 13:43:49 +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 358598816f build: Fix implementation of sources_are_suffix
The first file might be a header file, in which case this test will
fail, so check all the files till a match is found instead.

Also remove duplicate and incorrect can_compile check. It just checks
the suffix and we already check that above.
2016-07-05 16:24:10 +05:30
Thibault Saunier a23f577415 dependencies: Add a get_version method to Python3Dependency
Otherwise ninja files regeneration fails with:

  AttributeError: 'Python3Dependency' object has no attribute 'get_version'
2016-07-04 13:01:23 -04:00
Jussi Pakkanen d6ab5027fe Merge pull request #623 from mesonbuild/colorout
Enable colored output with GCC.
2016-07-03 02:29:50 +03:00
Jussi Pakkanen c0057da133 Can get arbitrary data from cross file properties. 2016-07-02 00:00:03 +03:00
Jussi Pakkanen a0666ebf9c Gcc versions older than 4.9 do not support color output. 2016-07-01 23:38:25 +03:00
Jussi Pakkanen 4f63fe4983 Enable colored output with GCC. Ninja redirects stdout/stderr so by default GCC thinks it is not talking to a terminal. 2016-07-01 23:18:06 +03:00
Jussi Pakkanen cc775d64c9 Merge pull request #618 from mesonbuild/rtrehaul
Rework run_target to mirror custom_target.
2016-07-01 22:45:49 +03:00
Jussi Pakkanen 70e84f9080 Use new run_target format. 2016-07-01 22:38:18 +03:00
Jussi Pakkanen 4f2b663928 Unify common code in run_target and custom_target. 2016-07-01 22:12:15 +03:00
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 0640fe0215 Add test for usage of generated File sources in libraries
This tests the previous commit:

 vs: Fix usage of mesonlib.File.rel_to_builddir with generated 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 4516e8a49f Add repr() implementations for build targets and File
This aids debugging
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 6c055c7c3c Add test for configure_file in custom target command list
This was not tested at all earlier
2016-07-01 20:50:47 +05:30
Nirbheek Chauhan 64cb70441b CustomTarget: Use mesonlib.File objects as-is in the command to be run
This allows us to output either the relative or absolute path as
requested. Fixes usage of configure_file inside CustomTarget commands
with the VS backends.
2016-07-01 20:50:47 +05:30
Nirbheek Chauhan 2e986ae30d backend: Raise a RuntimeError if an unknown object is added to the command list
This allows us to catch these errors early and print a useful message
2016-07-01 20:50:47 +05:30
Nirbheek Chauhan 8ad4779a05 Add test for installation of libraries in subprojects
The original test's subproject-install check had to be removed because
library names are now properly platform-specific
2016-07-01 20:50:47 +05:30
Nirbheek Chauhan 45c8557dc6 Fix tests for the new library/executable naming scheme
Also add new tests for the platform-specific and compiler-specific
versioning scheme.

A rough summary is:

1. A bug in how run_tests.py:validate_install checked for files has been
   fixed. Earlier it wasn't checking the install directory properly.
2. Shared libraries are no longer installed in common tests, and the
   library name/path testing is now done in platform-specific tests.
3. Executables are now always called something?exe in the
   installed_files.txt file, and the suffix automatically corrected
   depending on the platform.
4. If a test installs a file called 'no-installed-files', the installed
   files for that test are not validated. This is required to implement
   compiler-specific tests for library names/paths such as MSVC vs MinGW
5. The platform-specific file renaming in run_tests.py has been mostly
   removed since it is broken for shared libraries and isn't needed for
   static libraries.
6. run_tests.py now reports all missing and extra files. The logic for
   finding these has been reworked.
2016-07-01 20:50:47 +05:30
Nirbheek Chauhan 598997bdb5 scripts/install: Also strip '\' from the end of a path
Fixes installation of subdirs on Windows
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
Zhe Wang bc347aed0b GnuCPPCompiler: allow usage of GNU extensions (#619)
* GnuCPPCompiler: allow usage of GNU extensions

* Add myself to authors.txt
2016-06-27 19:31:07 +03:00
Jussi Pakkanen 0733c0f9a1 Changed run_target to take command as kwarg and add depends. This makes it behave the same as custom_target. 2016-06-24 23:07:57 +03:00
Jussi Pakkanen 35eb8c7b9a Added version info to sdl2dep. Closes #616. 2016-06-24 15:45:25 +03:00
Jussi Pakkanen ea4fe8e417 Run_target can run binaries obtained with find_program. 2016-06-24 15:02:43 +03:00
Nirbheek Chauhan 4934e70092 Don't pass pdb flags while linking inside compiler tests (#614)
This causes intermittent build failures in the MSVC CI because of a race
with the default anti-virus that ships with Windows while writing the
.pdb file: https://ci.appveyor.com/project/jpakkane/meson/build/1.0.58

There's a separate fix for that in the works that will fix this in the
general case, but for compiler tests we don't need to generate the pdb
file at all. So, just fetch the CRT flag (/MDd) if needed instead.

This has the side-effect of making compiler tests that use self.links
and self.run faster.
2016-06-24 13:47:47 +03:00
Jussi Pakkanen 06a5853fde Thank you ever so much Git. 2016-06-24 13:46:20 +03:00
Nirbheek Chauhan d61656d43c Fix typo argument order to TestRunner (#615) 2016-06-24 13:44:07 +03:00
Jussi Pakkanen b6e8809f25 Added minsize build type that optimizes for binary size. 2016-06-23 22:38:18 +03:00
Jussi Pakkanen 436eab9b85 Print full mesonlog on failed tests when run under CI. 2016-06-23 00:03:59 +03:00
Jussi Pakkanen ba4f26f8bf Merge pull request #610 from centricular/version-check-not-found-dep
dependency: Fix version check for a not-found dependency
2016-06-22 00:24:40 +03:00
Nirbheek Chauhan a927380098 Add a test for the broken cached version compare
https://github.com/mesonbuild/meson/pull/610
2016-06-21 08:43:57 +05:30
Nirbheek Chauhan fe52feb47d dependency: Fix version check for a not-found dependency
The check was wrong, and we were passing 'none' as the 'found' version
to the version compare if the cached dep was a not-found dependency
2016-06-21 08:40:48 +05:30
Nirbheek Chauhan c03870b798 compilers: Copy extra_args whenever we modify it
Otherwise the changes ripple upstream and modify extra_args in the callee
2016-06-21 03:24:48 +05:30
Jussi Pakkanen 10f6295ca8 Do not use [] as a function default argument as the variable persists over multiple invocations. 2016-06-21 00:38:07 +03:00
Jussi Pakkanen 642b4ddf71 Merge pull request #607 from centricular/subdir-include-order
Add subdir includes before external dep includes
2016-06-21 00:18:09 +03:00
Nirbheek Chauhan cd509043e0 wxwidgets: Don't error out if dependency is not required (#606) 2016-06-21 00:16:11 +03:00
Nirbheek Chauhan 7c90beefde find_library: Also accept extra_dirs as a single string argument 2016-06-21 02:30:52 +05:30