Commit Graph

744 Commits

Author SHA1 Message Date
Jussi Pakkanen d085002d18 Calculate target paths correctly when workdir is set. 2019-01-07 23:09:24 +02:00
Robert Bragg f2223fcf54 ninjabackend: Adding missing shell quotes for compiler arguments
Since trying to cross compile for Windows from Linux (WSL) and having
paths like this:

  '-L/mnt/c/Program Files (x86)/Microsoft Visual Studio/2017/\
    Community/VC/Tools/MSVC/14.15.26726/lib/x64'

I found that the spaces and brackets in the paths weren't properly
escaped by the Ninja backend.
2019-01-07 23:03:18 +02:00
Daniel Mensinger 4b17bbc753
Better list prepending 2019-01-06 12:19:34 +01:00
Daniel Mensinger df1434d5a5
Fixed CI issues 2019-01-06 12:19:34 +01:00
Daniel Mensinger 9d025f1374
Make custom command sources slightly more useful 2019-01-06 12:19:34 +01:00
Daniel Mensinger b97046ea0f
Fixed hash 2019-01-06 12:19:33 +01:00
Daniel Mensinger bd8bad46c3
Code cleanup and renamed variables 2019-01-06 12:19:33 +01:00
Daniel Mensinger 63e16fbcc3
Fixed flake8 2019-01-06 12:19:32 +01:00
Daniel Mensinger 9742927903
Absolute path generation refactoring 2019-01-06 12:19:32 +01:00
Daniel Mensinger 2487e0a1fb
Simplefied absolute path generation 2019-01-06 12:19:32 +01:00
Daniel Mensinger 5c39dd0668
Doc updates and throw if no target type is set 2019-01-06 12:19:31 +01:00
Daniel Mensinger f75e219297
Simplified code and improved preformance 2019-01-06 12:19:30 +01:00
Daniel Mensinger 7691b0460c
Ninja backend target introspection 2019-01-06 12:19:30 +01:00
Daniel Mensinger 4addd176db
Removed fallback detection logic 2019-01-06 12:19:28 +01:00
Daniel Mensinger a5be893b19
Some code cleanup 2019-01-06 12:19:28 +01:00
Daniel Mensinger 74274e23ca
Moved the source and compiler generation to the backend 2019-01-06 12:19:28 +01:00
Daniel Mensinger 111e596200
Fixed tests and benchmarks 2019-01-06 12:19:27 +01:00
Daniel Mensinger f4285f350e
Initial automatic target file generation 2019-01-06 12:19:27 +01:00
John Ericson 2b22576fb6 Remove cross_info; cross file is parsed up front and discarded 2019-01-02 16:22:47 -05:00
John Ericson dbf080afe9 Get rid of `need_cross_compiler`
Building a cross compiler (`build == host != target`) is not cross
compiling. As such, it doesn't make sense to handle it under
`is_cross_build`.

(N.B. Building a standard library for a cross compiler would require
cross compiling, but Meson has support to do such a thing as part of a
compiler build currently.)
2019-01-02 16:11:02 -05:00
Nicolas Schneider f1b32aa4bb vs: respect 'b_pch' option
Fixes #4681.
2019-01-02 22:17:36 +02:00
Jussi Pakkanen 8c9fcb1fea
Merge pull request #4564 from mensinda/introBuildOpts
mintro: Introspect --buildoptions without a build directory
2019-01-01 19:27:41 +02:00
Nicolas Schneider 739341ec04 compile pch .h file as c++-header when building a c++ target
Fixes #3641.
2019-01-01 18:57:43 +02:00
Daniel Mensinger 10ce5deb71
Introspection refactoring 2018-12-29 23:55:45 +01:00
Jussi Pakkanen 1fca654055 Add a clang-format target. 2018-12-30 00:50:00 +02:00
John Preston ca2e378c98 Update VS files only if something changed.
If you change only some project in meson.build,
only that .vcxproj file will be updated and reloaded.

If you change something not related to VS solution and projects
or simply touch the meson.build file, nothing will be reloaded.
2018-12-07 21:36:48 +02:00
Jussi Pakkanen c44a5a1aec Deduplicate export-dynamic and pthread. Closes #4567. 2018-12-06 16:20:54 +02:00
John Preston c17a80f47b Use correct environment for REGEN in VS backend.
Try to guess which VS Command Prompt was used for the Meson call.
If one is chosen invoke it before calling Meson in REGEN command.
2018-12-04 20:19:19 +02:00
Jussi Pakkanen 509afe752c Use /O1 instead of /Os for MSVC as the latter is deprecated. 2018-11-28 00:17:08 +02:00
Jussi Pakkanen 50d5bcff87 Remove MinimalRebuild as it is deprecated. Closes #4539. 2018-11-22 22:30:34 +02:00
John Preston 5d6dcf8850 Fix ProjectGuid values in VS projects. 2018-11-15 21:07:33 +02:00
John Preston 16144fd61b Add 'meson.build' to VS project files. 2018-11-15 21:06:31 +02:00
Dylan Baker 9294fd23be backends/ninja: all files in a java target should depend on generated sources
Because java files are both headers and source it's very probably that
generation and compilation will race otherwise.
2018-11-07 14:26:22 -08:00
Phillip Cao 76333d2a1e Add prefix option for link args 2018-11-08 00:02:24 +13:00
Phillip Cao fc77ec9243 Get cross_args from the compiler rather than environment directly
This aligns with how the sanity checker gets the args
2018-11-08 00:02:23 +13:00
Jon Turney e57fd01830
Accomodate clang-cl /showIncludes output
Accomodate clang-cl /showIncludes output in detect_vs_dep_prefix().

