Commit Graph

54 Commits

Author SHA1 Message Date
Jussi Pakkanen 7a3fdf70cc Convert PBXGroup. 2021-04-04 13:40:54 +03:00
Jussi Pakkanen d78dba08a7 Convert a few more. 2021-04-04 00:32:03 +03:00
Jussi Pakkanen 87f1007ba7 Reduce verbosity. 2021-04-03 23:47:35 +03:00
Jussi Pakkanen 18f718299c Convert one more object type and some scaffolding. 2021-04-03 23:33:08 +03:00
Jussi Pakkanen 0967800705 Start refactoring the xcode backend by creating proper classes for pbx primitives. 2021-04-03 20:57:40 +03:00
Eli Schwartz 6a0fabc647
mass rewrite of string formatting to use f-strings everywhere
performed by running "pyupgrade --py36-plus" and committing the results
2021-03-04 17:16:11 -05:00
Jeff Moguillansky 9226a92fe0 xcode-backend: add implicit includes
Move helper functions get_source_dir_include_args and
get_build_dir_include_args to backend base class
2021-02-04 13:05:17 -08:00
Jeff Moguillansky 7fd69cb4c4 xcode-backend: set global link args 2021-02-04 13:05:17 -08:00
Jeff Moguillansky 5d94d161ff xcode-backend: fix include paths
Add project directory as include path
Add include paths from dependencies for all languages (c, c++, objc, objc++)
2021-02-04 17:35:20 +00:00
Jeff Moguillansky 4f8cecca97 build: add function get_build_targets to Build class
Add function to Build class to get targets of type BuildTarget
Update xcode backend to call get_build_targets when iterating over targets.
This resolves crash in xcode backend when using custom targets:

AttributeError: ‘CustomTarget’ object has no attribute ‘objects’
2021-01-30 11:30:56 +00:00
Jeff Moguillansky 9eb8b6be28 xcode-backend: fix include paths
Add include paths from dependencies
2021-01-28 16:32:21 -08:00
Dylan Baker 23d3b98fc1 split mesonlib into a package
Currently mesonlib does some import tricks to figure out whether it
needs to use windows or posix specific functions. This is a little
hacky, but works fine. However, the way the typing stubs are implemented
for the msvcrt and fnctl modules will cause mypy to fail on the other
platform, since the functions are not implemented.

To aleviate this (and for slightly cleaner design), I've split mesonlib
into a pacakge with three modules. A universal module contains all of
the platform agnositc code, a win32 module contains window specific
code, a posix module contains the posix specific code, and a platform
module contains no-op implementations. Then the package's __init__ file
imports all of the universal functions and all of the functions from the
approriate platform module, or the no-op versions as fallbacks. This
makes mypy happy, and avoids `if`ing all over the code to switch between
the platform specific code.
2021-01-23 12:48:29 +01:00
Dylan Baker e81acbd606 Use a single coredata dictionary for options
This patches takes the options work to it's logical conclusion: A single
flat dictionary of OptionKey: UserOptions. This allows us to simplify a
large number of cases, as we don't need to check if an option is in this
dict or that one (or any of 5 or 6, actually).
2021-01-04 12:20:58 -08:00
Oskar Sigvardsson 1d443f1bc6 Fixed using files object in subdir with xcode backend
Fixes bug #589. When generating string from file object, it didn't take subdir
into account.
2020-10-04 14:52:28 +02:00
Daniel Mensinger 668610c0d2 backend: refactor: set self.interpreter in the constructor 2020-01-28 21:18:25 +02:00
Michael Hirsch, Ph.D ecaba8c234 xcode 64 bit for catalina [skip ci] 2019-10-18 01:07:52 +03:00
Dylan Baker 866d105036 xcodebackend: Fix iterating compilers after host/build changes
Fixes #5570
2019-06-30 00:29:39 +03:00
John Ericson 07777e15d4 Purge `is_cross` and friends without changing user interfaces
In most cases instead pass `for_machine`, the name of the relevant
machines (what compilers target, what targets run on, etc). This allows
us to use the cross code path in the native case, deduplicating the
code.

