diff options
34 files changed, 431 insertions, 298 deletions
diff --git a/.appveyor.yml b/.appveyor.yml index 85725c3..78f9f33 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -105,6 +105,21 @@ install: - cmd: if %compiler%==cygwin ( set WRAPPER=ci\run-in-cygwin.bat ) - cmd: if %compiler%==cygwin ( %WRAPPER% which %PYTHON% ) else ( where %PYTHON% ) + # Setup D compiler and dub packages + - ps: | + If($Env:compiler.StartsWith('msvc') -and $Env:backend -eq 'ninja') { + & .\ci\install-dmd.ps1 + $arch = 'x86_mscoff' + If($Env:arch -eq 'x64') { + $arch = 'x86_64' + } + & dub fetch urld + & dub build urld --compiler=dmd --arch=$arch + & dub fetch dubtestproject + & dub build dubtestproject:test1 --compiler=dmd --arch=$arch + & dub build dubtestproject:test2 --compiler=dmd --arch=$arch + } + # pkg-config is needed for the pkg-config tests on msvc - ps: | If($Env:compiler.StartsWith('msvc')) { diff --git a/ci/install-dmd.ps1 b/ci/install-dmd.ps1 new file mode 100644 index 0000000..fc8226c --- /dev/null +++ b/ci/install-dmd.ps1 @@ -0,0 +1,71 @@ +param ( + [string]$Version = $null +) +Set-StrictMode -Version latest +$ErrorActionPreference = "Stop" +$ProgressPreference = "SilentlyContinue" + +# default installation directory +$dmd_install = "C:\D" +$dmd_version_file = "C:\cache\DMD_LATEST" + +#echo "Fetching latest DMD version..." +if (!$Version) { + $dmd_latest_url = "http://downloads.dlang.org/releases/LATEST" + $retries = 10 + for ($i = 1; $i -le $retries; $i++) { + try { + [system.io.directory]::CreateDirectory((Split-Path -parent $dmd_version_file)) > $null + Invoke-WebRequest -URI $dmd_latest_url -OutFile $dmd_version_file + break + } catch [net.WebException] { + if ($i -eq $retries) { + break + } + $backoff = (10 * $i) # backoff 10s, 20s, 30s... + echo ('{0}: {1}' -f $dmd_latest_url, $_.Exception.Message) + echo ('Retrying in {0}s...' -f $backoff) + Start-Sleep -m ($backoff * 1000) + } catch { + throw + } + } + if (Test-Path $dmd_version_file) { + $dmd_version = Get-Content -Path $dmd_version_file + } else { + throw "Failed to resolve latest DMD version" + } +} else { + $dmd_version = $Version +} +$dmd_url = "http://downloads.dlang.org/releases/2.x/$dmd_version/dmd.$dmd_version.windows.zip" +$dmd_filename = [System.IO.Path]::GetFileName($dmd_url) +$dmd_archive = Join-Path ($env:temp) $dmd_filename + +#echo "Downloading $dmd_filename..." +$retries = 10 +for ($i = 1; $i -le $retries; $i++) { + try { + (New-Object net.webclient).DownloadFile($dmd_url, $dmd_archive) + break + } catch [net.WebException] { + if ($i -eq $retries) { + throw # fail on last retry + } + $backoff = (10 * $i) # backoff 10s, 20s, 30s... + echo ('{0}: {1}' -f $dmd_url, $_.Exception.Message) + echo ('Retrying in {0}s...' -f $backoff) + Start-Sleep -m ($backoff * 1000) + } +} + +#echo "Extracting $dmd_filename..." +Expand-Archive $dmd_archive -Force -DestinationPath $dmd_install + +# add to environment path +#echo "Installing DMD..." +$dmd_bin = Join-Path $dmd_install "dmd2\windows\bin" +$Env:Path = $Env:Path + ";" + $dmd_bin + +#echo "Testing DMD..." +& dmd.exe --version 2>&1>$null diff --git a/docs/markdown/Adding-new-projects-to-wrapdb.md b/docs/markdown/Adding-new-projects-to-wrapdb.md index 00fd0d7..832f803 100644 --- a/docs/markdown/Adding-new-projects-to-wrapdb.md +++ b/docs/markdown/Adding-new-projects-to-wrapdb.md @@ -74,7 +74,7 @@ First you need to fork the repository to your own page. Then you can create the emacs upstream.wrap meson.build <verify that your project builds and runs> git add upstream.wrap meson.build - git commit -a -m 'Created wrap files for libfoo-1.0.0.' + git commit -a -m 'Create wrap files for libfoo-1.0.0.' git push origin 1.0.0 Now you can file a merge request. Remember to file it against branch diff --git a/docs/markdown/Reference-tables.md b/docs/markdown/Reference-tables.md index ab79abd..ccdcb34 100644 --- a/docs/markdown/Reference-tables.md +++ b/docs/markdown/Reference-tables.md @@ -48,6 +48,7 @@ set in the cross file. | x86_64 | 64 bit x86 processor | | ia64 | Itanium processor | | arm | 32 bit ARM processor | +| arc | 32 bit ARC processor | | aarch64 | 64 bit ARM processor | | mips | 32 bit MIPS processor | | mips64 | 64 bit MIPS processor | diff --git a/docs/markdown/Release-notes-for-0.48.0.md b/docs/markdown/Release-notes-for-0.48.0.md index cf3db4c..1eb5488 100644 --- a/docs/markdown/Release-notes-for-0.48.0.md +++ b/docs/markdown/Release-notes-for-0.48.0.md @@ -1,17 +1,308 @@ --- title: Release 0.48 -short-description: Release notes for 0.48 (preliminary) +short-description: Release notes for 0.48 ... # New features -This page is a placeholder for the eventual release notes. +## Toggles for build type, optimization and vcrt type -Notable new features should come with release note updates. This is -done by creating a file snippet called `snippets/featurename.md` and -whose contents should look like this: +Since the very beginning Meson has provided different project types to +use, such as *debug* and *minsize*. There is also a *plain* type that +adds nothing by default but instead makes it the user's responsibility +to add everything by hand. This works but is a bit tedious. - ## Feature name +In this release we have added new new options to manually toggle +e.g. optimization levels and debug info so those can be changed +independently of other options. For example by default the debug +buildtype has no optmization enabled at all. If you wish to use GCC's +`-Og` instead, you could set it with the following command: - A short description explaining the new feature and how it should be used. +``` +meson configure -Doptimization=g +``` +Similarly we have added a toggle option to select the version of +Visual Studio C runtime to use. By default it uses the debug runtime +DLL debug builds and release DLL for release builds but this can be +manually changed with the new base option `b_vscrt`. + +## Meson warns if two calls to `configure_file()` write to the same file + +If two calls to [`configure_file()`](#Reference-manual.md#configure_file) +write to the same file Meson will print a `WARNING:` message during +configuration. For example: +```meson +project('configure_file', 'cpp') + +configure_file( + input: 'a.in', + output: 'out', + command: ['./foo.sh'] + ) +configure_file( + input: 'a.in', + output: 'out', + command: ['./foo.sh'] +) + +``` + +This will output: + +``` +The Meson build system +Version: 0.47.0.dev1 +Source dir: /path/to/srctree +Build dir: /path/to/buildtree +Build type: native build +Project name: configure_file +Project version: undefined +Build machine cpu family: x86_64 +Build machine cpu: x86_64 +Configuring out with command +WARNING: Output file out for configure_file overwritten. First time written in line 3 now in line 8 +Configuring out with command +Build targets in project: 0 +Found ninja-1.8.2 at /usr/bin/ninja +``` + +## New kwarg `console` for `custom_target()` + +This keyword argument conflicts with `capture`, and is meant for +commands that are resource-intensive and take a long time to +finish. With the Ninja backend, setting this will add this target to +[Ninja's `console` +pool](https://ninja-build.org/manual.html#_the_literal_console_literal_pool), +which has special properties such as not buffering stdout and +serializing all targets in this pool. + +The primary use-case for this is to be able to run external commands +that take a long time to exeute. Without setting this, the user does +not receive any feedback about what the program is doing. + +## `dependency(version:)` now applies to all dependency types + +Previously, version constraints were only enforced for dependencies found using +the pkg-config dependency provider. These constraints now apply to dependencies +found using any dependency provider. + +Some combinations of dependency, host and method do not currently support +discovery of the version. In these cases, the dependency will not be found if a +version constraint is applied, otherwise the `version()` method for the +dependency object will return `'unknown'`. + +(If discovering the version in one of these combinations is important to you, +and a method exists to determine the version in that case, please file an issue +with as much information as possible.) + +## python3 module is deprecated + +A generic module `python` has been added in Meson `0.46.0` and has a superset of +the features implemented by the previous `python3` module. + +In most cases, it is a simple matter of renaming: +```meson +py3mod = import('python3') +python = py3mod.find_python() +``` + +becomes + +```meson +pymod = import('python') +python = pymod.find_installation() +``` + +## Dictionary addition + +Dictionaries can now be added, values from the second dictionary overrides values +from the first + +```meson +d1 = {'a' : 'b'} +d3 = d1 + {'a' : 'c'} +d3 += {'d' : 'e'} +``` + +## Dist scripts + +You can now specify scripts that are run as part of the `dist` +target. An example usage would go like this: + +```meson +project('foo', 'c') + +# other stuff here + +meson.add_dist_script('dist_cleanup.py') +``` + +## Fatal warnings + +A new command line option has been added: `--fatal-meson-warnings`. When enabled, any +warning message printed by Meson will be fatal and raise an exception. It is +intended to be used by developers and CIs to easily catch deprecation warnings, +or any other potential issues. + +## Helper methods added for checking GNU style attributes: `__attribute__(...)` + +A set of new helpers have been added to the C and C++ compiler objects for +checking GNU style function attributes. These are not just simpler to use, they +may be optimized to return fast on compilers that don't support these +attributes. Currently this is true for MSVC. + +```meson +cc = meson.get_compiler('c') +if cc.has_function_attribute('aligned') + add_project_arguments('-DHAVE_ALIGNED', language : 'c') +endif +``` + +Would replace code like: + +```meson +if cc.compiles('''into foo(void) __attribute__((aligned(32)))''') + add_project_arguments('-DHAVE_ALIGNED', language : 'c') +endif +``` + +Additionally, a multi argument version has been added: + +```meson +foreach s : cc.get_supported_function_attributes(['hidden', 'alias']) + add_project_arguments('-DHAVE_@0@'.format(s.to_upper()), language : 'c') +endforeach +``` + +## `gnome.generate_gir()` now optionally accepts multiple libraries + +The GNOME module can now generate a single gir for multiple libraries, which +is something `g-ir-scanner` supported, but had not been exposed yet. + +gnome.generate_gir() will now accept multiple positional arguments, if none +of these arguments are an `Executable` instance. + +## Hotdoc module + +A new module has been written to ease generation of +[hotdoc](https://hotdoc.github.io/) based documentation. It supports +complex use cases such as hotdoc subprojects (to create documentation +portals) and makes it straight forward to leverage full capabilities +of hotdoc. + +Simple usage: + +``` meson +hotdoc = import('hotdoc') + +hotdoc.generate_doc( + 'foobar', + c_smart_index: true, + project_version: '0.1', + sitemap: 'sitemap.txt', + index: 'index.md', + c_sources: ['path/to/file.c'], + languages: ['c'], + install: true, +) +``` + +## `i18n.merge_file()` now fully supports variable substitutions defined in `custom_target()` + +Filename substitutions like @BASENAME@ and @PLAINNAME@ were previously +accepted but the name of the build target wasn't altered leading to +colliding target names when using the substitution twice. +i18n.merge_file() now behaves as custom_target() in this regard. + +## Projects args can be set separately for cross and native builds (potentially breaking change) + +It has been a longstanding bug (or let's call it a "delayed bug fix") +that if yo do this: + +```meson +add_project_arguments('-DFOO', language : 'c') +``` + +Then the flag is used both in native and cross compilations. This is +very confusing and almost never what you want. To fix this a new +keyword `native` has been added to all functions that add arguments, +namely `add_global_arguments`, `add_global_link_arguments`, +`add_project_arguments` and `add_project_link_arguments` that behaves +like the following: + +``` +## Added to native builds when compiling natively and to cross +## compilations when doing cross compiles. +add_project_arguments(...) + +## Added only to native compilations, not used in cross compilations. +add_project_arguments(..., native : true) + +## Added only to cross compilations, not used in native compilations. +add_project_arguments(..., native : false) +``` + +Also remember that cross compilation is a property of each +target. There can be target that are compiled with the native compiler +and some which are compiled with the cross compiler. + +Unfortunately this change is backwards incompatible and may cause some +projects to fail building. However this should be very rare in practice. + +## More flexible `override_find_program()`. + +It is now possible to pass an `executable` to +`override_find_program()` if the overridden program is not used during +configure. + +This is particularly useful for fallback dependencies like Protobuf +that also provide a tool like protoc. + +## `shared_library()` now supports setting dylib compatibility and current version + +Now, by default `shared_library()` sets `-compatibility_version` and +`-current_version` of a macOS dylib using the `soversion`. + +This can be overriden by using the `darwin_versions:` kwarg to +[`shared_library()`](Reference-manual.md#shared_library). As usual, you can +also pass this kwarg to `library()` or `build_target()` and it will be used in +the appropriate circumstances. + +## Version comparison + +`dependency(version:)` and other version constraints now handle versions +containing non-numeric characters better, comparing versions using the rpmvercmp +algorithm (as using the `pkg-config` autoconf macro `PKG_CHECK_MODULES` does). + +This is a breaking change for exact comparison constraints which rely on the +previous comparison behaviour of extending the compared versions with `'0'` +elements, up to the same length of `'.'`-separated elements. + +For example, a version of `'0.11.0'` would previously match a version constraint +of `'==0.11'`, but no longer does, being instead considered strictly greater. + +Instead, use a version constraint which exactly compares with the precise +version required, e.g. `'==0.11.0'`. + +## Keyword argument for GNU symbol visibility + +Build targets got a new keyword, `gnu_symbol_visibility` that controls +how symbols are exported from shared libraries. This is most commonly +used to hide implementation symbols like this: + +```meson +shared_library('mylib', ... + gnu_symbol_visibility: 'hidden') +``` + +In this case only symbols explicitly marked as visible in the source +files get exported. + +## Git wraps can now clone submodules automatically + +To enable this, the following needs to be added to the `.wrap` file: + +```ini +clone-recursive=true +``` diff --git a/docs/markdown/Release-notes-for-0.49.0.md b/docs/markdown/Release-notes-for-0.49.0.md new file mode 100644 index 0000000..b294ad5 --- /dev/null +++ b/docs/markdown/Release-notes-for-0.49.0.md @@ -0,0 +1,17 @@ +--- +title: Release 0.49 +short-description: Release notes for 0.49 (preliminary) +... + +# New features + +This page is a placeholder for the eventual release notes. + +Notable new features should come with release note updates. This is +done by creating a file snippet called `snippets/featurename.md` and +whose contents should look like this: + + ## Feature name + + A short description explaining the new feature and how it should be used. + diff --git a/docs/markdown/snippets/buildtype_toggles.md b/docs/markdown/snippets/buildtype_toggles.md deleted file mode 100644 index e6ae53d..0000000 --- a/docs/markdown/snippets/buildtype_toggles.md +++ /dev/null @@ -1,21 +0,0 @@ -## Toggles for build type, optimization and vcrt type - -Since the very beginning Meson has provided different project types to -use, such as *debug* and *minsize*. There is also a *plain* type that -adds nothing by default but instead makes it the user's responsibility -to add everything by hand. This works but is a bit tedious. - -In this release we have added new new options to manually toggle -e.g. optimization levels and debug info so those can be changed -independently of other options. For example by default the debug -buildtype has no optmization enabled at all. If you wish to use GCC's -`-Og` instead, you could set it with the following command: - -``` -meson configure -Doptimization=g -``` - -Similarly we have added a toggle option to select the version of -Visual Studio C runtime to use. By default it uses the debug runtime -DLL debug builds and release DLL for release builds but this can be -manually changed with the new base option `b_vscrt`. diff --git a/docs/markdown/snippets/configure_file_overwrite_warning.md b/docs/markdown/snippets/configure_file_overwrite_warning.md deleted file mode 100644 index 550407d..0000000 --- a/docs/markdown/snippets/configure_file_overwrite_warning.md +++ /dev/null @@ -1,39 +0,0 @@ -## Meson warns if two calls to configure_file() write to the same file - -If two calls to [`configure_file()`](#Reference-manual.md#configure_file) -write to the same file Meson will print a `WARNING:` message during -configuration. For example: -```meson -project('configure_file', 'cpp') - -configure_file( - input: 'a.in', - output: 'out', - command: ['./foo.sh'] - ) -configure_file( - input: 'a.in', - output: 'out', - command: ['./foo.sh'] -) - -``` - -This will output: - -``` -The Meson build system -Version: 0.47.0.dev1 -Source dir: /path/to/srctree -Build dir: /path/to/buildtree -Build type: native build -Project name: configure_file -Project version: undefined -Build machine cpu family: x86_64 -Build machine cpu: x86_64 -Configuring out with command -WARNING: Output file out for configure_file overwritten. First time written in line 3 now in line 8 -Configuring out with command -Build targets in project: 0 -Found ninja-1.8.2 at /usr/bin/ninja -``` diff --git a/docs/markdown/snippets/custom_target_console_pool.md b/docs/markdown/snippets/custom_target_console_pool.md deleted file mode 100644 index 8b9bb34..0000000 --- a/docs/markdown/snippets/custom_target_console_pool.md +++ /dev/null @@ -1,13 +0,0 @@ -## New kwarg `console` for `custom_target()` - -This keyword argument conflicts with `capture`, and is meant for -commands that are resource-intensive and take a long time to -finish. With the Ninja backend, setting this will add this target to -[Ninja's `console` -pool](https://ninja-build.org/manual.html#_the_literal_console_literal_pool), -which has special properties such as not buffering stdout and -serializing all targets in this pool. - -The primary use-case for this is to be able to run external commands -that take a long time to exeute. Without setting this, the user does -not receive any feedback about what the program is doing. diff --git a/docs/markdown/snippets/dependency_version.md b/docs/markdown/snippets/dependency_version.md deleted file mode 100644 index 4bbf346..0000000 --- a/docs/markdown/snippets/dependency_version.md +++ /dev/null @@ -1,14 +0,0 @@ -## `dependency(version:)` now applies to all dependency types - -Previously, version constraints were only enforced for dependencies found using -the pkg-config dependency provider. These constraints now apply to dependencies -found using any dependency provider. - -Some combinations of dependency, host and method do not currently support -discovery of the version. In these cases, the dependency will not be found if a -version constraint is applied, otherwise the `version()` method for the -dependency object will return `'unknown'`. - -(If discovering the version in one of these combinations is important to you, -and a method exists to determine the version in that case, please file an issue -with as much information as possible.) diff --git a/docs/markdown/snippets/deprecated_python3_module.md b/docs/markdown/snippets/deprecated_python3_module.md deleted file mode 100644 index 2c46830..0000000 --- a/docs/markdown/snippets/deprecated_python3_module.md +++ /dev/null @@ -1,18 +0,0 @@ -## python3 module is deprecated - -A generic module `python` has been added in Meson `0.46.0` and has a superset of -the features implemented by the previous `python3` module. - -In most cases, it is a simple matter of renaming: -```meson -py3mod = import('python3') -python = py3mod.find_python() -``` - -becomes - -```meson -pymod = import('python') -python = pymod.find_installation() -``` - diff --git a/docs/markdown/snippets/dict_add.md b/docs/markdown/snippets/dict_add.md deleted file mode 100644 index cde5b57..0000000 --- a/docs/markdown/snippets/dict_add.md +++ /dev/null @@ -1,10 +0,0 @@ -## Dictionary addition - -Dictionaries can now be added, values from the second dictionary overrides values -from the first - -```meson -d1 = {'a' : 'b'} -d3 = d1 + {'a' : 'c'} -d3 += {'d' : 'e'} -``` diff --git a/docs/markdown/snippets/distscript.md b/docs/markdown/snippets/distscript.md deleted file mode 100644 index 37d05fe..0000000 --- a/docs/markdown/snippets/distscript.md +++ /dev/null @@ -1,12 +0,0 @@ -## Dist scripts - -You can now specify scripts that are run as part of the `dist` -target. An example usage would go like this: - -```meson -project('foo', 'c') - -# other stuff here - -meson.add_dist_script('dist_cleanup.py') -``` diff --git a/docs/markdown/snippets/fatal_warnings.md b/docs/markdown/snippets/fatal_warnings.md deleted file mode 100644 index adf3334..0000000 --- a/docs/markdown/snippets/fatal_warnings.md +++ /dev/null @@ -1,6 +0,0 @@ -## Fatal warnings - -A new command line option has been added: `--fatal-meson-warnings`. When enabled, any -warning message printed by Meson will be fatal and raise an exception. It is -intended to be used by developers and CIs to easily catch deprecation warnings, -or any other potential issues. diff --git a/docs/markdown/snippets/function_attributes.md b/docs/markdown/snippets/function_attributes.md deleted file mode 100644 index 5514494..0000000 --- a/docs/markdown/snippets/function_attributes.md +++ /dev/null @@ -1,29 +0,0 @@ -## Helper methods added for checking GNU style attributes: __attribute__(...) - -A set of new helpers have been added to the C and C++ compiler objects for -checking GNU style function attributes. These are not just simpler to use, they -may be optimized to return fast on compilers that don't support these -attributes. Currently this is true for MSVC. - -```meson -cc = meson.get_compiler('c') -if cc.has_function_attribute('aligned') - add_project_arguments('-DHAVE_ALIGNED', language : 'c') -endif -``` - -Would replace code like: - -```meson -if cc.compiles('''into foo(void) __attribute__((aligned(32)))''') - add_project_arguments('-DHAVE_ALIGNED', language : 'c') -endif -``` - -Additionally, a multi argument version has been added: - -```meson -foreach s : cc.get_supported_function_attributes(['hidden', 'alias']) - add_project_arguments('-DHAVE_@0@'.format(s.to_upper()), language : 'c') -endforeach -``` diff --git a/docs/markdown/snippets/generate_gir_multiple_libraries.md b/docs/markdown/snippets/generate_gir_multiple_libraries.md deleted file mode 100644 index 3541b71..0000000 --- a/docs/markdown/snippets/generate_gir_multiple_libraries.md +++ /dev/null @@ -1,7 +0,0 @@ -## gnome.generate_gir() now optionally accepts multiple libraries - -The GNOME module can now generate a single gir for multiple libraries, which -is something `g-ir-scanner` supported, but had not been exposed yet. - -gnome.generate_gir() will now accept multiple positional arguments, if none -of these arguments are an `Executable` instance. diff --git a/docs/markdown/snippets/hotdoc_module.md b/docs/markdown/snippets/hotdoc_module.md deleted file mode 100644 index 4662ea2..0000000 --- a/docs/markdown/snippets/hotdoc_module.md +++ /dev/null @@ -1,22 +0,0 @@ -## Hotdoc module - -A new module has been written to ease generation of [hotdoc](https://hotdoc.github.io/) based -documentation. It supports complex use cases such as hotdoc subprojects (to create documentation -portals) and makes it straight forward to leverage full capabilities of hotdoc. - -Simple usage: - -``` meson -hotdoc = import('hotdoc') - -hotdoc.generate_doc( - 'foobar', - c_smart_index: true, - project_version: '0.1', - sitemap: 'sitemap.txt', - index: 'index.md', - c_sources: ['path/to/file.c'], - languages: ['c'], - install: true, -) -```
\ No newline at end of file diff --git a/docs/markdown/snippets/i18n_variable_substitution.md b/docs/markdown/snippets/i18n_variable_substitution.md deleted file mode 100644 index b58f62a..0000000 --- a/docs/markdown/snippets/i18n_variable_substitution.md +++ /dev/null @@ -1,4 +0,0 @@ -## i18n.merge_file() now fully supports variable substitutions defined in custom_target() - -Filename substitutions like @BASENAME@ and @PLAINNAME@ were previously accepted but the name of the build target wasn't altered leading to colliding target names when using the substitution twice. -i18n.merge_file() now behaves as custom_target() in this regard. diff --git a/docs/markdown/snippets/native_args.md b/docs/markdown/snippets/native_args.md deleted file mode 100644 index 54c6de2..0000000 --- a/docs/markdown/snippets/native_args.md +++ /dev/null @@ -1,34 +0,0 @@ -## Projects args can be set separately for cross and native builds (potentially breaking change) - -It has been a longstanding bug (or let's call it a "delayed bug fix") -that if yo do this: - -```meson -add_project_arguments('-DFOO', language : 'c') -``` - -Then the flag is used both in native and cross compilations. This is -very confusing and almost never what you want. To fix this a new -keyword `native` has been added to all functions that add arguments, -namely `add_global_arguments`, `add_global_link_arguments`, -`add_project_arguments` and `add_project_link_arguments` that behaves -like the following: - -``` -## Added to native builds when compiling natively and to cross -## compilations when doing cross compiles. -add_project_arguments(...) - -## Added only to native compilations, not used in cross compilations. -add_project_arguments(..., native : true) - -## Added only to cross compilations, not used in native compilations. -add_project_arguments(..., native : false) -``` - -Also remember that cross compilation is a property of each -target. There can be target that are compiled with the native compiler -and some which are compiled with the cross compiler. - -Unfortunately this change is backwards incompatible and may cause some -projects to fail building. However this should be very rare in practice. diff --git a/docs/markdown/snippets/overrideexe.md b/docs/markdown/snippets/overrideexe.md deleted file mode 100644 index 59213c5..0000000 --- a/docs/markdown/snippets/overrideexe.md +++ /dev/null @@ -1,8 +0,0 @@ -## More flexible `override_find_program()`. - -It is now possible to pass an `executable` to -`override_find_program()` if the overridden program is not used during -configure. - -This is particularly useful for fallback dependencies like Protobuf -that also provide a tool like protoc. diff --git a/docs/markdown/snippets/shared_library_darwin_versions.md b/docs/markdown/snippets/shared_library_darwin_versions.md deleted file mode 100644 index ad137f3..0000000 --- a/docs/markdown/snippets/shared_library_darwin_versions.md +++ /dev/null @@ -1,9 +0,0 @@ -## `shared_library()` now supports setting dylib compatibility and current version - -Now, by default `shared_library()` sets `-compatibility_version` and -`-current_version` of a macOS dylib using the `soversion`. - -This can be overriden by using the `darwin_versions:` kwarg to -[`shared_library()`](Reference-manual.md#shared_library). As usual, you can -also pass this kwarg to `library()` or `build_target()` and it will be used in -the appropriate circumstances. diff --git a/docs/markdown/snippets/version_comparison.md b/docs/markdown/snippets/version_comparison.md deleted file mode 100644 index 861a3ee..0000000 --- a/docs/markdown/snippets/version_comparison.md +++ /dev/null @@ -1,15 +0,0 @@ -## Version comparison - -`dependency(version:)` and other version constraints now handle versions -containing non-numeric characters better, comparing versions using the rpmvercmp -algorithm (as using the `pkg-config` autoconf macro `PKG_CHECK_MODULES` does). - -This is a breaking change for exact comparison constraints which rely on the -previous comparison behaviour of extending the compared versions with `'0'` -elements, up to the same length of `'.'`-separated elements. - -For example, a version of `'0.11.0'` would previously match a version constraint -of `'==0.11'`, but no longer does, being instead considered strictly greater. - -Instead, use a version constraint which exactly compares with the precise -version required, e.g. `'==0.11.0'`. diff --git a/docs/markdown/snippets/visibility.md b/docs/markdown/snippets/visibility.md deleted file mode 100644 index bbb99f1..0000000 --- a/docs/markdown/snippets/visibility.md +++ /dev/null @@ -1,13 +0,0 @@ -## Keyword argument for GNU symbol visibility - -Build targets got a new keyword, `gnu_symbol_visibility` that controls -how symbols are exported from shared libraries. This is most commonly -used to hide implementation symbols like this: - -```meson -shared_library('mylib', ... - gnu_symbol_visibility: 'hidden') -``` - -In this case only symbols explicitly marked as visible in the source -files get exported. diff --git a/docs/markdown/snippets/wrap_clone_recursive.md b/docs/markdown/snippets/wrap_clone_recursive.md deleted file mode 100644 index 7c1c0da..0000000 --- a/docs/markdown/snippets/wrap_clone_recursive.md +++ /dev/null @@ -1,7 +0,0 @@ -## Git wraps can now clone submodules automatically - -To enable this, the following needs to be added to the `.wrap` file: - -```ini -clone-recursive=true -```
\ No newline at end of file diff --git a/docs/sitemap.txt b/docs/sitemap.txt index 4ba1b90..bfed027 100644 --- a/docs/sitemap.txt +++ b/docs/sitemap.txt @@ -69,6 +69,7 @@ index.md Shipping-prebuilt-binaries-as-wraps.md fallback-wraptool.md Release-notes.md + Release-notes-for-0.49.0.md Release-notes-for-0.48.0.md Release-notes-for-0.47.0.md Release-notes-for-0.46.0.md diff --git a/man/meson.1 b/man/meson.1 index 747def8..a171b0b 100644 --- a/man/meson.1 +++ b/man/meson.1 @@ -1,4 +1,4 @@ -.TH MESON "1" "July 2018" "meson 0.47.0" "User Commands" +.TH MESON "1" "September 2018" "meson 0.48.0" "User Commands" .SH NAME meson - a high productivity build system .SH DESCRIPTION diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py index 3ef18e8..7c6a43b 100644 --- a/mesonbuild/compilers/c.py +++ b/mesonbuild/compilers/c.py @@ -124,6 +124,8 @@ class CCompiler(Compiler): if getattr(self, 'compiler_type', False) and self.compiler_type.is_osx_compiler: # Clang, GCC and ICC on macOS all use the same rpath arguments return self.build_osx_rpath_args(build_dir, rpath_paths, build_rpath) + elif self.compiler_type.is_windows_compiler: + return [] return self.build_unix_rpath_args(build_dir, from_dir, rpath_paths, build_rpath, install_rpath) def get_dependency_gen_args(self, outtarget, outfile): diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index a10f9ed..87bf5af 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -1314,9 +1314,11 @@ class GnuLikeCompiler(abc.ABC): def __init__(self, compiler_type): self.compiler_type = compiler_type self.base_options = ['b_pch', 'b_lto', 'b_pgo', 'b_sanitize', 'b_coverage', - 'b_ndebug', 'b_staticpic', 'b_asneeded'] - if not self.compiler_type.is_osx_compiler: + 'b_ndebug', 'b_staticpic'] + if not self.compiler_type.is_osx_compiler and not self.compiler_type.is_windows_compiler: self.base_options.append('b_lundef') + if not self.compiler_type.is_windows_compiler: + self.base_options.append('b_asneeded') # All GCC-like backends can do assembly self.can_compile_suffixes.add('s') diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py index 1cbe494..1ab7d72 100644 --- a/mesonbuild/coredata.py +++ b/mesonbuild/coredata.py @@ -23,7 +23,7 @@ from .wrap import WrapMode import ast import argparse -version = '0.47.999' +version = '0.48.999' backendlist = ['ninja', 'vs', 'vs2010', 'vs2015', 'vs2017', 'xcode'] default_yielding = False diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index 9c969ad..7a44f2f 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -69,6 +69,7 @@ build_filename = 'meson.build' known_cpu_families = ( 'aarch64', + 'arc', 'arm', 'e2k', 'ia64', @@ -1039,6 +1040,9 @@ class CrossBuildInfo: if entry == 'cpu_family' and res not in known_cpu_families: mlog.warning('Unknown CPU family %s, please report this at https://github.com/mesonbuild/meson/issues/new' % value) + if entry == 'endian' and res not in ('little', 'big'): + mlog.warning('Unknown endian %s in cross file' % res) + if self.ok_type(res): self.config[s][entry] = res elif isinstance(res, list): diff --git a/mesonbuild/mesonmain.py b/mesonbuild/mesonmain.py index cd925e5..dfad2e7 100644 --- a/mesonbuild/mesonmain.py +++ b/mesonbuild/mesonmain.py @@ -113,7 +113,7 @@ class MesonApp: '\nIf build failures persist, manually wipe your build directory to clear any\n' 'stored system data.\n' '\nTo change option values, run "meson configure" instead.') - sys.exit(1) + sys.exit(0) else: if reconfigure: print('Directory does not contain a valid build tree:\n{}'.format(build_dir)) diff --git a/mesonbuild/modules/hotdoc.py b/mesonbuild/modules/hotdoc.py index e621938..1080160 100644 --- a/mesonbuild/modules/hotdoc.py +++ b/mesonbuild/modules/hotdoc.py @@ -38,12 +38,13 @@ MIN_HOTDOC_VERSION = '0.8.100' class HotdocTargetBuilder: - def __init__(self, name, state, hotdoc, kwargs): + def __init__(self, name, state, hotdoc, interpreter, kwargs): self.hotdoc = hotdoc self.build_by_default = kwargs.pop('build_by_default', False) self.kwargs = kwargs self.name = name self.state = state + self.interpreter = interpreter self.include_paths = OrderedDict() self.builddir = state.environment.get_build_dir() @@ -93,7 +94,7 @@ class HotdocTargetBuilder: self.check_extra_arg_type(arg, v) return - valid_types = (str, bool, mesonlib.File, build.IncludeDirs) + valid_types = (str, bool, mesonlib.File, build.IncludeDirs, build.CustomTarget, build.BuildTarget) if not isinstance(value, valid_types): raise InvalidArguments('Argument "%s=%s" should be of type: %s.' % ( arg, value, [t.__name__ for t in valid_types])) @@ -211,6 +212,9 @@ class HotdocTargetBuilder: cmd.append(os.path.join(self.builddir, arg.get_curdir(), inc_dir)) continue + elif isinstance(arg, build.CustomTarget) or isinstance(arg, build.BuildTarget): + self._dependencies.append(arg) + arg = self.interpreter.backend.get_target_filename_abs(arg) cmd.append(arg) @@ -384,7 +388,7 @@ class HotDocModule(ExtensionModule): ' required for the project name.') project_name = args[0] - builder = HotdocTargetBuilder(project_name, state, self.hotdoc, kwargs) + builder = HotdocTargetBuilder(project_name, state, self.hotdoc, self.interpreter, kwargs) target, install_script = builder.make_targets() targets = [HotdocTargetHolder(target, self.interpreter)] if install_script: diff --git a/run_unittests.py b/run_unittests.py index 80864c9..8fe1c11 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -3794,7 +3794,7 @@ class LinuxlikeTests(BasePlatformTests): break self.assertIsInstance(docbook_target, dict) ifile = self.introspect(['--target-files', 'generated-gdbus-docbook@cus'])[0] - self.assertEqual(t['filename'], 'gdbus/generated-gdbus-doc-' + ifile) + self.assertEqual(t['filename'], 'gdbus/generated-gdbus-doc-' + os.path.basename(ifile)) def test_build_rpath(self): if is_cygwin(): diff --git a/test cases/failing/88 dub compiler/meson.build b/test cases/failing/88 dub compiler/meson.build index f5bc494..2f0b801 100644 --- a/test cases/failing/88 dub compiler/meson.build +++ b/test cases/failing/88 dub compiler/meson.build @@ -1,3 +1,9 @@ project('dub', 'd', meson_version: '0.48.0') +if meson.get_compiler('d').get_id() == 'dmd' + if host_machine.system() == 'windows' or host_machine.system() == 'cygwin' + error('MESON_SKIP_TEST Windows test environment lacks multiple D compilers.') + endif +endif + dependency('dubtestproject:test2', method: 'dub') # Compiler mismatch |