summaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/compilers.py
Commit message (Collapse)AuthorAgeFilesLines
* Improve support for macOS dylib versioningNirbheek Chauhan2018-08-291-15/+15
| | | | | | | | | | | | | | We now use the soversion to set compatibility_version and current_version by default. This is the only sane thing we can do by default because of the restrictions on the values that can be used for compatibility and current version. Users can override this value with the `darwin_versions:` kwarg, which can be a single value or a two-element list of values. The first one is the compatibility version and the second is the current version. Fixes https://github.com/mesonbuild/meson/issues/3555 Fixes https://github.com/mesonbuild/meson/issues/1451
* Deduplicate build-tree RPATHs on macOSDavid Seifert2018-08-281-2/+4
| | | | | | | | | | * Currently, RPATHs coming from dependencies and `build_rpath` provided by the user might contain the same path. Apple's `install_name` tool is allergic to providing the same argument twice when removing RPATHs: error: install_name_tool: "-delete_rpath /usr/lib" specified more than once
* CompilerArgs: -Wl,-lfoo is also a valid way to pass a libraryNirbheek Chauhan2018-08-281-2/+2
| | | | | | | | | Treat it the same as -lfoo by deduping and adding to --start/end-group Reported at https://gitlab.gnome.org/GNOME/glib/issues/1496 We don't do any advanced transformation for MSVC or de-dup because this is a very rare syntax.
* Merge pull request #3981 from GoaLitiuM/d-win-fixesJussi Pakkanen2018-08-271-6/+15
|\ | | | | Fix D support on Windows
| * Handle proper linking of MSVC runtime librariesGoaLitiuM2018-08-201-0/+9
| | | | | | | | DMD expects mscrtlib arguments while compiling, whereas LDC2 expects these while linking.
| * Remove optimization related arguments from buildtype args, inline release buildsGoaLitiuM2018-08-201-6/+6
| | | | | | | | Dub enables inlining by default for release builds, so meson should do it as well.
* | CompilerArgs: Allow calling to_native() multiple timesNirbheek Chauhan2018-08-231-5/+9
| | | | | | | | | | | | | | | | | | Add a keyword argument to to_native() to operate on a copy so that we can call it multiple times instead of modifying the original compiler args while iterating. This is used in the unit test, and might be used in Meson at some point too.
* | compilers: Handle dupes in the --start/end-group logicOle André Vadla RavnÄs2018-08-231-3/+4
| | | | | | | | | | The index calculated through `self.index()` may find the same flag earlier in the list and end up putting `--end-group` in the wrong spot.
* | compilers: Reduce sizes of MSVC linked binariesOle André Vadla RavnÄs2018-08-221-3/+3
| | | | | | | | | | | | | | | | | | | | | | - For optimization=s add /O1: Use Maximum Optimization (Favor Size), and remove /Os as it's implied by /O1. - Because we add /O1, this implies /Gy, i.e. Function-Level Linking, so unused code can be omitted. - Add /Gw: Optimize Global Data, so unused data can be omitted. With buildtype=minsize on x86 this reduces the size of a statically linked Vala compiler binary from 5 MB down to just 1.87 MB.
* | find_library: Use _build_wrapper to get library dirsBruce Richardson2018-08-221-10/+14
| | | | | | | | | | | | | | | | | | | | This means that we will take into account all the flags set in the cross file when fetching the list of library dirs, which means we won't incorrectly look for 64-bit libraries when building for 32-bit. Signed-off-by: Nirbheek Chauhan <nirbheek@centricular.com> Closes https://github.com/mesonbuild/meson/issues/3881
* | UserArrayOption: Allow duplicates when used as <lang>_args optionXavier Claessens2018-08-201-2/+2
|/ | | | Closes: #4021.
* Convert buildtype to optimization and debug options (#3489)Jussi Pakkanen2018-08-181-25/+77
|
* Unconditionally use get_gui_app_args()Jon Turney2018-08-151-0/+3
| | | | | Add get_gui_app_args() to the Compiler class so it can be unconditionally used
* Explicitly set the Windows subsystem for ninja/VisualCJon Turney2018-08-151-2/+2
|
* Merge pull request #3831 from mesonbuild/symvisibilityJussi Pakkanen2018-08-111-0/+15
|\ | | | | Add gnu_symbol_visibility keyword argument
| * Call it gnu_symbol_visibility instead.Jussi Pakkanen2018-08-091-12/+12
| |
| * Add kwarg for specifying symbol visibility.Jussi Pakkanen2018-08-091-0/+15
| |
* | PkgConfigDependency: Don't try to resolve internal compiler libsNirbheek Chauhan2018-08-111-0/+3
|/ | | | | | | -lc -lm -ldl -lrt -lpthread are special linker arguments that should never be resolved to on-disk libraries. Closes https://github.com/mesonbuild/meson/issues/3879
* Implement get_link_whole_for() for IntelCompiler (#3863)Alberto Sartori2018-07-101-0/+3
| | | closes #3862
* Added ARMCLANG compiler support for C/C++ (#3717)Vasu Penugonda2018-06-211-0/+80
|
* Rename clike_langs to clink_langs for clarityNirbheek Chauhan2018-06-201-11/+11
| | | | | | | D is not a 'c-like' language, but it can link to C libraries. The same might be true of Rust in the future and Go when we add support for it. This contains no functionality changes.
* dependencies: Don't assume self.compiler is a C compilerNirbheek Chauhan2018-06-201-1/+5
| | | | | | | | | | | All dependencies were using find_library, has_header, get_define, etc on self.compiler assuming that it's a compiler that outputs and consumes C-like libraries. This is not true for D (and in the future, for Rust) since although they can consume C libraries, they do not use the C ecosystem. For such purposes, we now have self.clib_compiler. Nothing uses self.compiler anymore as a result, and it has been removed.
* Add missing stubs to Compiler.Christoph Behle2018-06-181-0/+12
| | | | | | | | Added missing stubs to class Compiler for the methods: * compute_int * has_members * has_type * symbols_have_underscore_prefix
* Use stub to report misuse of get_defineChristoph Behle2018-06-181-0/+3
| | | | | Instead of checking on the call site add a stub to Compiler which raises an exception.
* macos: Rewrite install_name for dependent built libraries on installNirbheek Chauhan2018-06-181-13/+19
| | | | | | | | | | | | | | | | | | | | | | | | On macOS, we set the install_name for built libraries to @rpath/libfoo.dylib, and when linking to the library, we set the RPATH to its path in the build directory. This allows all built binaries to be run as-is from the build directory (uninstalled). However, on install, we have to strip all the RPATHs because they point to the build directory, and we change the install_name of all built libraries to the absolute path to the library. This causes the install name in binaries to be out of date. We now change that install name to point to the absolute path to each built library after installation. Fixes https://github.com/mesonbuild/meson/issues/3038 Fixes https://github.com/mesonbuild/meson/issues/3077 With this, the default workflow on macOS matches what everyone seems to do, including Autotools and CMake. The next step is providing a way for build files to override the install_name that is used after installation for use with, f.ex., private libraries when combined with the install_rpath: kwarg on targets.
* vala: fix extract_all_objects() resultPaolo Bonzini2018-06-101-2/+2
| | | | | | | | Because vala is not listed in clike_langs, is_source(fname) is returning False for Vala source files. Therefore, extract_all_objects() is completely empty for Vala programs. Fixes #791
* compilers: Use RUSTFLAGS from the env as default rust_args valueXavier Claessens2018-06-061-1/+2
|
* optinterpreter: Remove duplicated list of languagesXavier Claessens2018-06-061-0/+1
| | | | | | It is important to keep the list of languages up to date in optinterpreter, otherwise we could have conflicting options when adding new languages.
* Fix issues found by flake8Xavier Claessens2018-06-061-1/+0
|
* Move <lang>_args to coredata.compiler_optionsXavier Claessens2018-06-061-6/+25
|
* Move get_args_from_envvars() from environment to compilersXavier Claessens2018-06-061-1/+52
|
* Add a new option for building with Apple bitcode supportNirbheek Chauhan2018-06-061-15/+34
| | | | | | Normally, people would just pass -fembed-bitcode in CFLAGS, but this conflicts with -Wl,-dead_strip_dylibs and -bundle, so we need it as an option so that those can be quietly disabled.
* Add prog/lib dirs from the mingw cross-compiler to PATHNirbheek Chauhan2018-06-051-2/+16
| | | | | These directories contain DLLs that the executable may need, such as libstdc++-6.dll, libwinpthread, etc.
* New compiler method: check_headerNirbheek Chauhan2018-05-301-0/+3
| | | | | | | | This checks not only for existence, but also for usability of the header, which means it does a full compilation and not just pre-processing or __has_include. Fixes https://github.com/mesonbuild/meson/issues/2246
* Don't raise StopIteration in generators, no longer allowed with Python 3.7. ↔Christoph Reiter2018-05-291-1/+1
| | | | | | | | | Fixes #3622 Raising StopIteration from a generator has been deprecated with Python 3.5 and is now an error with Python 3.7: https://docs.python.org/3.8/library/exceptions.html#StopIteration Just use return instead.
* Revert "Add macOS linker versioning information"Nirbheek Chauhan2018-05-091-16/+8
| | | | | | This reverts commit fa6ca160548d7e8df9c4c724e6c96f5e004e5316. Closes https://github.com/mesonbuild/meson/issues/3550
* add linker flag to handle $ORIGIN on OpenBSDJasper Lievisse Adriaanse2018-05-041-2/+2
|
* Can combine D and C++ in a single target. Closes #3125.Jussi Pakkanen2018-05-021-0/+6
|
* Merge pull request #3353 from xclaesse/has-link-argumentJussi Pakkanen2018-04-171-10/+8
|\ | | | | Add has_link_argument() and friends
| * Add has_link_argument() and friendsXavier Claessens2018-04-161-1/+9
| | | | | | | | Closes: #3335.
| * has_argument(): reduce code duplicationXavier Claessens2018-04-161-10/+0
| |
* | Explicitly check for OpenMP headers.Elliott Sales de Andrade2018-04-171-1/+2
| |
* | Add an OpenMP dependency.Elliott Sales de Andrade2018-04-171-0/+20
|/ | | | | This works similarly to the thread dependency which stores the various inconsistent flags in each compiler.
* Merged Arm CC support.Jussi Pakkanen2018-04-161-0/+90
|\
| * Updates to CPP support and update review changesSomasekhar Penugonda2018-03-271-59/+70
| |
| * - Updating cpp_std options similar to other compiler classesBedarkar, Malhar2018-03-141-4/+30
| | | | | | | | | | | | | | - Updating environment.py for selecting '--vsn' option for armcc only. - Updating build type arguments from GitHub pull request - 3157 Change-Id: Id3151e7715ec1016afdbd65391bb0d414ec7de13
| * Meson Github pull request - 3186 requested changesSomasekhar Penugonda2018-03-071-2/+4
| | | | | | | | | | - Fixing flake8 error in compilers.py - [E124] closing bracket does not match visual indentation - Updating ARMCCompiler constructor in c.py to raise error as per comments
| * First cut of ARMCC support for MESON.Bedarkar, Malhar2018-03-051-0/+51
| | | | | | | | Change-Id: I15d8258e84d392baaccb8f670e33eefcfe8cd49a
* | Add macOS linker versioning informationTom Schoonjans2018-04-161-8/+16
| | | | | | | | | | | | This patch exploits the information residing in ltversion to set the -compatibility_version and -current_version flags that are passed to the linker on macOS.
* | Do not use -soname when linking with GCC for mingw/cygwinMarvin Scholz2018-04-161-2/+4
| | | | | | | | | | | | | | | | GNU LD does not use soname when linking a PE/COFF binary, so it makes no difference, but it breaks when using the llvm linker (lld), which does not support the soname flag when building PE/COFF binaries for Windows. Fix #3179