As one can see, environment got bigger as more information is kept
structured there, while ninjabackend got a smaller. Overall a few amount
of lines were added, but the hope is what's added is a lot simpler than
what's removed.
2019-06-09 13:13:25 -04:00
Daniel Mensinger 236221061a
Fixed unnecessary .items() 2019-04-29 12:23:13 +02:00
Daniel Mensinger 3581839f4c
Fix unused variables warnings 2019-04-29 12:22:50 +02:00
Dylan Baker 5678468c2c Don't use len() to test for container emptiness
I ran the numbers once before (it's in the meson history) but it's
*much* faster to *not* use len for testing if a container is empty or
not.
2019-04-25 12:28:51 -07:00
David Vanderson 5b53335724 xcode backend: Add target dependency link args 2019-02-24 23:47:58 +02: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
Guillermo Ignacio Enriquez Gutierrez aff3930464 Fix Xcode backend: Add build dir to SYSTEM_HEADER_SEARCH_PATHS so generated headers can be included/imported in sources 2018-10-01 19:22:52 +09:00
Guillermo Ignacio Enriquez Gutierrez 6f4ba8b2f4 Fix Xcode backend: support for precompiled headers. Only one header per target is supported 2018-09-25 01:11:46 +09:00
Guillermo Ignacio Enriquez Gutierrez 9b7bb4aa92 Partially fix targets that use precompiled header with --backend=xcode. Various compiled headers are not working yet [skip ci] 2018-09-24 02:17:57 +09:00
Guillermo Ignacio Enriquez Gutierrez f482b82a43 Sort some objects before writing as Xcode expects [skip ci] 2018-09-24 02:17:47 +09:00
Guillermo Ignacio Enriquez Gutierrez 05d1577e87 Fix `build --backend=xcode` (#4220)
* Fix exception when running

* Fix xcode project typos, indentation and other minor aesthetics diffs

* Use tab code \t instead of real tab
2018-09-19 08:05:24 -07:00
Jukka Laurila 1d0169f4e7 Fix shared library building on xcode. 2018-03-12 23:05:07 +02:00
Jukka Laurila 58ce5fe62d Fix xcode backend to run "meson test" instead of the nonexistent meson_test.py. 2018-03-09 00:26:14 +02:00
Jon Turney cd5dba5358 Fix flake8 'imported but unused' reports
$ flake8 | grep F401
./meson.py:17:1: F401 'mesonbuild.mesonlib' imported but unused
./meson.py:18:1: F401 'locale' imported but unused
./run_unittests.py:24:1: F401 'sys' imported but unused
./mesonbuild/minit.py:2:1: F401 'pyclbr.Function' imported but unused
./mesonbuild/minit.py:18:1: F401 'os' imported but unused
./mesonbuild/backend/vs2010backend.py:15:1: F401 'sys' imported but unused
./mesonbuild/backend/xcodebackend.py:19:1: F401 'sys' imported but unused
./mesonbuild/dependencies/ui.py:20:1: F401 'shutil' imported but unused
./mesonbuild/modules/python3.py:15:1: F401 'sys' imported but unused
./mesonbuild/modules/unstable_icestorm.py:15:1: F401 '..compilers' imported but unused
./mesonbuild/modules/unstable_icestorm.py:15:1: F401 '..mlog' imported but unused
./test cases/common/98 gen extra/srcgen3.py:3:1: F401 'os' imported but unused
2018-03-03 21:06:45 +00:00
Aleksey Filippov 2cf85ae16f Use os.path: basename() and dirname() instead of split()
According to Python documentation[1] dirname and basename
are defined as follows:
    os.path.dirname() = os.path.split()[0]
    os.path.basename() = os.path.split()[1]
For the purpose of better readability split() is replaced
by appropriate function if only one part of returned tuple
is used.

[1]: https://docs.python.org/3/library/os.path.html#os.path.split
2018-01-30 07:08:22 +11:00
Jussi Pakkanen 22adda1617 Review fixes. 2017-11-21 23:29:06 +02:00
Jussi Pakkanen 5d51bc79c7 Replaced sys.executable use with the mesonlib equivalent. 2017-11-20 23:08:17 +02:00
Jussi Pakkanen 5cec8fc43a Removed consecutive identical variable assignments. 2017-07-16 12:04:24 +03:00
Alistair Thomas a195b78c8d Whitespace tweaks to reduce Flake8 warnings 2017-05-29 19:32:47 +03:00
blackbox db176c85db xcode-backend framework fixes
- frameworks-per-target ( each needs its own uid )
2017-05-23 12:54:33 +02:00
blackbox dd443ad0eb codestyle 2017-05-23 12:54:33 +02:00
blackbox 03ebe2f56f remove debug-marker 2017-05-23 12:54:33 +02:00
blackbox ea5eb2a80d XCode frameworks support
- supported as "Link with Libraries".
- Frameworks added as a group to the project
- no need to specify custom linker flags anymore, xcodeproj works just like ninja

example mason.build file :
dep_main += [dependency('appleframeworks', modules : ['Foundation', 'AppKit', 'IOKIT', 'QuartzCore', 'OpenGL', 'GLUT', 'OpenAL'], required : true)]
2017-05-23 12:54:33 +02:00
Peter Hutterer a576791064 Use American English - 'ise' -> 'ize' where applicable 2017-05-04 22:09:27 +03:00
Mike Sinkovsky e9a891fe25 style: [E502] the backslash is redundant between brackets 2017-01-11 12:33:27 -05:00
Igor Gnatenko 969dc7e995 style: fix E124 violations
E124: closing bracket does not match visual indentation

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2017-01-01 12:02:05 -05:00
Igor Gnatenko 2017d8578a style: fix E226 violations
E226: missing whitespace around arithmetic operator

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2017-01-01 12:02:05 -05:00
Igor Gnatenko f0b30baa39 style: fix E225 violations
E225: missing whitespace around operator

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2017-01-01 12:02:05 -05:00
Jussi Pakkanen b55235dfbd Fix space before :. 2016-12-31 16:28:15 +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
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 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