clang-cl outputs lines terminated with \n, not \r\n

v2:
should invoke the detected compiler, not hardcode 'cl'
2018-11-04 15:42:06 +00:00
Jon Turney 64edfd5069
Detect clang-cl as msvc-like, not clang-like
Handle clang's cl or clang-cl being in PATH, or set in CC/CXX

Future work: checking the name of the executable here seems like a bad idea.
These compilers will fail to be detected if they are renamed.

v2:
Update compiler.get_argument_type() test
Fix comparisons of id inside CCompiler, backends and elsewhere

v3:
ClangClCPPCompiler should be a subclass of ClangClCCompier, as well

Future work: mocking in test_find_library_patterns() is effected, as we
now test for a subclass, rather than self.id in CCompiler.get_library_naming()
2018-11-04 15:42:00 +00:00
Aurélien Zanelli 5af84440bc ninjabackend: add generated source files to jar compile target source list
Otherwise, passing result of custom_target() to jar() target is ignored
and won't be compiled resulting in build fail.
2018-11-02 22:27:25 +02:00
Xavier Claessens f0e1342fb2 extract_all_sources: Also include generated object files
Closes #4281.
2018-11-02 21:40:04 +02:00
Marcel Hollerbach 468d1a05ec meson: cache get_target_generated_dir
This reduces the build time about 2 sec. The result itself is not hard
to calculate. However, persistent join calls with the same 2 strings are
not that usefull. This also caused about 600'000 calls to
get_target_dir, we are now down to 60'000 calls form this function to
get_target_dir.
2018-11-02 21:04:13 +02:00
Jon Turney 99b0a7acda Fix flake8 whitespace reports
$ flake8 | grep -E '(E128|E203|E221|E226|E303|W291|W293)'
./mesonbuild/backend/backends.py:32:1: E303 too many blank lines (3)
./mesonbuild/modules/i18n.py:90:56: E128 continuation line under-indented for visual indent
2018-10-24 19:11:46 +03:00
Jon Turney 93f7b83bf5 Fix flake8 'imported but unused' reports
$ flake8 | grep F401
./mesonbuild/minstall.py:15:1: F401 'gzip' imported but unused
./mesonbuild/backend/backends.py:26:1: F401 '..compilers.get_macos_dylib_install_name' imported but unused
./mesonbuild/backend/backends.py:29:1: F401 'functools.lru_cache' imported but unused
./mesonbuild/scripts/dist.py:27:1: F401 'mesonbuild.dependencies.ExternalProgram' imported but unused
2018-10-24 19:11:46 +03:00
Martin Storsjö ef14681fa0 Skip creating a PDB file if a debug build hasn't been requested
When running MSVC on linux via wine, the PDB output doesn't work;
this allows skipping that part.
2018-10-20 23:53:29 +03:00
Michał Górny e8232c7825 Remove implicit compression of man pages
Remove the code responsible for implicitly compressing manpages as .gz
files.  It has been established that manpage compression is a distro
packager's task, with existing distros already having their own
implementations of compression.

Fixes #4330
2018-10-20 13:16:28 +03:00
Xavier Claessens c453400d59 Add 'b_pie' compiler option
On Android executables must be position independent, many
distributions enable it by default too for security reasons.
2018-10-20 00:47:27 +03:00
Matthias Klumpp aa27dd7928 Regression fix: Don't try to import empty-string custom target include dirs (#4342)
* Don't try to import empty-string custom target include dirs

* Import current directory if custom target dir is empty

This restores the previous behavior and fixes test failures caused by
the previous commit.
2018-10-15 19:27:55 +03:00
Jon Turney a0a0c244e2 os.path.relpath() can fail on Windows
If builddir and sourcedir have different drive letters, a relative path
doesn't exist, and os.path.relpath fails with a ValueError exception.

This just fixes the places which are hit by test cases in a simple-minded
way.  There are several other uses of os.path.relpath(), which might be
suspect.
2018-10-10 19:43:24 +03:00
Guillermo Ignacio Enriquez Gutierrez fd86b0c619 Pass arguments from in xcode projects 2018-10-08 21:31:15 +03:00
Guillermo Ignacio Enriquez Gutierrez 47edf72cad Xcode project now supports assembly files 2018-10-08 21:31:15 +03:00
Dylan Baker a0e4548c41 backends: allow running host arch binaries on compatible build machines
Meson 0.48.0 some validation for using compiled binaries in custom
targets and generators, which is nice. It didn't take into account
though that as long as the OS is the same, some architectures support
running a related architecture natively (x86_64 can run x86 natively,
for example).

Fortunately we already have a method for covering this case available
through the Environment class.

Fixes #4254
2018-10-04 23:50:31 +03:00