Commit Graph

753 Commits

Author SHA1 Message Date
Jussi Pakkanen 902aaf2ce6
Merge pull request #4626 from Ericson2314/consolidate-properties
Go through coreutils.compiler_options.{build.host.target}
2019-02-04 23:06:46 +01:00
Nicolas Schneider c1fa61b7d9 vs: add PCH headers to project
Otherwise, they will not be visible in the IDE.
2019-02-04 20:27:57 +01:00
John Ericson 19f81d3e33 Never access environment.properties downstream
Instead use coredata.compiler_options.<machine>. This brings the cross
and native code paths closer together, since both now use that.

Command line options are interpreted just as before, for backwards
compatibility. This does introduce some funny conditionals. In the
future, I'd like to change the interpretation of command line options so

 - The logic is cross-agnostic, i.e. there are no conditions affected by
   `is_cross_build()`.

 - Compiler args for both the build and host machines can always be
   controlled by the command line.

 - Compiler args for both machines can always be controlled separately.
2019-02-02 13:59:14 -05:00
Nirbheek Chauhan 50b863032e find_library: Check arch of libraries on Darwin
macOS provides the tool `lipo` to check the archs supported by an
object (executable, static library, dylib, etc). This is especially
useful for fat archives, but it also helps with thin archives.

Without this, the linker will fail to link to the library we mistakenly
'found' like so:

ld: warning: ignoring file /path/to/libfoo.a, missing required architecture armv7 in file /path/to/libfoo.a
2019-01-31 20:36:49 +00:00
Michael Hirsch, Ph.D cccffaa29d BUGFIX: allow fc.run(code) to work, pick only Fortran module 2019-01-29 23:25:23 +02:00
Michael Hirsch, Ph.D da34bea893 pep8 py37 2019-01-29 22:06:11 +02:00
Nicolas Schneider 09739284be vs: fix PCH 2019-01-29 22:03:47 +02:00
Nicolas Schneider 2dcb6eb0b3 vs: escape embedded quotes of run targets 2019-01-27 20:10:09 +02:00
Luca Boccassi 267792174c custom_target: do not let install override build_by_default
A custom_target, if install is set to true, will always be built by
default even if build_by_default is explicitly set to false.
Ensure that this does not happen if it's set explicitly. To keep
backward compatibility, if build_by_default is not set explicitly and
install is true, set build_by_default to true.

Fixes #4107
2019-01-17 20:40:19 +02:00
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