diff -Nru meson-0.49.0/cross/armclang-linux.txt meson-0.52.1/cross/armclang-linux.txt --- meson-0.49.0/cross/armclang-linux.txt 1970-01-01 00:00:00.000000000 +0000 +++ meson-0.52.1/cross/armclang-linux.txt 2019-08-28 17:15:38.000000000 +0000 @@ -0,0 +1,35 @@ +# Using ARM compilers from Linux command line is tricky and +# not really well documented because they want you to use +# their IDE instead. +# +# First you need to do the full install with the IDE and set +# up license files et al. This may be possible from the command +# line. +# +# Then you need to do the following: +# +# Select toolchain by running /opt/arm/developmentstudio-2019.0/bin/select_default_toolchain +# Armcc is only available in toolchain version 5. +# Armclang is only available in toolchain version 6. +# Start shell with /opt/arm/developmentstudio-2019.0/bin/suite_exec zsh +# Now the compilers will work. + +[binaries] +# we could set exe_wrapper = qemu-arm-static but to test the case +# when cross compiled binaries can't be run we don't do that +c = '/opt/arm/developmentstudio-2019.0/sw/ARMCompiler6.12/bin/armclang' +#c = '/opt/arm/developmentstudio-2019.0/sw/ARMCompiler5.06u6/bin/armcc' +#cpp = '/usr/bin/arm-linux-gnueabihf-g++' +ar = '/opt/arm/developmentstudio-2019.0/sw/ARMCompiler6.12/bin/armar' +#strip = '/usr/arm-linux-gnueabihf/bin/strip' +#pkgconfig = '/usr/bin/arm-linux-gnueabihf-pkg-config' + +[properties] + +#c_args = ['--target=aarch64-arm-none-eabi'] + +[host_machine] +system = 'baremetal' +cpu_family = 'arm' +cpu = 'armv7' # Not sure if correct. +endian = 'little' diff -Nru meson-0.49.0/cross/tvos.txt meson-0.52.1/cross/tvos.txt --- meson-0.49.0/cross/tvos.txt 1970-01-01 00:00:00.000000000 +0000 +++ meson-0.52.1/cross/tvos.txt 2019-06-16 18:54:18.000000000 +0000 @@ -0,0 +1,27 @@ +# This is a cross compilation file from OSX Yosemite to Apple tvOS +# Apple keeps changing the location and names of files so +# these might not work for you. Use the googels and xcrun. + +[binaries] +c = 'clang' +cpp = 'clang++' +ar = 'ar' +strip = 'strip' + +[properties] +root = '/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer' + +c_args = ['-arch', 'arm64', '-mtvos-version-min=12.0', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk'] +cpp_args = ['-arch', 'arm64', '-mtvos-version-min=12.0', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk'] +c_link_args = ['-arch', 'arm64', '-mtvos-version-min=12.0', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk'] +cpp_link_args = ['-arch', 'arm64', '-mtvos-version-min=12.0', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk'] + +has_function_printf = true +has_function_hfkerhisadf = false + +[host_machine] +system = 'darwin' +cpu_family = 'arm' +cpu = 'arm64' +endian = 'little' + diff -Nru meson-0.49.0/cross/ubuntu-armhf.txt meson-0.52.1/cross/ubuntu-armhf.txt --- meson-0.49.0/cross/ubuntu-armhf.txt 2018-08-25 08:05:43.000000000 +0000 +++ meson-0.52.1/cross/ubuntu-armhf.txt 2019-08-25 22:36:06.000000000 +0000 @@ -12,7 +12,7 @@ root = '/usr/arm-linux-gnueabihf' # Used in unit test '140 get define' c_args = ['-DMESON_TEST_ISSUE_1665=1'] -cpp_args = ['-DMESON_TEST_ISSUE_1665=1'] +cpp_args = '-DMESON_TEST_ISSUE_1665=1' has_function_printf = true has_function_hfkerhisadf = false diff -Nru meson-0.49.0/cross/wasm.txt meson-0.52.1/cross/wasm.txt --- meson-0.49.0/cross/wasm.txt 1970-01-01 00:00:00.000000000 +0000 +++ meson-0.52.1/cross/wasm.txt 2019-08-28 17:15:38.000000000 +0000 @@ -0,0 +1,19 @@ +[binaries] +c = '/home/jpakkane/emsdk/fastcomp/emscripten/emcc' +cpp = '/home/jpakkane/emsdk/fastcomp/emscripten/em++' +ar = '/home/jpakkane/emsdk/fastcomp/emscripten/emar' + +[properties] + +c_args = ['-s', 'WASM=1', '-s', 'EXPORT_ALL=1'] +c_link_args = ['-s','EXPORT_ALL=1'] +cpp_args = ['-s', 'WASM=1', '-s', 'EXPORT_ALL=1'] +cpp_link_args = ['-s', 'EXPORT_ALL=1'] + +[host_machine] + +system = 'emscripten' +cpu_family = 'wasm32' +cpu = 'wasm32' +endian = 'little' + diff -Nru meson-0.49.0/data/com.mesonbuild.install.policy meson-0.52.1/data/com.mesonbuild.install.policy --- meson-0.49.0/data/com.mesonbuild.install.policy 2018-08-25 08:05:43.000000000 +0000 +++ meson-0.52.1/data/com.mesonbuild.install.policy 2019-02-07 09:08:55.000000000 +0000 @@ -17,7 +17,6 @@ /usr/bin/python3 /usr/bin/meson - install diff -Nru meson-0.49.0/data/macros.meson meson-0.52.1/data/macros.meson --- meson-0.49.0/data/macros.meson 2018-10-31 09:31:20.000000000 +0000 +++ meson-0.52.1/data/macros.meson 2019-05-02 18:59:50.000000000 +0000 @@ -2,6 +2,12 @@ %__meson_wrap_mode nodownload %__meson_auto_features enabled +%_smp_mesonflags %([ -z "$MESON_BUILD_NCPUS" ] \\\ + && MESON_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"; \\\ + ncpus_max=%{?_smp_ncpus_max}; \\\ + if [ -n "$ncpus_max" ] && [ "$ncpus_max" -gt 0 ] && [ "$MESON_BUILD_NCPUS" -gt "$ncpus_max" ]; then MESON_BUILD_NCPUS="$ncpus_max"; fi; \\\ + if [ "$MESON_BUILD_NCPUS" -gt 1 ]; then echo "--num-processes $MESON_BUILD_NCPUS"; fi) + %meson \ %set_build_flags \ %{shrink:%{__meson} \ @@ -31,9 +37,8 @@ %ninja_install -C %{_vpath_builddir} %meson_test \ - %ninja_test -C %{_vpath_builddir} || \ - ( rc=$?; \ - echo "-----BEGIN TESTLOG-----"; \ - cat %{_vpath_builddir}/meson-logs/testlog.txt; \ - echo "-----END TESTLOG-----"; \ - exit $rc; ) + %{shrink: %{__meson} test \ + -C %{_vpath_builddir} \ + %{?_smp_mesonflags} \ + --print-errorlogs \ + %{nil}} diff -Nru meson-0.49.0/data/shell-completions/bash/meson meson-0.52.1/data/shell-completions/bash/meson --- meson-0.49.0/data/shell-completions/bash/meson 1970-01-01 00:00:00.000000000 +0000 +++ meson-0.52.1/data/shell-completions/bash/meson 2019-03-10 17:10:57.000000000 +0000 @@ -0,0 +1,416 @@ +_meson() { + command="${COMP_WORDS[1]}" + case "$command" in + setup |\ + configure |\ + install |\ + introspect |\ + init |\ + test |\ + wrap |\ + subprojects |\ + help) + _meson-$command "${COMP_WORDS[@]:1}" + ;; + *) + _meson-setup "${COMP_WORDS[@]}" + ;; + esac +} && +complete -F _meson meson + +_meson_complete_option() { + option_string=$1 + + if [[ $# -eq 2 ]] && ! [[ "$option_string" == *=* ]]; then + option_string="$option_string=$2" + fi + + if [[ "$option_string" == *=* ]]; then + _meson_complete_option_value "$option_string" + else + _meson_complete_option_name "$option_string" + fi +} + +_meson_complete_option_name() { + option=$1 + options=($(python3 -c 'import sys, json +for option in json.load(sys.stdin): + print(option["name"]) +' <<< "$(_meson_get_options)")) + compopt -o nospace + COMPREPLY=($(compgen -W '${options[@]}' -S= -- "$option")) +} + +_meson_complete_option_value() { + cur=$1 + option_name=${cur%%=*} + option_value=${cur#*=} + + if _meson_complete_filedir "$option_name" "$option_value"; then + return + fi + +# TODO: support all the option types + options=($(python3 -c 'import sys, json +for option in json.load(sys.stdin): + if option["name"] != "'$option_name'": + continue + choices = [] + if option["type"] == "boolean": + choices.append("true") + choices.append("false") + elif option["type"] == "combo": + for choice in option["choices"]: + choices.append(choice) + for choice in choices: + if choice.startswith("'$cur'"): + print(choice) +' <<< "$(_meson_get_options)")) + COMPREPLY=("${options[@]}") +} + +_meson_get_options() { + local options + for builddir in "${COMP_WORDS[@]}"; do + if [ -d "$builddir" ]; then + break + fi + builddir=. + done + options=$(meson introspect "$builddir" --buildoptions 2>/dev/null) && + echo "$options" || + echo '[]' +} + +_meson_complete_filedir() { + _filedir_in() { + pushd "$1" &>/dev/null + local COMPREPLY=() + _filedir + echo "${COMPREPLY[@]}" + popd &>/dev/null + } + + option=$1 + cur=$2 + case $option in + prefix |\ + libdir |\ + libexecdir |\ + bindir |\ + sbindir |\ + includedir |\ + datadir |\ + mandir |\ + infodir |\ + localedir |\ + sysconfdir |\ + localstatedir |\ + sharedstatedir) + _filedir -d + ;; + cross-file) + _filedir + COMPREPLY+=($(_filedir_in "$XDG_DATA_DIRS"/meson/cross)) + COMPREPLY+=($(_filedir_in /usr/local/share/meson/cross)) + COMPREPLY+=($(_filedir_in /usr/share/meson/cross)) + COMPREPLY+=($(_filedir_in "$XDG_DATA_HOME"/meson/cross)) + COMPREPLY+=($(_filedir_in ~/.local/share/meson/cross)) + ;; + *) + return 1;; + esac + return 0 +} + +_meson-setup() { + + shortopts=( + h + D + v + ) + + longopts=( + help + prefix + libdir + libexecdir + bindir + sbindir + includedir + datadir + mandir + infodir + localedir + sysconfdir + localstatedir + sharedstatedir + backend + buildtype + strip + unity + werror + layout + default-library + warnlevel + stdsplit + errorlogs + cross-file + version + wrap-mode + ) + + local cur prev + if _get_comp_words_by_ref cur prev &>/dev/null && + [ "${prev:0:2}" = '--' ] && _meson_complete_option "${prev:2}" "$cur"; then + return + elif _get_comp_words_by_ref cur prev &>/dev/null && + [ "${prev:0:1}" = '-' ] && [ "${prev:1:2}" != '-' ] && _meson_complete_option "${prev:1}"; then + return + elif _get_comp_words_by_ref -n '=' cur prev &>/dev/null; then + if [ $prev == -D ]; then + _meson_complete_option "$cur" + return + fi + else + cur="${COMP_WORDS[COMP_CWORD]}" + fi + + if [[ "$cur" == "--"* ]]; then + COMPREPLY+=($(compgen -P '--' -W '${longopts[*]}' -- "${cur:2}")) + elif [[ "$cur" == "-"* ]]; then + COMPREPLY+=($(compgen -P '--' -W '${longopts[*]}' -- "${cur:2}")) + COMPREPLY+=($(compgen -P '-' -W '${shortopts[*]}' -- "${cur:1}")) + else + _filedir -d + if [ -z "$cur" ]; then + COMPREPLY+=($(compgen -P '--' -W '${longopts[*]}')) + COMPREPLY+=($(compgen -P '-' -W '${shortopts[*]}')) + fi + + if [ $COMP_CWORD -eq 1 ]; then + COMPREPLY+=($(compgen -W 'setup configure test introspect' -- "$cur")) + fi + fi +} + +_meson-configure() { + + shortopts=( + h + D + ) + + longopts=( + help + clearcache + ) + + local cur prev + if _get_comp_words_by_ref -n '=' cur prev &>/dev/null; then + if [ $prev == -D ]; then + _meson_complete_option "$cur" + return + fi + else + cur="${COMP_WORDS[COMP_CWORD]}" + fi + + if [[ "$cur" == "--"* ]]; then + COMPREPLY+=($(compgen -P '--' -W '${longopts[*]}' -- "${cur:2}")) + elif [[ "$cur" == "-"* ]]; then + COMPREPLY+=($(compgen -P '--' -W '${longopts[*]}' -- "${cur:2}")) + COMPREPLY+=($(compgen -P '-' -W '${shortopts[*]}' -- "${cur:1}")) + else + for dir in "${COMP_WORDS[@]}"; do + if [ -d "$dir" ]; then + break + fi + dir=. + done + if [ ! -d "$dir/meson-private" ]; then + _filedir -d + fi + + if [ -z "$cur" ]; then + COMPREPLY+=($(compgen -P '--' -W '${longopts[*]}')) + COMPREPLY+=($(compgen -P '-' -W '${shortopts[*]}')) + fi + fi +} + +_meson-test() { + shortopts=( + q + v + t + C + ) + + longopts=( + quiet + verbose + timeout-multiplier + repeat + no-rebuild + gdb + list + wrapper --wrap + no-suite + suite + no-stdsplit + print-errorlogs + benchmark + logbase + num-processes + setup + test-args + ) + + local cur prev + if _get_comp_words_by_ref -n ':' cur prev &>/dev/null; then + case $prev in + --repeat) + # number, can't be completed + return + ;; + --wrapper) + _command_offset $COMP_CWORD + return + ;; + -C) + _filedir -d + return + ;; + --suite | --no-suite) + for i in "${!COMP_WORDS[@]}"; do + opt="${COMP_WORDS[i]}" + dir="${COMP_WORDS[i+1]}" + case "$opt" in + -C) + break + ;; + esac + dir=. + done + suites=($(python3 -c 'import sys, json; +for test in json.load(sys.stdin): + for suite in test["suite"]: + print(suite) + ' <<< "$(meson introspect "$dir" --tests)")) +# TODO + COMPREPLY+=($(compgen -W "${suites[*]}" -- "$cur")) + return + ;; + --logbase) + # free string, can't be completed + return + ;; + --num-processes) + # number, can't be completed + return + ;; + -t | --timeout-multiplier) + # number, can't be completed + return + ;; + --setup) + # TODO + return + ;; + --test-args) + return + ;; + esac + else + cur="${COMP_WORDS[COMP_CWORD]}" + fi + + if [[ "$cur" == "--"* ]]; then + COMPREPLY+=($(compgen -P '--' -W '${longopts[*]}' -- "${cur:2}")) + elif [[ "$cur" == "-"* && ${#cur} -gt 1 ]]; then + COMPREPLY+=($(compgen -P '-' -W '${shortopts[*]}' -- "${cur:1}")) + else + for dir in "${COMP_WORDS[@]}"; do + if [ -d "$dir" ]; then + break + fi + dir=. + done + if [ ! -d "$dir/meson-private" ]; then + _filedir -d + fi + + for i in "${!COMP_WORDS[@]}"; do + opt="${COMP_WORDS[i]}" + dir="${COMP_WORDS[i+1]}" + case "$opt" in + -C) + break + ;; + esac + dir=. + done + tests=($(python3 -c 'import sys, json; +for test in json.load(sys.stdin): + print(test["name"]) +' <<< "$(meson introspect "$dir" --tests)")) + COMPREPLY+=($(compgen -W "${tests[*]}" -- "$cur")) + + if [ -z "$cur" ]; then + COMPREPLY+=($(compgen -P '--' -W '${longopts[*]}' -- "${cur:2}")) + COMPREPLY+=($(compgen -P '-' -W '${shortopts[*]}' -- "${cur:1}")) + fi + fi +} + +_meson-introspect() { + shortopts=( + h + ) + + longopts=( + targets + installed + buildsystem-files + buildoptions + tests + benchmarks + dependencies + projectinfo + ) + + local cur prev + if ! _get_comp_words_by_ref cur prev &>/dev/null; then + cur="${COMP_WORDS[COMP_CWORD]}" + fi + + if [[ "$cur" == "--"* ]]; then + COMPREPLY+=($(compgen -P '--' -W '${longopts[*]}' -- "${cur:2}")) + elif [[ "$cur" == "-"* ]]; then + COMPREPLY+=($(compgen -P '--' -W '${longopts[*]}' -- "${cur:2}")) + COMPREPLY+=($(compgen -P '-' -W '${shortopts[*]}' -- "${cur:1}")) + else + for dir in "${COMP_WORDS[@]}"; do + if [ -d "$dir" ]; then + break + fi + dir=. + done + if [ ! -d "$dir/meson-private" ]; then + _filedir -d + fi + + if [ -z "$cur" ]; then + COMPREPLY+=($(compgen -P '--' -W '${longopts[*]}')) + COMPREPLY+=($(compgen -P '-' -W '${shortopts[*]}')) + fi + fi +} + +_meson-wrap() { + : TODO +} diff -Nru meson-0.49.0/data/shell-completions/zsh/_meson meson-0.52.1/data/shell-completions/zsh/_meson --- meson-0.49.0/data/shell-completions/zsh/_meson 2018-08-25 08:05:43.000000000 +0000 +++ meson-0.52.1/data/shell-completions/zsh/_meson 2019-03-10 17:10:57.000000000 +0000 @@ -49,8 +49,7 @@ # TODO: implement build option completion (( $+functions[__meson_build_options] )) || __meson_build_options() {} -# TODO: implement target name completion -(( $+functions[__meson_targets] )) || __meson_targets() {} + # `meson introspect` currently can provide that information in JSON. # We can: # 1) pipe its output to python3 -m json.tool | grep "$alovelyregex" | cut <...> @@ -170,7 +169,6 @@ local -a specs=( '--targets[list top level targets]' '--installed[list all installed files and directories]' - '--target-files[list source files for a given target]:target:__meson_targets' '--buildsystem-files[list files that belong to the build system]' '--buildoptions[list all build options]' '--tests[list all unit tests]' diff -Nru meson-0.49.0/data/syntax-highlighting/vim/syntax/meson.vim meson-0.52.1/data/syntax-highlighting/vim/syntax/meson.vim --- meson-0.49.0/data/syntax-highlighting/vim/syntax/meson.vim 2018-10-31 09:31:20.000000000 +0000 +++ meson-0.52.1/data/syntax-highlighting/vim/syntax/meson.vim 2019-11-28 17:37:44.000000000 +0000 @@ -69,6 +69,7 @@ \ add_project_arguments \ add_project_link_arguments \ add_test_setup + \ alias_target \ assert \ benchmark \ both_libraries @@ -97,6 +98,7 @@ \ install_headers \ install_man \ install_subdir + \ is_disabler \ is_variable \ jar \ join_paths diff -Nru meson-0.49.0/debian/changelog meson-0.52.1/debian/changelog --- meson-0.49.0/debian/changelog 2019-01-10 15:39:12.000000000 +0000 +++ meson-0.52.1/debian/changelog 2020-06-11 00:14:52.000000000 +0000 @@ -1,8 +1,85 @@ -meson (0.49.0-1~bionic) bionic; urgency=medium +meson (0.52.1-1~bionic1) bionic; urgency=medium - * Backport to 18.04. + * build for bionic - -- Martin Pitt Thu, 10 Jan 2019 15:39:12 +0000 + -- Dan Streetman Wed, 10 Jun 2020 20:14:52 -0400 + +meson (0.52.1-1) unstable; urgency=medium + + * New upstream release. Closes: #945277. + * Packaging fixes from Lasse Kantola. Closes: #870314. + + -- Jussi Pakkanen Fri, 29 Nov 2019 15:52:29 +0200 + +meson (0.52.0-2) unstable; urgency=medium + + * Update wxwidgets build dependency. Closes: #943437. + * Disable FPGA tests temporarily to work around Yosys upstream + bug #1467. + + -- Jussi Pakkanen Tue, 29 Oct 2019 23:48:25 +0200 + +meson (0.52.0-1) unstable; urgency=medium + + * New upstream release. + * Removed python2 build dep to prepare for Python 2 removal. + Added boost-python explicitly to build-deps. + + -- Jussi Pakkanen Sun, 06 Oct 2019 20:05:53 +0300 + +meson (0.51.2-1) unstable; urgency=medium + + * New upstream release. + * Updated standards and compat versions. + + -- Jussi Pakkanen Mon, 26 Aug 2019 19:39:22 +0300 + +meson (0.51.1-1) unstable; urgency=medium + + * New upstream release. + * Fix debcrossgen on i386. + + -- Jussi Pakkanen Tue, 09 Jul 2019 19:40:49 +0300 + +meson (0.51.0-1) experimental; urgency=medium + + * New upstream release. + * Add build-dep to CMake needed by new tests. + + -- Jussi Pakkanen Sun, 16 Jun 2019 22:04:22 +0300 + +meson (0.50.1-1) experimental; urgency=medium + + * New upstream release. + + -- Jussi Pakkanen Wed, 17 Apr 2019 01:12:02 +0300 + +meson (0.50.0-1) experimental; urgency=medium + + * New upstream release. + * Install zsh completion files. Closes: #920154. + * Add python2-dev to build deps as needed by new tests. + + -- Jussi Pakkanen Sun, 10 Mar 2019 19:27:10 +0200 + +meson (0.49.2-1) unstable; urgency=medium + + * New upstream release. + + -- Jussi Pakkanen Mon, 04 Feb 2019 21:20:09 +0200 + +meson (0.49.1-1) unstable; urgency=medium + + * New upstream release. + + -- Jussi Pakkanen Wed, 23 Jan 2019 18:49:53 +0200 + +meson (0.49.0-2) unstable; urgency=medium + + * Debcrossgen CPU fix from Helmut Grohne. Closes: #919065. + * Add system compiler flags to cross files. Closes: #919117. + + -- Jussi Pakkanen Sun, 13 Jan 2019 00:59:08 +0200 meson (0.49.0-1) unstable; urgency=medium diff -Nru meson-0.49.0/debian/control meson-0.52.1/debian/control --- meson-0.49.0/debian/control 2018-09-24 15:52:45.000000000 +0000 +++ meson-0.52.1/debian/control 2020-06-11 00:13:35.000000000 +0000 @@ -2,11 +2,13 @@ Maintainer: Jussi Pakkanen Section: devel Priority: optional -Standards-Version: 4.2.1 +Standards-Version: 4.4.1 Homepage: https://mesonbuild.com -X-Python3-Version: >= 3.5 +X-Python3-Version: >= 3.6 +Rules-Requires-Root: no Build-Depends: debhelper (>= 11), python3:any (>= 3.5), + dh-exec, dh-python, python3-setuptools, ninja-build (>= 1.6), @@ -17,6 +19,7 @@ libboost-thread-dev , libboost-test-dev , libboost-log-dev , + libboost-python-dev , gobjc , gobjc++ , gnustep-make , @@ -38,7 +41,7 @@ bison , mono-mcs , mono-devel , - libwxgtk3.0-dev , + libwxgtk3.0-gtk3-dev , python3-gi , gtk-doc-tools , # Rust is not needed to build Meson, only to run a part of its test @@ -75,20 +78,22 @@ mercurial , gcovr , lcov , - fpga-icestorm , - arachne-pnr , - yosys , +# Disabled temporarily as this has an upstream bug. +# fpga-icestorm , +# arachne-pnr , +# yosys , doxygen , nasm , + cmake , Package: meson Architecture: all Multi-Arch: foreign -Depends: ${shlibs:Depends}, ${misc:Depends}, -# ${python3:Depends}, +Depends: + ${misc:Depends}, + ${python3:Depends}, ninja-build(>=1.6), - python3, - python3-pkg-resources, +# python3-pkg-resources, Description: high-productivity build system Meson is a build system designed to increase programmer productivity. It does this by providing a fast, simple and easy to diff -Nru meson-0.49.0/debian/debcrossgen meson-0.52.1/debian/debcrossgen --- meson-0.49.0/debian/debcrossgen 2018-04-23 00:26:52.000000000 +0000 +++ meson-0.52.1/debian/debcrossgen 2020-06-09 13:50:13.000000000 +0000 @@ -23,6 +23,9 @@ If you do not specify the --arch argument, Meson assumes that running plain 'dpkg-architecture' will return correct information for the host system. + +This script must be run in an environment where CPPFLAGS et al are set to the +same values used in the actual compilation. ''' ) @@ -42,6 +45,36 @@ return f raise ValueError("%s not found on $PATH" % program) +def write_args_line(ofile, name, args): + if len(args) == 0: + return + ostr = name + ' = [' + ostr += ', '.join("'" + i + "'" for i in args) + ostr += ']\n' + ofile.write(ostr) + +def write_args_from_envvars(ofile): + import shlex + cppflags = shlex.split(os.environ.get('CPPFLAGS', '')) + cflags = shlex.split(os.environ.get('CFLAGS', '')) + cxxflags = shlex.split(os.environ.get('CXXFLAGS', '')) + ldflags = shlex.split(os.environ.get('LDFLAGS', '')) + + c_args = cppflags + cflags + cpp_args = cppflags + cxxflags + c_link_args = cflags + ldflags + cpp_link_args = cxxflags + ldflags + + write_args_line(ofile, 'c_args', c_args) + write_args_line(ofile, 'cpp_args', cpp_args) + write_args_line(ofile, 'c_link_args', c_link_args) + write_args_line(ofile, 'cpp_link_args', cpp_link_args) + +cpu_family_map = dict(mips64el="mips64", + i686='x86') +cpu_map = dict(armhf="arm7hlf", + mips64el="mips64",) + def run(options): if options.arch is None: cmd = ['dpkg-architecture'] @@ -57,8 +90,10 @@ data[k] = v host_arch = data['DEB_HOST_GNU_TYPE'] host_os = data['DEB_HOST_ARCH_OS'] - host_cpu_family = data['DEB_HOST_GNU_CPU'] - host_cpu = data['DEB_HOST_ARCH'] # Not really correct, should be arm7hlf etc but it is not exposed. + host_cpu_family = cpu_family_map.get(data['DEB_HOST_GNU_CPU'], + data['DEB_HOST_GNU_CPU']) + host_cpu = cpu_map.get(data['DEB_HOST_ARCH'], + data['DEB_HOST_ARCH']) host_endian = data['DEB_HOST_ARCH_ENDIAN'] with open(options.outfile, "w") as ofile: ofile.write('[binaries]\n') @@ -75,6 +110,7 @@ except ValueError: pass # pkg-config is optional ofile.write('\n[properties]\n') + write_args_from_envvars(ofile) ofile.write('\n[host_machine]\n') ofile.write("system = '%s'\n" % host_os) ofile.write("cpu_family = '%s'\n" % host_cpu_family) @@ -84,4 +120,4 @@ if __name__ == '__main__': options = parser.parse_args() run(options) - print('Remember to add the proper --libdir arg to Meson invocation.') + print('Remember to add the correct --libdir arg to Meson invocation.') diff -Nru meson-0.49.0/debian/install meson-0.52.1/debian/install --- meson-0.49.0/debian/install 1970-01-01 00:00:00.000000000 +0000 +++ meson-0.52.1/debian/install 2020-06-11 00:12:22.000000000 +0000 @@ -0,0 +1,4 @@ +#!/usr/bin/dh-exec +__main__.py => /usr/bin/meson +debian/debcrossgen /usr/share/meson +data/shell-completions/zsh/_meson /usr/share/zsh/vendor-completions \ No newline at end of file diff -Nru meson-0.49.0/debian/rules meson-0.52.1/debian/rules --- meson-0.49.0/debian/rules 2018-08-04 23:00:41.000000000 +0000 +++ meson-0.52.1/debian/rules 2020-06-11 00:12:22.000000000 +0000 @@ -18,23 +18,3 @@ override_dh_auto_test: ./run_tests.py endif - -override_dh_clean: - dh_clean - rm -f meson-test-run.txt meson-test-run.xml - rm -rf __pycache__ - rm -rf mesonbuild/__pycache__ - rm -rf mesonbuild/*/__pycache__ - -override_dh_install: -# Helper script to autogenerate cross files. - dh_install - mkdir -p $$(pwd)/debian/meson/usr/share/meson - cp debian/debcrossgen $$(pwd)/debian/meson/usr/share/meson - rm -rf $$(pwd)/debian/meson/usr/lib/python*/dist-packages/mesonbuild/__pycache__ - rm -rf $$(pwd)/debian/meson/usr/lib/python*/dist-packages/mesonbuild/*/__pycache__ -# For some reason Debian helpers install the files in the wrong directory, -# i.e. /usr/lib/python3.6 instead of /usr/lib/python3. I don't know why -# or how to fix it, since we just call to the default tools with default -# parameters. Fix manually. - mv $$(pwd)/debian/meson/usr/lib/python3.* $$(pwd)/debian/meson/usr/lib/python3 diff -Nru meson-0.49.0/debian/upstream/metadata meson-0.52.1/debian/upstream/metadata --- meson-0.49.0/debian/upstream/metadata 1970-01-01 00:00:00.000000000 +0000 +++ meson-0.52.1/debian/upstream/metadata 2020-06-11 00:12:22.000000000 +0000 @@ -0,0 +1,8 @@ +Bug-Database: https://github.com/mesonbuild/meson/issues +Documentation: https://mesonbuild.com +FAQ: https://mesonbuild.com/FAQ.html +Registry: + - Name: PyPI + Entry: meson +Repository: https://github.com/mesonbuild/meson.git +Repository-Browse: https://github.com/mesonbuild/meson Binary files /tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/graphics/meson_logo_big.png and /tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/graphics/meson_logo_big.png differ diff -Nru meson-0.49.0/graphics/meson_logo.svg meson-0.52.1/graphics/meson_logo.svg --- meson-0.49.0/graphics/meson_logo.svg 2016-01-23 18:52:39.000000000 +0000 +++ meson-0.52.1/graphics/meson_logo.svg 2019-02-13 18:47:00.000000000 +0000 @@ -7,17 +7,60 @@ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" - xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="744.09448819" - height="1052.3622047" - id="svg2" + width="210mm" + height="297mm" + viewBox="0 0 210 297" version="1.1" - inkscape:version="0.91 r13725" + id="svg1769" + inkscape:version="0.92.3 (2405546, 2018-03-11)" sodipodi:docname="meson_logo.svg"> + id="defs1763"> + + + + + + + + + + - - - - - - - + inkscape:window-width="1226" + inkscape:window-height="910" + inkscape:window-x="536" + inkscape:window-y="82" + inkscape:window-maximized="0" /> + id="metadata1766"> image/svg+xml - + @@ -78,21 +95,246 @@ inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1"> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26416996;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 96.975039,102.57831 c -3.04835,1.72126 -4.94049,4.94629 -4.95784,8.44909 3.18944,1.73892 6.93427,1.67939 9.836611,0.0181 2.6e-4,-0.008 7.9e-4,-0.0165 0.001,-0.0248 -0.004,-3.484 -1.863431,-6.70217 -4.879301,-8.44238 z m 1.64176,3.72948 c 0.45198,0.30715 0.38492,1.04655 0.31212,1.55288 -0.0926,0.55776 -0.62713,1.47487 -1.32188,2.07326 0.0899,0.12885 0.14181,0.28753 0.14108,0.45682 -0.43052,0.21761 -0.85742,-0.0278 -1.37408,-0.47026 -0.51665,-0.44244 -1.07391,-1.32905 -1.25884,-2.24017 -0.16403,0.0174 -0.33188,-0.0192 -0.47594,-0.11007 0.0376,-0.51089 0.57985,-0.8146 1.0604,-0.99374 0.48056,-0.17913 1.71868,-0.2395 2.59158,0.0708 0.0681,-0.1429 0.18071,-0.26288 0.32556,-0.339 z" + id="path817-6-2-9-7-9-93-9-8-1-2-4-6" /> diff -Nru meson-0.49.0/man/meson.1 meson-0.52.1/man/meson.1 --- meson-0.49.0/man/meson.1 2018-12-09 19:42:19.000000000 +0000 +++ meson-0.52.1/man/meson.1 2019-11-28 17:37:44.000000000 +0000 @@ -1,4 +1,4 @@ -.TH MESON "1" "December 2018" "meson 0.49.0" "User Commands" +.TH MESON "1" "November 2019" "meson 0.52.1" "User Commands" .SH NAME meson - a high productivity build system .SH DESCRIPTION @@ -6,7 +6,7 @@ Meson is a build system designed to optimize programmer productivity. It aims to do this by providing simple, out-of-the-box support for modern software development tools and practices, such as -unit tests, coverage reports, Valgrind, CCache and the like. +unit tests, coverage reports, Valgrind, Ccache and the like. The main Meson executable provides many subcommands to access all the functionality. @@ -20,9 +20,9 @@ .B meson setup [ .I options .B ] [ -.I source directory -.B ] [ .I build directory +.B ] [ +.I source directory .B ] Note that the build directory must be different from the source @@ -37,7 +37,7 @@ You only need to run the Meson command once: when you first configure your build dir. After that you just run the build command. Meson will -autodetect changes in your source tree and regenerates all files +autodetect changes in your source tree and regenerate all files needed to build the project. The setup command is the default operation. If no actual command is @@ -48,9 +48,9 @@ .B meson [ .I options .B ] [ -.I source directory -.B ] [ .I build directory +.B ] [ +.I source directory .B ] .SS "options:" @@ -124,6 +124,18 @@ .B meson test provides a richer set of tools for invoking tests. +.B meson test +automatically rebuilds the necessary targets to run tests when used with the Ninja backend. +Upon build failure, +.B meson test +will return an exit code of 125. +This return code tells +.B git bisect run +to skip the current commit. +Thus bisecting using git can be done conveniently like this. + +.B git bisect run meson test -C build_dir + .SS "options:" .TP \fB\-\-repeat\fR @@ -214,6 +226,10 @@ .B 2 Internal error. .TP +.B 125 +.B meson test +could not rebuild the required targets. +.TP .SH SEE ALSO diff -Nru meson-0.49.0/MANIFEST.in meson-0.52.1/MANIFEST.in --- meson-0.49.0/MANIFEST.in 2018-08-25 08:05:43.000000000 +0000 +++ meson-0.52.1/MANIFEST.in 2019-09-16 21:20:45.000000000 +0000 @@ -18,3 +18,4 @@ include mesonrewriter.py include ghwt.py include __main__.py +include meson.py diff -Nru meson-0.49.0/mesonbuild/ast/__init__.py meson-0.52.1/mesonbuild/ast/__init__.py --- meson-0.49.0/mesonbuild/ast/__init__.py 1970-01-01 00:00:00.000000000 +0000 +++ meson-0.52.1/mesonbuild/ast/__init__.py 2019-03-06 20:48:10.000000000 +0000 @@ -0,0 +1,33 @@ +# Copyright 2019 The Meson development team + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This class contains the basic functionality needed to run any interpreter +# or an interpreter-based tool. + +__all__ = [ + 'AstConditionLevel', + 'AstInterpreter', + 'AstIDGenerator', + 'AstIndentationGenerator', + 'AstVisitor', + 'AstPrinter', + 'IntrospectionInterpreter', + 'build_target_functions', +] + +from .interpreter import AstInterpreter +from .introspection import IntrospectionInterpreter, build_target_functions +from .visitor import AstVisitor +from .postprocess import AstConditionLevel, AstIDGenerator, AstIndentationGenerator +from .printer import AstPrinter diff -Nru meson-0.49.0/mesonbuild/ast/interpreter.py meson-0.52.1/mesonbuild/ast/interpreter.py --- meson-0.49.0/mesonbuild/ast/interpreter.py 1970-01-01 00:00:00.000000000 +0000 +++ meson-0.52.1/mesonbuild/ast/interpreter.py 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,357 @@ +# Copyright 2016 The Meson development team + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This class contains the basic functionality needed to run any interpreter +# or an interpreter-based tool. + +from .visitor import AstVisitor +from .. import interpreterbase, mparser, mesonlib +from .. import environment + +from ..interpreterbase import InvalidArguments, BreakRequest, ContinueRequest +from ..mparser import ( + ArgumentNode, + ArithmeticNode, + ArrayNode, + AssignmentNode, + BaseNode, + ElementaryNode, + EmptyNode, + IdNode, + MethodNode, + PlusAssignmentNode, + TernaryNode, +) + +import os, sys +from typing import List, Any, Optional + +class DontCareObject(interpreterbase.InterpreterObject): + pass + +class MockExecutable(interpreterbase.InterpreterObject): + pass + +class MockStaticLibrary(interpreterbase.InterpreterObject): + pass + +class MockSharedLibrary(interpreterbase.InterpreterObject): + pass + +class MockCustomTarget(interpreterbase.InterpreterObject): + pass + +class MockRunTarget(interpreterbase.InterpreterObject): + pass + +ADD_SOURCE = 0 +REMOVE_SOURCE = 1 + +class AstInterpreter(interpreterbase.InterpreterBase): + def __init__(self, source_root: str, subdir: str, visitors: Optional[List[AstVisitor]] = None): + super().__init__(source_root, subdir) + self.visitors = visitors if visitors is not None else [] + self.visited_subdirs = {} + self.assignments = {} + self.assign_vals = {} + self.reverse_assignment = {} + self.funcs.update({'project': self.func_do_nothing, + 'test': self.func_do_nothing, + 'benchmark': self.func_do_nothing, + 'install_headers': self.func_do_nothing, + 'install_man': self.func_do_nothing, + 'install_data': self.func_do_nothing, + 'install_subdir': self.func_do_nothing, + 'configuration_data': self.func_do_nothing, + 'configure_file': self.func_do_nothing, + 'find_program': self.func_do_nothing, + 'include_directories': self.func_do_nothing, + 'add_global_arguments': self.func_do_nothing, + 'add_global_link_arguments': self.func_do_nothing, + 'add_project_arguments': self.func_do_nothing, + 'add_project_link_arguments': self.func_do_nothing, + 'message': self.func_do_nothing, + 'generator': self.func_do_nothing, + 'error': self.func_do_nothing, + 'run_command': self.func_do_nothing, + 'assert': self.func_do_nothing, + 'subproject': self.func_do_nothing, + 'dependency': self.func_do_nothing, + 'get_option': self.func_do_nothing, + 'join_paths': self.func_do_nothing, + 'environment': self.func_do_nothing, + 'import': self.func_do_nothing, + 'vcs_tag': self.func_do_nothing, + 'add_languages': self.func_do_nothing, + 'declare_dependency': self.func_do_nothing, + 'files': self.func_do_nothing, + 'executable': self.func_do_nothing, + 'static_library': self.func_do_nothing, + 'shared_library': self.func_do_nothing, + 'library': self.func_do_nothing, + 'build_target': self.func_do_nothing, + 'custom_target': self.func_do_nothing, + 'run_target': self.func_do_nothing, + 'subdir': self.func_subdir, + 'set_variable': self.func_do_nothing, + 'get_variable': self.func_do_nothing, + 'is_disabler': self.func_do_nothing, + 'is_variable': self.func_do_nothing, + 'disabler': self.func_do_nothing, + 'gettext': self.func_do_nothing, + 'jar': self.func_do_nothing, + 'warning': self.func_do_nothing, + 'shared_module': self.func_do_nothing, + 'option': self.func_do_nothing, + 'both_libraries': self.func_do_nothing, + 'add_test_setup': self.func_do_nothing, + 'find_library': self.func_do_nothing, + 'subdir_done': self.func_do_nothing, + 'alias_target': self.func_do_nothing, + }) + + def func_do_nothing(self, node, args, kwargs): + return True + + def load_root_meson_file(self): + super().load_root_meson_file() + for i in self.visitors: + self.ast.accept(i) + + def func_subdir(self, node, args, kwargs): + args = self.flatten_args(args) + if len(args) != 1 or not isinstance(args[0], str): + sys.stderr.write('Unable to evaluate subdir({}) in AstInterpreter --> Skipping\n'.format(args)) + return + + prev_subdir = self.subdir + subdir = os.path.join(prev_subdir, args[0]) + absdir = os.path.join(self.source_root, subdir) + buildfilename = os.path.join(subdir, environment.build_filename) + absname = os.path.join(self.source_root, buildfilename) + symlinkless_dir = os.path.realpath(absdir) + if symlinkless_dir in self.visited_subdirs: + sys.stderr.write('Trying to enter {} which has already been visited --> Skipping\n'.format(args[0])) + return + self.visited_subdirs[symlinkless_dir] = True + + if not os.path.isfile(absname): + sys.stderr.write('Unable to find build file {} --> Skipping\n'.format(buildfilename)) + return + with open(absname, encoding='utf8') as f: + code = f.read() + assert(isinstance(code, str)) + try: + codeblock = mparser.Parser(code, subdir).parse() + except mesonlib.MesonException as me: + me.file = buildfilename + raise me + + self.subdir = subdir + for i in self.visitors: + codeblock.accept(i) + self.evaluate_codeblock(codeblock) + self.subdir = prev_subdir + + def method_call(self, node): + return True + + def evaluate_arithmeticstatement(self, cur): + self.evaluate_statement(cur.left) + self.evaluate_statement(cur.right) + return 0 + + def evaluate_uminusstatement(self, cur): + self.evaluate_statement(cur.value) + return 0 + + def evaluate_ternary(self, node): + assert(isinstance(node, TernaryNode)) + self.evaluate_statement(node.condition) + self.evaluate_statement(node.trueblock) + self.evaluate_statement(node.falseblock) + + def evaluate_plusassign(self, node): + assert(isinstance(node, PlusAssignmentNode)) + if node.var_name not in self.assignments: + self.assignments[node.var_name] = [] + self.assign_vals[node.var_name] = [] + self.assignments[node.var_name] += [node.value] # Save a reference to the value node + if hasattr(node.value, 'ast_id'): + self.reverse_assignment[node.value.ast_id] = node + self.assign_vals[node.var_name] += [self.evaluate_statement(node.value)] + + def evaluate_indexing(self, node): + return 0 + + def unknown_function_called(self, func_name): + pass + + def reduce_arguments(self, args): + if isinstance(args, ArgumentNode): + if args.incorrect_order(): + raise InvalidArguments('All keyword arguments must be after positional arguments.') + return self.flatten_args(args.arguments), args.kwargs + else: + return self.flatten_args(args), {} + + def evaluate_comparison(self, node): + self.evaluate_statement(node.left) + self.evaluate_statement(node.right) + return False + + def evaluate_andstatement(self, cur): + self.evaluate_statement(cur.left) + self.evaluate_statement(cur.right) + return False + + def evaluate_orstatement(self, cur): + self.evaluate_statement(cur.left) + self.evaluate_statement(cur.right) + return False + + def evaluate_foreach(self, node): + try: + self.evaluate_codeblock(node.block) + except ContinueRequest: + pass + except BreakRequest: + pass + + def evaluate_if(self, node): + for i in node.ifs: + self.evaluate_codeblock(i.block) + if not isinstance(node.elseblock, EmptyNode): + self.evaluate_codeblock(node.elseblock) + + def get_variable(self, varname): + return 0 + + def assignment(self, node): + assert(isinstance(node, AssignmentNode)) + self.assignments[node.var_name] = [node.value] # Save a reference to the value node + if hasattr(node.value, 'ast_id'): + self.reverse_assignment[node.value.ast_id] = node + self.assign_vals[node.var_name] = [self.evaluate_statement(node.value)] # Evaluate the value just in case + + def resolve_node(self, node: BaseNode, include_unknown_args: bool = False, id_loop_detect: Optional[List[str]] = None) -> Optional[Any]: + def quick_resolve(n: BaseNode, loop_detect: Optional[List[str]] = None) -> Any: + if loop_detect is None: + loop_detect = [] + if isinstance(n, IdNode): + if n.value in loop_detect or n.value not in self.assignments: + return [] + return quick_resolve(self.assignments[n.value][0], loop_detect = loop_detect + [n.value]) + elif isinstance(n, ElementaryNode): + return n.value + else: + return n + + if id_loop_detect is None: + id_loop_detect = [] + result = None + + if not isinstance(node, BaseNode): + return None + + assert(hasattr(node, 'ast_id')) + if node.ast_id in id_loop_detect: + return None # Loop detected + id_loop_detect += [node.ast_id] + + # Try to evealuate the value of the node + if isinstance(node, IdNode): + result = quick_resolve(node) + + elif isinstance(node, ElementaryNode): + result = node.value + + elif isinstance(node, ArrayNode): + result = [x for x in node.args.arguments] + + elif isinstance(node, ArgumentNode): + result = [x for x in node.arguments] + + elif isinstance(node, ArithmeticNode): + if node.operation != 'add': + return None # Only handle string and array concats + l = quick_resolve(node.left) + r = quick_resolve(node.right) + if isinstance(l, str) and isinstance(r, str): + result = l + r # String concatination detected + else: + result = self.flatten_args(l, include_unknown_args, id_loop_detect) + self.flatten_args(r, include_unknown_args, id_loop_detect) + + elif isinstance(node, MethodNode): + src = quick_resolve(node.source_object) + margs = self.flatten_args(node.args, include_unknown_args, id_loop_detect) + try: + if isinstance(src, str): + result = self.string_method_call(src, node.name, margs) + elif isinstance(src, bool): + result = self.bool_method_call(src, node.name, margs) + elif isinstance(src, int): + result = self.int_method_call(src, node.name, margs) + elif isinstance(src, list): + result = self.array_method_call(src, node.name, margs) + elif isinstance(src, dict): + result = self.dict_method_call(src, node.name, margs) + except mesonlib.MesonException: + return None + + # Ensure that the result is fully resolved (no more nodes) + if isinstance(result, BaseNode): + result = self.resolve_node(result, include_unknown_args, id_loop_detect) + elif isinstance(result, list): + new_res = [] + for i in result: + if isinstance(i, BaseNode): + resolved = self.resolve_node(i, include_unknown_args, id_loop_detect) + if resolved is not None: + new_res += self.flatten_args(resolved, include_unknown_args, id_loop_detect) + else: + new_res += [i] + result = new_res + + return result + + def flatten_args(self, args: Any, include_unknown_args: bool = False, id_loop_detect: Optional[List[str]] = None) -> List[Any]: + # Make sure we are always dealing with lists + if not isinstance(args, list): + args = [args] + + flattend_args = [] + + # Resolve the contents of args + for i in args: + if isinstance(i, BaseNode): + resolved = self.resolve_node(i, include_unknown_args, id_loop_detect) + if resolved is not None: + if not isinstance(resolved, list): + resolved = [resolved] + flattend_args += resolved + elif isinstance(i, (str, bool, int, float)) or include_unknown_args: + flattend_args += [i] + return flattend_args + + def flatten_kwargs(self, kwargs: object, include_unknown_args: bool = False): + flattend_kwargs = {} + for key, val in kwargs.items(): + if isinstance(val, BaseNode): + resolved = self.resolve_node(val, include_unknown_args) + if resolved is not None: + flattend_kwargs[key] = resolved + elif isinstance(val, (str, bool, int, float)) or include_unknown_args: + flattend_kwargs[key] = val + return flattend_kwargs diff -Nru meson-0.49.0/mesonbuild/ast/introspection.py meson-0.52.1/mesonbuild/ast/introspection.py --- meson-0.49.0/mesonbuild/ast/introspection.py 1970-01-01 00:00:00.000000000 +0000 +++ meson-0.52.1/mesonbuild/ast/introspection.py 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,281 @@ +# Copyright 2018 The Meson development team + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This class contains the basic functionality needed to run any interpreter +# or an interpreter-based tool + +from . import AstInterpreter +from .. import compilers, environment, mesonlib, optinterpreter +from .. import coredata as cdata +from ..mesonlib import MachineChoice +from ..interpreterbase import InvalidArguments +from ..build import Executable, Jar, SharedLibrary, SharedModule, StaticLibrary +from ..mparser import BaseNode, ArithmeticNode, ArrayNode, ElementaryNode, IdNode, FunctionNode, StringNode +import os + +build_target_functions = ['executable', 'jar', 'library', 'shared_library', 'shared_module', 'static_library', 'both_libraries'] + +class IntrospectionHelper: + # mimic an argparse namespace + def __init__(self, cross_file): + self.cross_file = cross_file + self.native_file = None + self.cmd_line_options = {} + +class IntrospectionInterpreter(AstInterpreter): + # Interpreter to detect the options without a build directory + # Most of the code is stolen from interperter.Interpreter + def __init__(self, source_root, subdir, backend, visitors=None, cross_file=None, subproject='', subproject_dir='subprojects', env=None): + visitors = visitors if visitors is not None else [] + super().__init__(source_root, subdir, visitors=visitors) + + options = IntrospectionHelper(cross_file) + self.cross_file = cross_file + if env is None: + self.environment = environment.Environment(source_root, None, options) + else: + self.environment = env + self.subproject = subproject + self.subproject_dir = subproject_dir + self.coredata = self.environment.get_coredata() + self.option_file = os.path.join(self.source_root, self.subdir, 'meson_options.txt') + self.backend = backend + self.default_options = {'backend': self.backend} + self.project_data = {} + self.targets = [] + self.dependencies = [] + self.project_node = None + + self.funcs.update({ + 'add_languages': self.func_add_languages, + 'dependency': self.func_dependency, + 'executable': self.func_executable, + 'jar': self.func_jar, + 'library': self.func_library, + 'project': self.func_project, + 'shared_library': self.func_shared_lib, + 'shared_module': self.func_shared_module, + 'static_library': self.func_static_lib, + 'both_libraries': self.func_both_lib, + }) + + def func_project(self, node, args, kwargs): + if self.project_node: + raise InvalidArguments('Second call to project()') + self.project_node = node + if len(args) < 1: + raise InvalidArguments('Not enough arguments to project(). Needs at least the project name.') + + proj_name = args[0] + proj_vers = kwargs.get('version', 'undefined') + proj_langs = self.flatten_args(args[1:]) + if isinstance(proj_vers, ElementaryNode): + proj_vers = proj_vers.value + if not isinstance(proj_vers, str): + proj_vers = 'undefined' + self.project_data = {'descriptive_name': proj_name, 'version': proj_vers} + + if os.path.exists(self.option_file): + oi = optinterpreter.OptionInterpreter(self.subproject) + oi.process(self.option_file) + self.coredata.merge_user_options(oi.options) + + def_opts = self.flatten_args(kwargs.get('default_options', [])) + self.project_default_options = mesonlib.stringlistify(def_opts) + self.project_default_options = cdata.create_options_dict(self.project_default_options) + self.default_options.update(self.project_default_options) + self.coredata.set_default_options(self.default_options, self.subproject, self.environment) + + if not self.is_subproject() and 'subproject_dir' in kwargs: + spdirname = kwargs['subproject_dir'] + if isinstance(spdirname, ElementaryNode): + self.subproject_dir = spdirname.value + if not self.is_subproject(): + self.project_data['subprojects'] = [] + subprojects_dir = os.path.join(self.source_root, self.subproject_dir) + if os.path.isdir(subprojects_dir): + for i in os.listdir(subprojects_dir): + if os.path.isdir(os.path.join(subprojects_dir, i)): + self.do_subproject(i) + + self.coredata.init_backend_options(self.backend) + options = {k: v for k, v in self.environment.cmd_line_options.items() if k.startswith('backend_')} + + self.coredata.set_options(options) + self.func_add_languages(None, proj_langs, None) + + def do_subproject(self, dirname): + subproject_dir_abs = os.path.join(self.environment.get_source_dir(), self.subproject_dir) + subpr = os.path.join(subproject_dir_abs, dirname) + try: + subi = IntrospectionInterpreter(subpr, '', self.backend, cross_file=self.cross_file, subproject=dirname, subproject_dir=self.subproject_dir, env=self.environment, visitors=self.visitors) + subi.analyze() + subi.project_data['name'] = dirname + self.project_data['subprojects'] += [subi.project_data] + except (mesonlib.MesonException, RuntimeError): + return + + def func_add_languages(self, node, args, kwargs): + args = self.flatten_args(args) + for for_machine in [MachineChoice.BUILD, MachineChoice.HOST]: + for lang in sorted(args, key=compilers.sort_clink): + lang = lang.lower() + if lang not in self.coredata.compilers[for_machine]: + self.environment.detect_compiler_for(lang, for_machine) + + def func_dependency(self, node, args, kwargs): + args = self.flatten_args(args) + if not args: + return + name = args[0] + has_fallback = 'fallback' in kwargs + required = kwargs.get('required', True) + condition_level = node.condition_level if hasattr(node, 'condition_level') else 0 + if isinstance(required, ElementaryNode): + required = required.value + if not isinstance(required, bool): + required = False + self.dependencies += [{ + 'name': name, + 'required': required, + 'has_fallback': has_fallback, + 'conditional': condition_level > 0, + 'node': node + }] + + def build_target(self, node, args, kwargs, targetclass): + args = self.flatten_args(args) + if not args or not isinstance(args[0], str): + return + name = args[0] + srcqueue = [node] + + # Process the soruces BEFORE flattening the kwargs, to preserve the original nodes + if 'sources' in kwargs: + srcqueue += mesonlib.listify(kwargs['sources']) + + kwargs = self.flatten_kwargs(kwargs, True) + + source_nodes = [] + while srcqueue: + curr = srcqueue.pop(0) + arg_node = None + assert(isinstance(curr, BaseNode)) + if isinstance(curr, FunctionNode): + arg_node = curr.args + elif isinstance(curr, ArrayNode): + arg_node = curr.args + elif isinstance(curr, IdNode): + # Try to resolve the ID and append the node to the queue + var_name = curr.value + if var_name in self.assignments and self.assignments[var_name]: + tmp_node = self.assignments[var_name][0] + if isinstance(tmp_node, (ArrayNode, IdNode, FunctionNode)): + srcqueue += [tmp_node] + elif isinstance(curr, ArithmeticNode): + srcqueue += [curr.left, curr.right] + if arg_node is None: + continue + arg_nodes = arg_node.arguments.copy() + # Pop the first element if the function is a build target function + if isinstance(curr, FunctionNode) and curr.func_name in build_target_functions: + arg_nodes.pop(0) + elemetary_nodes = [x for x in arg_nodes if isinstance(x, (str, StringNode))] + srcqueue += [x for x in arg_nodes if isinstance(x, (FunctionNode, ArrayNode, IdNode, ArithmeticNode))] + if elemetary_nodes: + source_nodes += [curr] + + # Make sure nothing can crash when creating the build class + kwargs_reduced = {k: v for k, v in kwargs.items() if k in targetclass.known_kwargs and k in ['install', 'build_by_default', 'build_always']} + kwargs_reduced = {k: v.value if isinstance(v, ElementaryNode) else v for k, v in kwargs_reduced.items()} + kwargs_reduced = {k: v for k, v in kwargs_reduced.items() if not isinstance(v, BaseNode)} + for_machine = MachineChoice.HOST + objects = [] + empty_sources = [] # Passing the unresolved sources list causes errors + target = targetclass(name, self.subdir, self.subproject, for_machine, empty_sources, objects, self.environment, kwargs_reduced) + + new_target = { + 'name': target.get_basename(), + 'id': target.get_id(), + 'type': target.get_typename(), + 'defined_in': os.path.normpath(os.path.join(self.source_root, self.subdir, environment.build_filename)), + 'subdir': self.subdir, + 'build_by_default': target.build_by_default, + 'installed': target.should_install(), + 'outputs': target.get_outputs(), + 'sources': source_nodes, + 'kwargs': kwargs, + 'node': node, + } + + self.targets += [new_target] + return new_target + + def build_library(self, node, args, kwargs): + default_library = self.coredata.get_builtin_option('default_library') + if default_library == 'shared': + return self.build_target(node, args, kwargs, SharedLibrary) + elif default_library == 'static': + return self.build_target(node, args, kwargs, StaticLibrary) + elif default_library == 'both': + return self.build_target(node, args, kwargs, SharedLibrary) + + def func_executable(self, node, args, kwargs): + return self.build_target(node, args, kwargs, Executable) + + def func_static_lib(self, node, args, kwargs): + return self.build_target(node, args, kwargs, StaticLibrary) + + def func_shared_lib(self, node, args, kwargs): + return self.build_target(node, args, kwargs, SharedLibrary) + + def func_both_lib(self, node, args, kwargs): + return self.build_target(node, args, kwargs, SharedLibrary) + + def func_shared_module(self, node, args, kwargs): + return self.build_target(node, args, kwargs, SharedModule) + + def func_library(self, node, args, kwargs): + return self.build_library(node, args, kwargs) + + def func_jar(self, node, args, kwargs): + return self.build_target(node, args, kwargs, Jar) + + def func_build_target(self, node, args, kwargs): + if 'target_type' not in kwargs: + return + target_type = kwargs.pop('target_type') + if isinstance(target_type, ElementaryNode): + target_type = target_type.value + if target_type == 'executable': + return self.build_target(node, args, kwargs, Executable) + elif target_type == 'shared_library': + return self.build_target(node, args, kwargs, SharedLibrary) + elif target_type == 'static_library': + return self.build_target(node, args, kwargs, StaticLibrary) + elif target_type == 'both_libraries': + return self.build_target(node, args, kwargs, SharedLibrary) + elif target_type == 'library': + return self.build_library(node, args, kwargs) + elif target_type == 'jar': + return self.build_target(node, args, kwargs, Jar) + + def is_subproject(self): + return self.subproject != '' + + def analyze(self): + self.load_root_meson_file() + self.sanity_check_ast() + self.parse_project() + self.run() diff -Nru meson-0.49.0/mesonbuild/ast/postprocess.py meson-0.52.1/mesonbuild/ast/postprocess.py --- meson-0.49.0/mesonbuild/ast/postprocess.py 1970-01-01 00:00:00.000000000 +0000 +++ meson-0.52.1/mesonbuild/ast/postprocess.py 2019-03-06 20:48:10.000000000 +0000 @@ -0,0 +1,116 @@ +# Copyright 2019 The Meson development team + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This class contains the basic functionality needed to run any interpreter +# or an interpreter-based tool + +from . import AstVisitor +from .. import mparser + +class AstIndentationGenerator(AstVisitor): + def __init__(self): + self.level = 0 + + def visit_default_func(self, node: mparser.BaseNode): + # Store the current level in the node + node.level = self.level + + def visit_ArrayNode(self, node: mparser.ArrayNode): + self.visit_default_func(node) + self.level += 1 + node.args.accept(self) + self.level -= 1 + + def visit_DictNode(self, node: mparser.DictNode): + self.visit_default_func(node) + self.level += 1 + node.args.accept(self) + self.level -= 1 + + def visit_MethodNode(self, node: mparser.MethodNode): + self.visit_default_func(node) + node.source_object.accept(self) + self.level += 1 + node.args.accept(self) + self.level -= 1 + + def visit_FunctionNode(self, node: mparser.FunctionNode): + self.visit_default_func(node) + self.level += 1 + node.args.accept(self) + self.level -= 1 + + def visit_ForeachClauseNode(self, node: mparser.ForeachClauseNode): + self.visit_default_func(node) + self.level += 1 + node.items.accept(self) + node.block.accept(self) + self.level -= 1 + + def visit_IfClauseNode(self, node: mparser.IfClauseNode): + self.visit_default_func(node) + for i in node.ifs: + i.accept(self) + if node.elseblock: + self.level += 1 + node.elseblock.accept(self) + self.level -= 1 + + def visit_IfNode(self, node: mparser.IfNode): + self.visit_default_func(node) + self.level += 1 + node.condition.accept(self) + node.block.accept(self) + self.level -= 1 + +class AstIDGenerator(AstVisitor): + def __init__(self): + self.counter = {} + + def visit_default_func(self, node: mparser.BaseNode): + name = type(node).__name__ + if name not in self.counter: + self.counter[name] = 0 + node.ast_id = name + '#' + str(self.counter[name]) + self.counter[name] += 1 + +class AstConditionLevel(AstVisitor): + def __init__(self): + self.condition_level = 0 + + def visit_default_func(self, node: mparser.BaseNode): + node.condition_level = self.condition_level + + def visit_ForeachClauseNode(self, node: mparser.ForeachClauseNode): + self.visit_default_func(node) + self.condition_level += 1 + node.items.accept(self) + node.block.accept(self) + self.condition_level -= 1 + + def visit_IfClauseNode(self, node: mparser.IfClauseNode): + self.visit_default_func(node) + for i in node.ifs: + i.accept(self) + if node.elseblock: + self.condition_level += 1 + node.elseblock.accept(self) + self.condition_level -= 1 + + def visit_IfNode(self, node: mparser.IfNode): + self.visit_default_func(node) + self.condition_level += 1 + node.condition.accept(self) + node.block.accept(self) + self.condition_level -= 1 diff -Nru meson-0.49.0/mesonbuild/ast/printer.py meson-0.52.1/mesonbuild/ast/printer.py --- meson-0.49.0/mesonbuild/ast/printer.py 1970-01-01 00:00:00.000000000 +0000 +++ meson-0.52.1/mesonbuild/ast/printer.py 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,204 @@ +# Copyright 2019 The Meson development team + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This class contains the basic functionality needed to run any interpreter +# or an interpreter-based tool + +from .. import mparser +from . import AstVisitor +import re + +arithmic_map = { + 'add': '+', + 'sub': '-', + 'mod': '%', + 'mul': '*', + 'div': '/' +} + +class AstPrinter(AstVisitor): + def __init__(self, indent: int = 2, arg_newline_cutoff: int = 5): + self.result = '' + self.indent = indent + self.arg_newline_cutoff = arg_newline_cutoff + self.ci = '' + self.is_newline = True + self.last_level = 0 + + def post_process(self): + self.result = re.sub(r'\s+\n', '\n', self.result) + + def append(self, data: str, node: mparser.BaseNode): + level = 0 + if node and hasattr(node, 'level'): + level = node.level + else: + level = self.last_level + self.last_level = level + if self.is_newline: + self.result += ' ' * (level * self.indent) + self.result += data + self.is_newline = False + + def append_padded(self, data: str, node: mparser.BaseNode): + if self.result[-1] not in [' ', '\n']: + data = ' ' + data + self.append(data + ' ', node) + + def newline(self): + self.result += '\n' + self.is_newline = True + + def visit_BooleanNode(self, node: mparser.BooleanNode): + self.append('true' if node.value else 'false', node) + + def visit_IdNode(self, node: mparser.IdNode): + self.append(node.value, node) + + def visit_NumberNode(self, node: mparser.NumberNode): + self.append(str(node.value), node) + + def visit_StringNode(self, node: mparser.StringNode): + self.append("'" + node.value + "'", node) + + def visit_ContinueNode(self, node: mparser.ContinueNode): + self.append('continue', node) + + def visit_BreakNode(self, node: mparser.BreakNode): + self.append('break', node) + + def visit_ArrayNode(self, node: mparser.ArrayNode): + self.append('[', node) + node.args.accept(self) + self.append(']', node) + + def visit_DictNode(self, node: mparser.DictNode): + self.append('{', node) + node.args.accept(self) + self.append('}', node) + + def visit_OrNode(self, node: mparser.OrNode): + node.left.accept(self) + self.append_padded('or', node) + node.right.accept(self) + + def visit_AndNode(self, node: mparser.AndNode): + node.left.accept(self) + self.append_padded('and', node) + node.right.accept(self) + + def visit_ComparisonNode(self, node: mparser.ComparisonNode): + node.left.accept(self) + self.append_padded(mparser.comparison_map[node.ctype], node) + node.right.accept(self) + + def visit_ArithmeticNode(self, node: mparser.ArithmeticNode): + node.left.accept(self) + self.append_padded(arithmic_map[node.operation], node) + node.right.accept(self) + + def visit_NotNode(self, node: mparser.NotNode): + self.append_padded('not', node) + node.value.accept(self) + + def visit_CodeBlockNode(self, node: mparser.CodeBlockNode): + for i in node.lines: + i.accept(self) + self.newline() + + def visit_IndexNode(self, node: mparser.IndexNode): + node.iobject.accept(self) + self.append('[', node) + node.index.accept(self) + self.append(']', node) + + def visit_MethodNode(self, node: mparser.MethodNode): + node.source_object.accept(self) + self.append('.' + node.name + '(', node) + node.args.accept(self) + self.append(')', node) + + def visit_FunctionNode(self, node: mparser.FunctionNode): + self.append(node.func_name + '(', node) + node.args.accept(self) + self.append(')', node) + + def visit_AssignmentNode(self, node: mparser.AssignmentNode): + self.append(node.var_name + ' = ', node) + node.value.accept(self) + + def visit_PlusAssignmentNode(self, node: mparser.PlusAssignmentNode): + self.append(node.var_name + ' += ', node) + node.value.accept(self) + + def visit_ForeachClauseNode(self, node: mparser.ForeachClauseNode): + varnames = [x.value for x in node.varnames] + self.append_padded('foreach', node) + self.append_padded(', '.join(varnames), node) + self.append_padded(':', node) + node.items.accept(self) + self.newline() + node.block.accept(self) + self.append('endforeach', node) + + def visit_IfClauseNode(self, node: mparser.IfClauseNode): + prefix = '' + for i in node.ifs: + self.append_padded(prefix + 'if', node) + prefix = 'el' + i.accept(self) + if node.elseblock: + self.append('else', node) + node.elseblock.accept(self) + self.append('endif', node) + + def visit_UMinusNode(self, node: mparser.UMinusNode): + self.append_padded('-', node) + node.value.accept(self) + + def visit_IfNode(self, node: mparser.IfNode): + node.condition.accept(self) + self.newline() + node.block.accept(self) + + def visit_TernaryNode(self, node: mparser.TernaryNode): + node.condition.accept(self) + self.append_padded('?', node) + node.trueblock.accept(self) + self.append_padded(':', node) + node.falseblock.accept(self) + + def visit_ArgumentNode(self, node: mparser.ArgumentNode): + break_args = (len(node.arguments) + len(node.kwargs)) > self.arg_newline_cutoff + for i in node.arguments + list(node.kwargs.values()): + if not isinstance(i, (mparser.ElementaryNode, mparser.IndexNode)): + break_args = True + if break_args: + self.newline() + for i in node.arguments: + i.accept(self) + self.append(', ', node) + if break_args: + self.newline() + for key, val in node.kwargs.items(): + self.append(key, node) + self.append_padded(':', node) + val.accept(self) + self.append(', ', node) + if break_args: + self.newline() + if break_args: + self.result = re.sub(r', \n$', '\n', self.result) + else: + self.result = re.sub(r', $', '', self.result) diff -Nru meson-0.49.0/mesonbuild/ast/visitor.py meson-0.52.1/mesonbuild/ast/visitor.py --- meson-0.49.0/mesonbuild/ast/visitor.py 1970-01-01 00:00:00.000000000 +0000 +++ meson-0.52.1/mesonbuild/ast/visitor.py 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,139 @@ +# Copyright 2019 The Meson development team + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This class contains the basic functionality needed to run any interpreter +# or an interpreter-based tool + +from .. import mparser + +class AstVisitor: + def __init__(self): + pass + + def visit_default_func(self, node: mparser.BaseNode): + pass + + def visit_BooleanNode(self, node: mparser.BooleanNode): + self.visit_default_func(node) + + def visit_IdNode(self, node: mparser.IdNode): + self.visit_default_func(node) + + def visit_NumberNode(self, node: mparser.NumberNode): + self.visit_default_func(node) + + def visit_StringNode(self, node: mparser.StringNode): + self.visit_default_func(node) + + def visit_ContinueNode(self, node: mparser.ContinueNode): + self.visit_default_func(node) + + def visit_BreakNode(self, node: mparser.BreakNode): + self.visit_default_func(node) + + def visit_ArrayNode(self, node: mparser.ArrayNode): + self.visit_default_func(node) + node.args.accept(self) + + def visit_DictNode(self, node: mparser.DictNode): + self.visit_default_func(node) + node.args.accept(self) + + def visit_EmptyNode(self, node: mparser.EmptyNode): + self.visit_default_func(node) + + def visit_OrNode(self, node: mparser.OrNode): + self.visit_default_func(node) + node.left.accept(self) + node.right.accept(self) + + def visit_AndNode(self, node: mparser.AndNode): + self.visit_default_func(node) + node.left.accept(self) + node.right.accept(self) + + def visit_ComparisonNode(self, node: mparser.ComparisonNode): + self.visit_default_func(node) + node.left.accept(self) + node.right.accept(self) + + def visit_ArithmeticNode(self, node: mparser.ArithmeticNode): + self.visit_default_func(node) + node.left.accept(self) + node.right.accept(self) + + def visit_NotNode(self, node: mparser.NotNode): + self.visit_default_func(node) + node.value.accept(self) + + def visit_CodeBlockNode(self, node: mparser.CodeBlockNode): + self.visit_default_func(node) + for i in node.lines: + i.accept(self) + + def visit_IndexNode(self, node: mparser.IndexNode): + self.visit_default_func(node) + node.iobject.accept(self) + node.index.accept(self) + + def visit_MethodNode(self, node: mparser.MethodNode): + self.visit_default_func(node) + node.source_object.accept(self) + node.args.accept(self) + + def visit_FunctionNode(self, node: mparser.FunctionNode): + self.visit_default_func(node) + node.args.accept(self) + + def visit_AssignmentNode(self, node: mparser.AssignmentNode): + self.visit_default_func(node) + node.value.accept(self) + + def visit_PlusAssignmentNode(self, node: mparser.PlusAssignmentNode): + self.visit_default_func(node) + node.value.accept(self) + + def visit_ForeachClauseNode(self, node: mparser.ForeachClauseNode): + self.visit_default_func(node) + node.items.accept(self) + node.block.accept(self) + + def visit_IfClauseNode(self, node: mparser.IfClauseNode): + self.visit_default_func(node) + for i in node.ifs: + i.accept(self) + if node.elseblock: + node.elseblock.accept(self) + + def visit_UMinusNode(self, node: mparser.UMinusNode): + self.visit_default_func(node) + node.value.accept(self) + + def visit_IfNode(self, node: mparser.IfNode): + self.visit_default_func(node) + node.condition.accept(self) + node.block.accept(self) + + def visit_TernaryNode(self, node: mparser.TernaryNode): + self.visit_default_func(node) + node.condition.accept(self) + node.trueblock.accept(self) + node.falseblock.accept(self) + + def visit_ArgumentNode(self, node: mparser.ArgumentNode): + self.visit_default_func(node) + for i in node.arguments: + i.accept(self) + for val in node.kwargs.values(): + val.accept(self) diff -Nru meson-0.49.0/mesonbuild/astinterpreter.py meson-0.52.1/mesonbuild/astinterpreter.py --- meson-0.49.0/mesonbuild/astinterpreter.py 2018-12-09 14:27:23.000000000 +0000 +++ meson-0.52.1/mesonbuild/astinterpreter.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,281 +0,0 @@ -# Copyright 2016 The Meson development team - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# This class contains the basic functionality needed to run any interpreter -# or an interpreter-based tool. - -from . import interpreterbase, mlog, mparser, mesonlib -from . import environment - -from .interpreterbase import InterpreterException, InvalidArguments, BreakRequest, ContinueRequest - -import os, sys - -class DontCareObject(interpreterbase.InterpreterObject): - pass - -class MockExecutable(interpreterbase.InterpreterObject): - pass - -class MockStaticLibrary(interpreterbase.InterpreterObject): - pass - -class MockSharedLibrary(interpreterbase.InterpreterObject): - pass - -class MockCustomTarget(interpreterbase.InterpreterObject): - pass - -class MockRunTarget(interpreterbase.InterpreterObject): - pass - -ADD_SOURCE = 0 -REMOVE_SOURCE = 1 - -class AstInterpreter(interpreterbase.InterpreterBase): - def __init__(self, source_root, subdir): - super().__init__(source_root, subdir) - self.funcs.update({'project': self.func_do_nothing, - 'test': self.func_do_nothing, - 'benchmark': self.func_do_nothing, - 'install_headers': self.func_do_nothing, - 'install_man': self.func_do_nothing, - 'install_data': self.func_do_nothing, - 'install_subdir': self.func_do_nothing, - 'configuration_data': self.func_do_nothing, - 'configure_file': self.func_do_nothing, - 'find_program': self.func_do_nothing, - 'include_directories': self.func_do_nothing, - 'add_global_arguments': self.func_do_nothing, - 'add_global_link_arguments': self.func_do_nothing, - 'add_project_arguments': self.func_do_nothing, - 'add_project_link_arguments': self.func_do_nothing, - 'message': self.func_do_nothing, - 'generator': self.func_do_nothing, - 'error': self.func_do_nothing, - 'run_command': self.func_do_nothing, - 'assert': self.func_do_nothing, - 'subproject': self.func_do_nothing, - 'dependency': self.func_do_nothing, - 'get_option': self.func_do_nothing, - 'join_paths': self.func_do_nothing, - 'environment': self.func_do_nothing, - 'import': self.func_do_nothing, - 'vcs_tag': self.func_do_nothing, - 'add_languages': self.func_do_nothing, - 'declare_dependency': self.func_do_nothing, - 'files': self.func_do_nothing, - 'executable': self.func_do_nothing, - 'static_library': self.func_do_nothing, - 'shared_library': self.func_do_nothing, - 'library': self.func_do_nothing, - 'build_target': self.func_do_nothing, - 'custom_target': self.func_do_nothing, - 'run_target': self.func_do_nothing, - 'subdir': self.func_do_nothing, - 'set_variable': self.func_do_nothing, - 'get_variable': self.func_do_nothing, - 'is_variable': self.func_do_nothing, - }) - - def func_do_nothing(self, node, args, kwargs): - return True - - def method_call(self, node): - return True - - def evaluate_arithmeticstatement(self, cur): - return 0 - - def evaluate_plusassign(self, node): - return 0 - - def evaluate_indexing(self, node): - return 0 - - def unknown_function_called(self, func_name): - pass - - def reduce_arguments(self, args): - assert(isinstance(args, mparser.ArgumentNode)) - if args.incorrect_order(): - raise InvalidArguments('All keyword arguments must be after positional arguments.') - return args.arguments, args.kwargs - - def evaluate_comparison(self, node): - return False - - def evaluate_foreach(self, node): - try: - self.evaluate_codeblock(node.block) - except ContinueRequest: - pass - except BreakRequest: - pass - - def evaluate_if(self, node): - for i in node.ifs: - self.evaluate_codeblock(i.block) - if not isinstance(node.elseblock, mparser.EmptyNode): - self.evaluate_codeblock(node.elseblock) - - def get_variable(self, varname): - return 0 - - def assignment(self, node): - pass - -class RewriterInterpreter(AstInterpreter): - def __init__(self, source_root, subdir): - super().__init__(source_root, subdir) - self.asts = {} - self.funcs.update({'files': self.func_files, - 'executable': self.func_executable, - 'static_library': self.func_static_lib, - 'shared_library': self.func_shared_lib, - 'library': self.func_library, - 'build_target': self.func_build_target, - 'custom_target': self.func_custom_target, - 'run_target': self.func_run_target, - 'subdir': self.func_subdir, - 'set_variable': self.func_set_variable, - 'get_variable': self.func_get_variable, - 'is_variable': self.func_is_variable, - }) - - def func_executable(self, node, args, kwargs): - if args[0] == self.targetname: - if self.operation == ADD_SOURCE: - self.add_source_to_target(node, args, kwargs) - elif self.operation == REMOVE_SOURCE: - self.remove_source_from_target(node, args, kwargs) - else: - raise NotImplementedError('Bleep bloop') - return MockExecutable() - - def func_static_lib(self, node, args, kwargs): - return MockStaticLibrary() - - def func_shared_lib(self, node, args, kwargs): - return MockSharedLibrary() - - def func_library(self, node, args, kwargs): - return self.func_shared_lib(node, args, kwargs) - - def func_custom_target(self, node, args, kwargs): - return MockCustomTarget() - - def func_run_target(self, node, args, kwargs): - return MockRunTarget() - - def func_subdir(self, node, args, kwargs): - prev_subdir = self.subdir - subdir = os.path.join(prev_subdir, args[0]) - self.subdir = subdir - buildfilename = os.path.join(self.subdir, environment.build_filename) - absname = os.path.join(self.source_root, buildfilename) - if not os.path.isfile(absname): - self.subdir = prev_subdir - raise InterpreterException('Nonexistent build def file %s.' % buildfilename) - with open(absname, encoding='utf8') as f: - code = f.read() - assert(isinstance(code, str)) - try: - codeblock = mparser.Parser(code, self.subdir).parse() - self.asts[subdir] = codeblock - except mesonlib.MesonException as me: - me.file = buildfilename - raise me - self.evaluate_codeblock(codeblock) - self.subdir = prev_subdir - - def func_files(self, node, args, kwargs): - if not isinstance(args, list): - return [args] - return args - - def transform(self): - self.load_root_meson_file() - self.asts[''] = self.ast - self.sanity_check_ast() - self.parse_project() - self.run() - - def add_source(self, targetname, filename): - self.operation = ADD_SOURCE - self.targetname = targetname - self.filename = filename - self.transform() - - def remove_source(self, targetname, filename): - self.operation = REMOVE_SOURCE - self.targetname = targetname - self.filename = filename - self.transform() - - def add_source_to_target(self, node, args, kwargs): - namespan = node.args.arguments[0].bytespan - buildfilename = os.path.join(self.source_root, self.subdir, environment.build_filename) - raw_data = open(buildfilename, 'r').read() - updated = raw_data[0:namespan[1]] + (", '%s'" % self.filename) + raw_data[namespan[1]:] - open(buildfilename, 'w').write(updated) - sys.exit(0) - - def remove_argument_item(self, args, i): - assert(isinstance(args, mparser.ArgumentNode)) - namespan = args.arguments[i].bytespan - # Usually remove the comma after this item but if it is - # the last argument, we need to remove the one before. - if i >= len(args.commas): - i -= 1 - if i < 0: - commaspan = (0, 0) # Removed every entry in the list. - else: - commaspan = args.commas[i].bytespan - if commaspan[0] < namespan[0]: - commaspan, namespan = namespan, commaspan - buildfilename = os.path.join(self.source_root, args.subdir, environment.build_filename) - raw_data = open(buildfilename, 'r').read() - intermediary = raw_data[0:commaspan[0]] + raw_data[commaspan[1]:] - updated = intermediary[0:namespan[0]] + intermediary[namespan[1]:] - open(buildfilename, 'w').write(updated) - sys.exit(0) - - def hacky_find_and_remove(self, node_to_remove): - for a in self.asts[node_to_remove.subdir].lines: - if a.lineno == node_to_remove.lineno: - if isinstance(a, mparser.AssignmentNode): - v = a.value - if not isinstance(v, mparser.ArrayNode): - raise NotImplementedError('Not supported yet, bro.') - args = v.args - for i in range(len(args.arguments)): - if isinstance(args.arguments[i], mparser.StringNode) and self.filename == args.arguments[i].value: - self.remove_argument_item(args, i) - raise NotImplementedError('Sukkess') - - def remove_source_from_target(self, node, args, kwargs): - for i in range(1, len(node.args)): - # Is file name directly in function call as a string. - if isinstance(node.args.arguments[i], mparser.StringNode) and self.filename == node.args.arguments[i].value: - self.remove_argument_item(node.args, i) - # Is file name in a variable that gets expanded here. - if isinstance(node.args.arguments[i], mparser.IdNode): - avar = self.get_variable(node.args.arguments[i].value) - if not isinstance(avar, list): - raise NotImplementedError('Non-arrays not supported yet, sorry.') - for entry in avar: - if isinstance(entry, mparser.StringNode) and entry.value == self.filename: - self.hacky_find_and_remove(entry) - sys.exit('Could not find source %s in target %s.' % (self.filename, args[0])) diff -Nru meson-0.49.0/mesonbuild/backend/backends.py meson-0.52.1/mesonbuild/backend/backends.py --- meson-0.49.0/mesonbuild/backend/backends.py 2018-12-09 14:27:16.000000000 +0000 +++ meson-0.52.1/mesonbuild/backend/backends.py 2019-11-28 17:37:44.000000000 +0000 @@ -20,13 +20,14 @@ from .. import mlog import json import subprocess -from ..mesonlib import MesonException, OrderedSet +from ..mesonlib import MachineChoice, MesonException, OrderedSet, OptionOverrideProxy from ..mesonlib import classify_unity_sources from ..mesonlib import File -from ..compilers import CompilerArgs, VisualStudioCCompiler +from ..compilers import CompilerArgs, VisualStudioLikeCompiler from collections import OrderedDict import shlex from functools import lru_cache +import typing class CleanTrees: @@ -68,13 +69,10 @@ self.optional = optional class ExecutableSerialisation: - def __init__(self, name, fname, cmd_args, env, is_cross, exe_wrapper, - workdir, extra_paths, capture): - self.name = name - self.fname = fname + def __init__(self, cmd_args, env=None, exe_wrapper=None, + workdir=None, extra_paths=None, capture=None): self.cmd_args = cmd_args - self.env = env - self.is_cross = is_cross + self.env = env or {} if exe_wrapper is not None: assert(isinstance(exe_wrapper, dependencies.ExternalProgram)) self.exe_runner = exe_wrapper @@ -83,8 +81,12 @@ self.capture = capture class TestSerialisation: - def __init__(self, name, project, suite, fname, is_cross_built, exe_wrapper, is_parallel, - cmd_args, env, should_fail, timeout, workdir, extra_paths): + def __init__(self, name: str, project: str, suite: str, fname: typing.List[str], + is_cross_built: bool, exe_wrapper: typing.Optional[build.Executable], + needs_exe_wrapper: bool, is_parallel: bool, cmd_args: typing.List[str], + env: build.EnvironmentVariables, should_fail: bool, + timeout: typing.Optional[int], workdir: typing.Optional[str], + extra_paths: typing.List[str], protocol: str, priority: int): self.name = name self.project_name = project self.suite = suite @@ -100,37 +102,48 @@ self.timeout = timeout self.workdir = workdir self.extra_paths = extra_paths - -class OptionProxy: - def __init__(self, name, value): - self.name = name - self.value = value - -class OptionOverrideProxy: - '''Mimic an option list but transparently override - selected option values.''' - def __init__(self, overrides, *options): - self.overrides = overrides - self.options = options - - def __getitem__(self, option_name): - for opts in self.options: - if option_name in opts: - return self._get_override(option_name, opts[option_name]) - raise KeyError('Option not found', option_name) - - def _get_override(self, option_name, base_opt): - if option_name in self.overrides: - return OptionProxy(base_opt.name, base_opt.validate_value(self.overrides[option_name])) - return base_opt + self.protocol = protocol + self.priority = priority + self.needs_exe_wrapper = needs_exe_wrapper + +def get_backend_from_name(backend, build): + if backend == 'ninja': + from . import ninjabackend + return ninjabackend.NinjaBackend(build) + elif backend == 'vs': + from . import vs2010backend + return vs2010backend.autodetect_vs_version(build) + elif backend == 'vs2010': + from . import vs2010backend + return vs2010backend.Vs2010Backend(build) + elif backend == 'vs2015': + from . import vs2015backend + return vs2015backend.Vs2015Backend(build) + elif backend == 'vs2017': + from . import vs2017backend + return vs2017backend.Vs2017Backend(build) + elif backend == 'vs2019': + from . import vs2019backend + return vs2019backend.Vs2019Backend(build) + elif backend == 'xcode': + from . import xcodebackend + return xcodebackend.XCodeBackend(build) + return None # This class contains the basic functionality that is needed by all backends. # Feel free to move stuff in and out of it as you see fit. class Backend: def __init__(self, build): + # Make it possible to construct a dummy backend + # This is used for introspection without a build directory + if build is None: + self.environment = None + return self.build = build self.environment = build.environment self.processed_targets = {} + self.build_dir = self.environment.get_build_dir() + self.source_dir = self.environment.get_source_dir() self.build_to_src = mesonlib.relpath(self.environment.get_source_dir(), self.environment.get_build_dir()) @@ -140,6 +153,8 @@ mlog.warning('custom_target {!r} has more than one output! ' 'Using the first one.'.format(t.name)) filename = t.get_outputs()[0] + elif isinstance(t, build.CustomTargetIndex): + filename = t.get_outputs()[0] else: assert(isinstance(t, build.BuildTarget)) filename = t.get_filename() @@ -158,9 +173,9 @@ self.environment.coredata.base_options) def get_compiler_options_for_target(self, target): - return OptionOverrideProxy(target.option_overrides, - # no code depends on builtins for now - self.environment.coredata.compiler_options) + return OptionOverrideProxy( + target.option_overrides, + self.environment.coredata.compiler_options[target.for_machine]) def get_option_for_target(self, option_name, target): if option_name in target.option_overrides: @@ -178,6 +193,10 @@ return os.path.join(self.get_target_dir(target), link_lib) elif isinstance(target, build.StaticLibrary): return os.path.join(self.get_target_dir(target), target.get_filename()) + elif isinstance(target, (build.CustomTarget, build.CustomTargetIndex)): + if not target.is_linkable_target(): + raise MesonException('Tried to link against custom target "%s", which is not linkable.' % target.name) + return os.path.join(self.get_target_dir(target), target.get_filename()) elif isinstance(target, build.Executable): if target.import_filename: return os.path.join(self.get_target_dir(target), target.get_import_filename()) @@ -185,6 +204,7 @@ return None raise AssertionError('BUG: Tried to link to {!r} which is not linkable'.format(target)) + @lru_cache(maxsize=None) def get_target_dir(self, target): if self.environment.coredata.get_builtin_option('layout') == 'mirror': dirname = target.get_subdir() @@ -261,7 +281,8 @@ os.path.join('dummyprefixdir', fromdir)) def flatten_object_list(self, target, proj_dir_to_build_root=''): - return self._flatten_object_list(target, target.get_objects(), proj_dir_to_build_root) + obj_list = self._flatten_object_list(target, target.get_objects(), proj_dir_to_build_root) + return list(dict.fromkeys(obj_list)) def _flatten_object_list(self, target, objects, proj_dir_to_build_root): obj_list = [] @@ -280,24 +301,61 @@ raise MesonException('Unknown data type in object list.') return obj_list - def serialize_executable(self, tname, exe, cmd_args, workdir, env={}, - extra_paths=None, capture=None): + def as_meson_exe_cmdline(self, tname, exe, cmd_args, workdir=None, + for_machine=MachineChoice.BUILD, + extra_bdeps=None, capture=None, force_serialize=False): ''' Serialize an executable for running with a generator or a custom target ''' import hashlib - if extra_paths is None: - # The callee didn't check if we needed extra paths, so check it here - if mesonlib.is_windows() or mesonlib.is_cygwin(): - extra_paths = self.determine_windows_extra_paths(exe, []) - else: - extra_paths = [] - # Can't just use exe.name here; it will likely be run more than once + machine = self.environment.machines[for_machine] + if machine.is_windows() or machine.is_cygwin(): + extra_paths = self.determine_windows_extra_paths(exe, extra_bdeps or []) + else: + extra_paths = [] + + if isinstance(exe, dependencies.ExternalProgram): + exe_cmd = exe.get_command() + exe_for_machine = exe.for_machine + elif isinstance(exe, (build.BuildTarget, build.CustomTarget)): + exe_cmd = [self.get_target_filename_abs(exe)] + exe_for_machine = exe.for_machine + else: + exe_cmd = [exe] + exe_for_machine = MachineChoice.BUILD + + is_cross_built = not self.environment.machines.matches_build_machine(exe_for_machine) + if is_cross_built and self.environment.need_exe_wrapper(): + exe_wrapper = self.environment.get_exe_wrapper() + if not exe_wrapper.found(): + msg = 'The exe_wrapper {!r} defined in the cross file is ' \ + 'needed by target {!r}, but was not found. Please ' \ + 'check the command and/or add it to PATH.' + raise MesonException(msg.format(exe_wrapper.name, tname)) + else: + if exe_cmd[0].endswith('.jar'): + exe_cmd = ['java', '-jar'] + exe_cmd + elif exe_cmd[0].endswith('.exe') and not (mesonlib.is_windows() or mesonlib.is_cygwin()): + exe_cmd = ['mono'] + exe_cmd + exe_wrapper = None + + force_serialize = force_serialize or extra_paths or workdir or \ + exe_wrapper or any('\n' in c for c in cmd_args) + if not force_serialize: + if not capture: + return None + return (self.environment.get_build_command() + + ['--internal', 'exe', '--capture', capture, '--'] + exe_cmd + cmd_args) + + workdir = workdir or self.environment.get_build_dir() + env = {} if isinstance(exe, (dependencies.ExternalProgram, build.BuildTarget, build.CustomTarget)): basename = exe.name else: basename = os.path.basename(exe) + + # Can't just use exe.name here; it will likely be run more than once # Take a digest of the cmd args, env, workdir, and capture. This avoids # collisions and also makes the name deterministic over regenerations # which avoids a rebuild by Ninja because the cmdline stays the same. @@ -307,33 +365,11 @@ scratch_file = 'meson_exe_{0}_{1}.dat'.format(basename, digest) exe_data = os.path.join(self.environment.get_scratch_dir(), scratch_file) with open(exe_data, 'wb') as f: - if isinstance(exe, dependencies.ExternalProgram): - exe_cmd = exe.get_command() - exe_is_native = True - elif isinstance(exe, (build.BuildTarget, build.CustomTarget)): - exe_cmd = [self.get_target_filename_abs(exe)] - exe_is_native = not exe.is_cross - else: - exe_cmd = [exe] - exe_is_native = True - is_cross_built = (not exe_is_native) and \ - self.environment.is_cross_build() and \ - self.environment.cross_info.need_cross_compiler() and \ - self.environment.cross_info.need_exe_wrapper() - if is_cross_built: - exe_wrapper = self.environment.get_exe_wrapper() - if not exe_wrapper.found(): - msg = 'The exe_wrapper {!r} defined in the cross file is ' \ - 'needed by target {!r}, but was not found. Please ' \ - 'check the command and/or add it to PATH.' - raise MesonException(msg.format(exe_wrapper.name, tname)) - else: - exe_wrapper = None - es = ExecutableSerialisation(basename, exe_cmd, cmd_args, env, - is_cross_built, exe_wrapper, workdir, + es = ExecutableSerialisation(exe_cmd + cmd_args, env, + exe_wrapper, workdir, extra_paths, capture) pickle.dump(es, f) - return exe_data + return self.environment.get_build_command() + ['--internal', 'exe', '--unpickle', exe_data] def serialize_tests(self): test_data = os.path.join(self.environment.get_scratch_dir(), 'meson_test_setup.dat') @@ -350,10 +386,7 @@ Otherwise, we query the target for the dynamic linker. ''' if isinstance(target, build.StaticLibrary): - if target.is_cross: - return self.build.static_cross_linker, [] - else: - return self.build.static_linker, [] + return self.build.static_linker[target.for_machine], [] l, stdlib_args = target.get_clink_dynamic_linker_and_stdlibs() return l, stdlib_args @@ -429,7 +462,8 @@ else: source = os.path.relpath(os.path.join(build_dir, rel_src), os.path.join(self.environment.get_source_dir(), target.get_subdir())) - return source.replace('/', '_').replace('\\', '_') + '.' + self.environment.get_object_suffix() + machine = self.environment.machines[target.for_machine] + return source.replace('/', '_').replace('\\', '_') + '.' + machine.get_object_suffix() def determine_ext_objs(self, extobj, proj_dir_to_build_root): result = [] @@ -484,6 +518,23 @@ args += compiler.get_pch_use_args(pchpath, p[0]) return includeargs + args + def create_msvc_pch_implementation(self, target, lang, pch_header): + # We have to include the language in the file name, otherwise + # pch.c and pch.cpp will both end up as pch.obj in VS backends. + impl_name = 'meson_pch-%s.%s' % (lang, lang) + pch_rel_to_build = os.path.join(self.get_target_private_dir(target), impl_name) + # Make sure to prepend the build dir, since the working directory is + # not defined. Otherwise, we might create the file in the wrong path. + pch_file = os.path.join(self.build_dir, pch_rel_to_build) + os.makedirs(os.path.dirname(pch_file), exist_ok=True) + + content = '#include "%s"' % os.path.basename(pch_header) + pch_file_tmp = pch_file + '.tmp' + with open(pch_file_tmp, 'w') as f: + f.write(content) + mesonlib.replace_if_different(pch_file, pch_file_tmp) + return pch_rel_to_build + @staticmethod def escape_extra_args(compiler, args): # No extra escaping/quoting needed when not running on Windows @@ -491,7 +542,7 @@ return args extra_args = [] # Compiler-specific escaping is needed for -D args but not for any others - if isinstance(compiler, VisualStudioCCompiler): + if isinstance(compiler, VisualStudioLikeCompiler): # MSVC needs escaping when a -D argument ends in \ or \" for arg in args: if arg.startswith('-D') or arg.startswith('/D'): @@ -544,14 +595,14 @@ commands += compiler.get_optimization_args(self.get_option_for_target('optimization', target)) commands += compiler.get_debug_args(self.get_option_for_target('debug', target)) # Add compile args added using add_project_arguments() - commands += self.build.get_project_args(compiler, target.subproject, target.is_cross) + commands += self.build.get_project_args(compiler, target.subproject, target.for_machine) # Add compile args added using add_global_arguments() # These override per-project arguments - commands += self.build.get_global_args(compiler, target.is_cross) - if not target.is_cross: - # Compile args added from the env: CFLAGS/CXXFLAGS, etc. We want these - # to override all the defaults, but not the per-target compile args. - commands += self.environment.coredata.get_external_args(compiler.get_language()) + commands += self.build.get_global_args(compiler, target.for_machine) + # Compile args added from the env: CFLAGS/CXXFLAGS, etc, or the cross + # file. We want these to override all the defaults, but not the + # per-target compile args. + commands += self.environment.coredata.get_external_args(target.for_machine, compiler.get_language()) # Always set -fPIC for shared libraries if isinstance(target, build.SharedLibrary): commands += compiler.get_pic_args() @@ -579,17 +630,13 @@ elif isinstance(dep, dependencies.ExternalLibrary): commands += dep.get_link_args('vala') else: - commands += dep.get_compile_args() + commands += compiler.get_dependency_compile_args(dep) # Qt needs -fPIC for executables # XXX: We should move to -fPIC for all executables if isinstance(target, build.Executable): commands += dep.get_exe_args(compiler) # For 'automagic' deps: Boost and GTest. Also dependency('threads'). # pkg-config puts the thread flags itself via `Cflags:` - if dep.need_threads(): - commands += compiler.thread_flags(self.environment) - elif dep.need_openmp(): - commands += compiler.openmp_flags() # Fortran requires extra include directives. if compiler.language == 'fortran': for lt in target.link_targets: @@ -615,11 +662,11 @@ def get_mingw_extra_paths(self, target): paths = OrderedSet() # The cross bindir - root = self.environment.cross_info.get_root() + root = self.environment.properties[target.for_machine].get_root() if root: paths.add(os.path.join(root, 'bin')) # The toolchain bindir - sys_root = self.environment.cross_info.get_sys_root() + sys_root = self.environment.properties[target.for_machine].get_sys_root() if sys_root: paths.add(os.path.join(sys_root, 'bin')) # Get program and library dirs from all target compilers @@ -629,7 +676,7 @@ paths.update(cc.get_library_dirs(self.environment)) return list(paths) - def determine_windows_extra_paths(self, target, extra_bdeps, is_cross=False): + def determine_windows_extra_paths(self, target: typing.Union[build.BuildTarget, str], extra_bdeps): '''On Windows there is no such thing as an rpath. We must determine all locations of DLLs that this exe links to and return them so they can be used in unit @@ -649,7 +696,8 @@ continue dirseg = os.path.join(self.environment.get_build_dir(), self.get_target_dir(ld)) result.add(dirseg) - if is_cross: + if (isinstance(target, build.BuildTarget) and + not self.environment.machines.matches_build_machine(target.for_machine)): result.update(self.get_mingw_extra_paths(target)) return list(result) @@ -659,33 +707,31 @@ def write_test_file(self, datafile): self.write_test_serialisation(self.build.get_tests(), datafile) - def write_test_serialisation(self, tests, datafile): + def create_test_serialisation(self, tests): arr = [] - for t in tests: + for t in sorted(tests, key=lambda tst: -1 * tst.priority): exe = t.get_exe() if isinstance(exe, dependencies.ExternalProgram): cmd = exe.get_command() else: cmd = [os.path.join(self.environment.get_build_dir(), self.get_target_filename(t.get_exe()))] - is_cross = self.environment.is_cross_build() and \ - self.environment.cross_info.need_cross_compiler() and \ - self.environment.cross_info.need_exe_wrapper() - if isinstance(exe, build.BuildTarget): - is_cross = is_cross and exe.is_cross - if isinstance(exe, dependencies.ExternalProgram): + if isinstance(exe, (build.BuildTarget, dependencies.ExternalProgram)): + test_for_machine = exe.for_machine + else: # E.g. an external verifier or simulator program run on a generated executable. # Can always be run without a wrapper. - is_cross = False - if is_cross: + test_for_machine = MachineChoice.BUILD + is_cross = not self.environment.machines.matches_build_machine(test_for_machine) + if is_cross and self.environment.need_exe_wrapper(): exe_wrapper = self.environment.get_exe_wrapper() else: exe_wrapper = None - if mesonlib.for_windows(is_cross, self.environment) or \ - mesonlib.for_cygwin(is_cross, self.environment): + machine = self.environment.machines[exe.for_machine] + if machine.is_windows() or machine.is_cygwin(): extra_bdeps = [] if isinstance(exe, build.CustomTarget): extra_bdeps = exe.get_transitive_build_target_deps() - extra_paths = self.determine_windows_extra_paths(exe, extra_bdeps, is_cross) + extra_paths = self.determine_windows_extra_paths(exe, extra_bdeps) else: extra_paths = [] cmd_args = [] @@ -700,14 +746,26 @@ elif isinstance(a, str): cmd_args.append(a) elif isinstance(a, build.Target): - cmd_args.append(self.get_target_filename(a)) + cmd_args.append(self.construct_target_rel_path(a, t.workdir)) else: raise MesonException('Bad object in test command.') ts = TestSerialisation(t.get_name(), t.project_name, t.suite, cmd, is_cross, - exe_wrapper, t.is_parallel, cmd_args, t.env, - t.should_fail, t.timeout, t.workdir, extra_paths) + exe_wrapper, self.environment.need_exe_wrapper(), + t.is_parallel, cmd_args, t.env, + t.should_fail, t.timeout, t.workdir, + extra_paths, t.protocol, t.priority) arr.append(ts) - pickle.dump(arr, datafile) + return arr + + def write_test_serialisation(self, tests, datafile): + pickle.dump(self.create_test_serialisation(tests), datafile) + + def construct_target_rel_path(self, a, workdir): + if workdir is None: + return self.get_target_filename(a) + assert(os.path.isabs(workdir)) + abs_path = self.get_target_filename_abs(a) + return os.path.relpath(abs_path, workdir) def generate_depmf_install(self, d): if self.build.dep_manifest_name is None: @@ -726,8 +784,8 @@ deps = [os.path.join(self.build_to_src, df) for df in self.interpreter.get_build_def_files()] if self.environment.is_cross_build(): - deps.append(os.path.join(self.build_to_src, - self.environment.coredata.cross_file)) + deps.extend(self.environment.coredata.cross_files) + deps.extend(self.environment.coredata.config_files) deps.append('meson-private/coredata.dat') if os.path.exists(os.path.join(self.environment.get_source_dir(), 'meson_options.txt')): deps.append(os.path.join(self.build_to_src, 'meson_options.txt')) @@ -738,15 +796,17 @@ return deps def exe_object_to_cmd_array(self, exe): - if self.environment.is_cross_build() and \ - isinstance(exe, build.BuildTarget) and exe.is_cross: - if self.environment.exe_wrapper is None and self.environment.cross_info.need_exe_wrapper(): - s = textwrap.dedent(''' - Can not use target {} as a generator because it is cross-built - and no exe wrapper is defined or needs_exe_wrapper is true. - You might want to set it to native instead.'''.format(exe.name)) - raise MesonException(s) if isinstance(exe, build.BuildTarget): + if exe.for_machine is not MachineChoice.BUILD: + if (self.environment.is_cross_build() and + self.environment.exe_wrapper is None and + self.environment.need_exe_wrapper()): + s = textwrap.dedent(''' + Cannot use target {} as a generator because it is built for the + host machine and no exe wrapper is defined or needs_exe_wrapper is + true. You might want to set `native: true` instead to build it for + the build machine.'''.format(exe.name)) + raise MesonException(s) exe_arr = [os.path.join(self.environment.get_build_dir(), self.get_target_filename(exe))] else: exe_arr = exe.get_command() @@ -763,7 +823,7 @@ def replace_outputs(self, args, private_dir, output_list): newargs = [] - regex = re.compile('@OUTPUT(\d+)@') + regex = re.compile(r'@OUTPUT(\d+)@') for arg in args: m = regex.search(arg) while m is not None: @@ -778,7 +838,7 @@ result = OrderedDict() # Get all build and custom targets that must be built by default for name, t in self.build.get_targets().items(): - if t.build_by_default or t.install: + if t.build_by_default: result[name] = t # Get all targets used as test executables and arguments. These must # also be built by default. XXX: Sometime in the future these should be @@ -800,14 +860,22 @@ result[dep.get_id()] = dep return result + @lru_cache(maxsize=None) + def get_custom_target_provided_by_generated_source(self, generated_source): + libs = [] + for f in generated_source.get_outputs(): + if self.environment.is_library(f): + libs.append(os.path.join(self.get_target_dir(generated_source), f)) + return libs + + @lru_cache(maxsize=None) def get_custom_target_provided_libraries(self, target): libs = [] for t in target.get_generated_sources(): if not isinstance(t, build.CustomTarget): continue - for f in t.get_outputs(): - if self.environment.is_library(f): - libs.append(os.path.join(self.get_target_dir(t), f)) + l = self.get_custom_target_provided_by_generated_source(t) + libs = libs + l return libs def is_unity(self, target): @@ -834,6 +902,8 @@ fname = [os.path.join(self.get_target_dir(i), p) for p in i.get_outputs()] elif isinstance(i, build.GeneratedList): fname = [os.path.join(self.get_target_private_dir(target), p) for p in i.get_outputs()] + elif isinstance(i, build.ExtractedObjects): + fname = [os.path.join(self.get_target_private_dir(i.target), p) for p in i.get_outputs(self)] else: fname = [i.rel_to_builddir(self.build_to_src)] if target.absolute_paths: @@ -902,8 +972,14 @@ raise MesonException(msg) dfilename = os.path.join(outdir, target.depfile) i = i.replace('@DEPFILE@', dfilename) + elif '@PRIVATE_DIR@' in i: + if target.absolute_paths: + pdir = self.get_target_private_dir_abs(target) + else: + pdir = self.get_target_private_dir(target) + i = i.replace('@PRIVATE_DIR@', pdir) elif '@PRIVATE_OUTDIR_' in i: - match = re.search('@PRIVATE_OUTDIR_(ABS_)?([^/\s*]*)@', i) + match = re.search(r'@PRIVATE_OUTDIR_(ABS_)?([^/\s*]*)@', i) if not match: msg = 'Custom target {!r} has an invalid argument {!r}' \ ''.format(target.name, i) @@ -951,18 +1027,14 @@ cmd = s['exe'] + s['args'] subprocess.check_call(cmd, env=child_env) - def create_install_data_files(self): - install_data_file = os.path.join(self.environment.get_scratch_dir(), 'install.dat') - - if self.environment.is_cross_build(): - bins = self.environment.cross_info.config['binaries'] - if 'strip' not in bins: + def create_install_data(self): + strip_bin = self.environment.binaries.host.lookup_entry('strip') + if strip_bin is None: + if self.environment.is_cross_build(): mlog.warning('Cross file does not specify strip binary, result will not be stripped.') - strip_bin = None else: - strip_bin = mesonlib.stringlistify(bins['strip']) - else: - strip_bin = self.environment.native_strip_bin + # TODO go through all candidates, like others + strip_bin = [self.environment.default_strip[0]] d = InstallData(self.environment.get_source_dir(), self.environment.get_build_dir(), self.environment.get_prefix(), @@ -976,8 +1048,12 @@ self.generate_data_install(d) self.generate_custom_install_script(d) self.generate_subdir_install(d) + return d + + def create_install_data_files(self): + install_data_file = os.path.join(self.environment.get_scratch_dir(), 'install.dat') with open(install_data_file, 'wb') as ofile: - pickle.dump(d, ofile) + pickle.dump(self.create_install_data(), ofile) def generate_target_install(self, d): for t in self.build.get_targets().values(): @@ -994,7 +1070,20 @@ install_mode = t.get_custom_install_mode() # Install the target output(s) if isinstance(t, build.BuildTarget): - should_strip = self.get_option_for_target('strip', t) + # In general, stripping static archives is tricky and full of pitfalls. + # Wholesale stripping of static archives with a command such as + # + # strip libfoo.a + # + # is broken, as GNU's strip will remove *every* symbol in a static + # archive. One solution to this nonintuitive behaviour would be + # to only strip local/debug symbols. Unfortunately, strip arguments + # are not specified by POSIX and therefore not portable. GNU's `-g` + # option (i.e. remove debug symbols) is equivalent to Apple's `-S`. + # + # TODO: Create GNUStrip/AppleStrip/etc. hierarchy for more + # fine-grained stripping of static archives. + should_strip = not isinstance(t, build.StaticLibrary) and self.get_option_for_target('strip', t) # Install primary build output (library/executable/jar, etc) # Done separately because of strip/aliases/rpath if outdirs[0] is not False: @@ -1039,7 +1128,8 @@ if num_outdirs == 1 and num_out > 1: for output in t.get_outputs(): f = os.path.join(self.get_target_dir(t), output) - i = TargetInstallData(f, outdirs[0], {}, False, {}, None, install_mode) + i = TargetInstallData(f, outdirs[0], {}, False, {}, None, install_mode, + optional=not t.build_by_default) d.targets.append(i) else: for output, outdir in zip(t.get_outputs(), outdirs): @@ -1047,7 +1137,8 @@ if outdir is False: continue f = os.path.join(self.get_target_dir(t), output) - i = TargetInstallData(f, outdir, {}, False, {}, None, install_mode) + i = TargetInstallData(f, outdir, {}, False, {}, None, install_mode, + optional=not t.build_by_default) d.targets.append(i) def generate_custom_install_script(self, d): @@ -1123,3 +1214,53 @@ dst_dir = os.path.join(dst_dir, os.path.basename(src_dir)) d.install_subdirs.append([src_dir, dst_dir, sd.install_mode, sd.exclude]) + + def get_introspection_data(self, target_id, target): + ''' + Returns a list of source dicts with the following format for a given target: + [ + { + "language": "", + "compiler": ["result", "of", "comp.get_exelist()"], + "parameters": ["list", "of", "compiler", "parameters], + "sources": ["list", "of", "all", "", "source", "files"], + "generated_sources": ["list", "of", "generated", "source", "files"] + } + ] + + This is a limited fallback / reference implementation. The backend should override this method. + ''' + if isinstance(target, (build.CustomTarget, build.BuildTarget)): + source_list_raw = target.sources + target.extra_files + source_list = [] + for j in source_list_raw: + if isinstance(j, mesonlib.File): + source_list += [j.absolute_path(self.source_dir, self.build_dir)] + elif isinstance(j, str): + source_list += [os.path.join(self.source_dir, j)] + source_list = list(map(lambda x: os.path.normpath(x), source_list)) + + compiler = [] + if isinstance(target, build.CustomTarget): + tmp_compiler = target.command + if not isinstance(compiler, list): + tmp_compiler = [compiler] + for j in tmp_compiler: + if isinstance(j, mesonlib.File): + compiler += [j.absolute_path(self.source_dir, self.build_dir)] + elif isinstance(j, str): + compiler += [j] + elif isinstance(j, (build.BuildTarget, build.CustomTarget)): + compiler += j.get_outputs() + else: + raise RuntimeError('Type "{}" is not supported in get_introspection_data. This is a bug'.format(type(j).__name__)) + + return [{ + 'language': 'unknown', + 'compiler': compiler, + 'parameters': [], + 'sources': source_list, + 'generated_sources': [] + }] + + return [] diff -Nru meson-0.49.0/mesonbuild/backend/ninjabackend.py meson-0.52.1/mesonbuild/backend/ninjabackend.py --- meson-0.49.0/mesonbuild/backend/ninjabackend.py 2018-12-09 14:27:23.000000000 +0000 +++ meson-0.52.1/mesonbuild/backend/ninjabackend.py 2019-11-28 17:37:44.000000000 +0000 @@ -11,15 +11,14 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - +from typing import List import os import re -import shlex import pickle import subprocess from collections import OrderedDict import itertools -from pathlib import PurePath +from pathlib import PurePath, Path from functools import lru_cache from . import backends @@ -29,21 +28,32 @@ from .. import mlog from .. import dependencies from .. import compilers -from ..compilers import CompilerArgs, CCompiler, VisualStudioCCompiler +from ..compilers import (Compiler, CompilerArgs, CCompiler, FortranCompiler, + PGICCompiler, VisualStudioLikeCompiler) from ..linkers import ArLinker -from ..mesonlib import File, MesonException, OrderedSet +from ..mesonlib import ( + File, LibType, MachineChoice, MesonException, OrderedSet, PerMachine, ProgressBar, quote_arg +) from ..mesonlib import get_compiler_for_source, has_path_sep from .backends import CleanTrees from ..build import InvalidArguments +FORTRAN_INCLUDE_PAT = r"^\s*#?include\s*['\"](\w+\.\w+)['\"]" +FORTRAN_MODULE_PAT = r"^\s*\bmodule\b\s+(\w+)\s*(?:!+.*)*$" +FORTRAN_SUBMOD_PAT = r"^\s*\bsubmodule\b\s*\((\w+:?\w+)\)\s*(\w+)" +FORTRAN_USE_PAT = r"^\s*use,?\s*(?:non_intrinsic)?\s*(?:::)?\s*(\w+)" + if mesonlib.is_windows(): + # FIXME: can't use quote_arg on Windows just yet; there are a number of existing workarounds + # throughout the codebase that cumulatively make the current code work (see, e.g. Backend.escape_extra_args + # and NinjaBuildElement.write below) and need to be properly untangled before attempting this quote_func = lambda s: '"{}"'.format(s) - execute_wrapper = 'cmd /c' - rmfile_prefix = 'del /f /s /q {} &&' + execute_wrapper = ['cmd', '/c'] + rmfile_prefix = ['del', '/f', '/s', '/q', '{}', '&&'] else: - quote_func = shlex.quote - execute_wrapper = '' - rmfile_prefix = 'rm -f {} &&' + quote_func = quote_arg + execute_wrapper = [] + rmfile_prefix = ['rm', '-f', '{}', '&&'] def ninja_quote(text, is_build_line=False): if is_build_line: @@ -61,6 +71,52 @@ raise MesonException(errmsg) return text +class NinjaComment: + def __init__(self, comment): + self.comment = comment + + def write(self, outfile): + for l in self.comment.split('\n'): + outfile.write('# ') + outfile.write(l) + outfile.write('\n') + outfile.write('\n') + +class NinjaRule: + def __init__(self, rule, command, args, description, + rspable = False, deps = None, depfile = None, extra = None): + self.name = rule + self.command = command # includes args which never go into a rspfile + self.args = args # args which will go into a rspfile, if used + self.description = description + self.deps = deps # depstyle 'gcc' or 'msvc' + self.depfile = depfile + self.extra = extra + self.rspable = rspable # if a rspfile can be used + self.refcount = 0 + + def write(self, outfile): + if not self.refcount: + return + + outfile.write('rule %s\n' % self.name) + if self.rspable: + outfile.write(' command = %s @$out.rsp\n' % ' '.join(self.command)) + outfile.write(' rspfile = $out.rsp\n') + outfile.write(' rspfile_content = %s\n' % ' '.join(self.args)) + else: + outfile.write(' command = %s\n' % ' '.join(self.command + self.args)) + if self.deps: + outfile.write(' deps = %s\n' % self.deps) + if self.depfile: + outfile.write(' depfile = %s\n' % self.depfile) + outfile.write(' description = %s\n' % self.description) + if self.extra: + for l in self.extra.split('\n'): + outfile.write(' ') + outfile.write(l) + outfile.write('\n') + outfile.write('\n') class NinjaBuildElement: def __init__(self, all_outputs, outfilenames, rule, infilenames): @@ -114,8 +170,11 @@ line = line.replace('\\', '/') outfile.write(line) - # All the entries that should remain unquoted - raw_names = {'DEPFILE', 'DESC', 'pool', 'description'} + # ninja variables whose value should remain unquoted. The value of these + # ninja variables (or variables we use them in) is interpreted directly + # by ninja (e.g. the value of the depfile variable is a pathname that + # ninja will read from, etc.), so it must not be shell quoted. + raw_names = {'DEPFILE', 'DESC', 'pool', 'description', 'targetdep'} for e in self.elems: (name, elems) = e @@ -150,8 +209,10 @@ self.ninja_filename = 'build.ninja' self.fortran_deps = {} self.all_outputs = {} + self.introspection_data = {} + self.created_llvm_ir_rule = PerMachine(False, False) - def create_target_alias(self, to_target, outfile): + def create_target_alias(self, to_target): # We need to use aliases for targets that might be used as directory # names to workaround a Ninja bug that breaks `ninja -t clean`. # This is used for 'reserved' targets such as 'test', 'install', @@ -162,14 +223,22 @@ raise AssertionError(m.format(to_target)) from_target = to_target[len('meson-'):] elem = NinjaBuildElement(self.all_outputs, from_target, 'phony', to_target) - elem.write(outfile) + self.add_build(elem) def detect_vs_dep_prefix(self, tempfilename): '''VS writes its dependency in a locale dependent format. Detect the search prefix to use.''' - for compiler in self.build.compilers.values(): + # TODO don't hard-code host + for compiler in self.environment.coredata.compilers.host.values(): # Have to detect the dependency format - if isinstance(compiler, VisualStudioCCompiler): + + # IFort on windows is MSVC like, but doesn't have /showincludes + if isinstance(compiler, FortranCompiler): + continue + if isinstance(compiler, PGICCompiler) and mesonlib.is_windows(): + # for the purpose of this function, PGI doesn't act enough like MSVC + return open(tempfilename, 'a', encoding='utf-8') + if isinstance(compiler, VisualStudioLikeCompiler): break else: # None of our compilers are MSVC, we're done. @@ -185,23 +254,33 @@ # and locale dependent. Any attempt at converting it to # Python strings leads to failure. We _must_ do this detection # in raw byte mode and write the result in raw bytes. - pc = subprocess.Popen([compiler.get_exelist(), - '/showIncludes', '/c', 'incdetect.c'], + pc = subprocess.Popen(compiler.get_exelist() + + ['/showIncludes', '/c', 'incdetect.c'], cwd=self.environment.get_scratch_dir(), stdout=subprocess.PIPE, stderr=subprocess.PIPE) - (stdo, _) = pc.communicate() + (stdout, stderr) = pc.communicate() # We want to match 'Note: including file: ' in the line # 'Note: including file: d:\MyDir\include\stdio.h', however # different locales have different messages with a different # number of colons. Match up to the the drive name 'd:\'. matchre = re.compile(rb"^(.*\s)[a-zA-Z]:\\.*stdio.h$") - for line in re.split(rb'\r?\n', stdo): - match = matchre.match(line) - if match: - with open(tempfilename, 'ab') as binfile: - binfile.write(b'msvc_deps_prefix = ' + match.group(1) + b'\n') - return open(tempfilename, 'a', encoding='utf-8') + + def detect_prefix(out): + for line in re.split(rb'\r?\n', out): + match = matchre.match(line) + if match: + with open(tempfilename, 'ab') as binfile: + binfile.write(b'msvc_deps_prefix = ' + match.group(1) + b'\n') + return open(tempfilename, 'a', encoding='utf-8') + return None + + # Some cl wrappers (e.g. Squish Coco) output dependency info + # to stderr rather than stdout + result = detect_prefix(stdout) or detect_prefix(stderr) + if result: + return result + raise MesonException('Could not determine vs dep dependency prefix string.') def generate(self, interp): @@ -217,24 +296,40 @@ outfile.write('# It is autogenerated by the Meson build system.\n') outfile.write('# Do not edit by hand.\n\n') outfile.write('ninja_required_version = 1.5.1\n\n') + + num_pools = self.environment.coredata.backend_options['backend_max_links'].value + if num_pools > 0: + outfile.write('''pool link_pool + depth = %d + +''' % num_pools) + with self.detect_vs_dep_prefix(tempfilename) as outfile: - self.generate_rules(outfile) - self.generate_phony(outfile) - outfile.write('# Build rules for targets\n\n') - for t in self.build.get_targets().values(): - self.generate_target(t, outfile) - outfile.write('# Test rules\n\n') - self.generate_tests(outfile) - outfile.write('# Install rules\n\n') - self.generate_install(outfile) - self.generate_dist(outfile) + self.generate_rules() + + self.build_elements = [] + self.generate_phony() + self.add_build_comment(NinjaComment('Build rules for targets')) + for t in ProgressBar(self.build.get_targets().values(), desc='Generating targets'): + self.generate_target(t) + self.add_build_comment(NinjaComment('Test rules')) + self.generate_tests() + self.add_build_comment(NinjaComment('Install rules')) + self.generate_install() + self.generate_dist() if 'b_coverage' in self.environment.coredata.base_options and \ self.environment.coredata.base_options['b_coverage'].value: - outfile.write('# Coverage rules\n\n') - self.generate_coverage_rules(outfile) - outfile.write('# Suffix\n\n') - self.generate_utils(outfile) - self.generate_ending(outfile) + self.add_build_comment(NinjaComment('Coverage rules')) + self.generate_coverage_rules() + self.add_build_comment(NinjaComment('Suffix')) + self.generate_utils() + self.generate_ending() + + self.write_rules(outfile) + self.write_builds(outfile) + + default = 'default all\n\n' + outfile.write(default) # Only overwrite the old build file after the new one has been # fully created. os.replace(tempfilename, outfilename) @@ -242,10 +337,12 @@ # http://clang.llvm.org/docs/JSONCompilationDatabase.html def generate_compdb(self): - pch_compilers = ['%s_PCH' % i for i in self.build.compilers] - native_compilers = ['%s_COMPILER' % i for i in self.build.compilers] - cross_compilers = ['%s_CROSS_COMPILER' % i for i in self.build.cross_compilers] - ninja_compdb = [self.ninja_command, '-t', 'compdb'] + pch_compilers + native_compilers + cross_compilers + rules = [] + for for_machine in MachineChoice: + for lang in self.environment.coredata.compilers[for_machine]: + rules += [self.get_compiler_rule_name(lang, for_machine)] + rules += [self.get_pch_rule_name(lang, for_machine)] + ninja_compdb = [self.ninja_command, '-t', 'compdb'] + rules builddir = self.environment.get_build_dir() try: jsondb = subprocess.check_output(ninja_compdb, cwd=builddir) @@ -321,30 +418,85 @@ return False return True - def generate_target(self, target, outfile): + def create_target_source_introspection(self, target: build.Target, comp: compilers.Compiler, parameters, sources, generated_sources): + ''' + Adds the source file introspection information for a language of a target + + Internal introspection storage formart: + self.introspection_data = { + '': { + : { + 'language: 'lang', + 'compiler': ['comp', 'exe', 'list'], + 'parameters': ['UNIQUE', 'parameter', 'list'], + 'sources': [], + 'generated_sources': [], + } + } + } + ''' + tid = target.get_id() + lang = comp.get_language() + tgt = self.introspection_data[tid] + # Find an existing entry or create a new one + id_hash = (lang, tuple(parameters)) + src_block = tgt.get(id_hash, None) + if src_block is None: + # Convert parameters + if isinstance(parameters, CompilerArgs): + parameters = parameters.to_native(copy=True) + parameters = comp.compute_parameters_with_absolute_paths(parameters, self.build_dir) + # The new entry + src_block = { + 'language': lang, + 'compiler': comp.get_exelist(), + 'parameters': parameters, + 'sources': [], + 'generated_sources': [], + } + tgt[id_hash] = src_block + # Make source files absolute + sources = [x.absolute_path(self.source_dir, self.build_dir) if isinstance(x, File) else os.path.normpath(os.path.join(self.build_dir, x)) + for x in sources] + generated_sources = [x.absolute_path(self.source_dir, self.build_dir) if isinstance(x, File) else os.path.normpath(os.path.join(self.build_dir, x)) + for x in generated_sources] + # Add the source files + src_block['sources'] += sources + src_block['generated_sources'] += generated_sources + + def is_rust_target(self, target): + if len(target.sources) > 0: + first_file = target.sources[0] + if first_file.fname.endswith('.rs'): + return True + return False + + def generate_target(self, target): if isinstance(target, build.CustomTarget): - self.generate_custom_target(target, outfile) + self.generate_custom_target(target) if isinstance(target, build.RunTarget): - self.generate_run_target(target, outfile) + self.generate_run_target(target) name = target.get_id() if name in self.processed_targets: return self.processed_targets[name] = True + # Initialize an empty introspection source list + self.introspection_data[name] = {} # Generate rules for all dependency targets - self.process_target_dependencies(target, outfile) + self.process_target_dependencies(target) # If target uses a language that cannot link to C objects, # just generate for that language and return. if isinstance(target, build.Jar): - self.generate_jar_target(target, outfile) + self.generate_jar_target(target) return - if 'rust' in target.compilers: - self.generate_rust_target(target, outfile) + if self.is_rust_target(target): + self.generate_rust_target(target) return if 'cs' in target.compilers: - self.generate_cs_target(target, outfile) + self.generate_cs_target(target) return if 'swift' in target.compilers: - self.generate_swift_target(target, outfile) + self.generate_swift_target(target) return # Now we handle the following languages: @@ -362,24 +514,19 @@ # Sources consumed by valac are filtered out. These only contain # C/C++ sources, objects, generated libs, and unknown sources now. target_sources, generated_sources, \ - vala_generated_sources = self.generate_vala_compile(target, outfile) + vala_generated_sources = self.generate_vala_compile(target) else: target_sources = self.get_target_sources(target) generated_sources = self.get_target_generated_sources(target) vala_generated_sources = [] self.scan_fortran_module_outputs(target) # Generate rules for GeneratedLists - self.generate_generator_list_rules(target, outfile) + self.generate_generator_list_rules(target) # Generate rules for building the remaining source files in this target outname = self.get_target_filename(target) obj_list = [] - use_pch = self.environment.coredata.base_options.get('b_pch', False) is_unity = self.is_unity(target) - if use_pch and target.has_pch(): - pch_objects = self.generate_pch(target, outfile) - else: - pch_objects = [] header_deps = [] unity_src = [] unity_deps = [] # Generated sources that must be built before compiling a Unity target. @@ -402,7 +549,7 @@ # This will be set as dependencies of all the target's sources. At the # same time, also deal with generated sources that need to be compiled. generated_source_files = [] - for rel_src, gensrc in generated_sources.items(): + for rel_src in generated_sources.keys(): dirpart, fnamepart = os.path.split(rel_src) raw_src = File(True, dirpart, fnamepart) if self.environment.is_source(rel_src) and not self.environment.is_header(rel_src): @@ -426,12 +573,18 @@ # because we need `header_deps` to be fully generated in the above loop. for src in generated_source_files: if self.environment.is_llvm_ir(src): - o = self.generate_llvm_ir_compile(target, outfile, src) + o = self.generate_llvm_ir_compile(target, src) else: - o = self.generate_single_compile(target, outfile, src, True, + o = self.generate_single_compile(target, src, True, header_deps=header_deps) obj_list.append(o) + use_pch = self.environment.coredata.base_options.get('b_pch', False) + if use_pch and target.has_pch(): + pch_objects = self.generate_pch(target, header_deps=header_deps) + else: + pch_objects = [] + # Generate compilation targets for C sources generated from Vala # sources. This can be extended to other $LANG->C compilers later if # necessary. This needs to be separate for at least Vala @@ -458,39 +611,39 @@ # Passing 'vala' here signifies that we want the compile # arguments to be specialized for C code generated by # valac. For instance, no warnings should be emitted. - obj_list.append(self.generate_single_compile(target, outfile, src, 'vala', [], header_deps)) + obj_list.append(self.generate_single_compile(target, src, 'vala', [], header_deps)) # Generate compile targets for all the pre-existing sources for this target - for f, src in target_sources.items(): + for src in target_sources.values(): if not self.environment.is_header(src): if self.environment.is_llvm_ir(src): - obj_list.append(self.generate_llvm_ir_compile(target, outfile, src)) + obj_list.append(self.generate_llvm_ir_compile(target, src)) elif is_unity and self.get_target_source_can_unity(target, src): abs_src = os.path.join(self.environment.get_build_dir(), src.rel_to_builddir(self.build_to_src)) unity_src.append(abs_src) else: - obj_list.append(self.generate_single_compile(target, outfile, src, False, [], header_deps)) + obj_list.append(self.generate_single_compile(target, src, False, [], header_deps)) obj_list += self.flatten_object_list(target) if is_unity: for src in self.generate_unity_files(target, unity_src): - obj_list.append(self.generate_single_compile(target, outfile, src, True, unity_deps + header_deps)) + obj_list.append(self.generate_single_compile(target, src, True, unity_deps + header_deps)) linker, stdlib_args = self.determine_linker_and_stdlib_args(target) - elem = self.generate_link(target, outfile, outname, obj_list, linker, pch_objects, stdlib_args=stdlib_args) + elem = self.generate_link(target, outname, obj_list, linker, pch_objects, stdlib_args=stdlib_args) self.generate_shlib_aliases(target, self.get_target_dir(target)) - elem.write(outfile) + self.add_build(elem) - def process_target_dependencies(self, target, outfile): + def process_target_dependencies(self, target): for t in target.get_dependencies(): if t.get_id() not in self.processed_targets: - self.generate_target(t, outfile) + self.generate_target(t) - def custom_target_generator_inputs(self, target, outfile): + def custom_target_generator_inputs(self, target): for s in target.sources: if hasattr(s, 'held_object'): s = s.held_object if isinstance(s, build.GeneratedList): - self.generate_genlist_for_target(s, target, outfile) + self.generate_genlist_for_target(s, target) def unwrap_dep_list(self, target): deps = [] @@ -503,8 +656,8 @@ deps.append(os.path.join(self.get_target_dir(i), output)) return deps - def generate_custom_target(self, target, outfile): - self.custom_target_generator_inputs(target, outfile) + def generate_custom_target(self, target): + self.custom_target_generator_inputs(target) (srcs, ofilenames, cmd) = self.eval_custom_target_command(target) deps = self.unwrap_dep_list(target) deps += self.get_custom_target_depend_files(target) @@ -521,37 +674,13 @@ # Add a dependency on all the outputs of this target for output in d.get_outputs(): elem.add_dep(os.path.join(self.get_target_dir(d), output)) - serialize = False - extra_paths = [] - # If the target requires capturing stdout, then use the serialized - # executable wrapper to capture that output and save it to a file. - if target.capture: - serialize = True - # If the command line requires a newline, also use the wrapper, as - # ninja does not support them in its build rule syntax. - if any('\n' in c for c in cmd): - serialize = True - # Windows doesn't have -rpath, so for EXEs that need DLLs built within - # the project, we need to set PATH so the DLLs are found. We use - # a serialized executable wrapper for that and check if the - # CustomTarget command needs extra paths first. - is_cross = self.environment.is_cross_build() and \ - self.environment.cross_info.need_cross_compiler() and \ - self.environment.cross_info.need_exe_wrapper() - if mesonlib.for_windows(is_cross, self.environment) or \ - mesonlib.for_cygwin(is_cross, self.environment): - extra_bdeps = target.get_transitive_build_target_deps() - extra_paths = self.determine_windows_extra_paths(target.command[0], - extra_bdeps, is_cross) - if extra_paths: - serialize = True - if serialize: - exe_data = self.serialize_executable(target.name, target.command[0], cmd[1:], - # All targets are built from the build dir - self.environment.get_build_dir(), - extra_paths=extra_paths, - capture=ofilenames[0] if target.capture else None) - cmd = self.environment.get_build_command() + ['--internal', 'exe', exe_data] + + meson_exe_cmd = self.as_meson_exe_cmdline(target.name, target.command[0], cmd[1:], + for_machine=target.for_machine, + extra_bdeps=target.get_transitive_build_target_deps(), + capture=ofilenames[0] if target.capture else None) + if meson_exe_cmd: + cmd = meson_exe_cmd cmd_type = 'meson_exe.py custom' else: cmd_type = 'custom' @@ -566,10 +695,17 @@ cmd = self.replace_paths(target, cmd) elem.add_item('COMMAND', cmd) elem.add_item('description', desc.format(target.name, cmd_type)) - elem.write(outfile) + self.add_build(elem) self.processed_targets[target.get_id()] = True - def generate_run_target(self, target, outfile): + def build_run_target_name(self, target): + if target.subproject != '': + subproject_prefix = '{}@@'.format(target.subproject) + else: + subproject_prefix = '' + return '{}{}'.format(subproject_prefix, target.name) + + def generate_run_target(self, target): cmd = self.environment.get_build_command() + ['--internal', 'commandrunner'] deps = self.unwrap_dep_list(target) arg_strings = [] @@ -585,12 +721,6 @@ arg_strings.append(os.path.join(self.environment.get_build_dir(), relfname)) else: raise AssertionError('Unreachable code in generate_run_target: ' + str(i)) - if target.subproject != '': - subproject_prefix = '{}@@'.format(target.subproject) - else: - subproject_prefix = '' - target_name = 'meson-{}{}'.format(subproject_prefix, target.name) - elem = NinjaBuildElement(self.all_outputs, target_name, 'CUSTOM_COMMAND', []) cmd += [self.environment.get_source_dir(), self.environment.get_build_dir(), target.subdir] + self.environment.get_build_command() @@ -623,14 +753,21 @@ cmd.append(target.command) cmd += arg_strings + if texe: + target_name = 'meson-{}'.format(self.build_run_target_name(target)) + elem = NinjaBuildElement(self.all_outputs, target_name, 'CUSTOM_COMMAND', []) + elem.add_item('COMMAND', cmd) + elem.add_item('description', 'Running external command %s.' % target.name) + elem.add_item('pool', 'console') + # Alias that runs the target defined above with the name the user specified + self.create_target_alias(target_name) + else: + target_name = self.build_run_target_name(target) + elem = NinjaBuildElement(self.all_outputs, target_name, 'phony', []) + elem.add_dep(deps) cmd = self.replace_paths(target, cmd) - elem.add_item('COMMAND', cmd) - elem.add_item('description', 'Running external command %s.' % target.name) - elem.add_item('pool', 'console') - elem.write(outfile) - # Alias that runs the target defined above with the name the user specified - self.create_target_alias(target_name, outfile) + self.add_build(elem) self.processed_targets[target.get_id()] = True def generate_coverage_command(self, elem, outputs): @@ -643,49 +780,49 @@ self.environment.get_build_dir(), self.environment.get_log_dir()]) - def generate_coverage_rules(self, outfile): + def generate_coverage_rules(self): e = NinjaBuildElement(self.all_outputs, 'meson-coverage', 'CUSTOM_COMMAND', 'PHONY') self.generate_coverage_command(e, []) e.add_item('description', 'Generates coverage reports.') - e.write(outfile) + self.add_build(e) # Alias that runs the target defined above - self.create_target_alias('meson-coverage', outfile) - self.generate_coverage_legacy_rules(outfile) + self.create_target_alias('meson-coverage') + self.generate_coverage_legacy_rules() - def generate_coverage_legacy_rules(self, outfile): + def generate_coverage_legacy_rules(self): e = NinjaBuildElement(self.all_outputs, 'meson-coverage-xml', 'CUSTOM_COMMAND', 'PHONY') self.generate_coverage_command(e, ['--xml']) e.add_item('description', 'Generates XML coverage report.') - e.write(outfile) + self.add_build(e) # Alias that runs the target defined above - self.create_target_alias('meson-coverage-xml', outfile) + self.create_target_alias('meson-coverage-xml') e = NinjaBuildElement(self.all_outputs, 'meson-coverage-text', 'CUSTOM_COMMAND', 'PHONY') self.generate_coverage_command(e, ['--text']) e.add_item('description', 'Generates text coverage report.') - e.write(outfile) + self.add_build(e) # Alias that runs the target defined above - self.create_target_alias('meson-coverage-text', outfile) + self.create_target_alias('meson-coverage-text') e = NinjaBuildElement(self.all_outputs, 'meson-coverage-html', 'CUSTOM_COMMAND', 'PHONY') self.generate_coverage_command(e, ['--html']) e.add_item('description', 'Generates HTML coverage report.') - e.write(outfile) + self.add_build(e) # Alias that runs the target defined above - self.create_target_alias('meson-coverage-html', outfile) + self.create_target_alias('meson-coverage-html') - def generate_install(self, outfile): + def generate_install(self): self.create_install_data_files() elem = NinjaBuildElement(self.all_outputs, 'meson-install', 'CUSTOM_COMMAND', 'PHONY') elem.add_dep('all') elem.add_item('DESC', 'Installing files.') elem.add_item('COMMAND', self.environment.get_build_command() + ['install', '--no-rebuild']) elem.add_item('pool', 'console') - elem.write(outfile) + self.add_build(elem) # Alias that runs the target defined above - self.create_target_alias('meson-install', outfile) + self.create_target_alias('meson-install') - def generate_tests(self, outfile): + def generate_tests(self): self.serialize_tests() cmd = self.environment.get_build_command(True) + ['test', '--no-rebuild'] if not self.environment.coredata.get_builtin_option('stdsplit'): @@ -696,9 +833,9 @@ elem.add_item('COMMAND', cmd) elem.add_item('DESC', 'Running all tests.') elem.add_item('pool', 'console') - elem.write(outfile) + self.add_build(elem) # Alias that runs the above-defined meson-test target - self.create_target_alias('meson-test', outfile) + self.create_target_alias('meson-test') # And then benchmarks. cmd = self.environment.get_build_command(True) + [ @@ -708,54 +845,69 @@ elem.add_item('COMMAND', cmd) elem.add_item('DESC', 'Running benchmark suite.') elem.add_item('pool', 'console') - elem.write(outfile) + self.add_build(elem) # Alias that runs the above-defined meson-benchmark target - self.create_target_alias('meson-benchmark', outfile) + self.create_target_alias('meson-benchmark') - def generate_rules(self, outfile): - outfile.write('# Rules for compiling.\n\n') - self.generate_compile_rules(outfile) - outfile.write('# Rules for linking.\n\n') - num_pools = self.environment.coredata.backend_options['backend_max_links'].value - if num_pools > 0: - outfile.write('''pool link_pool - depth = %d - -''' % num_pools) - if self.environment.is_cross_build(): - self.generate_static_link_rules(True, outfile) - self.generate_static_link_rules(False, outfile) - self.generate_dynamic_link_rules(outfile) - outfile.write('# Other rules\n\n') - outfile.write('rule CUSTOM_COMMAND\n') - outfile.write(' command = $COMMAND\n') - outfile.write(' description = $DESC\n') - outfile.write(' restat = 1\n\n') + def generate_rules(self): + self.rules = [] + self.ruledict = {} + + self.add_rule_comment(NinjaComment('Rules for compiling.')) + self.generate_compile_rules() + self.add_rule_comment(NinjaComment('Rules for linking.')) + self.generate_static_link_rules() + self.generate_dynamic_link_rules() + self.add_rule_comment(NinjaComment('Other rules')) # Ninja errors out if you have deps = gcc but no depfile, so we must # have two rules for custom commands. - outfile.write('rule CUSTOM_COMMAND_DEP\n') - outfile.write(' command = $COMMAND\n') - outfile.write(' description = $DESC\n') - outfile.write(' deps = gcc\n') - outfile.write(' depfile = $DEPFILE\n') - outfile.write(' restat = 1\n\n') - outfile.write('rule REGENERATE_BUILD\n') + self.add_rule(NinjaRule('CUSTOM_COMMAND', ['$COMMAND'], [], '$DESC', + extra='restat = 1')) + self.add_rule(NinjaRule('CUSTOM_COMMAND_DEP', ['$COMMAND'], [], '$DESC', + deps='gcc', depfile='$DEPFILE', + extra='restat = 1')) + c = [ninja_quote(quote_func(x)) for x in self.environment.get_build_command()] + \ ['--internal', 'regenerate', ninja_quote(quote_func(self.environment.get_source_dir())), ninja_quote(quote_func(self.environment.get_build_dir()))] - outfile.write(" command = " + ' '.join(c) + ' --backend ninja\n') - outfile.write(' description = Regenerating build files.\n') - outfile.write(' generator = 1\n\n') - outfile.write('\n') - - def generate_phony(self, outfile): - outfile.write('# Phony build target, always out of date\n') - outfile.write('build PHONY: phony\n') - outfile.write('\n') + self.add_rule(NinjaRule('REGENERATE_BUILD', + c + ['--backend', 'ninja'], [], + 'Regenerating build files.', + extra='generator = 1')) + + def add_rule_comment(self, comment): + self.rules.append(comment) + + def add_build_comment(self, comment): + self.build_elements.append(comment) + + def add_rule(self, rule): + self.rules.append(rule) + self.ruledict[rule.name] = rule + + def add_build(self, build): + self.build_elements.append(build) + + # increment rule refcount + if build.rule != 'phony': + self.ruledict[build.rule].refcount += 1 + + def write_rules(self, outfile): + for r in self.rules: + r.write(outfile) + + def write_builds(self, outfile): + for b in ProgressBar(self.build_elements, desc='Writing build.ninja'): + b.write(outfile) + + def generate_phony(self): + self.add_build_comment(NinjaComment('Phony build target, always out of date')) + elem = NinjaBuildElement(self.all_outputs, 'PHONY', 'phony', '') + self.add_build(elem) - def generate_jar_target(self, target, outfile): + def generate_jar_target(self, target): fname = target.get_filename() outname_rel = os.path.join(self.get_target_dir(target), fname) src_list = target.get_sources() @@ -771,14 +923,16 @@ # Add possible java generated files to src list generated_sources = self.get_target_generated_sources(target) - for rel_src, gensrc in generated_sources.items(): + gen_src_list = [] + for rel_src in generated_sources.keys(): dirpart, fnamepart = os.path.split(rel_src) raw_src = File(True, dirpart, fnamepart) if rel_src.endswith('.java'): - src_list.append(raw_src) + gen_src_list.append(raw_src) - for src in src_list: - plain_class_path = self.generate_single_java_compile(src, target, compiler, outfile) + compile_args = self.determine_single_java_compile_args(target, compiler) + for src in src_list + gen_src_list: + plain_class_path = self.generate_single_java_compile(src, target, compiler, compile_args) class_list.append(plain_class_path) class_dep_list = [os.path.join(self.get_target_private_dir(target), i) for i in class_list] manifest_path = os.path.join(self.get_target_private_dir(target), 'META-INF', 'MANIFEST.MF') @@ -803,9 +957,11 @@ elem = NinjaBuildElement(self.all_outputs, outname_rel, jar_rule, []) elem.add_dep(class_dep_list) elem.add_item('ARGS', commands) - elem.write(outfile) + self.add_build(elem) + # Create introspection information + self.create_target_source_introspection(target, compiler, compile_args, src_list, gen_src_list) - def generate_cs_resource_tasks(self, target, outfile): + def generate_cs_resource_tasks(self, target): args = [] deps = [] for r in target.resources: @@ -818,7 +974,7 @@ elem = NinjaBuildElement(self.all_outputs, ofilename, "CUSTOM_COMMAND", rel_sourcefile) elem.add_item('COMMAND', ['resgen', rel_sourcefile, ofilename]) elem.add_item('DESC', 'Compiling resource %s.' % rel_sourcefile) - elem.write(outfile) + self.add_build(elem) deps.append(ofilename) a = '-resource:' + ofilename else: @@ -826,7 +982,7 @@ args.append(a) return args, deps - def generate_cs_target(self, target, outfile): + def generate_cs_target(self, target): buildtype = self.get_option_for_target('buildtype', target) fname = target.get_filename() outname_rel = os.path.join(self.get_target_dir(target), fname) @@ -844,7 +1000,7 @@ commands.append('-target:library') else: raise MesonException('Unknown C# target type.') - (resource_args, resource_deps) = self.generate_cs_resource_tasks(target, outfile) + (resource_args, resource_deps) = self.generate_cs_resource_tasks(target) commands += resource_args deps += resource_deps commands += compiler.get_output_args(outname_rel) @@ -857,34 +1013,31 @@ else: outputs = [outname_rel] generated_sources = self.get_target_generated_sources(target) + generated_rel_srcs = [] for rel_src in generated_sources.keys(): dirpart, fnamepart = os.path.split(rel_src) if rel_src.lower().endswith('.cs'): - rel_srcs.append(os.path.normpath(rel_src)) + generated_rel_srcs.append(os.path.normpath(rel_src)) deps.append(os.path.normpath(rel_src)) for dep in target.get_external_deps(): commands.extend_direct(dep.get_link_args()) - commands += self.build.get_project_args(compiler, target.subproject, target.is_cross) - commands += self.build.get_global_args(compiler, target.is_cross) + commands += self.build.get_project_args(compiler, target.subproject, target.for_machine) + commands += self.build.get_global_args(compiler, target.for_machine) - elem = NinjaBuildElement(self.all_outputs, outputs, 'cs_COMPILER', rel_srcs) + elem = NinjaBuildElement(self.all_outputs, outputs, self.get_compiler_rule_name('cs', target.for_machine), rel_srcs + generated_rel_srcs) elem.add_dep(deps) elem.add_item('ARGS', commands) - elem.write(outfile) + self.add_build(elem) - self.generate_generator_list_rules(target, outfile) + self.generate_generator_list_rules(target) + self.create_target_source_introspection(target, compiler, commands, rel_srcs, generated_rel_srcs) - def generate_single_java_compile(self, src, target, compiler, outfile): - deps = [os.path.join(self.get_target_dir(l), l.get_filename()) for l in target.link_targets] - generated_sources = self.get_target_generated_sources(target) - for rel_src, gensrc in generated_sources.items(): - if rel_src.endswith('.java'): - deps.append(rel_src) + def determine_single_java_compile_args(self, target, compiler): args = [] args += compiler.get_buildtype_args(self.get_option_for_target('buildtype', target)) - args += self.build.get_global_args(compiler, target.is_cross) - args += self.build.get_project_args(compiler, target.subproject, target.is_cross) + args += self.build.get_global_args(compiler, target.for_machine) + args += self.build.get_project_args(compiler, target.subproject, target.for_machine) args += target.get_java_args() args += compiler.get_output_args(self.get_target_private_dir(target)) args += target.get_classpath_args() @@ -895,23 +1048,28 @@ for idir in i.get_incdirs(): sourcepath += os.path.join(self.build_to_src, i.curdir, idir) + os.pathsep args += ['-sourcepath', sourcepath] + return args + + def generate_single_java_compile(self, src, target, compiler, args): + deps = [os.path.join(self.get_target_dir(l), l.get_filename()) for l in target.link_targets] + generated_sources = self.get_target_generated_sources(target) + for rel_src in generated_sources.keys(): + if rel_src.endswith('.java'): + deps.append(rel_src) rel_src = src.rel_to_builddir(self.build_to_src) plain_class_path = src.fname[:-4] + 'class' rel_obj = os.path.join(self.get_target_private_dir(target), plain_class_path) - element = NinjaBuildElement(self.all_outputs, rel_obj, compiler.get_language() + '_COMPILER', rel_src) + element = NinjaBuildElement(self.all_outputs, rel_obj, self.compiler_to_rule_name(compiler), rel_src) element.add_dep(deps) element.add_item('ARGS', args) - element.write(outfile) + self.add_build(element) return plain_class_path - def generate_java_link(self, outfile): - rule = 'rule java_LINKER\n' - command = ' command = jar $ARGS\n' - description = ' description = Creating JAR $out.\n' - outfile.write(rule) - outfile.write(command) - outfile.write(description) - outfile.write('\n') + def generate_java_link(self): + rule = 'java_LINKER' + command = ['jar', '$ARGS'] + description = 'Creating JAR $out.' + self.add_rule(NinjaRule(rule, command, [], description)) def determine_dep_vapis(self, target): """ @@ -987,7 +1145,7 @@ srctype[f] = gensrc return vala, vapi, (others, othersgen) - def generate_vala_compile(self, target, outfile): + def generate_vala_compile(self, target): """Vala is compiled into C. Set up all necessary build steps here.""" (vala_src, vapi_src, other_src) = self.split_vala_sources(target) extra_dep_files = [] @@ -1081,7 +1239,7 @@ if len(target.install_dir) > 3 and target.install_dir[3] is True: target.install_dir[3] = os.path.join(self.environment.get_datadir(), 'gir-1.0') # Detect gresources and add --gresources arguments for each - for (gres, gensrc) in other_src[1].items(): + for gensrc in other_src[1].values(): if isinstance(gensrc, modules.GResourceTarget): gres_xml, = self.get_custom_target_sources(gensrc) args += ['--gresources=' + gres_xml] @@ -1098,14 +1256,15 @@ extra_dep_files += dependency_vapis args += extra_args element = NinjaBuildElement(self.all_outputs, valac_outputs, - valac.get_language() + '_COMPILER', + self.compiler_to_rule_name(valac), all_files + dependency_vapis) element.add_item('ARGS', args) element.add_dep(extra_dep_files) - element.write(outfile) + self.add_build(element) + self.create_target_source_introspection(target, valac, args, all_files, []) return other_src[0], other_src[1], vala_c_src - def generate_rust_target(self, target, outfile): + def generate_rust_target(self, target): rustc = target.compilers['rust'] # Rust compiler takes only the main file as input and # figures out what other files are needed via import @@ -1134,6 +1293,9 @@ args += ['--crate-name', target.name] args += rustc.get_buildtype_args(self.get_option_for_target('buildtype', target)) args += rustc.get_debug_args(self.get_option_for_target('debug', target)) + args += rustc.get_optimization_args(self.get_option_for_target('optimization', target)) + args += self.build.get_global_args(rustc, target.for_machine) + args += self.build.get_project_args(rustc, target.subproject, target.for_machine) depfile = os.path.join(target.subdir, target.name + '.d') args += ['--emit', 'dep-info={}'.format(depfile), '--emit', 'link'] args += target.get_extra_args('rust') @@ -1172,7 +1334,8 @@ self.get_target_dir(target)) else: target_slashname_workaround_dir = self.get_target_dir(target) - rpath_args = rustc.build_rpath_args(self.environment.get_build_dir(), + rpath_args = rustc.build_rpath_args(self.environment, + self.environment.get_build_dir(), target_slashname_workaround_dir, self.determine_rpath_dirs(target), target.build_rpath, @@ -1181,19 +1344,37 @@ # installations for rpath_arg in rpath_args: args += ['-C', 'link-arg=' + rpath_arg + ':' + os.path.join(rustc.get_sysroot(), 'lib')] - crstr = '' - if target.is_cross: - crstr = '_CROSS' - compiler_name = 'rust%s_COMPILER' % crstr + compiler_name = self.get_compiler_rule_name('rust', target.for_machine) element = NinjaBuildElement(self.all_outputs, target_name, compiler_name, main_rust_file) if len(orderdeps) > 0: element.add_orderdep(orderdeps) element.add_item('ARGS', args) element.add_item('targetdep', depfile) element.add_item('cratetype', cratetype) - element.write(outfile) + self.add_build(element) if isinstance(target, build.SharedLibrary): - self.generate_shsym(outfile, target) + self.generate_shsym(target) + self.create_target_source_introspection(target, rustc, args, [main_rust_file], []) + + @staticmethod + def get_rule_suffix(for_machine: MachineChoice) -> str: + return PerMachine('_FOR_BUILD', '')[for_machine] + + @classmethod + def get_compiler_rule_name(cls, lang: str, for_machine: MachineChoice) -> str: + return '%s_COMPILER%s' % (lang, cls.get_rule_suffix(for_machine)) + + @classmethod + def get_pch_rule_name(cls, lang: str, for_machine: MachineChoice) -> str: + return '%s_PCH%s' % (lang, cls.get_rule_suffix(for_machine)) + + @classmethod + def compiler_to_rule_name(cls, compiler: Compiler) -> str: + return cls.get_compiler_rule_name(compiler.get_language(), compiler.for_machine) + + @classmethod + def compiler_to_pch_rule_name(cls, compiler: Compiler) -> str: + return cls.get_pch_rule_name(compiler.get_language(), compiler.for_machine) def swift_module_file_name(self, target): return os.path.join(self.get_target_private_dir(target), @@ -1238,16 +1419,18 @@ others.append(i) return srcs, others - def generate_swift_target(self, target, outfile): + def generate_swift_target(self, target): module_name = self.target_swift_modulename(target) swiftc = target.compilers['swift'] abssrc = [] + relsrc = [] abs_headers = [] header_imports = [] for i in target.get_sources(): if swiftc.can_compile(i): - relsrc = i.rel_to_builddir(self.build_to_src) - abss = os.path.normpath(os.path.join(self.environment.get_build_dir(), relsrc)) + rels = i.rel_to_builddir(self.build_to_src) + abss = os.path.normpath(os.path.join(self.environment.get_build_dir(), rels)) + relsrc.append(rels) abssrc.append(abss) elif self.environment.is_header(i): relh = i.rel_to_builddir(self.build_to_src) @@ -1261,8 +1444,8 @@ compile_args += swiftc.get_optimization_args(self.get_option_for_target('optimization', target)) compile_args += swiftc.get_debug_args(self.get_option_for_target('debug', target)) compile_args += swiftc.get_module_args(module_name) - compile_args += self.build.get_project_args(swiftc, target.subproject, target.is_cross) - compile_args += self.build.get_global_args(swiftc, target.is_cross) + compile_args += self.build.get_project_args(swiftc, target.subproject, target.for_machine) + compile_args += self.build.get_global_args(swiftc, target.for_machine) for i in reversed(target.get_include_dirs()): basedir = i.get_curdir() for d in i.get_incdirs(): @@ -1274,8 +1457,8 @@ sargs = swiftc.get_include_args(srctreedir) compile_args += sargs link_args = swiftc.get_output_args(os.path.join(self.environment.get_build_dir(), self.get_target_filename(target))) - link_args += self.build.get_project_link_args(swiftc, target.subproject, target.is_cross) - link_args += self.build.get_global_link_args(swiftc, target.is_cross) + link_args += self.build.get_project_link_args(swiftc, target.subproject, target.for_machine) + link_args += self.build.get_global_link_args(swiftc, target.for_machine) rundir = self.get_target_private_dir(target) out_module_name = self.swift_module_file_name(target) in_module_files = self.determine_swift_dep_modules(target) @@ -1302,283 +1485,193 @@ objects.append(oname) rel_objects.append(os.path.join(self.get_target_private_dir(target), oname)) + rulename = self.get_compiler_rule_name('swift', target.for_machine) + # Swiftc does not seem to be able to emit objects and module files in one go. - elem = NinjaBuildElement(self.all_outputs, rel_objects, - 'swift_COMPILER', - abssrc) + elem = NinjaBuildElement(self.all_outputs, rel_objects, rulename, abssrc) elem.add_dep(in_module_files + rel_generated) elem.add_dep(abs_headers) elem.add_item('ARGS', compile_args + header_imports + abs_generated + module_includes) elem.add_item('RUNDIR', rundir) - elem.write(outfile) + self.add_build(elem) elem = NinjaBuildElement(self.all_outputs, out_module_name, - 'swift_COMPILER', + self.get_compiler_rule_name('swift', target.for_machine), abssrc) elem.add_dep(in_module_files + rel_generated) elem.add_item('ARGS', compile_args + abs_generated + module_includes + swiftc.get_mod_gen_args()) elem.add_item('RUNDIR', rundir) - elem.write(outfile) + self.add_build(elem) if isinstance(target, build.StaticLibrary): - elem = self.generate_link(target, outfile, self.get_target_filename(target), - rel_objects, self.build.static_linker) - elem.write(outfile) + elem = self.generate_link(target, self.get_target_filename(target), + rel_objects, self.build.static_linker[target.for_machine]) + self.add_build(elem) elif isinstance(target, build.Executable): - elem = NinjaBuildElement(self.all_outputs, self.get_target_filename(target), 'swift_COMPILER', []) + elem = NinjaBuildElement(self.all_outputs, self.get_target_filename(target), rulename, []) elem.add_dep(rel_objects) elem.add_dep(link_deps) elem.add_item('ARGS', link_args + swiftc.get_std_exe_link_args() + objects + abs_link_deps) elem.add_item('RUNDIR', rundir) - elem.write(outfile) + self.add_build(elem) else: raise MesonException('Swift supports only executable and static library targets.') + # Introspection information + self.create_target_source_introspection(target, swiftc, compile_args + header_imports + module_includes, relsrc, rel_generated) - def generate_static_link_rules(self, is_cross, outfile): + def generate_static_link_rules(self): num_pools = self.environment.coredata.backend_options['backend_max_links'].value - if 'java' in self.build.compilers: - if not is_cross: - self.generate_java_link(outfile) - if is_cross: - if self.environment.cross_info.need_cross_compiler(): - static_linker = self.build.static_cross_linker - else: - static_linker = self.build.static_linker - crstr = '_CROSS' - else: - static_linker = self.build.static_linker - crstr = '' - if static_linker is None: - return - rule = 'rule STATIC%s_LINKER\n' % crstr - if static_linker.can_linker_accept_rsp(): - command_template = ''' command = {executable} $LINK_ARGS {output_args} @$out.rsp - rspfile = $out.rsp - rspfile_content = $in -''' - else: - command_template = ' command = {executable} $LINK_ARGS {output_args} $in\n' - cmdlist = [] - # FIXME: Must normalize file names with pathlib.Path before writing - # them out to fix this properly on Windows. See: - # https://github.com/mesonbuild/meson/issues/1517 - # https://github.com/mesonbuild/meson/issues/1526 - if isinstance(static_linker, ArLinker) and not mesonlib.is_windows(): - # `ar` has no options to overwrite archives. It always appends, - # which is never what we want. Delete an existing library first if - # it exists. https://github.com/mesonbuild/meson/issues/1355 - cmdlist = [execute_wrapper, rmfile_prefix.format('$out')] - cmdlist += static_linker.get_exelist() - command = command_template.format( - executable=' '.join(cmdlist), - output_args=' '.join(static_linker.get_output_args('$out'))) - description = ' description = Linking static target $out.\n\n' - outfile.write(rule) - outfile.write(command) - if num_pools > 0: - outfile.write(' pool = link_pool\n') - outfile.write(description) + if 'java' in self.environment.coredata.compilers.host: + self.generate_java_link() + for for_machine in MachineChoice: + static_linker = self.build.static_linker[for_machine] + if static_linker is None: + return + rule = 'STATIC_LINKER%s' % self.get_rule_suffix(for_machine) + cmdlist = [] + args = ['$in'] + # FIXME: Must normalize file names with pathlib.Path before writing + # them out to fix this properly on Windows. See: + # https://github.com/mesonbuild/meson/issues/1517 + # https://github.com/mesonbuild/meson/issues/1526 + if isinstance(static_linker, ArLinker) and not mesonlib.is_windows(): + # `ar` has no options to overwrite archives. It always appends, + # which is never what we want. Delete an existing library first if + # it exists. https://github.com/mesonbuild/meson/issues/1355 + cmdlist = execute_wrapper + [c.format('$out') for c in rmfile_prefix] + cmdlist += static_linker.get_exelist() + cmdlist += ['$LINK_ARGS'] + cmdlist += static_linker.get_output_args('$out') + description = 'Linking static target $out.' + if num_pools > 0: + pool = 'pool = link_pool' + else: + pool = None + self.add_rule(NinjaRule(rule, cmdlist, args, description, + rspable=static_linker.can_linker_accept_rsp(), + extra=pool)) - def generate_dynamic_link_rules(self, outfile): + def generate_dynamic_link_rules(self): num_pools = self.environment.coredata.backend_options['backend_max_links'].value - ctypes = [(self.build.compilers, False)] - if self.environment.is_cross_build(): - if self.environment.cross_info.need_cross_compiler(): - ctypes.append((self.build.cross_compilers, True)) - else: - # Native compiler masquerades as the cross compiler. - ctypes.append((self.build.compilers, True)) - else: - ctypes.append((self.build.cross_compilers, True)) - for (complist, is_cross) in ctypes: + for for_machine in MachineChoice: + complist = self.environment.coredata.compilers[for_machine] for langname, compiler in complist.items(): if langname == 'java' \ or langname == 'vala' \ or langname == 'rust' \ or langname == 'cs': continue - crstr = '' - cross_args = [] - if is_cross: - crstr = '_CROSS' - try: - cross_args = self.environment.cross_info.config['properties'][langname + '_link_args'] - except KeyError: - pass - rule = 'rule %s%s_LINKER\n' % (langname, crstr) - if compiler.can_linker_accept_rsp(): - command_template = ''' command = {executable} @$out.rsp - rspfile = $out.rsp - rspfile_content = $ARGS {output_args} $in $LINK_ARGS {cross_args} $aliasing -''' - else: - command_template = ' command = {executable} $ARGS {output_args} $in $LINK_ARGS {cross_args} $aliasing\n' - command = command_template.format( - executable=' '.join(compiler.get_linker_exelist()), - cross_args=' '.join(cross_args), - output_args=' '.join(compiler.get_linker_output_args('$out')) - ) - description = ' description = Linking target $out.\n' - outfile.write(rule) - outfile.write(command) + rule = '%s_LINKER%s' % (langname, self.get_rule_suffix(for_machine)) + command = compiler.get_linker_exelist() + args = ['$ARGS'] + compiler.get_linker_output_args('$out') + ['$in', '$LINK_ARGS'] + description = 'Linking target $out.' if num_pools > 0: - outfile.write(' pool = link_pool\n') - outfile.write(description) - outfile.write('\n') - outfile.write('\n') + pool = 'pool = link_pool' + else: + pool = None + self.add_rule(NinjaRule(rule, command, args, description, + rspable=compiler.can_linker_accept_rsp(), + extra=pool)) + args = [ninja_quote(quote_func(x)) for x in self.environment.get_build_command()] + \ ['--internal', 'symbolextractor', '$in', '$out'] - symrule = 'rule SHSYM\n' - symcmd = ' command = ' + ' '.join(args) + ' $CROSS\n' - synstat = ' restat = 1\n' - syndesc = ' description = Generating symbol file $out.\n' - outfile.write(symrule) - outfile.write(symcmd) - outfile.write(synstat) - outfile.write(syndesc) - outfile.write('\n') - - def generate_java_compile_rule(self, compiler, outfile): - rule = 'rule %s_COMPILER\n' % compiler.get_language() - invoc = ' '.join([ninja_quote(i) for i in compiler.get_exelist()]) - command = ' command = %s $ARGS $in\n' % invoc - description = ' description = Compiling Java object $in.\n' - outfile.write(rule) - outfile.write(command) - outfile.write(description) - outfile.write('\n') - - def generate_cs_compile_rule(self, compiler, outfile): - rule = 'rule %s_COMPILER\n' % compiler.get_language() - invoc = ' '.join([ninja_quote(i) for i in compiler.get_exelist()]) - - if mesonlib.is_windows(): - command = ''' command = {executable} @$out.rsp - rspfile = $out.rsp - rspfile_content = $ARGS $in -'''.format(executable=invoc) - else: - command = ' command = %s $ARGS $in\n' % invoc - - description = ' description = Compiling C Sharp target $out.\n' - outfile.write(rule) - outfile.write(command) - outfile.write(description) - outfile.write('\n') - - def generate_vala_compile_rules(self, compiler, outfile): - rule = 'rule %s_COMPILER\n' % compiler.get_language() - invoc = ' '.join([ninja_quote(i) for i in compiler.get_exelist()]) - command = ' command = %s $ARGS $in\n' % invoc - description = ' description = Compiling Vala source $in.\n' - restat = ' restat = 1\n' # ValaC does this always to take advantage of it. - outfile.write(rule) - outfile.write(command) - outfile.write(description) - outfile.write(restat) - outfile.write('\n') - - def generate_rust_compile_rules(self, compiler, outfile, is_cross): - crstr = '' - if is_cross: - crstr = '_CROSS' - rule = 'rule %s%s_COMPILER\n' % (compiler.get_language(), crstr) - invoc = ' '.join([ninja_quote(i) for i in compiler.get_exelist()]) - command = ' command = %s $ARGS $in\n' % invoc - description = ' description = Compiling Rust source $in.\n' - depfile = ' depfile = $targetdep\n' - - depstyle = ' deps = gcc\n' - outfile.write(rule) - outfile.write(command) - outfile.write(description) - outfile.write(depfile) - outfile.write(depstyle) - outfile.write('\n') + symrule = 'SHSYM' + symcmd = args + ['$CROSS'] + syndesc = 'Generating symbol file $out.' + synstat = 'restat = 1' + self.add_rule(NinjaRule(symrule, symcmd, [], syndesc, extra=synstat)) + + def generate_java_compile_rule(self, compiler): + rule = self.compiler_to_rule_name(compiler) + invoc = [ninja_quote(i) for i in compiler.get_exelist()] + command = invoc + ['$ARGS', '$in'] + description = 'Compiling Java object $in.' + self.add_rule(NinjaRule(rule, command, [], description)) + + def generate_cs_compile_rule(self, compiler): + rule = self.compiler_to_rule_name(compiler) + invoc = [ninja_quote(i) for i in compiler.get_exelist()] + command = invoc + args = ['$ARGS', '$in'] + description = 'Compiling C Sharp target $out.' + self.add_rule(NinjaRule(rule, command, args, description, + rspable=mesonlib.is_windows())) + + def generate_vala_compile_rules(self, compiler): + rule = self.compiler_to_rule_name(compiler) + invoc = [ninja_quote(i) for i in compiler.get_exelist()] + command = invoc + ['$ARGS', '$in'] + description = 'Compiling Vala source $in.' + self.add_rule(NinjaRule(rule, command, [], description, extra='restat = 1')) + + def generate_rust_compile_rules(self, compiler): + rule = self.compiler_to_rule_name(compiler) + invoc = [ninja_quote(i) for i in compiler.get_exelist()] + command = invoc + ['$ARGS', '$in'] + description = 'Compiling Rust source $in.' + depfile = '$targetdep' + depstyle = 'gcc' + self.add_rule(NinjaRule(rule, command, [], description, deps=depstyle, + depfile=depfile)) - def generate_swift_compile_rules(self, compiler, outfile): - rule = 'rule %s_COMPILER\n' % compiler.get_language() + def generate_swift_compile_rules(self, compiler): + rule = self.compiler_to_rule_name(compiler) full_exe = [ninja_quote(x) for x in self.environment.get_build_command()] + [ '--internal', 'dirchanger', '$RUNDIR', ] - invoc = (' '.join(full_exe) + ' ' + - ' '.join(ninja_quote(i) for i in compiler.get_exelist())) - command = ' command = %s $ARGS $in\n' % invoc - description = ' description = Compiling Swift source $in.\n' - outfile.write(rule) - outfile.write(command) - outfile.write(description) - outfile.write('\n') + invoc = full_exe + [ninja_quote(i) for i in compiler.get_exelist()] + command = invoc + ['$ARGS', '$in'] + description = 'Compiling Swift source $in.' + self.add_rule(NinjaRule(rule, command, [], description)) - def generate_fortran_dep_hack(self, outfile, crstr): + def generate_fortran_dep_hack(self, crstr): + rule = 'FORTRAN_DEP_HACK%s' % (crstr) if mesonlib.is_windows(): - cmd = 'cmd /C ""' + cmd = ['cmd', '/C'] else: - cmd = 'true' - template = '''# Workaround for these issues: -# https://groups.google.com/forum/#!topic/ninja-build/j-2RfBIOd_8 -# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485 -rule FORTRAN_DEP_HACK%s - command = %s - description = Dep hack - restat = 1 + cmd = ['true'] + self.add_rule_comment(NinjaComment('''Workaround for these issues: +https://groups.google.com/forum/#!topic/ninja-build/j-2RfBIOd_8 +https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485''')) + self.add_rule(NinjaRule(rule, cmd, [], 'Dep hack', extra='restat = 1')) -''' - outfile.write(template % (crstr, cmd)) - - def generate_llvm_ir_compile_rule(self, compiler, is_cross, outfile): - if getattr(self, 'created_llvm_ir_rule', False): + def generate_llvm_ir_compile_rule(self, compiler): + if self.created_llvm_ir_rule[compiler.for_machine]: return - rule = 'rule llvm_ir{}_COMPILER\n'.format('_CROSS' if is_cross else '') - if compiler.can_linker_accept_rsp(): - command_template = ' command = {executable} @$out.rsp\n' \ - ' rspfile = $out.rsp\n' \ - ' rspfile_content = $ARGS {cross_args} {output_args} {compile_only_args} $in\n' - else: - command_template = ' command = {executable} $ARGS {cross_args} {output_args} {compile_only_args} $in\n' - command = command_template.format( - executable=' '.join([ninja_quote(i) for i in compiler.get_exelist()]), - cross_args=' '.join(compiler.get_cross_extra_flags(self.environment, False)) if is_cross else '', - output_args=' '.join(compiler.get_output_args('$out')), - compile_only_args=' '.join(compiler.get_compile_only_args()) - ) - description = ' description = Compiling LLVM IR object $in.\n' - outfile.write(rule) - outfile.write(command) - outfile.write(description) - outfile.write('\n') - self.created_llvm_ir_rule = True + rule = self.get_compiler_rule_name('llvm_ir', compiler.for_machine) + command = [ninja_quote(i) for i in compiler.get_exelist()] + args = ['$ARGS'] + compiler.get_output_args('$out') + compiler.get_compile_only_args() + ['$in'] + description = 'Compiling LLVM IR object $in.' + self.add_rule(NinjaRule(rule, command, args, description, + rspable=compiler.can_linker_accept_rsp())) + self.created_llvm_ir_rule[compiler.for_machine] = True - def generate_compile_rule_for(self, langname, compiler, is_cross, outfile): + def generate_compile_rule_for(self, langname, compiler): if langname == 'java': - if not is_cross: - self.generate_java_compile_rule(compiler, outfile) + if self.environment.machines.matches_build_machine(compiler.for_machine): + self.generate_java_compile_rule(compiler) return if langname == 'cs': - if not is_cross: - self.generate_cs_compile_rule(compiler, outfile) + if self.environment.machines.matches_build_machine(compiler.for_machine): + self.generate_cs_compile_rule(compiler) return if langname == 'vala': - if not is_cross: - self.generate_vala_compile_rules(compiler, outfile) + self.generate_vala_compile_rules(compiler) return if langname == 'rust': - self.generate_rust_compile_rules(compiler, outfile, is_cross) + self.generate_rust_compile_rules(compiler) return if langname == 'swift': - if not is_cross: - self.generate_swift_compile_rules(compiler, outfile) + if self.environment.machines.matches_build_machine(compiler.for_machine): + self.generate_swift_compile_rules(compiler) return - if is_cross: - crstr = '_CROSS' - else: - crstr = '' + crstr = self.get_rule_suffix(compiler.for_machine) if langname == 'fortran': - self.generate_fortran_dep_hack(outfile, crstr) - rule = 'rule %s%s_COMPILER\n' % (langname, crstr) + self.generate_fortran_dep_hack(crstr) + rule = self.get_compiler_rule_name(langname, compiler.for_machine) depargs = compiler.get_dependency_gen_args('$out', '$DEPFILE') quoted_depargs = [] for d in depargs: @@ -1586,108 +1679,62 @@ d = quote_func(d) quoted_depargs.append(d) - if is_cross: - cross_args = compiler.get_cross_extra_flags(self.environment, False) - else: - cross_args = '' - if compiler.can_linker_accept_rsp(): - command_template = ''' command = {executable} @$out.rsp - rspfile = $out.rsp - rspfile_content = $ARGS {cross_args} {dep_args} {output_args} {compile_only_args} $in -''' - else: - command_template = ' command = {executable} $ARGS {cross_args} {dep_args} {output_args} {compile_only_args} $in\n' - command = command_template.format( - executable=' '.join([ninja_quote(i) for i in compiler.get_exelist()]), - cross_args=' '.join(cross_args), - dep_args=' '.join(quoted_depargs), - output_args=' '.join(compiler.get_output_args('$out')), - compile_only_args=' '.join(compiler.get_compile_only_args()) - ) - description = ' description = Compiling %s object $out.\n' % compiler.get_display_language() - if isinstance(compiler, VisualStudioCCompiler): - deps = ' deps = msvc\n' - else: - deps = ' deps = gcc\n' - deps += ' depfile = $DEPFILE\n' - outfile.write(rule) - outfile.write(command) - outfile.write(deps) - outfile.write(description) - outfile.write('\n') + command = [ninja_quote(i) for i in compiler.get_exelist()] + args = ['$ARGS'] + quoted_depargs + compiler.get_output_args('$out') + compiler.get_compile_only_args() + ['$in'] + description = 'Compiling %s object $out.' % compiler.get_display_language() + if isinstance(compiler, VisualStudioLikeCompiler): + deps = 'msvc' + depfile = None + else: + deps = 'gcc' + depfile = '$DEPFILE' + self.add_rule(NinjaRule(rule, command, args, description, + rspable=compiler.can_linker_accept_rsp(), + deps=deps, depfile=depfile)) - def generate_pch_rule_for(self, langname, compiler, is_cross, outfile): + def generate_pch_rule_for(self, langname, compiler): if langname != 'c' and langname != 'cpp': return - if is_cross: - crstr = '_CROSS' - else: - crstr = '' - rule = 'rule %s%s_PCH\n' % (langname, crstr) + rule = self.compiler_to_pch_rule_name(compiler) depargs = compiler.get_dependency_gen_args('$out', '$DEPFILE') - cross_args = [] - if is_cross: - try: - cross_args = compiler.get_cross_extra_flags(self.environment, False) - except KeyError: - pass quoted_depargs = [] for d in depargs: if d != '$out' and d != '$in': d = quote_func(d) quoted_depargs.append(d) - if isinstance(compiler, VisualStudioCCompiler): - output = '' + if isinstance(compiler, VisualStudioLikeCompiler): + output = [] else: - output = ' '.join(compiler.get_output_args('$out')) - command = " command = {executable} $ARGS {cross_args} {dep_args} {output_args} {compile_only_args} $in\n".format( - executable=' '.join(compiler.get_exelist()), - cross_args=' '.join(cross_args), - dep_args=' '.join(quoted_depargs), - output_args=output, - compile_only_args=' '.join(compiler.get_compile_only_args()) - ) - description = ' description = Precompiling header %s.\n' % '$in' - if isinstance(compiler, VisualStudioCCompiler): - deps = ' deps = msvc\n' - else: - deps = ' deps = gcc\n' - deps += ' depfile = $DEPFILE\n' - outfile.write(rule) - outfile.write(command) - outfile.write(deps) - outfile.write(description) - outfile.write('\n') - - def generate_compile_rules(self, outfile): - for langname, compiler in self.build.compilers.items(): - if compiler.get_id() == 'clang': - self.generate_llvm_ir_compile_rule(compiler, False, outfile) - self.generate_compile_rule_for(langname, compiler, False, outfile) - self.generate_pch_rule_for(langname, compiler, False, outfile) - if self.environment.is_cross_build(): - # In case we are going a target-only build, make the native compilers - # masquerade as cross compilers. - if self.environment.cross_info.need_cross_compiler(): - cclist = self.build.cross_compilers - else: - cclist = self.build.compilers - for langname, compiler in cclist.items(): + output = compiler.get_output_args('$out') + command = compiler.get_exelist() + ['$ARGS'] + quoted_depargs + output + compiler.get_compile_only_args() + ['$in'] + description = 'Precompiling header $in.' + if isinstance(compiler, VisualStudioLikeCompiler): + deps = 'msvc' + depfile = None + else: + deps = 'gcc' + depfile = '$DEPFILE' + self.add_rule(NinjaRule(rule, command, [], description, deps=deps, + depfile=depfile)) + + def generate_compile_rules(self): + for for_machine in MachineChoice: + clist = self.environment.coredata.compilers[for_machine] + for langname, compiler in clist.items(): if compiler.get_id() == 'clang': - self.generate_llvm_ir_compile_rule(compiler, True, outfile) - self.generate_compile_rule_for(langname, compiler, True, outfile) - self.generate_pch_rule_for(langname, compiler, True, outfile) - outfile.write('\n') + self.generate_llvm_ir_compile_rule(compiler) + self.generate_compile_rule_for(langname, compiler) + self.generate_pch_rule_for(langname, compiler) - def generate_generator_list_rules(self, target, outfile): + def generate_generator_list_rules(self, target): # CustomTargets have already written their rules and # CustomTargetIndexes don't actually get generated, so write rules for # GeneratedLists here for genlist in target.get_generated_sources(): if isinstance(genlist, (build.CustomTarget, build.CustomTargetIndex)): continue - self.generate_genlist_for_target(genlist, target, outfile) + self.generate_genlist_for_target(genlist, target) def replace_paths(self, target, args, override_subdir=None): if override_subdir: @@ -1703,20 +1750,20 @@ args = [x.replace('\\', '/') for x in args] return args - def generate_genlist_for_target(self, genlist, target, outfile): + def generate_genlist_for_target(self, genlist, target): generator = genlist.get_generator() subdir = genlist.subdir exe = generator.get_exe() exe_arr = self.exe_object_to_cmd_array(exe) infilelist = genlist.get_inputs() outfilelist = genlist.get_outputs() - extra_dependencies = [os.path.join(self.build_to_src, i) for i in genlist.extra_depends] + extra_dependencies = self.get_custom_target_depend_files(genlist) for i in range(len(infilelist)): + curfile = infilelist[i] if len(generator.outputs) == 1: sole_output = os.path.join(self.get_target_private_dir(target), outfilelist[i]) else: - sole_output = '' - curfile = infilelist[i] + sole_output = '{}'.format(curfile) infilename = curfile.rel_to_builddir(self.build_to_src) base_args = generator.get_arglist(infilename) outfiles = genlist.get_outputs_for(curfile) @@ -1733,46 +1780,52 @@ for x in args] args = self.replace_outputs(args, self.get_target_private_dir(target), outfilelist) # We have consumed output files, so drop them from the list of remaining outputs. - if sole_output == '': + if len(generator.outputs) > 1: outfilelist = outfilelist[len(generator.outputs):] args = self.replace_paths(target, args, override_subdir=subdir) cmdlist = exe_arr + self.replace_extra_args(args, genlist) - if generator.capture: - exe_data = self.serialize_executable( - 'generator ' + cmdlist[0], - cmdlist[0], - cmdlist[1:], - self.environment.get_build_dir(), - capture=outfiles[0] - ) - cmd = self.environment.get_build_command() + ['--internal', 'exe', exe_data] - abs_pdir = os.path.join(self.environment.get_build_dir(), self.get_target_dir(target)) - os.makedirs(abs_pdir, exist_ok=True) - else: - cmd = cmdlist + meson_exe_cmd = self.as_meson_exe_cmdline('generator ' + cmdlist[0], + cmdlist[0], cmdlist[1:], + capture=outfiles[0] if generator.capture else None) + if meson_exe_cmd: + cmdlist = meson_exe_cmd + abs_pdir = os.path.join(self.environment.get_build_dir(), self.get_target_dir(target)) + os.makedirs(abs_pdir, exist_ok=True) elem = NinjaBuildElement(self.all_outputs, outfiles, rulename, infilename) + elem.add_dep([self.get_target_filename(x) for x in generator.depends]) if generator.depfile is not None: elem.add_item('DEPFILE', depfile) if len(extra_dependencies) > 0: elem.add_dep(extra_dependencies) - elem.add_item('DESC', 'Generating {!r}.'.format(sole_output)) + if len(generator.outputs) == 1: + elem.add_item('DESC', 'Generating {!r}.'.format(sole_output)) + else: + # since there are multiple outputs, we log the source that caused the rebuild + elem.add_item('DESC', 'Generating source from {!r}.'.format(sole_output)) if isinstance(exe, build.BuildTarget): elem.add_dep(self.get_target_filename(exe)) - elem.add_item('COMMAND', cmd) - elem.write(outfile) + elem.add_item('COMMAND', cmdlist) + self.add_build(elem) def scan_fortran_module_outputs(self, target): + """ + Find all module and submodule made available in a Fortran code file. + """ compiler = None - for lang, c in self.build.compilers.items(): + # TODO other compilers + for lang, c in self.environment.coredata.compilers.host.items(): if lang == 'fortran': compiler = c break if compiler is None: self.fortran_deps[target.get_basename()] = {} return - modre = re.compile(r"\s*module\s+(\w+)", re.IGNORECASE) + + modre = re.compile(FORTRAN_MODULE_PAT, re.IGNORECASE) + submodre = re.compile(FORTRAN_SUBMOD_PAT, re.IGNORECASE) module_files = {} + submodule_files = {} for s in target.get_sources(): # FIXME, does not work for Fortran sources generated by # custom_target() and generator() as those are run after @@ -1781,67 +1834,54 @@ continue filename = s.absolute_path(self.environment.get_source_dir(), self.environment.get_build_dir()) - # Some Fortran editors save in weird encodings, - # but all the parts we care about are in ASCII. - with open(filename, errors='ignore') as f: + # Fortran keywords must be ASCII. + with open(filename, encoding='ascii', errors='ignore') as f: for line in f: modmatch = modre.match(line) if modmatch is not None: modname = modmatch.group(1).lower() - if modname == 'procedure': - # MODULE PROCEDURE construct - continue if modname in module_files: raise InvalidArguments( 'Namespace collision: module %s defined in ' 'two files %s and %s.' % (modname, module_files[modname], s)) module_files[modname] = s - self.fortran_deps[target.get_basename()] = module_files + else: + submodmatch = submodre.match(line) + if submodmatch is not None: + # '_' is arbitrarily used to distinguish submod from mod. + parents = submodmatch.group(1).lower().split(':') + submodname = parents[0] + '_' + submodmatch.group(2).lower() + + if submodname in submodule_files: + raise InvalidArguments( + 'Namespace collision: submodule %s defined in ' + 'two files %s and %s.' % + (submodname, submodule_files[submodname], s)) + submodule_files[submodname] = s - def get_fortran_deps(self, compiler, src, target): - mod_files = [] - usere = re.compile(r"\s*use\s+(\w+)", re.IGNORECASE) - dirname = self.get_target_private_dir(target) + self.fortran_deps[target.get_basename()] = {**module_files, **submodule_files} + + def get_fortran_deps(self, compiler: FortranCompiler, src: Path, target) -> List[str]: + """ + Find all module and submodule needed by a Fortran target + """ + + dirname = Path(self.get_target_private_dir(target)) tdeps = self.fortran_deps[target.get_basename()] - with open(src) as f: - for line in f: - usematch = usere.match(line) - if usematch is not None: - usename = usematch.group(1).lower() - if usename not in tdeps: - # The module is not provided by any source file. This - # is due to: - # a) missing file/typo/etc - # b) using a module provided by the compiler, such as - # OpenMP - # There's no easy way to tell which is which (that I - # know of) so just ignore this and go on. Ideally we - # would print a warning message to the user but this is - # a common occurrence, which would lead to lots of - # distracting noise. - continue - mod_source_file = tdeps[usename] - # Check if a source uses a module it exports itself. - # Potential bug if multiple targets have a file with - # the same name. - if mod_source_file.fname == os.path.basename(src): - continue - mod_name = compiler.module_name_to_filename( - usematch.group(1)) - mod_files.append(os.path.join(dirname, mod_name)) + srcdir = Path(self.source_dir) + + mod_files = _scan_fortran_file_deps(src, srcdir, dirname, tdeps, compiler) return mod_files def get_cross_stdlib_args(self, target, compiler): - if not target.is_cross: + if self.environment.machines.matches_build_machine(target.for_machine): return [] - if not self.environment.cross_info.has_stdlib(compiler.language): + if not self.environment.properties.host.has_stdlib(compiler.language): return [] return compiler.get_no_stdinc_args() def get_compile_debugfile_args(self, compiler, target, objfile): - if not isinstance(compiler, VisualStudioCCompiler): - return [] # The way MSVC uses PDB files is documented exactly nowhere so # the following is what we have been able to decipher via # reverse engineering. @@ -1899,7 +1939,7 @@ def get_link_debugfile_args(self, linker, target, outname): return linker.get_link_debugfile_args(outname) - def generate_llvm_ir_compile(self, target, outfile, src): + def generate_llvm_ir_compile(self, target, src): compiler = get_compiler_for_source(target.compilers.values(), src) commands = CompilerArgs(compiler) # Compiler args for compiling this target @@ -1916,7 +1956,7 @@ src_filename = src obj_basename = src_filename.replace('/', '_').replace('\\', '_') rel_obj = os.path.join(self.get_target_private_dir(target), obj_basename) - rel_obj += '.' + self.environment.get_object_suffix() + rel_obj += '.' + self.environment.machines[target.for_machine].get_object_suffix() commands += self.get_compile_debugfile_args(compiler, target, rel_obj) if isinstance(src, File) and src.is_built: rel_src = src.fname @@ -1925,13 +1965,13 @@ else: raise InvalidArguments('Invalid source type: {!r}'.format(src)) # Write the Ninja build command - compiler_name = 'llvm_ir{}_COMPILER'.format('_CROSS' if target.is_cross else '') + compiler_name = self.get_compiler_rule_name('llvm_ir', compiler.for_machine) element = NinjaBuildElement(self.all_outputs, rel_obj, compiler_name, rel_src) # Convert from GCC-style link argument naming to the naming used by the # current compiler. commands = commands.to_native() element.add_item('ARGS', commands) - element.write(outfile) + self.add_build(element) return rel_obj def get_source_dir_include_args(self, target, compiler): @@ -1964,6 +2004,27 @@ return incs @lru_cache(maxsize=None) + def generate_inc_dir(self, compiler, d, basedir, is_system): + # Avoid superfluous '/.' at the end of paths when d is '.' + if d not in ('', '.'): + expdir = os.path.join(basedir, d) + else: + expdir = basedir + srctreedir = os.path.join(self.build_to_src, expdir) + sargs = compiler.get_include_args(srctreedir, is_system) + # There may be include dirs where a build directory has not been + # created for some source dir. For example if someone does this: + # + # inc = include_directories('foo/bar/baz') + # + # But never subdir()s into the actual dir. + if os.path.isdir(os.path.join(self.environment.get_build_dir(), expdir)): + bargs = compiler.get_include_args(expdir, is_system) + else: + bargs = [] + return (sargs, bargs) + + @lru_cache(maxsize=None) def _generate_single_compile(self, target, compiler, is_generated=False): base_proxy = self.get_base_options_for_target(target) # Create an empty commands list, and start adding arguments from @@ -2003,26 +2064,10 @@ # -Ipath will add to begin of array. And without reverse # flags will be added in reversed order. for d in reversed(i.get_incdirs()): - # Avoid superfluous '/.' at the end of paths when d is '.' - if d not in ('', '.'): - expdir = os.path.join(basedir, d) - else: - expdir = basedir - srctreedir = os.path.join(self.build_to_src, expdir) # Add source subdir first so that the build subdir overrides it - sargs = compiler.get_include_args(srctreedir, i.is_system) - commands += sargs - # There may be include dirs where a build directory has not been - # created for some source dir. For example if someone does this: - # - # inc = include_directories('foo/bar/baz') - # - # But never subdir()s into the actual dir. - if os.path.isdir(os.path.join(self.environment.get_build_dir(), expdir)): - bargs = compiler.get_include_args(expdir, i.is_system) - else: - bargs = [] - commands += bargs + (compile_obj, includeargs) = self.generate_inc_dir(compiler, d, basedir, i.is_system) + commands += compile_obj + commands += includeargs for d in i.get_extra_build_dirs(): commands += compiler.get_include_args(d, i.is_system) # Add per-target compile args, f.ex, `c_args : ['-DFOO']`. We set these @@ -2052,10 +2097,13 @@ commands += compiler.get_include_args(self.get_target_private_dir(target), False) return commands - def generate_single_compile(self, target, outfile, src, is_generated=False, header_deps=[], order_deps=[]): + def generate_single_compile(self, target, src, is_generated=False, header_deps=None, order_deps=None): """ Compiles C/C++, ObjC/ObjC++, Fortran, and D sources """ + header_deps = header_deps if header_deps is not None else [] + order_deps = order_deps if order_deps is not None else [] + if isinstance(src, str) and src.endswith('.h'): raise AssertionError('BUG: sources should not contain headers {!r}'.format(src)) @@ -2063,6 +2111,12 @@ commands = self._generate_single_compile(target, compiler, is_generated) commands = CompilerArgs(commands.compiler, commands) + # Create introspection information + if is_generated is False: + self.create_target_source_introspection(target, compiler, commands, [src], []) + else: + self.create_target_source_introspection(target, compiler, commands, [], [src]) + build_dir = self.environment.get_build_dir() if isinstance(src, File): rel_src = src.rel_to_builddir(self.build_to_src) @@ -2099,10 +2153,7 @@ arr.append(i) pch_dep = arr - crstr = '' - if target.is_cross: - crstr = '_CROSS' - compiler_name = '%s%s_COMPILER' % (compiler.get_language(), crstr) + compiler_name = self.compiler_to_rule_name(compiler) extra_deps = [] if compiler.get_language() == 'fortran': # Can't read source file to scan for deps if it's generated later @@ -2110,25 +2161,22 @@ # outdir argument instead. # https://github.com/mesonbuild/meson/issues/1348 if not is_generated: - abs_src = os.path.join(build_dir, rel_src) + abs_src = Path(build_dir) / rel_src extra_deps += self.get_fortran_deps(compiler, abs_src, target) # Dependency hack. Remove once multiple outputs in Ninja is fixed: # https://groups.google.com/forum/#!topic/ninja-build/j-2RfBIOd_8 for modname, srcfile in self.fortran_deps[target.get_basename()].items(): modfile = os.path.join(self.get_target_private_dir(target), compiler.module_name_to_filename(modname)) + if srcfile == src: + crstr = self.get_rule_suffix(target.for_machine) depelem = NinjaBuildElement(self.all_outputs, modfile, 'FORTRAN_DEP_HACK' + crstr, rel_obj) - depelem.write(outfile) + self.add_build(depelem) commands += compiler.get_module_outdir_args(self.get_target_private_dir(target)) element = NinjaBuildElement(self.all_outputs, rel_obj, compiler_name, rel_src) - for d in header_deps: - if isinstance(d, File): - d = d.rel_to_builddir(self.build_to_src) - elif not self.has_dir_part(d): - d = os.path.join(self.get_target_private_dir(target), d) - element.add_dep(d) + self.add_header_deps(target, element, header_deps) for d in extra_deps: element.add_dep(d) for d in order_deps: @@ -2137,7 +2185,7 @@ elif not self.has_dir_part(d): d = os.path.join(self.get_target_private_dir(target), d) element.add_orderdep(d) - element.add_orderdep(pch_dep) + element.add_dep(pch_dep) # Convert from GCC-style link argument naming to the naming used by the # current compiler. commands = commands.to_native() @@ -2145,9 +2193,17 @@ element.add_orderdep(i) element.add_item('DEPFILE', dep_file) element.add_item('ARGS', commands) - element.write(outfile) + self.add_build(element) return rel_obj + def add_header_deps(self, target, ninja_element, header_deps): + for d in header_deps: + if isinstance(d, File): + d = d.rel_to_builddir(self.build_to_src) + elif not self.has_dir_part(d): + d = os.path.join(self.get_target_private_dir(target), d) + ninja_element.add_dep(d) + def has_dir_part(self, fname): # FIXME FIXME: The usage of this is a terrible and unreliable hack if isinstance(fname, File): @@ -2166,34 +2222,43 @@ return [os.path.join(self.get_target_dir(lt), lt.get_filename()) for lt in target.link_targets] def generate_msvc_pch_command(self, target, compiler, pch): - if len(pch) != 2: - raise MesonException('MSVC requires one header and one source to produce precompiled headers.') header = pch[0] - source = pch[1] pchname = compiler.get_pch_name(header) dst = os.path.join(self.get_target_private_dir(target), pchname) commands = [] commands += self.generate_basic_compiler_args(target, compiler) + + if len(pch) == 1: + # Auto generate PCH. + source = self.create_msvc_pch_implementation(target, compiler.get_language(), pch[0]) + pch_header_dir = os.path.dirname(os.path.join(self.build_to_src, target.get_source_subdir(), header)) + commands += compiler.get_include_args(pch_header_dir, False) + else: + source = os.path.join(self.build_to_src, target.get_source_subdir(), pch[1]) + just_name = os.path.basename(header) (objname, pch_args) = compiler.gen_pch_args(just_name, source, dst) commands += pch_args + commands += self._generate_single_compile(target, compiler) commands += self.get_compile_debugfile_args(compiler, target, objname) dep = dst + '.' + compiler.get_depfile_suffix() - return commands, dep, dst, [objname] + return commands, dep, dst, [objname], source def generate_gcc_pch_command(self, target, compiler, pch): commands = self._generate_single_compile(target, compiler) + if pch.split('.')[-1] == 'h' and compiler.language == 'cpp': + # Explicitly compile pch headers as C++. If Clang is invoked in C++ mode, it actually warns if + # this option is not set, and for gcc it also makes sense to use it. + commands += ['-x', 'c++-header'] dst = os.path.join(self.get_target_private_dir(target), os.path.basename(pch) + '.' + compiler.get_pch_suffix()) dep = dst + '.' + compiler.get_depfile_suffix() return commands, dep, dst, [] # Gcc does not create an object file during pch generation. - def generate_pch(self, target, outfile): - cstr = '' + def generate_pch(self, target, header_deps=None): + header_deps = header_deps if header_deps is not None else [] pch_objects = [] - if target.is_cross: - cstr = '_CROSS' for lang in ['c', 'cpp']: pch = target.get_pch(lang) if not pch: @@ -2204,9 +2269,8 @@ ''.format(target.get_basename()) raise InvalidArguments(msg) compiler = target.compilers[lang] - if isinstance(compiler, VisualStudioCCompiler): - src = os.path.join(self.build_to_src, target.get_source_subdir(), pch[-1]) - (commands, dep, dst, objs) = self.generate_msvc_pch_command(target, compiler, pch) + if isinstance(compiler, VisualStudioLikeCompiler): + (commands, dep, dst, objs, src) = self.generate_msvc_pch_command(target, compiler, pch) extradep = os.path.join(self.build_to_src, target.get_source_subdir(), pch[0]) elif compiler.id == 'intel': # Intel generates on target generation @@ -2216,29 +2280,31 @@ (commands, dep, dst, objs) = self.generate_gcc_pch_command(target, compiler, pch[0]) extradep = None pch_objects += objs - rulename = compiler.get_language() + cstr + '_PCH' + rulename = self.compiler_to_pch_rule_name(compiler) elem = NinjaBuildElement(self.all_outputs, dst, rulename, src) if extradep is not None: elem.add_dep(extradep) + self.add_header_deps(target, elem, header_deps) elem.add_item('ARGS', commands) elem.add_item('DEPFILE', dep) - elem.write(outfile) + self.add_build(elem) return pch_objects - def generate_shsym(self, outfile, target): + def generate_shsym(self, target): target_name = target.get_filename() target_file = self.get_target_filename(target) targetdir = self.get_target_private_dir(target) symname = os.path.join(targetdir, target_name + '.symbols') elem = NinjaBuildElement(self.all_outputs, symname, 'SHSYM', target_file) - if self.environment.is_cross_build() and self.environment.cross_info.need_cross_compiler(): - elem.add_item('CROSS', '--cross-host=' + self.environment.cross_info.config['host_machine']['system']) - elem.write(outfile) + if self.environment.is_cross_build(): + elem.add_item('CROSS', '--cross-host=' + self.environment.machines[target.for_machine].system) + self.add_build(elem) def get_cross_stdlib_link_args(self, target, linker): - if isinstance(target, build.StaticLibrary) or not target.is_cross: + if isinstance(target, build.StaticLibrary) or \ + self.environment.machines.matches_build_machine(target.for_machine): return [] - if not self.environment.cross_info.has_stdlib(linker.language): + if not self.environment.properties.host.has_stdlib(linker.language): return [] return linker.get_no_stdlib_link_args() @@ -2247,8 +2313,6 @@ if isinstance(target, build.Executable): # Currently only used with the Swift compiler to add '-emit-executable' commands += linker.get_std_exe_link_args() - # If gui_app is significant on this platform, add the appropriate linker arguments - commands += linker.get_gui_app_args(target.gui_app) # If export_dynamic, add the appropriate linker arguments if target.export_dynamic: commands += linker.gen_export_dynamic_link_args(self.environment) @@ -2266,9 +2330,10 @@ # All shared libraries are PIC commands += linker.get_pic_args() # Add -Wl,-soname arguments on Linux, -install_name on OS X - commands += linker.get_soname_args(target.prefix, target.name, target.suffix, - target.soversion, target.darwin_versions, - isinstance(target, build.SharedModule)) + commands += linker.get_soname_args( + self.environment, target.prefix, target.name, target.suffix, + target.soversion, target.darwin_versions, + isinstance(target, build.SharedModule)) # This is only visited when building for Windows using either GCC or Visual Studio if target.vs_module_defs and hasattr(linker, 'gen_vs_module_defs_args'): commands += linker.gen_vs_module_defs_args(target.vs_module_defs.rel_to_builddir(self.build_to_src)) @@ -2281,19 +2346,27 @@ raise RuntimeError('Unknown build target type.') return commands + def get_target_type_link_args_post_dependencies(self, target, linker): + commands = [] + if isinstance(target, build.Executable): + # If gui_app is significant on this platform, add the appropriate linker arguments. + # Unfortunately this can't be done in get_target_type_link_args, because some misguided + # libraries (such as SDL2) add -mwindows to their link flags. + commands += linker.get_gui_app_args(target.gui_app) + return commands + def get_link_whole_args(self, linker, target): target_args = self.build_target_link_arguments(linker, target.link_whole_targets) return linker.get_link_whole_for(target_args) if len(target_args) else [] - @staticmethod @lru_cache(maxsize=None) - def guess_library_absolute_path(linker, libname, search_dirs, patterns): + def guess_library_absolute_path(self, linker, libname, search_dirs, patterns): for d in search_dirs: for p in patterns: trial = CCompiler._get_trials_from_pattern(p, d, libname) if not trial: continue - trial = CCompiler._get_file_from_list(trial) + trial = CCompiler._get_file_from_list(self.environment, trial) if not trial: continue # Return the first result @@ -2312,7 +2385,7 @@ build_dir = self.environment.get_build_dir() # the following loop sometimes consumes two items from command in one pass - it = iter(commands) + it = iter(linker.native_args_to_unix(commands)) for item in it: if item in internal and not item.startswith('-'): continue @@ -2345,9 +2418,9 @@ guessed_dependencies = [] # TODO The get_library_naming requirement currently excludes link targets that use d or fortran as their main linker if hasattr(linker, 'get_library_naming'): - search_dirs = tuple(search_dirs) + linker.get_library_dirs(self.environment) - static_patterns = linker.get_library_naming(self.environment, 'static', strict=True) - shared_patterns = linker.get_library_naming(self.environment, 'shared', strict=True) + search_dirs = tuple(search_dirs) + tuple(linker.get_library_dirs(self.environment)) + static_patterns = linker.get_library_naming(self.environment, LibType.STATIC, strict=True) + shared_patterns = linker.get_library_naming(self.environment, LibType.SHARED, strict=True) for libname in libs: # be conservative and record most likely shared and static resolution, because we don't know exactly # which one the linker will prefer @@ -2356,23 +2429,23 @@ sharedlibs = self.guess_library_absolute_path(linker, libname, search_dirs, shared_patterns) if staticlibs: - guessed_dependencies.append(os.path.realpath(staticlibs)) + guessed_dependencies.append(staticlibs.resolve().as_posix()) if sharedlibs: - guessed_dependencies.append(os.path.realpath(sharedlibs)) + guessed_dependencies.append(sharedlibs.resolve().as_posix()) return guessed_dependencies + absolute_libs - def generate_link(self, target, outfile, outname, obj_list, linker, extra_args=[], stdlib_args=[]): + def generate_link(self, target, outname, obj_list, linker, extra_args=None, stdlib_args=None): + extra_args = extra_args if extra_args is not None else [] + stdlib_args = stdlib_args if stdlib_args is not None else [] if isinstance(target, build.StaticLibrary): linker_base = 'STATIC' else: linker_base = linker.get_language() # Fixme. if isinstance(target, build.SharedLibrary): - self.generate_shsym(outfile, target) - crstr = '' - if target.is_cross: - crstr = '_CROSS' - linker_rule = linker_base + crstr + '_LINKER' + self.generate_shsym(target) + crstr = self.get_rule_suffix(target.for_machine) + linker_rule = linker_base + '_LINKER' + crstr # Create an empty commands list, and start adding link arguments from # various sources in the order in which they must override each other # starting from hard-coded defaults followed by build options and so on. @@ -2385,7 +2458,9 @@ # Add linker args for linking this target derived from 'base' build # options passed on the command-line, in default_options, etc. # These have the lowest priority. - if not isinstance(target, build.StaticLibrary): + if isinstance(target, build.StaticLibrary): + commands += linker.get_base_link_args(self.get_base_options_for_target(target)) + else: commands += compilers.get_base_link_args(self.get_base_options_for_target(target), linker, isinstance(target, build.SharedModule)) @@ -2408,14 +2483,13 @@ if not isinstance(target, build.StaticLibrary): # Add link args added using add_project_link_arguments() - commands += self.build.get_project_link_args(linker, target.subproject, target.is_cross) + commands += self.build.get_project_link_args(linker, target.subproject, target.for_machine) # Add link args added using add_global_link_arguments() # These override per-project link arguments - commands += self.build.get_global_link_args(linker, target.is_cross) - if not target.is_cross: - # Link args added from the env: LDFLAGS. We want these to - # override all the defaults but not the per-target link args. - commands += self.environment.coredata.get_external_link_args(linker.get_language()) + commands += self.build.get_global_link_args(linker, target.for_machine) + # Link args added from the env: LDFLAGS. We want these to override + # all the defaults but not the per-target link args. + commands += self.environment.coredata.get_external_link_args(target.for_machine, linker.get_language()) # Now we will add libraries and library paths from various sources @@ -2434,34 +2508,27 @@ if not isinstance(target, build.StaticLibrary): # For 'automagic' deps: Boost and GTest. Also dependency('threads'). # pkg-config puts the thread flags itself via `Cflags:` - need_threads = False - need_openmp = False - commands += target.link_args + commands += linker.get_target_link_args(target) # External deps must be last because target link libraries may depend on them. for dep in target.get_external_deps(): # Extend without reordering or de-dup to preserve `-L -l` sets # https://github.com/mesonbuild/meson/issues/1718 - commands.extend_preserving_lflags(dep.get_link_args()) - need_threads |= dep.need_threads() - need_openmp |= dep.need_openmp() + commands.extend_preserving_lflags(linker.get_dependency_link_args(dep)) for d in target.get_dependencies(): if isinstance(d, build.StaticLibrary): for dep in d.get_external_deps(): - need_threads |= dep.need_threads() - need_openmp |= dep.need_openmp() - commands.extend_preserving_lflags(dep.get_link_args()) - if need_openmp: - commands += linker.openmp_flags() - if need_threads: - commands += linker.thread_link_flags(self.environment) + commands.extend_preserving_lflags(linker.get_dependency_link_args(dep)) + + # Add link args specific to this BuildTarget type that must not be overridden by dependencies + commands += self.get_target_type_link_args_post_dependencies(target, linker) # Add link args for c_* or cpp_* build options. Currently this only # adds c_winlibs and cpp_winlibs when building for Windows. This needs # to be after all internal and external libraries so that unresolved # symbols from those can be found here. This is needed when the # *_winlibs that we want to link to are static mingw64 libraries. - commands += linker.get_option_link_args(self.environment.coredata.compiler_options) + commands += linker.get_option_link_args(self.environment.coredata.compiler_options[target.for_machine]) dep_targets = [] dep_targets.extend(self.guess_external_link_dependencies(linker, target, commands, internal)) @@ -2477,7 +2544,8 @@ self.get_target_dir(target)) else: target_slashname_workaround_dir = self.get_target_dir(target) - commands += linker.build_rpath_args(self.environment.get_build_dir(), + commands += linker.build_rpath_args(self.environment, + self.environment.get_build_dir(), target_slashname_workaround_dir, self.determine_rpath_dirs(target), target.build_rpath, @@ -2524,38 +2592,38 @@ except OSError: mlog.debug("Library versioning disabled because we do not have symlink creation privileges.") - def generate_custom_target_clean(self, outfile, trees): + def generate_custom_target_clean(self, trees): e = NinjaBuildElement(self.all_outputs, 'meson-clean-ctlist', 'CUSTOM_COMMAND', 'PHONY') d = CleanTrees(self.environment.get_build_dir(), trees) d_file = os.path.join(self.environment.get_scratch_dir(), 'cleantrees.dat') e.add_item('COMMAND', self.environment.get_build_command() + ['--internal', 'cleantrees', d_file]) e.add_item('description', 'Cleaning custom target directories.') - e.write(outfile) + self.add_build(e) # Alias that runs the target defined above - self.create_target_alias('meson-clean-ctlist', outfile) + self.create_target_alias('meson-clean-ctlist') # Write out the data file passed to the script with open(d_file, 'wb') as ofile: pickle.dump(d, ofile) return 'clean-ctlist' - def generate_gcov_clean(self, outfile): + def generate_gcov_clean(self): gcno_elem = NinjaBuildElement(self.all_outputs, 'meson-clean-gcno', 'CUSTOM_COMMAND', 'PHONY') script_root = self.environment.get_script_dir() clean_script = os.path.join(script_root, 'delwithsuffix.py') gcno_elem.add_item('COMMAND', mesonlib.python_command + [clean_script, '.', 'gcno']) gcno_elem.add_item('description', 'Deleting gcno files.') - gcno_elem.write(outfile) + self.add_build(gcno_elem) # Alias that runs the target defined above - self.create_target_alias('meson-clean-gcno', outfile) + self.create_target_alias('meson-clean-gcno') gcda_elem = NinjaBuildElement(self.all_outputs, 'meson-clean-gcda', 'CUSTOM_COMMAND', 'PHONY') script_root = self.environment.get_script_dir() clean_script = os.path.join(script_root, 'delwithsuffix.py') gcda_elem.add_item('COMMAND', mesonlib.python_command + [clean_script, '.', 'gcda']) gcda_elem.add_item('description', 'Deleting gcda files.') - gcda_elem.write(outfile) + self.add_build(gcda_elem) # Alias that runs the target defined above - self.create_target_alias('meson-clean-gcda', outfile) + self.create_target_alias('meson-clean-gcda') def get_user_option_args(self): cmds = [] @@ -2566,39 +2634,68 @@ # affect behavior in any other way. return sorted(cmds) - def generate_dist(self, outfile): + def generate_dist(self): elem = NinjaBuildElement(self.all_outputs, 'meson-dist', 'CUSTOM_COMMAND', 'PHONY') elem.add_item('DESC', 'Creating source packages') - elem.add_item('COMMAND', self.environment.get_build_command() + [ - '--internal', 'dist', - self.environment.source_dir, - self.environment.build_dir, - ] + self.environment.get_build_command()) + elem.add_item('COMMAND', self.environment.get_build_command() + ['dist']) elem.add_item('pool', 'console') - elem.write(outfile) + self.add_build(elem) # Alias that runs the target defined above - self.create_target_alias('meson-dist', outfile) + self.create_target_alias('meson-dist') - # For things like scan-build and other helper tools we might have. - def generate_utils(self, outfile): + def generate_scanbuild(self): + if not environment.detect_scanbuild(): + return cmd = self.environment.get_build_command() + \ ['--internal', 'scanbuild', self.environment.source_dir, self.environment.build_dir] + \ self.environment.get_build_command() + self.get_user_option_args() elem = NinjaBuildElement(self.all_outputs, 'meson-scan-build', 'CUSTOM_COMMAND', 'PHONY') elem.add_item('COMMAND', cmd) elem.add_item('pool', 'console') - elem.write(outfile) + self.add_build(elem) # Alias that runs the target defined above - self.create_target_alias('meson-scan-build', outfile) + self.create_target_alias('meson-scan-build') + + def generate_clangtool(self, name): + target_name = 'clang-' + name + if not os.path.exists(os.path.join(self.environment.source_dir, '.clang-' + name)) and \ + not os.path.exists(os.path.join(self.environment.source_dir, '_clang-' + name)): + return + if target_name in self.all_outputs: + return + cmd = self.environment.get_build_command() + \ + ['--internal', 'clang' + name, self.environment.source_dir, self.environment.build_dir] + elem = NinjaBuildElement(self.all_outputs, 'meson-' + target_name, 'CUSTOM_COMMAND', 'PHONY') + elem.add_item('COMMAND', cmd) + elem.add_item('pool', 'console') + self.add_build(elem) + self.create_target_alias('meson-' + target_name) + + def generate_clangformat(self): + if not environment.detect_clangformat(): + return + self.generate_clangtool('format') + + def generate_clangtidy(self): + import shutil + if not shutil.which('clang-tidy'): + return + self.generate_clangtool('tidy') + + # For things like scan-build and other helper tools we might have. + def generate_utils(self): + self.generate_scanbuild() + self.generate_clangformat() + self.generate_clangtidy() cmd = self.environment.get_build_command() + ['--internal', 'uninstall'] elem = NinjaBuildElement(self.all_outputs, 'meson-uninstall', 'CUSTOM_COMMAND', 'PHONY') elem.add_item('COMMAND', cmd) elem.add_item('pool', 'console') - elem.write(outfile) + self.add_build(elem) # Alias that runs the target defined above - self.create_target_alias('meson-uninstall', outfile) + self.create_target_alias('meson-uninstall') - def generate_ending(self, outfile): + def generate_ending(self): targetlist = [] for t in self.get_build_by_default_targets().values(): # Add the first output of each target to the 'all' target so that @@ -2606,16 +2703,13 @@ targetlist.append(os.path.join(self.get_target_dir(t), t.get_outputs()[0])) elem = NinjaBuildElement(self.all_outputs, 'all', 'phony', targetlist) - elem.write(outfile) - - default = 'default all\n\n' - outfile.write(default) + self.add_build(elem) elem = NinjaBuildElement(self.all_outputs, 'meson-clean', 'CUSTOM_COMMAND', 'PHONY') elem.add_item('COMMAND', [self.ninja_command, '-t', 'clean']) elem.add_item('description', 'Cleaning.') # Alias that runs the above-defined meson-clean target - self.create_target_alias('meson-clean', outfile) + self.create_target_alias('meson-clean') # If we have custom targets in this project, add all their outputs to # the list that is passed to the `cleantrees.py` script. The script @@ -2630,29 +2724,122 @@ for o in t.get_outputs(): ctlist.append(os.path.join(self.get_target_dir(t), o)) if ctlist: - elem.add_dep(self.generate_custom_target_clean(outfile, ctlist)) + elem.add_dep(self.generate_custom_target_clean(ctlist)) if 'b_coverage' in self.environment.coredata.base_options and \ self.environment.coredata.base_options['b_coverage'].value: - self.generate_gcov_clean(outfile) + self.generate_gcov_clean() elem.add_dep('clean-gcda') elem.add_dep('clean-gcno') - elem.write(outfile) + self.add_build(elem) deps = self.get_regen_filelist() elem = NinjaBuildElement(self.all_outputs, 'build.ninja', 'REGENERATE_BUILD', deps) elem.add_item('pool', 'console') - elem.write(outfile) + self.add_build(elem) elem = NinjaBuildElement(self.all_outputs, 'reconfigure', 'REGENERATE_BUILD', 'PHONY') elem.add_item('pool', 'console') - elem.write(outfile) + self.add_build(elem) elem = NinjaBuildElement(self.all_outputs, deps, 'phony', '') - elem.write(outfile) + self.add_build(elem) + + def get_introspection_data(self, target_id, target): + if target_id not in self.introspection_data or len(self.introspection_data[target_id]) == 0: + return super().get_introspection_data(target_id, target) + + result = [] + for i in self.introspection_data[target_id].values(): + result += [i] + return result def load(build_dir): filename = os.path.join(build_dir, 'meson-private', 'install.dat') with open(filename, 'rb') as f: obj = pickle.load(f) return obj + + +def _scan_fortran_file_deps(src: Path, srcdir: Path, dirname: Path, tdeps, compiler) -> List[str]: + """ + scan a Fortran file for dependencies. Needs to be distinct from target + to allow for recursion induced by `include` statements.er + + It makes a number of assumptions, including + + * `use`, `module`, `submodule` name is not on a continuation line + + Regex + ----- + + * `incre` works for `#include "foo.f90"` and `include "foo.f90"` + * `usere` works for legacy and Fortran 2003 `use` statements + * `submodre` is for Fortran >= 2008 `submodule` + """ + + incre = re.compile(FORTRAN_INCLUDE_PAT, re.IGNORECASE) + usere = re.compile(FORTRAN_USE_PAT, re.IGNORECASE) + submodre = re.compile(FORTRAN_SUBMOD_PAT, re.IGNORECASE) + + mod_files = [] + src = Path(src) + with src.open(encoding='ascii', errors='ignore') as f: + for line in f: + # included files + incmatch = incre.match(line) + if incmatch is not None: + incfile = srcdir / incmatch.group(1) + if incfile.suffix.lower()[1:] in compiler.file_suffixes: + mod_files.extend(_scan_fortran_file_deps(incfile, srcdir, dirname, tdeps, compiler)) + # modules + usematch = usere.match(line) + if usematch is not None: + usename = usematch.group(1).lower() + if usename == 'intrinsic': # this keeps the regex simpler + continue + if usename not in tdeps: + # The module is not provided by any source file. This + # is due to: + # a) missing file/typo/etc + # b) using a module provided by the compiler, such as + # OpenMP + # There's no easy way to tell which is which (that I + # know of) so just ignore this and go on. Ideally we + # would print a warning message to the user but this is + # a common occurrence, which would lead to lots of + # distracting noise. + continue + srcfile = srcdir / tdeps[usename].fname # type: Path + if not srcfile.is_file(): + if srcfile.name != src.name: # generated source file + pass + else: # subproject + continue + elif srcfile.samefile(src): # self-reference + continue + + mod_name = compiler.module_name_to_filename(usename) + mod_files.append(str(dirname / mod_name)) + else: # submodules + submodmatch = submodre.match(line) + if submodmatch is not None: + parents = submodmatch.group(1).lower().split(':') + assert len(parents) in (1, 2), ( + 'submodule ancestry must be specified as' + ' ancestor:parent but Meson found {}'.format(parents)) + + ancestor_child = '_'.join(parents) + if ancestor_child not in tdeps: + raise MesonException("submodule {} relies on ancestor module {} that was not found.".format(submodmatch.group(2).lower(), ancestor_child.split('_')[0])) + submodsrcfile = srcdir / tdeps[ancestor_child].fname # type: Path + if not submodsrcfile.is_file(): + if submodsrcfile.name != src.name: # generated source file + pass + else: # subproject + continue + elif submodsrcfile.samefile(src): # self-reference + continue + mod_name = compiler.module_name_to_filename(ancestor_child) + mod_files.append(str(dirname / mod_name)) + return mod_files diff -Nru meson-0.49.0/mesonbuild/backend/vs2010backend.py meson-0.52.1/mesonbuild/backend/vs2010backend.py --- meson-0.49.0/mesonbuild/backend/vs2010backend.py 2018-12-09 14:27:23.000000000 +0000 +++ meson-0.52.1/mesonbuild/backend/vs2010backend.py 2019-08-28 17:15:39.000000000 +0000 @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +import copy import os import pickle import xml.dom.minidom @@ -25,7 +26,9 @@ from .. import mlog from .. import compilers from ..compilers import CompilerArgs -from ..mesonlib import MesonException, File, python_command, replace_if_different +from ..mesonlib import ( + MesonException, File, python_command, replace_if_different +) from ..environment import Environment, build_filename def autodetect_vs_version(build): @@ -43,6 +46,10 @@ 'Visual Studio\\2017' in vs_install_dir: from mesonbuild.backend.vs2017backend import Vs2017Backend return Vs2017Backend(build) + if vs_version == '16.0' or 'Visual Studio 19' in vs_install_dir or \ + 'Visual Studio\\2019' in vs_install_dir: + from mesonbuild.backend.vs2019backend import Vs2019Backend + return Vs2019Backend(build) if 'Visual Studio 10.0' in vs_install_dir: return Vs2010Backend(build) raise MesonException('Could not detect Visual Studio using VisualStudioVersion: {!r} or VSINSTALLDIR: {!r}!\n' @@ -87,6 +94,7 @@ self.vs_version = '2010' self.windows_target_platform_version = None self.subdirs = {} + self.handled_target_deps = {} def generate_custom_generator_commands(self, target, parent_node): generator_output_files = [] @@ -118,6 +126,7 @@ sole_output = '' curfile = infilelist[i] infilename = os.path.join(down, curfile.rel_to_builddir(self.build_to_src)) + deps = self.get_custom_target_depend_files(genlist, True) base_args = generator.get_arglist(infilename) outfiles_rel = genlist.get_outputs_for(curfile) outfiles = [os.path.join(target_private_dir, of) for of in outfiles_rel] @@ -134,20 +143,24 @@ for x in args] args = [x.replace('\\', '/') for x in args] cmd = exe_arr + self.replace_extra_args(args, genlist) - if generator.capture: - exe_data = self.serialize_executable( - 'generator ' + cmd[0], - cmd[0], - cmd[1:], - self.environment.get_build_dir(), - capture=outfiles[0] - ) - cmd = self.environment.get_build_command() + ['--internal', 'exe', exe_data] - abs_pdir = os.path.join(self.environment.get_build_dir(), self.get_target_dir(target)) - os.makedirs(abs_pdir, exist_ok=True) + # Always use a wrapper because MSBuild eats random characters when + # there are many arguments. + tdir_abs = os.path.join(self.environment.get_build_dir(), self.get_target_dir(target)) + cmd = self.as_meson_exe_cmdline( + 'generator ' + cmd[0], + cmd[0], + cmd[1:], + workdir=tdir_abs, + capture=outfiles[0] if generator.capture else None, + force_serialize=True + ) + deps = cmd[-1:] + deps + abs_pdir = os.path.join(self.environment.get_build_dir(), self.get_target_dir(target)) + os.makedirs(abs_pdir, exist_ok=True) cbs = ET.SubElement(idgroup, 'CustomBuild', Include=infilename) ET.SubElement(cbs, 'Command').text = ' '.join(self.quote_arguments(cmd)) ET.SubElement(cbs, 'Outputs').text = ';'.join(outfiles) + ET.SubElement(cbs, 'AdditionalInputs').text = ';'.join(deps) return generator_output_files, custom_target_output_files, custom_target_include_dirs def generate(self, interp): @@ -199,7 +212,7 @@ if 'VCINSTALLDIR' in os.environ: vs_version = os.environ['VisualStudioVersion'] \ if 'VisualStudioVersion' in os.environ else None - relative_path = 'Auxiliary\\Build\\' if vs_version == '15.0' else '' + relative_path = 'Auxiliary\\Build\\' if vs_version >= '15.0' else '' script_path = os.environ['VCINSTALLDIR'] + relative_path + 'vcvarsall.bat' if os.path.exists(script_path): if has_arch_values: @@ -238,9 +251,15 @@ all_deps[d.get_id()] = d elif isinstance(target, build.BuildTarget): for ldep in target.link_targets: - all_deps[ldep.get_id()] = ldep + if isinstance(ldep, build.CustomTargetIndex): + all_deps[ldep.get_id()] = ldep.target + else: + all_deps[ldep.get_id()] = ldep for ldep in target.link_whole_targets: - all_deps[ldep.get_id()] = ldep + if isinstance(ldep, build.CustomTargetIndex): + all_deps[ldep.get_id()] = ldep.target + else: + all_deps[ldep.get_id()] = ldep for obj_id, objdep in self.get_obj_target_deps(target.objects): all_deps[obj_id] = objdep for gendep in target.get_generated_sources(): @@ -295,7 +314,7 @@ target = self.build.targets[prj[0]] lang = 'default' if hasattr(target, 'compilers') and target.compilers: - for (lang_out, _) in target.compilers.items(): + for lang_out in target.compilers.keys(): lang = lang_out break prj_line = prj_templ % ( @@ -303,19 +322,9 @@ prj[0], prj[1], prj[2]) ofile.write(prj_line) target_dict = {target.get_id(): target} - # Get direct deps - all_deps = self.get_target_deps(target_dict) # Get recursive deps recursive_deps = self.get_target_deps( target_dict, recursive=True) - ofile.write('\tProjectSection(ProjectDependencies) = ' - 'postProject\n') - regen_guid = self.environment.coredata.regen_guid - ofile.write('\t\t{%s} = {%s}\n' % (regen_guid, regen_guid)) - for dep in all_deps.keys(): - guid = self.environment.coredata.target_guids[dep] - ofile.write('\t\t{%s} = {%s}\n' % (guid, guid)) - ofile.write('\tEndProjectSection\n') ofile.write('EndProject\n') for dep, target in recursive_deps.items(): if prj[0] in default_projlist: @@ -379,7 +388,7 @@ for p in projlist: if p[1].parent != PurePath('.'): ofile.write("\t\t{%s} = {%s}\n" % (p[2], self.subdirs[p[1].parent][0])) - for (_, subdir) in self.subdirs.items(): + for subdir in self.subdirs.values(): if subdir[1]: ofile.write("\t\t{%s} = {%s}\n" % (subdir[0], subdir[1])) ofile.write('\tEndGlobalSection\n') @@ -444,10 +453,26 @@ def quote_arguments(self, arr): return ['"%s"' % i for i in arr] - def add_project_reference(self, root, include, projid): + def add_project_reference(self, root, include, projid, link_outputs=False): ig = ET.SubElement(root, 'ItemGroup') pref = ET.SubElement(ig, 'ProjectReference', Include=include) ET.SubElement(pref, 'Project').text = '{%s}' % projid + if not link_outputs: + # Do not link in generated .lib files from dependencies automatically. + # We only use the dependencies for ordering and link in the generated + # objects and .lib files manually. + ET.SubElement(pref, 'LinkLibraryDependencies').text = 'false' + + def add_target_deps(self, root, target): + target_dict = {target.get_id(): target} + for dep in self.get_target_deps(target_dict).values(): + if dep.get_id() in self.handled_target_deps[target.get_id()]: + # This dependency was already handled manually. + continue + relpath = self.get_target_dir_relative_to(dep, target) + vcxproj = os.path.join(relpath, dep.get_id() + '.vcxproj') + tid = self.environment.coredata.target_guids[dep.get_id()] + self.add_project_reference(root, vcxproj, tid) def create_basic_crap(self, target, guid): project_name = target.name @@ -472,14 +497,14 @@ pname.text = project_name if self.windows_target_platform_version: ET.SubElement(globalgroup, 'WindowsTargetPlatformVersion').text = self.windows_target_platform_version - ET.SubElement(root, 'Import', Project='$(VCTargetsPath)\Microsoft.Cpp.Default.props') + ET.SubElement(root, 'Import', Project=r'$(VCTargetsPath)\Microsoft.Cpp.Default.props') type_config = ET.SubElement(root, 'PropertyGroup', Label='Configuration') ET.SubElement(type_config, 'ConfigurationType') ET.SubElement(type_config, 'CharacterSet').text = 'MultiByte' ET.SubElement(type_config, 'UseOfMfc').text = 'false' if self.platform_toolset: ET.SubElement(type_config, 'PlatformToolset').text = self.platform_toolset - ET.SubElement(root, 'Import', Project='$(VCTargetsPath)\Microsoft.Cpp.props') + ET.SubElement(root, 'Import', Project=r'$(VCTargetsPath)\Microsoft.Cpp.props') direlem = ET.SubElement(root, 'PropertyGroup') fver = ET.SubElement(direlem, '_ProjectFileVersion') fver.text = self.project_file_version @@ -493,13 +518,16 @@ def gen_run_target_vcxproj(self, target, ofname, guid): root = self.create_basic_crap(target, guid) - action = ET.SubElement(root, 'ItemDefinitionGroup') - customstep = ET.SubElement(action, 'PostBuildEvent') - cmd_raw = [target.command] + target.args + if not target.command: + # FIXME: This is an alias target that doesn't run any command, there + # is probably a better way than running a this dummy command. + cmd_raw = python_command + ['-c', 'exit'] + else: + cmd_raw = [target.command] + target.args cmd = python_command + \ [os.path.join(self.environment.get_script_dir(), 'commandrunner.py'), - self.environment.get_build_dir(), self.environment.get_source_dir(), + self.environment.get_build_dir(), self.get_target_dir(target)] + self.environment.get_build_command() for i in cmd_raw: if isinstance(i, build.BuildTarget): @@ -509,18 +537,20 @@ elif isinstance(i, File): relfname = i.rel_to_builddir(self.build_to_src) cmd.append(os.path.join(self.environment.get_build_dir(), relfname)) + elif isinstance(i, str): + # Escape embedded quotes, because we quote the entire argument below. + cmd.append(i.replace('"', '\\"')) else: cmd.append(i) cmd_templ = '''"%s" ''' * len(cmd) - ET.SubElement(customstep, 'Command').text = cmd_templ % tuple(cmd) - ET.SubElement(customstep, 'Message').text = 'Running custom command.' - ET.SubElement(root, 'Import', Project='$(VCTargetsPath)\Microsoft.Cpp.targets') + self.add_custom_build(root, 'run_target', cmd_templ % tuple(cmd)) + ET.SubElement(root, 'Import', Project=r'$(VCTargetsPath)\Microsoft.Cpp.targets') + self.add_regen_dependency(root) + self.add_target_deps(root, target) self._prettyprint_vcxproj_xml(ET.ElementTree(root), ofname) def gen_custom_target_vcxproj(self, target, ofname, guid): root = self.create_basic_crap(target, guid) - action = ET.SubElement(root, 'ItemDefinitionGroup') - customstep = ET.SubElement(action, 'CustomBuildStep') # We need to always use absolute paths because our invocation is always # from the target dir, not the build root. target.absolute_paths = True @@ -530,18 +560,22 @@ # there are many arguments. tdir_abs = os.path.join(self.environment.get_build_dir(), self.get_target_dir(target)) extra_bdeps = target.get_transitive_build_target_deps() - extra_paths = self.determine_windows_extra_paths(target.command[0], extra_bdeps) - exe_data = self.serialize_executable(target.name, target.command[0], cmd[1:], - # All targets run from the target dir - tdir_abs, - extra_paths=extra_paths, - capture=ofilenames[0] if target.capture else None) - wrapper_cmd = self.environment.get_build_command() + ['--internal', 'exe', exe_data] - ET.SubElement(customstep, 'Command').text = ' '.join(self.quote_arguments(wrapper_cmd)) - ET.SubElement(customstep, 'Outputs').text = ';'.join(ofilenames) - ET.SubElement(customstep, 'Inputs').text = ';'.join([exe_data] + srcs + depend_files) - ET.SubElement(root, 'Import', Project='$(VCTargetsPath)\Microsoft.Cpp.targets') + wrapper_cmd = self.as_meson_exe_cmdline(target.name, target.command[0], cmd[1:], + # All targets run from the target dir + workdir=tdir_abs, + extra_bdeps=extra_bdeps, + capture=ofilenames[0] if target.capture else None, + force_serialize=True) + if target.build_always_stale: + # Use a nonexistent file to always consider the target out-of-date. + ofilenames += [self.nonexistent_file(os.path.join(self.environment.get_scratch_dir(), + 'outofdate.file'))] + self.add_custom_build(root, 'custom_target', ' '.join(self.quote_arguments(wrapper_cmd)), + deps=wrapper_cmd[-1:] + srcs + depend_files, outputs=ofilenames) + ET.SubElement(root, 'Import', Project=r'$(VCTargetsPath)\Microsoft.Cpp.targets') self.generate_custom_generator_commands(target, root) + self.add_regen_dependency(root) + self.add_target_deps(root, target) self._prettyprint_vcxproj_xml(ET.ElementTree(root), ofname) @classmethod @@ -553,18 +587,37 @@ return 'cpp' raise MesonException('Could not guess language from source file %s.' % src) - def add_pch(self, inc_cl, proj_to_src_dir, pch_sources, source_file): + def add_pch(self, pch_sources, lang, inc_cl): if len(pch_sources) <= 1: # We only need per file precompiled headers if we have more than 1 language. return - lang = Vs2010Backend.lang_from_source_file(source_file) - header = os.path.join(proj_to_src_dir, pch_sources[lang][0]) - pch_file = ET.SubElement(inc_cl, 'PrecompiledHeaderFile') - pch_file.text = header + self.use_pch(pch_sources, lang, inc_cl) + + def create_pch(self, pch_sources, lang, inc_cl): + pch = ET.SubElement(inc_cl, 'PrecompiledHeader') + pch.text = 'Create' + self.add_pch_files(pch_sources, lang, inc_cl) + + def use_pch(self, pch_sources, lang, inc_cl): + header = self.add_pch_files(pch_sources, lang, inc_cl) pch_include = ET.SubElement(inc_cl, 'ForcedIncludeFiles') pch_include.text = header + ';%(ForcedIncludeFiles)' + + def add_pch_files(self, pch_sources, lang, inc_cl): + header = os.path.basename(pch_sources[lang][0]) + pch_file = ET.SubElement(inc_cl, 'PrecompiledHeaderFile') + # When USING PCHs, MSVC will not do the regular include + # directory lookup, but simply use a string match to find the + # PCH to use. That means the #include directive must match the + # pch_file.text used during PCH CREATION verbatim. + # When CREATING a PCH, MSVC will do the include directory + # lookup to find the actual PCH header to use. Thus, the PCH + # header must either be in the include_directories of the target + # or be in the same directory as the PCH implementation. + pch_file.text = header pch_out = ET.SubElement(inc_cl, 'PrecompiledHeaderOutputFile') pch_out.text = '$(IntDir)$(TargetName)-%s.pch' % lang + return header def is_argument_with_msbuild_xml_entry(self, entry): # Remove arguments that have a top level XML entry so @@ -673,7 +726,7 @@ # No source files, only objects, but we still need a compiler, so # return a found compiler if len(target.objects) > 0: - for lang, c in self.environment.coredata.compilers.items(): + for lang, c in self.environment.coredata.compilers[target.for_machine].items(): if lang in ('c', 'cpp'): return c raise MesonException('Could not find a C or C++ compiler. MSVC can only build C/C++ projects.') @@ -692,6 +745,7 @@ mlog.debug('Generating vcxproj %s.' % target.name) entrypoint = 'WinMainCRTStartup' subsystem = 'Windows' + self.handled_target_deps[target.get_id()] = [] if isinstance(target, build.Executable): conftype = 'Application' if not target.gui_app: @@ -747,7 +801,7 @@ pname.text = project_name if self.windows_target_platform_version: ET.SubElement(globalgroup, 'WindowsTargetPlatformVersion').text = self.windows_target_platform_version - ET.SubElement(root, 'Import', Project='$(VCTargetsPath)\Microsoft.Cpp.Default.props') + ET.SubElement(root, 'Import', Project=r'$(VCTargetsPath)\Microsoft.Cpp.Default.props') # Start configuration type_config = ET.SubElement(root, 'PropertyGroup', Label='Configuration') ET.SubElement(type_config, 'ConfigurationType').text = conftype @@ -758,44 +812,35 @@ ET.SubElement(type_config, 'WholeProgramOptimization').text = 'false' # Let VS auto-set the RTC level ET.SubElement(type_config, 'BasicRuntimeChecks').text = 'Default' - o_flags = split_o_flags_args(buildtype_args) - if '/Oi' in o_flags: - ET.SubElement(type_config, 'IntrinsicFunctions').text = 'true' - if '/Ob1' in o_flags: - ET.SubElement(type_config, 'InlineFunctionExpansion').text = 'OnlyExplicitInline' - elif '/Ob2' in o_flags: - ET.SubElement(type_config, 'InlineFunctionExpansion').text = 'AnySuitable' - # In modern MSVC parlance "/O1" means size optimization. - # "/Os" has been deprecated. - if '/O1' in o_flags: - ET.SubElement(type_config, 'FavorSizeOrSpeed').text = 'Size' - else: - ET.SubElement(type_config, 'FavorSizeOrSpeed').text = 'Speed' # Incremental linking increases code size if '/INCREMENTAL:NO' in buildtype_link_args: ET.SubElement(type_config, 'LinkIncremental').text = 'false' + + # Build information + compiles = ET.SubElement(root, 'ItemDefinitionGroup') + clconf = ET.SubElement(compiles, 'ClCompile') # CRT type; debug or release if vscrt_type.value == 'from_buildtype': if self.buildtype == 'debug' or self.buildtype == 'debugoptimized': ET.SubElement(type_config, 'UseDebugLibraries').text = 'true' - ET.SubElement(type_config, 'RuntimeLibrary').text = 'MultiThreadedDebugDLL' + ET.SubElement(clconf, 'RuntimeLibrary').text = 'MultiThreadedDebugDLL' else: ET.SubElement(type_config, 'UseDebugLibraries').text = 'false' - ET.SubElement(type_config, 'RuntimeLibrary').text = 'MultiThreaded' + ET.SubElement(clconf, 'RuntimeLibrary').text = 'MultiThreaded' elif vscrt_type.value == 'mdd': ET.SubElement(type_config, 'UseDebugLibraries').text = 'true' - ET.SubElement(type_config, 'RuntimeLibrary').text = 'MultiThreadedDebugDLL' + ET.SubElement(clconf, 'RuntimeLibrary').text = 'MultiThreadedDebugDLL' elif vscrt_type.value == 'mt': # FIXME, wrong ET.SubElement(type_config, 'UseDebugLibraries').text = 'false' - ET.SubElement(type_config, 'RuntimeLibrary').text = 'MultiThreaded' + ET.SubElement(clconf, 'RuntimeLibrary').text = 'MultiThreaded' elif vscrt_type.value == 'mtd': # FIXME, wrong ET.SubElement(type_config, 'UseDebugLibraries').text = 'true' - ET.SubElement(type_config, 'RuntimeLibrary').text = 'MultiThreadedDebug' + ET.SubElement(clconf, 'RuntimeLibrary').text = 'MultiThreadedDebug' else: ET.SubElement(type_config, 'UseDebugLibraries').text = 'false' - ET.SubElement(type_config, 'RuntimeLibrary').text = 'MultiThreadedDLL' + ET.SubElement(clconf, 'RuntimeLibrary').text = 'MultiThreadedDLL' # Debug format if '/ZI' in buildtype_args: ET.SubElement(type_config, 'DebugInformationFormat').text = 'EditAndContinue' @@ -810,17 +855,8 @@ ET.SubElement(type_config, 'BasicRuntimeChecks').text = 'UninitializedLocalUsageCheck' elif '/RTCs' in buildtype_args: ET.SubElement(type_config, 'BasicRuntimeChecks').text = 'StackFrameRuntimeCheck' - # Optimization flags - if '/Ox' in o_flags: - ET.SubElement(type_config, 'Optimization').text = 'Full' - elif '/O2' in o_flags: - ET.SubElement(type_config, 'Optimization').text = 'MaxSpeed' - elif '/O1' in o_flags: - ET.SubElement(type_config, 'Optimization').text = 'MinSpace' - elif '/Od' in o_flags: - ET.SubElement(type_config, 'Optimization').text = 'Disabled' # End configuration - ET.SubElement(root, 'Import', Project='$(VCTargetsPath)\Microsoft.Cpp.props') + ET.SubElement(root, 'Import', Project=r'$(VCTargetsPath)\Microsoft.Cpp.props') generated_files, custom_target_output_files, generated_files_include_dirs = self.generate_custom_generator_commands(target, root) (gen_src, gen_hdrs, gen_objs, gen_langs) = self.split_sources(generated_files) (custom_src, custom_hdrs, custom_objs, custom_langs) = self.split_sources(custom_target_output_files) @@ -839,9 +875,6 @@ ET.SubElement(direlem, 'TargetName').text = tfilename[0] ET.SubElement(direlem, 'TargetExt').text = tfilename[1] - # Build information - compiles = ET.SubElement(root, 'ItemDefinitionGroup') - clconf = ET.SubElement(compiles, 'ClCompile') # Arguments, include dirs, defines for all files in the current target target_args = [] target_defines = [] @@ -859,24 +892,23 @@ for l, comp in target.compilers.items(): if l in file_args: file_args[l] += compilers.get_base_compile_args(self.get_base_options_for_target(target), comp) - file_args[l] += comp.get_option_compile_args(self.environment.coredata.compiler_options) + file_args[l] += comp.get_option_compile_args(self.environment.coredata.compiler_options[target.for_machine]) # Add compile args added using add_project_arguments() - for l, args in self.build.projects_args.get(target.subproject, {}).items(): + for l, args in self.build.projects_args[target.for_machine].get(target.subproject, {}).items(): if l in file_args: file_args[l] += args # Add compile args added using add_global_arguments() # These override per-project arguments - for l, args in self.build.global_args.items(): + for l, args in self.build.global_args[target.for_machine].items(): if l in file_args: file_args[l] += args - if not target.is_cross: - # Compile args added from the env: CFLAGS/CXXFLAGS, etc. We want these - # to override all the defaults, but not the per-target compile args. - for key, opt in self.environment.coredata.compiler_options.items(): - l, suffix = key.split('_', 1) - if suffix == 'args' and l in file_args: - file_args[l] += opt.value + # Compile args added from the env or cross file: CFLAGS/CXXFLAGS, etc. We want these + # to override all the defaults, but not the per-target compile args. + for key, opt in self.environment.coredata.compiler_options[target.for_machine].items(): + l, suffix = key.split('_', 1) + if suffix == 'args' and l in file_args: + file_args[l] += opt.value for args in file_args.values(): # This is where Visual Studio will insert target_args, target_defines, # etc, which are added later from external deps (see below). @@ -982,38 +1014,58 @@ target_defines.append('%(PreprocessorDefinitions)') ET.SubElement(clconf, 'PreprocessorDefinitions').text = ';'.join(target_defines) ET.SubElement(clconf, 'FunctionLevelLinking').text = 'true' - pch_node = ET.SubElement(clconf, 'PrecompiledHeader') # Warning level warning_level = self.get_option_for_target('warning_level', target) ET.SubElement(clconf, 'WarningLevel').text = 'Level' + str(1 + int(warning_level)) if self.get_option_for_target('werror', target): ET.SubElement(clconf, 'TreatWarningAsError').text = 'true' + # Optimization flags + o_flags = split_o_flags_args(buildtype_args) + if '/Ox' in o_flags: + ET.SubElement(clconf, 'Optimization').text = 'Full' + elif '/O2' in o_flags: + ET.SubElement(clconf, 'Optimization').text = 'MaxSpeed' + elif '/O1' in o_flags: + ET.SubElement(clconf, 'Optimization').text = 'MinSpace' + elif '/Od' in o_flags: + ET.SubElement(clconf, 'Optimization').text = 'Disabled' + if '/Oi' in o_flags: + ET.SubElement(clconf, 'IntrinsicFunctions').text = 'true' + if '/Ob1' in o_flags: + ET.SubElement(clconf, 'InlineFunctionExpansion').text = 'OnlyExplicitInline' + elif '/Ob2' in o_flags: + ET.SubElement(clconf, 'InlineFunctionExpansion').text = 'AnySuitable' + # Size-preserving flags + if '/Os' in o_flags: + ET.SubElement(clconf, 'FavorSizeOrSpeed').text = 'Size' + else: + ET.SubElement(clconf, 'FavorSizeOrSpeed').text = 'Speed' # Note: SuppressStartupBanner is /NOLOGO and is 'true' by default pch_sources = {} - for lang in ['c', 'cpp']: - pch = target.get_pch(lang) - if not pch: - continue - pch_node.text = 'Use' - if compiler.id == 'msvc': - if len(pch) != 2: - raise MesonException('MSVC requires one header and one source to produce precompiled headers.') - pch_sources[lang] = [pch[0], pch[1], lang] - else: - # I don't know whether its relevant but let's handle other compilers - # used with a vs backend - pch_sources[lang] = [pch[0], None, lang] + if self.environment.coredata.base_options.get('b_pch', False): + pch_node = ET.SubElement(clconf, 'PrecompiledHeader') + for lang in ['c', 'cpp']: + pch = target.get_pch(lang) + if not pch: + continue + pch_node.text = 'Use' + if compiler.id == 'msvc': + if len(pch) == 1: + # Auto generate PCH. + src = os.path.join(down, self.create_msvc_pch_implementation(target, lang, pch[0])) + pch_header_dir = os.path.dirname(os.path.join(proj_to_src_dir, pch[0])) + else: + src = os.path.join(proj_to_src_dir, pch[1]) + pch_header_dir = None + pch_sources[lang] = [pch[0], src, lang, pch_header_dir] + else: + # I don't know whether its relevant but let's handle other compilers + # used with a vs backend + pch_sources[lang] = [pch[0], None, lang, None] if len(pch_sources) == 1: # If there is only 1 language with precompiled headers, we can use it for the entire project, which # is cleaner than specifying it for each source file. - pch_source = list(pch_sources.values())[0] - header = os.path.join(proj_to_src_dir, pch_source[0]) - pch_file = ET.SubElement(clconf, 'PrecompiledHeaderFile') - pch_file.text = header - pch_include = ET.SubElement(clconf, 'ForcedIncludeFiles') - pch_include.text = header + ';%(ForcedIncludeFiles)' - pch_out = ET.SubElement(clconf, 'PrecompiledHeaderOutputFile') - pch_out.text = '$(IntDir)$(TargetName)-%s.pch' % pch_source[2] + self.use_pch(pch_sources, list(pch_sources)[0], clconf) resourcecompile = ET.SubElement(compiles, 'ResourceCompile') ET.SubElement(resourcecompile, 'PreprocessorDefinitions') @@ -1033,14 +1085,14 @@ options = self.environment.coredata.base_options extra_link_args += compiler.get_std_shared_module_link_args(options) # Add link args added using add_project_link_arguments() - extra_link_args += self.build.get_project_link_args(compiler, target.subproject, target.is_cross) + extra_link_args += self.build.get_project_link_args(compiler, target.subproject, target.for_machine) # Add link args added using add_global_link_arguments() # These override per-project link arguments - extra_link_args += self.build.get_global_link_args(compiler, target.is_cross) - if not target.is_cross: - # Link args added from the env: LDFLAGS. We want these to - # override all the defaults but not the per-target link args. - extra_link_args += self.environment.coredata.get_external_link_args(compiler.get_language()) + extra_link_args += self.build.get_global_link_args(compiler, target.for_machine) + # Link args added from the env: LDFLAGS, or the cross file. We want + # these to override all the defaults but not the per-target link + # args. + extra_link_args += self.environment.coredata.get_external_link_args(target.for_machine, compiler.get_language()) # Only non-static built targets need link args and link dependencies extra_link_args += target.link_args # External deps must be last because target link libraries may depend on them. @@ -1063,12 +1115,16 @@ # to be after all internal and external libraries so that unresolved # symbols from those can be found here. This is needed when the # *_winlibs that we want to link to are static mingw64 libraries. - extra_link_args += compiler.get_option_link_args(self.environment.coredata.compiler_options) + extra_link_args += compiler.get_option_link_args(self.environment.coredata.compiler_options[compiler.for_machine]) (additional_libpaths, additional_links, extra_link_args) = self.split_link_args(extra_link_args.to_native()) # Add more libraries to be linked if needed for t in target.get_dependencies(): - lobj = self.build.targets[t.get_id()] + if isinstance(t, build.CustomTargetIndex): + # We don't need the actual project here, just the library name + lobj = t + else: + lobj = self.build.targets[t.get_id()] linkname = os.path.join(down, self.get_target_filename_for_linking(lobj)) if t in target.link_whole_targets: # /WHOLEARCHIVE:foo must go into AdditionalOptions @@ -1081,7 +1137,10 @@ trelpath = self.get_target_dir_relative_to(t, target) tvcxproj = os.path.join(trelpath, t.get_id() + '.vcxproj') tid = self.environment.coredata.target_guids[t.get_id()] - self.add_project_reference(root, tvcxproj, tid) + self.add_project_reference(root, tvcxproj, tid, link_outputs=True) + # Mark the dependency as already handled to not have + # multiple references to the same target. + self.handled_target_deps[target.get_id()].append(t.get_id()) else: # Other libraries go into AdditionalDependencies if linkname not in additional_links: @@ -1137,7 +1196,7 @@ ET.SubElement(meson_file_group, 'None', Include=os.path.join(proj_to_src_dir, build_filename)) extra_files = target.extra_files - if len(headers) + len(gen_hdrs) + len(extra_files) > 0: + if len(headers) + len(gen_hdrs) + len(extra_files) + len(pch_sources) > 0: inc_hdrs = ET.SubElement(root, 'ItemGroup') for h in headers: relpath = os.path.join(down, h.rel_to_builddir(self.build_to_src)) @@ -1147,6 +1206,9 @@ for h in target.extra_files: relpath = os.path.join(down, h.rel_to_builddir(self.build_to_src)) ET.SubElement(inc_hdrs, 'CLInclude', Include=relpath) + for lang in pch_sources: + h = pch_sources[lang][0] + ET.SubElement(inc_hdrs, 'CLInclude', Include=os.path.join(proj_to_src_dir, h)) if len(sources) + len(gen_src) + len(pch_sources) > 0: inc_src = ET.SubElement(root, 'ItemGroup') @@ -1154,7 +1216,7 @@ relpath = os.path.join(down, s.rel_to_builddir(self.build_to_src)) inc_cl = ET.SubElement(inc_src, 'CLCompile', Include=relpath) lang = Vs2010Backend.lang_from_source_file(s) - self.add_pch(inc_cl, proj_to_src_dir, pch_sources, s) + self.add_pch(pch_sources, lang, inc_cl) self.add_additional_options(lang, inc_cl, file_args) self.add_preprocessor_defines(lang, inc_cl, file_defines) self.add_include_dirs(lang, inc_cl, file_inc_dirs) @@ -1162,26 +1224,24 @@ for s in gen_src: inc_cl = ET.SubElement(inc_src, 'CLCompile', Include=s) lang = Vs2010Backend.lang_from_source_file(s) - self.add_pch(inc_cl, proj_to_src_dir, pch_sources, s) + self.add_pch(pch_sources, lang, inc_cl) self.add_additional_options(lang, inc_cl, file_args) self.add_preprocessor_defines(lang, inc_cl, file_defines) self.add_include_dirs(lang, inc_cl, file_inc_dirs) for lang in pch_sources: - header, impl, suffix = pch_sources[lang] + impl = pch_sources[lang][1] if impl: - relpath = os.path.join(proj_to_src_dir, impl) - inc_cl = ET.SubElement(inc_src, 'CLCompile', Include=relpath) - pch = ET.SubElement(inc_cl, 'PrecompiledHeader') - pch.text = 'Create' - pch_out = ET.SubElement(inc_cl, 'PrecompiledHeaderOutputFile') - pch_out.text = '$(IntDir)$(TargetName)-%s.pch' % suffix - pch_file = ET.SubElement(inc_cl, 'PrecompiledHeaderFile') - # MSBuild searches for the header relative from the implementation, so we have to use - # just the file name instead of the relative path to the file. - pch_file.text = os.path.basename(header) + inc_cl = ET.SubElement(inc_src, 'CLCompile', Include=impl) + self.create_pch(pch_sources, lang, inc_cl) self.add_additional_options(lang, inc_cl, file_args) self.add_preprocessor_defines(lang, inc_cl, file_defines) - self.add_include_dirs(lang, inc_cl, file_inc_dirs) + pch_header_dir = pch_sources[lang][3] + if pch_header_dir: + inc_dirs = copy.deepcopy(file_inc_dirs) + inc_dirs[lang] = [pch_header_dir] + inc_dirs[lang] + else: + inc_dirs = file_inc_dirs + self.add_include_dirs(lang, inc_cl, inc_dirs) if self.has_objects(objects, additional_objects, gen_objs): inc_objs = ET.SubElement(root, 'ItemGroup') @@ -1192,10 +1252,9 @@ ET.SubElement(inc_objs, 'Object', Include=s) self.add_generated_objects(inc_objs, gen_objs) - ET.SubElement(root, 'Import', Project='$(VCTargetsPath)\Microsoft.Cpp.targets') - # Reference the regen target. - regen_vcxproj = os.path.join(self.environment.get_build_dir(), 'REGEN.vcxproj') - self.add_project_reference(root, regen_vcxproj, self.environment.coredata.regen_guid) + ET.SubElement(root, 'Import', Project=r'$(VCTargetsPath)\Microsoft.Cpp.targets') + self.add_regen_dependency(root) + self.add_target_deps(root, target) self._prettyprint_vcxproj_xml(ET.ElementTree(root), ofname) def gen_regenproj(self, project_name, ofname): @@ -1220,14 +1279,14 @@ pname.text = project_name if self.windows_target_platform_version: ET.SubElement(globalgroup, 'WindowsTargetPlatformVersion').text = self.windows_target_platform_version - ET.SubElement(root, 'Import', Project='$(VCTargetsPath)\Microsoft.Cpp.Default.props') + ET.SubElement(root, 'Import', Project=r'$(VCTargetsPath)\Microsoft.Cpp.Default.props') type_config = ET.SubElement(root, 'PropertyGroup', Label='Configuration') ET.SubElement(type_config, 'ConfigurationType').text = "Utility" ET.SubElement(type_config, 'CharacterSet').text = 'MultiByte' ET.SubElement(type_config, 'UseOfMfc').text = 'false' if self.platform_toolset: ET.SubElement(type_config, 'PlatformToolset').text = self.platform_toolset - ET.SubElement(root, 'Import', Project='$(VCTargetsPath)\Microsoft.Cpp.props') + ET.SubElement(root, 'Import', Project=r'$(VCTargetsPath)\Microsoft.Cpp.props') direlem = ET.SubElement(root, 'PropertyGroup') fver = ET.SubElement(direlem, '_ProjectFileVersion') fver.text = self.project_file_version @@ -1247,32 +1306,14 @@ ET.SubElement(midl, 'InterfaceIdentifierFilename').text = '%(Filename)_i.c' ET.SubElement(midl, 'ProxyFileName').text = '%(Filename)_p.c' regen_command = self.environment.get_build_command() + ['--internal', 'regencheck'] - private_dir = self.environment.get_scratch_dir() - vcvars_command = self.get_vcvars_command() - cmd_templ = '''setlocal -call %s > NUL -"%s" "%s" -if %%errorlevel%% neq 0 goto :cmEnd -:cmEnd -endlocal & call :cmErrorLevel %%errorlevel%% & goto :cmDone -:cmErrorLevel -exit /b %%1 -:cmDone -if %%errorlevel%% neq 0 goto :VCEnd''' - igroup = ET.SubElement(root, 'ItemGroup') - rulefile = os.path.join(self.environment.get_scratch_dir(), 'regen.rule') - if not os.path.exists(rulefile): - with open(rulefile, 'w', encoding='utf-8') as f: - f.write("# Meson regen file.") - custombuild = ET.SubElement(igroup, 'CustomBuild', Include=rulefile) - message = ET.SubElement(custombuild, 'Message') - message.text = 'Checking whether solution needs to be regenerated.' - ET.SubElement(custombuild, 'Command').text = cmd_templ % \ - (vcvars_command, '" "'.join(regen_command), private_dir) - ET.SubElement(custombuild, 'Outputs').text = Vs2010Backend.get_regen_stampfile(self.environment.get_build_dir()) - deps = self.get_regen_filelist() - ET.SubElement(custombuild, 'AdditionalInputs').text = ';'.join(deps) - ET.SubElement(root, 'Import', Project='$(VCTargetsPath)\Microsoft.Cpp.targets') + cmd_templ = '''call %s > NUL +"%s" "%s"''' + regen_command = cmd_templ % \ + (self.get_vcvars_command(), '" "'.join(regen_command), self.environment.get_scratch_dir()) + self.add_custom_build(root, 'regen', regen_command, deps=self.get_regen_filelist(), + outputs=[Vs2010Backend.get_regen_stampfile(self.environment.get_build_dir())], + msg='Checking whether solution needs to be regenerated.') + ET.SubElement(root, 'Import', Project=r'$(VCTargetsPath)\Microsoft.Cpp.targets') ET.SubElement(root, 'ImportGroup', Label='ExtensionTargets') self._prettyprint_vcxproj_xml(ET.ElementTree(root), ofname) @@ -1299,14 +1340,14 @@ pname.text = project_name if self.windows_target_platform_version: ET.SubElement(globalgroup, 'WindowsTargetPlatformVersion').text = self.windows_target_platform_version - ET.SubElement(root, 'Import', Project='$(VCTargetsPath)\Microsoft.Cpp.Default.props') + ET.SubElement(root, 'Import', Project=r'$(VCTargetsPath)\Microsoft.Cpp.Default.props') type_config = ET.SubElement(root, 'PropertyGroup', Label='Configuration') ET.SubElement(type_config, 'ConfigurationType') ET.SubElement(type_config, 'CharacterSet').text = 'MultiByte' ET.SubElement(type_config, 'UseOfMfc').text = 'false' if self.platform_toolset: ET.SubElement(type_config, 'PlatformToolset').text = self.platform_toolset - ET.SubElement(root, 'Import', Project='$(VCTargetsPath)\Microsoft.Cpp.props') + ET.SubElement(root, 'Import', Project=r'$(VCTargetsPath)\Microsoft.Cpp.props') direlem = ET.SubElement(root, 'PropertyGroup') fver = ET.SubElement(direlem, '_ProjectFileVersion') fver.text = self.project_file_version @@ -1325,27 +1366,16 @@ ET.SubElement(midl, 'TypeLibraryName').text = '%(Filename).tlb' ET.SubElement(midl, 'InterfaceIdentifierFilename').text = '%(Filename)_i.c' ET.SubElement(midl, 'ProxyFileName').text = '%(Filename)_p.c' - postbuild = ET.SubElement(action, 'PostBuildEvent') - ET.SubElement(postbuild, 'Message') # FIXME: No benchmarks? test_command = self.environment.get_build_command() + ['test', '--no-rebuild'] if not self.environment.coredata.get_builtin_option('stdsplit'): test_command += ['--no-stdsplit'] if self.environment.coredata.get_builtin_option('errorlogs'): test_command += ['--print-errorlogs'] - cmd_templ = '''setlocal -"%s" -if %%errorlevel%% neq 0 goto :cmEnd -:cmEnd -endlocal & call :cmErrorLevel %%errorlevel%% & goto :cmDone -:cmErrorLevel -exit /b %%1 -:cmDone -if %%errorlevel%% neq 0 goto :VCEnd''' self.serialize_tests() - ET.SubElement(postbuild, 'Command').text =\ - cmd_templ % ('" "'.join(test_command)) - ET.SubElement(root, 'Import', Project='$(VCTargetsPath)\Microsoft.Cpp.targets') + self.add_custom_build(root, 'run_tests', '"%s"' % ('" "'.join(test_command))) + ET.SubElement(root, 'Import', Project=r'$(VCTargetsPath)\Microsoft.Cpp.targets') + self.add_regen_dependency(root) self._prettyprint_vcxproj_xml(ET.ElementTree(root), ofname) def gen_installproj(self, target_name, ofname): @@ -1372,14 +1402,14 @@ pname.text = project_name if self.windows_target_platform_version: ET.SubElement(globalgroup, 'WindowsTargetPlatformVersion').text = self.windows_target_platform_version - ET.SubElement(root, 'Import', Project='$(VCTargetsPath)\Microsoft.Cpp.Default.props') + ET.SubElement(root, 'Import', Project=r'$(VCTargetsPath)\Microsoft.Cpp.Default.props') type_config = ET.SubElement(root, 'PropertyGroup', Label='Configuration') ET.SubElement(type_config, 'ConfigurationType') ET.SubElement(type_config, 'CharacterSet').text = 'MultiByte' ET.SubElement(type_config, 'UseOfMfc').text = 'false' if self.platform_toolset: ET.SubElement(type_config, 'PlatformToolset').text = self.platform_toolset - ET.SubElement(root, 'Import', Project='$(VCTargetsPath)\Microsoft.Cpp.props') + ET.SubElement(root, 'Import', Project=r'$(VCTargetsPath)\Microsoft.Cpp.props') direlem = ET.SubElement(root, 'PropertyGroup') fver = ET.SubElement(direlem, '_ProjectFileVersion') fver.text = self.project_file_version @@ -1398,12 +1428,24 @@ ET.SubElement(midl, 'TypeLibraryName').text = '%(Filename).tlb' ET.SubElement(midl, 'InterfaceIdentifierFilename').text = '%(Filename)_i.c' ET.SubElement(midl, 'ProxyFileName').text = '%(Filename)_p.c' - postbuild = ET.SubElement(action, 'PostBuildEvent') - ET.SubElement(postbuild, 'Message') - # FIXME: No benchmarks? - test_command = self.environment.get_build_command() + ['install', '--no-rebuild'] + install_command = self.environment.get_build_command() + ['install', '--no-rebuild'] + self.add_custom_build(root, 'run_install', '"%s"' % ('" "'.join(install_command))) + ET.SubElement(root, 'Import', Project=r'$(VCTargetsPath)\Microsoft.Cpp.targets') + self.add_regen_dependency(root) + self._prettyprint_vcxproj_xml(ET.ElementTree(root), ofname) + + def add_custom_build(self, node, rulename, command, deps=None, outputs=None, msg=None): + igroup = ET.SubElement(node, 'ItemGroup') + rulefile = os.path.join(self.environment.get_scratch_dir(), rulename + '.rule') + if not os.path.exists(rulefile): + with open(rulefile, 'w', encoding='utf-8') as f: + f.write("# Meson regen file.") + custombuild = ET.SubElement(igroup, 'CustomBuild', Include=rulefile) + if msg: + message = ET.SubElement(custombuild, 'Message') + message.text = msg cmd_templ = '''setlocal -"%s" +%s if %%errorlevel%% neq 0 goto :cmEnd :cmEnd endlocal & call :cmErrorLevel %%errorlevel%% & goto :cmDone @@ -1411,11 +1453,27 @@ exit /b %%1 :cmDone if %%errorlevel%% neq 0 goto :VCEnd''' - ET.SubElement(postbuild, 'Command').text =\ - cmd_templ % ('" "'.join(test_command)) - ET.SubElement(root, 'Import', Project='$(VCTargetsPath)\Microsoft.Cpp.targets') - self._prettyprint_vcxproj_xml(ET.ElementTree(root), ofname) + ET.SubElement(custombuild, 'Command').text = cmd_templ % command + if not outputs: + # Use a nonexistent file to always consider the target out-of-date. + outputs = [self.nonexistent_file(os.path.join(self.environment.get_scratch_dir(), + 'outofdate.file'))] + ET.SubElement(custombuild, 'Outputs').text = ';'.join(outputs) + if deps: + ET.SubElement(custombuild, 'AdditionalInputs').text = ';'.join(deps) + + @staticmethod + def nonexistent_file(prefix): + i = 0 + file = prefix + while os.path.exists(file): + file = '%s%d' % (prefix, i) + return file def generate_debug_information(self, link): # valid values for vs2015 is 'false', 'true', 'DebugFastLink' ET.SubElement(link, 'GenerateDebugInformation').text = 'true' + + def add_regen_dependency(self, root): + regen_vcxproj = os.path.join(self.environment.get_build_dir(), 'REGEN.vcxproj') + self.add_project_reference(root, regen_vcxproj, self.environment.coredata.regen_guid) diff -Nru meson-0.49.0/mesonbuild/backend/vs2015backend.py meson-0.52.1/mesonbuild/backend/vs2015backend.py --- meson-0.49.0/mesonbuild/backend/vs2015backend.py 2017-05-30 10:48:54.000000000 +0000 +++ meson-0.52.1/mesonbuild/backend/vs2015backend.py 2019-08-28 17:15:39.000000000 +0000 @@ -13,11 +13,23 @@ # limitations under the License. from .vs2010backend import Vs2010Backend +from ..mesonlib import MesonException class Vs2015Backend(Vs2010Backend): def __init__(self, build): super().__init__(build) self.name = 'vs2015' - self.platform_toolset = 'v140' self.vs_version = '2015' + if self.environment is not None: + # TODO: we assume host == build + comps = self.environment.coredata.compilers.host + if comps and all(c.id == 'intel-cl' for c in comps.values()): + c = list(comps.values())[0] + if c.version.startswith('19'): + self.platform_toolset = 'Intel C++ Compiler 19.0' + else: + # We don't have support for versions older than 2019 right now. + raise MesonException('There is currently no support for ICL before 19, patches welcome.') + if self.platform_toolset is None: + self.platform_toolset = 'v140' diff -Nru meson-0.49.0/mesonbuild/backend/vs2017backend.py meson-0.52.1/mesonbuild/backend/vs2017backend.py --- meson-0.49.0/mesonbuild/backend/vs2017backend.py 2018-08-25 08:05:43.000000000 +0000 +++ meson-0.52.1/mesonbuild/backend/vs2017backend.py 2019-08-28 17:15:39.000000000 +0000 @@ -16,14 +16,29 @@ import xml.etree.ElementTree as ET from .vs2010backend import Vs2010Backend +from ..mesonlib import MesonException class Vs2017Backend(Vs2010Backend): def __init__(self, build): super().__init__(build) self.name = 'vs2017' - self.platform_toolset = 'v141' self.vs_version = '2017' + # We assume that host == build + if self.environment is not None: + comps = self.environment.coredata.compilers.host + if comps: + if comps and all(c.id == 'clang-cl' for c in comps.values()): + self.platform_toolset = 'llvm' + elif comps and all(c.id == 'intel-cl' for c in comps.values()): + c = list(comps.values())[0] + if c.version.startswith('19'): + self.platform_toolset = 'Intel C++ Compiler 19.0' + else: + # We don't have support for versions older than 2019 right now. + raise MesonException('There is currently no support for ICL before 19, patches welcome.') + if self.platform_toolset is None: + self.platform_toolset = 'v141' # WindowsSDKVersion should be set by command prompt. sdk_version = os.environ.get('WindowsSDKVersion', None) if sdk_version: diff -Nru meson-0.49.0/mesonbuild/backend/vs2019backend.py meson-0.52.1/mesonbuild/backend/vs2019backend.py --- meson-0.49.0/mesonbuild/backend/vs2019backend.py 1970-01-01 00:00:00.000000000 +0000 +++ meson-0.52.1/mesonbuild/backend/vs2019backend.py 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,44 @@ +# Copyright 2014-2019 The Meson development team + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os +import xml.etree.ElementTree as ET + +from .vs2010backend import Vs2010Backend + + +class Vs2019Backend(Vs2010Backend): + def __init__(self, build): + super().__init__(build) + self.name = 'vs2019' + if self.environment is not None: + comps = self.environment.coredata.compilers.host + if comps and all(c.id == 'clang-cl' for c in comps.values()): + self.platform_toolset = 'llvm' + elif comps and all(c.id == 'intel-cl' for c in comps.values()): + c = list(comps.values())[0] + if c.version.startswith('19'): + self.platform_toolset = 'Intel C++ Compiler 19.0' + # We don't have support for versions older than 2019 right now. + if not self.platform_toolset: + self.platform_toolset = 'v142' + self.vs_version = '2019' + # WindowsSDKVersion should be set by command prompt. + sdk_version = os.environ.get('WindowsSDKVersion', None) + if sdk_version: + self.windows_target_platform_version = sdk_version.rstrip('\\') + + def generate_debug_information(self, link): + # valid values for vs2019 is 'false', 'true', 'DebugFastLink', 'DebugFull' + ET.SubElement(link, 'GenerateDebugInformation').text = 'DebugFull' diff -Nru meson-0.49.0/mesonbuild/backend/xcodebackend.py meson-0.52.1/mesonbuild/backend/xcodebackend.py --- meson-0.49.0/mesonbuild/backend/xcodebackend.py 2018-12-09 14:27:16.000000000 +0000 +++ meson-0.52.1/mesonbuild/backend/xcodebackend.py 2019-11-28 17:37:44.000000000 +0000 @@ -345,7 +345,7 @@ self.ofile.write('/* End PBXFileReference section */\n') def generate_pbx_frameworks_buildphase(self): - for tname, t in self.build.targets.items(): + for t in self.build.targets.values(): self.ofile.write('\n/* Begin PBXFrameworksBuildPhase section */\n') self.write_line('%s /* %s */ = {\n' % (t.buildphasemap['Frameworks'], 'Frameworks')) self.indent_level += 1 @@ -587,7 +587,7 @@ def generate_pbx_sources_build_phase(self): self.ofile.write('\n/* Begin PBXSourcesBuildPhase section */\n') - for name, phase_id in self.source_phase.items(): + for name in self.source_phase.keys(): t = self.build.targets[name] self.write_line('%s /* Sources */ = {' % (t.buildphasemap[name])) self.indent_level += 1 @@ -733,20 +733,22 @@ else: product_name = target.get_basename() ldargs += target.link_args + for dep in target.get_external_deps(): + ldargs += dep.get_link_args() ldstr = ' '.join(ldargs) valid = self.buildconfmap[target_name][buildtype] langargs = {} - for lang in self.environment.coredata.compilers: + for lang in self.environment.coredata.compilers[target.for_machine]: if lang not in langnamemap: continue # Add compile args added using add_project_arguments() - pargs = self.build.projects_args.get(target.subproject, {}).get(lang, []) + pargs = self.build.projects_args[target.for_machine].get(target.subproject, {}).get(lang, []) # Add compile args added using add_global_arguments() # These override per-project arguments - gargs = self.build.global_args.get(lang, []) + gargs = self.build.global_args[target.for_machine].get(lang, []) targs = target.get_extra_args(lang) args = pargs + gargs + targs - if len(args) > 0: + if args: langargs[langnamemap[lang]] = args symroot = os.path.join(self.environment.get_build_dir(), target.subdir) self.write_line('%s /* %s */ = {' % (valid, buildtype)) @@ -781,7 +783,7 @@ self.write_line('GCC_PREFIX_HEADER = "$(PROJECT_DIR)/%s";' % relative_pch_path) self.write_line('GCC_PREPROCESSOR_DEFINITIONS = "";') self.write_line('GCC_SYMBOLS_PRIVATE_EXTERN = NO;') - if len(headerdirs) > 0: + if headerdirs: quotedh = ','.join(['"\\"%s\\""' % i for i in headerdirs]) self.write_line('HEADER_SEARCH_PATHS=(%s);' % quotedh) self.write_line('INSTALL_PATH = "%s";' % install_path) diff -Nru meson-0.49.0/mesonbuild/build.py meson-0.52.1/mesonbuild/build.py --- meson-0.49.0/mesonbuild/build.py 2018-12-09 14:27:23.000000000 +0000 +++ meson-0.52.1/mesonbuild/build.py 2019-11-28 17:37:44.000000000 +0000 @@ -18,17 +18,18 @@ import hashlib import pickle from functools import lru_cache +import typing from . import environment from . import dependencies from . import mlog from .mesonlib import ( - File, MesonException, listify, extract_as_list, OrderedSet, - typeslistify, stringlistify, classify_unity_sources, - get_filenames_templates_dict, substitute_values, - for_windows, for_darwin, for_cygwin, for_android, has_path_sep + File, MesonException, MachineChoice, PerMachine, OrderedSet, listify, + extract_as_list, typeslistify, stringlistify, classify_unity_sources, + get_filenames_templates_dict, substitute_values, has_path_sep, ) -from .compilers import is_object, clink_langs, sort_clink, lang_suffixes, get_macos_dylib_install_name +from .compilers import Compiler, is_object, clink_langs, sort_clink, lang_suffixes +from .linkers import StaticLinker from .interpreterbase import FeatureNew pch_kwargs = set(['c_pch', 'cpp_pch']) @@ -36,6 +37,7 @@ lang_arg_kwargs = set([ 'c_args', 'cpp_args', + 'cuda_args', 'd_args', 'd_import_dirs', 'd_unittest', @@ -87,15 +89,19 @@ rust_kwargs | cs_kwargs) -known_exe_kwargs = known_build_target_kwargs | {'implib', 'export_dynamic', 'pie'} +known_exe_kwargs = known_build_target_kwargs | {'implib', 'export_dynamic', 'link_language', 'pie'} known_shlib_kwargs = known_build_target_kwargs | {'version', 'soversion', 'vs_module_defs', 'darwin_versions'} -known_shmod_kwargs = known_build_target_kwargs +known_shmod_kwargs = known_build_target_kwargs | {'vs_module_defs'} known_stlib_kwargs = known_build_target_kwargs | {'pic'} known_jar_kwargs = known_exe_kwargs | {'main_class'} @lru_cache(maxsize=None) -def get_target_macos_dylib_install_name(ld): - return get_macos_dylib_install_name(ld.prefix, ld.name, ld.suffix, ld.soversion) +def get_target_macos_dylib_install_name(ld) -> str: + name = ['@rpath/', ld.prefix, ld.name] + if ld.soversion is not None: + name.append('.' + ld.soversion) + name.append('.dylib') + return ''.join(name) class InvalidArguments(MesonException): pass @@ -105,29 +111,22 @@ all dependencies and so on. """ - def __init__(self, environment): + def __init__(self, environment: environment.Environment): self.project_name = 'name of master project' self.project_version = None self.environment = environment self.projects = {} self.targets = OrderedDict() - self.compilers = OrderedDict() - self.cross_compilers = OrderedDict() - self.global_args = {} - self.projects_args = {} - self.global_link_args = {} - self.projects_link_args = {} - self.cross_global_args = {} - self.cross_projects_args = {} - self.cross_global_link_args = {} - self.cross_projects_link_args = {} + self.global_args = PerMachine({}, {}) # type: PerMachine[typing.Dict[str, typing.List[str]]] + self.projects_args = PerMachine({}, {}) # type: PerMachine[typing.Dict[str, typing.List[str]]] + self.global_link_args = PerMachine({}, {}) # type: PerMachine[typing.Dict[str, typing.List[str]]] + self.projects_link_args = PerMachine({}, {}) # type: PerMachine[typing.Dict[str, typing.List[str]]] self.tests = [] self.benchmarks = [] self.headers = [] self.man = [] self.data = [] - self.static_linker = None - self.static_cross_linker = None + self.static_linker = PerMachine(None, None) # type: PerMachine[StaticLinker] self.subprojects = {} self.subproject_dir = '' self.install_scripts = [] @@ -136,8 +135,8 @@ self.install_dirs = [] self.dep_manifest_name = None self.dep_manifest = {} - self.cross_stdlibs = {} - self.test_setups = {} + self.stdlibs = PerMachine({}, {}) + self.test_setups = {} # type: typing.Dict[str, TestSetup] self.test_setup_default_name = None self.find_overrides = {} self.searched_programs = set() # The list of all programs that have been searched for. @@ -155,19 +154,9 @@ for k, v in other.__dict__.items(): self.__dict__[k] = v - def add_compiler(self, compiler): - if self.static_linker is None and compiler.needs_static_linker(): - self.static_linker = self.environment.detect_static_linker(compiler) - lang = compiler.get_language() - if lang not in self.compilers: - self.compilers[lang] = compiler - - def add_cross_compiler(self, compiler): - if not self.cross_compilers: - self.static_cross_linker = self.environment.detect_static_linker(compiler) - lang = compiler.get_language() - if lang not in self.cross_compilers: - self.cross_compilers[lang] = compiler + def ensure_static_linker(self, compiler): + if self.static_linker[compiler.for_machine] is None and compiler.needs_static_linker(): + self.static_linker[compiler.for_machine] = self.environment.detect_static_linker(compiler) def get_project(self): return self.projects[''] @@ -196,23 +185,23 @@ def get_install_subdirs(self): return self.install_dirs - def get_global_args(self, compiler, for_cross): - d = self.cross_global_args if for_cross else self.global_args + def get_global_args(self, compiler, for_machine): + d = self.global_args[for_machine] return d.get(compiler.get_language(), []) - def get_project_args(self, compiler, project, for_cross): - d = self.cross_projects_args if for_cross else self.projects_args + def get_project_args(self, compiler, project, for_machine): + d = self.projects_args[for_machine] args = d.get(project) if not args: return [] return args.get(compiler.get_language(), []) - def get_global_link_args(self, compiler, for_cross): - d = self.cross_global_link_args if for_cross else self.global_link_args + def get_global_link_args(self, compiler, for_machine): + d = self.global_link_args[for_machine] return d.get(compiler.get_language(), []) - def get_project_link_args(self, compiler, project, for_cross): - d = self.cross_projects_link_args if for_cross else self.projects_link_args + def get_project_link_args(self, compiler, project, for_machine): + d = self.projects_link_args[for_machine] link_args = d.get(project) if not link_args: @@ -249,12 +238,12 @@ ''' Holds a list of sources for which the objects must be extracted ''' - def __init__(self, target, srclist=[], genlist=[], objlist=[], recursive=True): + def __init__(self, target, srclist=None, genlist=None, objlist=None, recursive=True): self.target = target self.recursive = recursive - self.srclist = srclist - self.genlist = genlist - self.objlist = objlist + self.srclist = srclist if srclist is not None else [] + self.genlist = genlist if genlist is not None else [] + self.objlist = objlist if objlist is not None else [] if self.target.is_unity: self.check_unity_compatible() @@ -293,14 +282,30 @@ 'in Unity builds. You can only extract all ' 'the object files for each compiler at once.') + def get_outputs(self, backend): + # TODO: Consider if we need to handle genlist here + return [ + backend.object_filename_from_source(self.target, source) + for source in self.srclist + ] + class EnvironmentVariables: def __init__(self): self.envvars = [] + # The set of all env vars we have operations for. Only used for self.has_name() + self.varnames = set() def __repr__(self): repr_str = "<{0}: {1}>" return repr_str.format(self.__class__.__name__, self.envvars) + def add_var(self, method, name, args, kwargs): + self.varnames.add(name) + self.envvars.append((method, name, args, kwargs)) + + def has_name(self, name): + return name in self.varnames + def get_value(self, values, kwargs): separator = kwargs.get('separator', os.pathsep) @@ -325,14 +330,14 @@ return value - def get_env(self, full_env): + def get_env(self, full_env: typing.Dict[str, str]) -> typing.Dict[str, str]: env = full_env.copy() for method, name, values, kwargs in self.envvars: env[name] = method(full_env, name, values, kwargs) return env class Target: - def __init__(self, name, subdir, subproject, build_by_default): + def __init__(self, name, subdir, subproject, build_by_default, for_machine: MachineChoice): if has_path_sep(name): # Fix failing test 53 when this becomes an error. mlog.warning('''Target "%s" has a path separator in its name. @@ -342,9 +347,12 @@ self.subdir = subdir self.subproject = subproject self.build_by_default = build_by_default + self.for_machine = for_machine self.install = False self.build_always_stale = False self.option_overrides = {} + if not hasattr(self, 'typename'): + raise RuntimeError('Target type is not set for target class "{}". This is a bug'.format(type(self).__name__)) def get_install_dir(self, environment): # Find the installation directory. @@ -366,6 +374,9 @@ def get_subdir(self): return self.subdir + def get_typename(self): + return self.typename + @staticmethod def _get_id_hash(target_id): # We don't really need cryptographic security here. @@ -404,9 +415,14 @@ self.build_by_default = kwargs['build_by_default'] if not isinstance(self.build_by_default, bool): raise InvalidArguments('build_by_default must be a boolean value.') + elif kwargs.get('install', False): + # For backward compatibility, if build_by_default is not explicitly + # set, use the value of 'install' if it's enabled. + self.build_by_default = True + self.option_overrides = self.parse_overrides(kwargs) - def parse_overrides(self, kwargs): + def parse_overrides(self, kwargs) -> dict: result = {} overrides = stringlistify(kwargs.get('override_options', [])) for o in overrides: @@ -418,23 +434,23 @@ result[k] = v return result - def is_linkable_target(self): + def is_linkable_target(self) -> bool: return False class BuildTarget(Target): known_kwargs = known_build_target_kwargs - def __init__(self, name, subdir, subproject, is_cross, sources, objects, environment, kwargs): - super().__init__(name, subdir, subproject, True) - self.is_cross = is_cross + def __init__(self, name, subdir, subproject, for_machine: MachineChoice, sources, objects, environment, kwargs): + super().__init__(name, subdir, subproject, True, for_machine) unity_opt = environment.coredata.get_builtin_option('unity') self.is_unity = unity_opt == 'on' or (unity_opt == 'subprojects' and subproject != '') self.environment = environment self.sources = [] - self.compilers = OrderedDict() + self.compilers = OrderedDict() # type: OrderedDict[str, Compiler] self.objects = [] self.external_deps = [] self.include_dirs = [] + self.link_language = kwargs.get('link_language') self.link_targets = [] self.link_whole_targets = [] self.link_depends = [] @@ -468,7 +484,7 @@ raise InvalidArguments('Build target %s has no sources.' % name) self.process_compilers_late() self.validate_sources() - self.validate_cross_install(environment) + self.validate_install(environment) self.check_module_linking() def __lt__(self, other): @@ -478,9 +494,12 @@ repr_str = "<{0} {1}: {2}>" return repr_str.format(self.__class__.__name__, self.get_id(), self.filename) - def validate_cross_install(self, environment): - if environment.is_cross_build() and not self.is_cross and self.need_install: - raise InvalidArguments('Tried to install a natively built target in a cross build.') + def validate_install(self, environment): + if self.for_machine is MachineChoice.BUILD and self.need_install: + if environment.is_cross_build(): + raise InvalidArguments('Tried to install a target for the build machine in a cross build.') + else: + mlog.warning('Installing target build for the build machine. This will fail in a cross build.') def check_unknown_kwargs(self, kwargs): # Override this method in derived classes that have more @@ -547,18 +566,20 @@ which compiler to use if one hasn't been selected already. """ # Populate list of compilers - if self.is_cross: - compilers = self.environment.coredata.cross_compilers - else: - compilers = self.environment.coredata.compilers + compilers = self.environment.coredata.compilers[self.for_machine] + + # did user override clink_langs for this target? + link_langs = [self.link_language] if self.link_language else clink_langs # If this library is linked against another library we need to consider # the languages of those libraries as well. if self.link_targets or self.link_whole_targets: extra = set() for t in itertools.chain(self.link_targets, self.link_whole_targets): + if isinstance(t, CustomTarget) or isinstance(t, CustomTargetIndex): + continue # We can't know anything about these. for name, compiler in t.compilers.items(): - if name in clink_langs: + if name in link_langs: extra.add((name, compiler)) for name, compiler in sorted(extra, key=lambda p: sort_clink(p[0])): self.compilers[name] = compiler @@ -567,7 +588,7 @@ # No source files or parent targets, target consists of only object # files of unknown origin. Just add the first clink compiler # that we have and hope that it can link these objects - for lang in clink_langs: + for lang in link_langs: if lang in compilers: self.compilers[lang] = compilers[lang] break @@ -582,10 +603,7 @@ if not self.sources and not self.generated and not self.objects: return # Populate list of compilers - if self.is_cross: - compilers = self.environment.coredata.cross_compilers - else: - compilers = self.environment.coredata.compilers + compilers = self.environment.coredata.compilers[self.for_machine] # Pre-existing sources sources = list(self.sources) # All generated sources @@ -712,9 +730,12 @@ def extract_objects(self, srclist): obj_src = [] for src in srclist: - if not isinstance(src, str): - raise MesonException('Object extraction arguments must be strings.') - src = File(False, self.subdir, src) + if isinstance(src, str): + src = File(False, self.subdir, src) + elif isinstance(src, File): + FeatureNew('File argument for extract_objects', '0.50.0').use(self.subproject) + else: + raise MesonException('Object extraction arguments must be strings or Files.') # FIXME: It could be a generated source if src not in self.sources: raise MesonException('Tried to extract unknown source %s.' % src) @@ -788,13 +809,13 @@ for linktarget in lwhole: self.link_whole(linktarget) - c_pchlist, cpp_pchlist, clist, cpplist, cslist, valalist, objclist, objcpplist, fortranlist, rustlist \ - = extract_as_list(kwargs, 'c_pch', 'cpp_pch', 'c_args', 'cpp_args', 'cs_args', 'vala_args', 'objc_args', + c_pchlist, cpp_pchlist, clist, cpplist, cudalist, cslist, valalist, objclist, objcpplist, fortranlist, rustlist \ + = extract_as_list(kwargs, 'c_pch', 'cpp_pch', 'c_args', 'cpp_args', 'cuda_args', 'cs_args', 'vala_args', 'objc_args', 'objcpp_args', 'fortran_args', 'rust_args') self.add_pch('c', c_pchlist) self.add_pch('cpp', cpp_pchlist) - compiler_args = {'c': clist, 'cpp': cpplist, 'cs': cslist, 'vala': valalist, 'objc': objclist, 'objcpp': objcpplist, + compiler_args = {'c': clist, 'cpp': cpplist, 'cuda': cudalist, 'cs': cslist, 'vala': valalist, 'objc': objclist, 'objcpp': objcpplist, 'fortran': fortranlist, 'rust': rustlist } for key, value in compiler_args.items(): @@ -905,13 +926,14 @@ # You can't disable PIC on OS X. The compiler ignores -fno-PIC. # PIC is always on for Windows (all code is position-independent # since library loading is done differently) - if for_darwin(self.is_cross, self.environment) or for_windows(self.is_cross, self.environment): + m = self.environment.machines[self.for_machine] + if m.is_darwin() or m.is_windows(): self.pic = True else: self.pic = self._extract_pic_pie(kwargs, 'pic') if isinstance(self, Executable): # Executables must be PIE on Android - if for_android(self.is_cross, self.environment): + if self.environment.machines[self.for_machine].is_android(): self.pie = True else: self.pie = self._extract_pic_pie(kwargs, 'pie') @@ -948,22 +970,23 @@ def get_extra_args(self, language): return self.extra_args.get(language, []) - def get_dependencies(self, exclude=None, internal=True): + def get_dependencies(self, exclude=None, for_pkgconfig=False): transitive_deps = [] if exclude is None: exclude = [] - if internal: - link_targets = itertools.chain(self.link_targets, self.link_whole_targets) - else: - # We don't want the 'internal' libraries when generating the - # `Libs:` and `Libs.private:` lists in pkg-config files. - link_targets = self.link_targets - for t in link_targets: + for t in itertools.chain(self.link_targets, self.link_whole_targets): if t in transitive_deps or t in exclude: continue - transitive_deps.append(t) + # When generating `Libs:` and `Libs.private:` lists in pkg-config + # files we don't want to include static libraries that we link_whole + # or are uninstalled (they're implicitly promoted to link_whole). + # But we still need to include their transitive dependencies, + # a static library we link_whole would itself link to a shared + # library or an installed static library. + if not for_pkgconfig or (not t.is_internal() and t not in self.link_whole_targets): + transitive_deps.append(t) if isinstance(t, StaticLibrary): - transitive_deps += t.get_dependencies(transitive_deps + exclude, internal) + transitive_deps += t.get_dependencies(transitive_deps + exclude, for_pkgconfig) return transitive_deps def get_source_subdir(self): @@ -1001,24 +1024,26 @@ if isinstance(dep, dependencies.InternalDependency): # Those parts that are internal. self.process_sourcelist(dep.sources) - self.add_include_dirs(dep.include_directories) + self.add_include_dirs(dep.include_directories, dep.get_include_type()) for l in dep.libraries: self.link(l) for l in dep.whole_libraries: self.link_whole(l) - if dep.compile_args or dep.link_args: + if dep.get_compile_args() or dep.get_link_args(): # Those parts that are external. extpart = dependencies.InternalDependency('undefined', [], - dep.compile_args, - dep.link_args, + dep.get_compile_args(), + dep.get_link_args(), [], [], [], []) self.external_deps.append(extpart) # Deps of deps. self.add_deps(dep.ext_deps) elif isinstance(dep, dependencies.Dependency): - self.external_deps.append(dep) - self.process_sourcelist(dep.get_sources()) + if dep not in self.external_deps: + self.external_deps.append(dep) + self.process_sourcelist(dep.get_sources()) + self.add_deps(dep.ext_deps) elif isinstance(dep, BuildTarget): raise InvalidArguments('''Tried to use a build target as a dependency. You probably should put it in link_with instead.''') @@ -1038,9 +1063,16 @@ def get_external_deps(self): return self.external_deps + def is_internal(self): + return isinstance(self, StaticLibrary) and not self.need_install + def link(self, target): for t in listify(target, unholder=True): - if not isinstance(t, Target): + if isinstance(self, StaticLibrary) and self.need_install and t.is_internal(): + # When we're a static library and we link_with to an + # internal/convenience library, promote to link_whole. + return self.link_whole(t) + if not isinstance(t, (Target, CustomTargetIndex)): raise InvalidArguments('{!r} is not a target.'.format(t)) if not t.is_linkable_target(): raise InvalidArguments('Link target {!r} is not linkable.'.format(t)) @@ -1048,22 +1080,46 @@ msg = "Can't link non-PIC static library {!r} into shared library {!r}. ".format(t.name, self.name) msg += "Use the 'pic' option to static_library to build with PIC." raise InvalidArguments(msg) - if self.is_cross != t.is_cross: - raise InvalidArguments('Tried to mix cross built and native libraries in target {!r}'.format(self.name)) + if self.for_machine is not t.for_machine: + msg = 'Tried to mix libraries for machines {} and {} in target {!r}'.format(self.for_machine, t.for_machine, self.name) + if self.environment.is_cross_build(): + raise InvalidArguments(msg + ' This is not possible in a cross build.') + else: + mlog.warning(msg + ' This will fail in cross build.') self.link_targets.append(t) def link_whole(self, target): for t in listify(target, unholder=True): - if not isinstance(t, StaticLibrary): + if isinstance(t, (CustomTarget, CustomTargetIndex)): + if not t.is_linkable_target(): + raise InvalidArguments('Custom target {!r} is not linkable.'.format(t)) + if not t.get_filename().endswith('.a'): + raise InvalidArguments('Can only link_whole custom targets that are .a archives.') + elif not isinstance(t, StaticLibrary): raise InvalidArguments('{!r} is not a static library.'.format(t)) if isinstance(self, SharedLibrary) and not t.pic: msg = "Can't link non-PIC static library {!r} into shared library {!r}. ".format(t.name, self.name) msg += "Use the 'pic' option to static_library to build with PIC." raise InvalidArguments(msg) - if self.is_cross != t.is_cross: - raise InvalidArguments('Tried to mix cross built and native libraries in target {!r}'.format(self.name)) + if self.for_machine is not t.for_machine: + msg = 'Tried to mix libraries for machines {1} and {2} in target {!r}'.format(self.name, self.for_machine, t.for_machine) + if self.environment.is_cross_build(): + raise InvalidArguments(msg + ' This is not possible in a cross build.') + else: + mlog.warning(msg + ' This will fail in cross build.') + if isinstance(self, StaticLibrary): + # When we're a static library and we link_whole: to another static + # library, we need to add that target's objects to ourselves. + self.objects += t.extract_all_objects_recurse() self.link_whole_targets.append(t) + def extract_all_objects_recurse(self): + objs = [self.extract_all_objects()] + for t in self.link_targets: + if t.is_internal(): + objs += t.extract_all_objects_recurse() + return objs + def add_pch(self, language, pchlist): if not pchlist: return @@ -1080,11 +1136,21 @@ pchlist = [pchlist[1], pchlist[0]] else: raise InvalidArguments('PCH argument %s is of unknown type.' % pchlist[0]) + + if (os.path.dirname(pchlist[0]) != os.path.dirname(pchlist[1])): + raise InvalidArguments('PCH files must be stored in the same folder.') + + mlog.warning('PCH source files are deprecated, only a single header file should be used.') elif len(pchlist) > 2: raise InvalidArguments('PCH definition may have a maximum of 2 files.') + for f in pchlist: + if not isinstance(f, str): + raise MesonException('PCH arguments must be strings.') + if not os.path.isfile(os.path.join(self.environment.source_dir, self.subdir, f)): + raise MesonException('File %s does not exist.' % f) self.pch[language] = pchlist - def add_include_dirs(self, args): + def add_include_dirs(self, args, set_is_system: typing.Optional[str] = None): ids = [] for a in args: # FIXME same hack, forcibly unpack from holder. @@ -1093,6 +1159,11 @@ if not isinstance(a, IncludeDirs): raise InvalidArguments('Include directory to be added is not an include directory object.') ids.append(a) + if set_is_system is None: + set_is_system = 'preserve' + if set_is_system != 'preserve': + is_system = set_is_system == 'system' + ids = [IncludeDirs(x.get_curdir(), x.get_incdirs(), is_system, x.get_extra_build_dirs()) for x in ids] self.include_dirs += ids def add_compiler_args(self, language, args): @@ -1108,7 +1179,7 @@ def get_aliases(self): return {} - def get_langs_used_by_deps(self): + def get_langs_used_by_deps(self) -> typing.List[str]: ''' Sometimes you want to link to a C++ library that exports C API, which means the linker must link in the C++ stdlib, and we must use a C++ @@ -1118,6 +1189,11 @@ See: https://github.com/mesonbuild/meson/issues/1653 ''' langs = [] + + # User specified link_language of target (for multi-language targets) + if self.link_language: + return [self.link_language] + # Check if any of the external libraries were written in this language for dep in self.external_deps: if dep.language is None: @@ -1127,9 +1203,12 @@ # Check if any of the internal libraries this target links to were # written in this language for link_target in itertools.chain(self.link_targets, self.link_whole_targets): + if isinstance(link_target, (CustomTarget, CustomTargetIndex)): + continue for language in link_target.compilers: if language not in langs: langs.append(language) + return langs def get_clink_dynamic_linker_and_stdlibs(self): @@ -1144,10 +1223,7 @@ ''' # Populate list of all compilers, not just those being used to compile # sources in this target - if self.is_cross: - all_compilers = self.environment.coredata.cross_compilers - else: - all_compilers = self.environment.coredata.compilers + all_compilers = self.environment.coredata.compilers[self.for_machine] # Languages used by dependencies dep_langs = self.get_langs_used_by_deps() # Pick a compiler based on the language priority-order @@ -1171,6 +1247,10 @@ m = 'Could not get a dynamic linker for build target {!r}' raise AssertionError(m.format(self.name)) + def get_using_rustc(self): + if len(self.sources) > 0 and self.sources[0].fname.endswith('.rs'): + return True + def get_using_msvc(self): ''' Check if the dynamic linker is MSVC. Used by Executable, StaticLibrary, @@ -1191,7 +1271,7 @@ ''' linker, _ = self.get_clink_dynamic_linker_and_stdlibs() # Mixing many languages with MSVC is not supported yet so ignore stdlibs. - if linker and linker.get_id() in ['msvc', 'clang-cl', 'llvm', 'dmd']: + if linker and linker.get_id() in {'msvc', 'clang-cl', 'intel-cl', 'llvm', 'dmd', 'nvcc'}: return True return False @@ -1201,7 +1281,7 @@ ''' for link_target in self.link_targets: if isinstance(link_target, SharedModule): - if for_darwin(self.is_cross, self.environment): + if self.environment.machines[self.for_machine].is_darwin(): raise MesonException('''target links against shared modules. This is not permitted on OSX''') else: @@ -1221,6 +1301,7 @@ self.exe = exe self.depfile = None self.capture = False + self.depends = [] self.process_kwargs(kwargs) def __repr__(self): @@ -1269,6 +1350,12 @@ if not isinstance(capture, bool): raise InvalidArguments('Capture must be boolean.') self.capture = capture + if 'depends' in kwargs: + depends = listify(kwargs['depends'], unholder=True) + for d in depends: + if not isinstance(d, BuildTarget): + raise InvalidArguments('Depends entries must be build targets.') + self.depends.append(d) def get_base_outnames(self, inname): plainname = os.path.basename(inname) @@ -1292,8 +1379,8 @@ relpath = pathlib.PurePath(trial).relative_to(parent) return relpath.parts[0] != '..' # For subdirs we can only go "down". - def process_files(self, name, files, state, preserve_path_from=None, extra_args=[]): - output = GeneratedList(self, state.subdir, preserve_path_from, extra_args=extra_args) + def process_files(self, name, files, state, preserve_path_from=None, extra_args=None): + output = GeneratedList(self, state.subdir, preserve_path_from, extra_args=extra_args if extra_args is not None else []) for f in files: if isinstance(f, str): f = File.from_source_file(state.environment.source_dir, state.subdir, f) @@ -1308,7 +1395,7 @@ class GeneratedList: - def __init__(self, generator, subdir, preserve_path_from=None, extra_args=[]): + def __init__(self, generator, subdir, preserve_path_from=None, extra_args=None): if hasattr(generator, 'held_object'): generator = generator.held_object self.generator = generator @@ -1318,8 +1405,17 @@ self.outfilelist = [] self.outmap = {} self.extra_depends = [] + self.depend_files = [] self.preserve_path_from = preserve_path_from - self.extra_args = extra_args + self.extra_args = extra_args if extra_args is not None else [] + if isinstance(generator.exe, dependencies.ExternalProgram): + if not generator.exe.found(): + raise InvalidArguments('Tried to use not-found external program as generator') + path = generator.exe.get_path() + if os.path.isabs(path): + # Can only add a dependency on an external program which we + # know the absolute path of + self.depend_files.append(File.from_absolute_file(path)) def add_preserved_path_segment(self, infile, outfiles, state): result = [] @@ -1357,19 +1453,22 @@ class Executable(BuildTarget): known_kwargs = known_exe_kwargs - def __init__(self, name, subdir, subproject, is_cross, sources, objects, environment, kwargs): + def __init__(self, name, subdir, subproject, for_machine: MachineChoice, sources, objects, environment, kwargs): + self.typename = 'executable' if 'pie' not in kwargs and 'b_pie' in environment.coredata.base_options: kwargs['pie'] = environment.coredata.base_options['b_pie'].value - super().__init__(name, subdir, subproject, is_cross, sources, objects, environment, kwargs) + super().__init__(name, subdir, subproject, for_machine, sources, objects, environment, kwargs) # Unless overridden, executables have no suffix or prefix. Except on # Windows and with C#/Mono executables where the suffix is 'exe' if not hasattr(self, 'prefix'): self.prefix = '' if not hasattr(self, 'suffix'): + machine = environment.machines[for_machine] # Executable for Windows or C#/Mono - if (for_windows(is_cross, environment) or - for_cygwin(is_cross, environment) or 'cs' in self.compilers): + if machine.is_windows() or machine.is_cygwin() or 'cs' in self.compilers: self.suffix = 'exe' + elif machine.system.startswith('wasm') or machine.system == 'emscripten': + self.suffix = 'js' elif ('c' in self.compilers and self.compilers['c'].get_id().startswith('arm') or 'cpp' in self.compilers and self.compilers['cpp'].get_id().startswith('arm')): self.suffix = 'axf' @@ -1377,7 +1476,7 @@ 'cpp' in self.compilers and self.compilers['cpp'].get_id().startswith('ccrx')): self.suffix = 'abs' else: - self.suffix = '' + self.suffix = environment.machines[for_machine].get_exe_suffix() self.filename = self.name if self.suffix: self.filename += '.' + self.suffix @@ -1406,7 +1505,8 @@ implib_basename = self.name + '.exe' if not isinstance(kwargs.get('implib', False), bool): implib_basename = kwargs['implib'] - if for_windows(is_cross, environment) or for_cygwin(is_cross, environment): + m = environment.machines[for_machine] + if m.is_windows() or m.is_cygwin(): self.vs_import_filename = '{0}.lib'.format(implib_basename) self.gcc_import_filename = 'lib{0}.a'.format(implib_basename) if self.get_using_msvc(): @@ -1446,10 +1546,11 @@ class StaticLibrary(BuildTarget): known_kwargs = known_stlib_kwargs - def __init__(self, name, subdir, subproject, is_cross, sources, objects, environment, kwargs): + def __init__(self, name, subdir, subproject, for_machine: MachineChoice, sources, objects, environment, kwargs): + self.typename = 'static library' if 'pic' not in kwargs and 'b_staticpic' in environment.coredata.base_options: kwargs['pic'] = environment.coredata.base_options['b_staticpic'].value - super().__init__(name, subdir, subproject, is_cross, sources, objects, environment, kwargs) + super().__init__(name, subdir, subproject, for_machine, sources, objects, environment, kwargs) if 'cs' in self.compilers: raise InvalidArguments('Static libraries not supported for C#.') if 'rust' in self.compilers: @@ -1505,7 +1606,8 @@ class SharedLibrary(BuildTarget): known_kwargs = known_shlib_kwargs - def __init__(self, name, subdir, subproject, is_cross, sources, objects, environment, kwargs): + def __init__(self, name, subdir, subproject, for_machine: MachineChoice, sources, objects, environment, kwargs): + self.typename = 'shared library' self.soversion = None self.ltversion = None # Max length 2, first element is compatibility_version, second is current_version @@ -1517,7 +1619,7 @@ self.vs_import_filename = None # The import library that GCC would generate (and prefer) self.gcc_import_filename = None - super().__init__(name, subdir, subproject, is_cross, sources, objects, environment, kwargs) + super().__init__(name, subdir, subproject, for_machine, sources, objects, environment, kwargs) if 'rust' in self.compilers: # If no crate type is specified, or it's the generic lib type, use dylib if not hasattr(self, 'rust_crate_type') or self.rust_crate_type == 'lib': @@ -1531,7 +1633,7 @@ if not hasattr(self, 'suffix'): self.suffix = None self.basic_filename_tpl = '{0.prefix}{0.name}.{0.suffix}' - self.determine_filenames(is_cross, environment) + self.determine_filenames(environment) def get_link_deps_mapping(self, prefix, environment): result = {} @@ -1548,7 +1650,7 @@ def get_default_install_dir(self, environment): return environment.get_shared_lib_dir() - def determine_filenames(self, is_cross, env): + def determine_filenames(self, env): """ See https://github.com/mesonbuild/meson/pull/417 for details. @@ -1581,11 +1683,16 @@ # C, C++, Swift, Vala # Only Windows uses a separate import library for linking # For all other targets/platforms import_filename stays None - elif for_windows(is_cross, env): + elif env.machines[self.for_machine].is_windows(): suffix = 'dll' self.vs_import_filename = '{0}{1}.lib'.format(self.prefix if self.prefix is not None else '', self.name) self.gcc_import_filename = '{0}{1}.dll.a'.format(self.prefix if self.prefix is not None else 'lib', self.name) - if self.get_using_msvc(): + if self.get_using_rustc(): + # Shared library is of the form foo.dll + prefix = '' + # Import library is called foo.dll.lib + self.import_filename = '{0}.dll.lib'.format(self.name) + elif self.get_using_msvc(): # Shared library is of the form foo.dll prefix = '' # Import library is called foo.lib @@ -1601,7 +1708,7 @@ self.filename_tpl = '{0.prefix}{0.name}-{0.soversion}.{0.suffix}' else: self.filename_tpl = '{0.prefix}{0.name}.{0.suffix}' - elif for_cygwin(is_cross, env): + elif env.machines[self.for_machine].is_cygwin(): suffix = 'dll' self.gcc_import_filename = '{0}{1}.dll.a'.format(self.prefix if self.prefix is not None else 'lib', self.name) # Shared library is of the form cygfoo.dll @@ -1613,7 +1720,7 @@ self.filename_tpl = '{0.prefix}{0.name}-{0.soversion}.{0.suffix}' else: self.filename_tpl = '{0.prefix}{0.name}.{0.suffix}' - elif for_darwin(is_cross, env): + elif env.machines[self.for_machine].is_darwin(): prefix = 'lib' suffix = 'dylib' # On macOS, the filename can only contain the major version @@ -1623,7 +1730,7 @@ else: # libfoo.dylib self.filename_tpl = '{0.prefix}{0.name}.{0.suffix}' - elif for_android(is_cross, env): + elif env.machines[self.for_machine].is_android(): prefix = 'lib' suffix = 'so' # Android doesn't support shared_library versioning @@ -1688,7 +1795,7 @@ def process_kwargs(self, kwargs, environment): super().process_kwargs(kwargs, environment) - if not for_android(self.is_cross, self.environment): + if not self.environment.machines[self.for_machine].is_android(): supports_versioning = True else: supports_versioning = False @@ -1713,7 +1820,7 @@ # We replicate what Autotools does here and take the first # number of the version by default. self.soversion = self.ltversion.split('.')[0] - # macOS and iOS dylib compatibility_version and current_version + # macOS, iOS and tvOS dylib compatibility_version and current_version if 'darwin_versions' in kwargs: self.darwin_versions = self._validate_darwin_versions(kwargs['darwin_versions']) elif self.soversion: @@ -1808,12 +1915,13 @@ class SharedModule(SharedLibrary): known_kwargs = known_shmod_kwargs - def __init__(self, name, subdir, subproject, is_cross, sources, objects, environment, kwargs): + def __init__(self, name, subdir, subproject, for_machine: MachineChoice, sources, objects, environment, kwargs): if 'version' in kwargs: raise MesonException('Shared modules must not specify the version kwarg.') if 'soversion' in kwargs: raise MesonException('Shared modules must not specify the soversion kwarg.') - super().__init__(name, subdir, subproject, is_cross, sources, objects, environment, kwargs) + super().__init__(name, subdir, subproject, for_machine, sources, objects, environment, kwargs) + self.typename = 'shared module' def get_default_install_dir(self, environment): return environment.get_shared_module_dir() @@ -1838,13 +1946,15 @@ 'console', ]) - def __init__(self, name, subdir, subproject, kwargs, absolute_paths=False): - super().__init__(name, subdir, subproject, False) + def __init__(self, name, subdir, subproject, kwargs, absolute_paths=False, backend=None): + self.typename = 'custom' + # TODO expose keyword arg to make MachineChoice.HOST configurable + super().__init__(name, subdir, subproject, False, MachineChoice.HOST) self.dependencies = [] self.extra_depends = [] self.depend_files = [] # Files that this target depends on but are not on the command line. self.depfile = None - self.process_kwargs(kwargs) + self.process_kwargs(kwargs, backend) self.extra_files = [] # Whether to use absolute paths for all files on the commandline self.absolute_paths = absolute_paths @@ -1866,9 +1976,6 @@ repr_str = "<{0} {1}: {2}>" return repr_str.format(self.__class__.__name__, self.get_id(), self.command) - def get_id(self): - return self.name + self.type_suffix() - def get_target_dependencies(self): deps = self.dependencies[:] deps += self.extra_depends @@ -1908,8 +2015,7 @@ final_cmd.append(c) elif isinstance(c, dependencies.ExternalProgram): if not c.found(): - m = 'Tried to use not-found external program {!r} in "command"' - raise InvalidArguments(m.format(c.name)) + raise InvalidArguments('Tried to use not-found external program in "command"') path = c.get_path() if os.path.isabs(path): # Can only add a dependency on an external program which we @@ -1925,14 +2031,14 @@ raise InvalidArguments('Argument {!r} in "command" is invalid'.format(c)) return final_cmd - def process_kwargs(self, kwargs): + def process_kwargs(self, kwargs, backend): super().process_kwargs(kwargs) self.sources = extract_as_list(kwargs, 'input', unholder=True) if 'output' not in kwargs: raise InvalidArguments('Missing keyword argument "output".') self.outputs = listify(kwargs['output']) # This will substitute values from the input into output and return it. - inputs = get_sources_string_names(self.sources) + inputs = get_sources_string_names(self.sources, backend) values = get_filenames_templates_dict(inputs, []) for i in self.outputs: if not(isinstance(i, str)): @@ -2066,6 +2172,22 @@ raise InvalidArguments('Substitution in depfile for custom_target that does not have an input file.') return self.depfile + def is_linkable_target(self): + if len(self.outputs) != 1: + return False + suf = os.path.splitext(self.outputs[0])[-1] + if suf == '.a' or suf == '.dll' or suf == '.lib' or suf == '.so': + return True + + def get_link_deps_mapping(self, prefix, environment): + return {} + + def get_link_dep_subdirs(self): + return OrderedSet() + + def get_all_link_deps(self): + return [] + def type_suffix(self): return "@cus" @@ -2080,7 +2202,9 @@ class RunTarget(Target): def __init__(self, name, command, args, dependencies, subdir, subproject): - super().__init__(name, subdir, subproject, False) + self.typename = 'run' + # These don't produce output artifacts + super().__init__(name, subdir, subproject, False, MachineChoice.BUILD) self.command = command self.args = args self.dependencies = dependencies @@ -2107,14 +2231,27 @@ def get_filename(self): return self.name + def get_outputs(self): + if isinstance(self.name, str): + return [self.name] + elif isinstance(self.name, list): + return self.name + else: + raise RuntimeError('RunTarget: self.name is neither a list nor a string. This is a bug') + def type_suffix(self): return "@run" +class AliasTarget(RunTarget): + def __init__(self, name, dependencies, subdir, subproject): + super().__init__(name, '', [], dependencies, subdir, subproject) + class Jar(BuildTarget): known_kwargs = known_jar_kwargs - def __init__(self, name, subdir, subproject, is_cross, sources, objects, environment, kwargs): - super().__init__(name, subdir, subproject, is_cross, sources, objects, environment, kwargs) + def __init__(self, name, subdir, subproject, for_machine: MachineChoice, sources, objects, environment, kwargs): + self.typename = 'jar' + super().__init__(name, subdir, subproject, for_machine, sources, objects, environment, kwargs) for s in self.sources: if not s.endswith('.java'): raise InvalidArguments('Jar source %s is not a java file.' % s) @@ -2134,7 +2271,7 @@ def get_java_args(self): return self.java_args - def validate_cross_install(self, environment): + def validate_install(self, environment): # All jar targets are installable. pass @@ -2157,8 +2294,10 @@ """ def __init__(self, target, output): + self.typename = 'custom' self.target = target self.output = output + self.for_machine = target.for_machine def __repr__(self): return ''.format( @@ -2170,6 +2309,26 @@ def get_subdir(self): return self.target.get_subdir() + def get_filename(self): + return self.output + + def get_id(self): + return self.target.get_id() + + def get_all_link_deps(self): + return self.target.get_all_link_deps() + + def get_link_deps_mapping(self, prefix, environment): + return self.target.get_link_deps_mapping(prefix, environment) + + def get_link_dep_subdirs(self): + return self.target.get_link_dep_subdirs() + + def is_linkable_target(self): + suf = os.path.splitext(self.output)[-1] + if suf == '.a' or suf == '.dll' or suf == '.lib' or suf == '.so': + return True + class ConfigureFile: def __init__(self, subdir, sourcename, targetname, configuration_data): @@ -2239,13 +2398,14 @@ self['args'] = args class TestSetup: - def __init__(self, *, exe_wrapper=None, gdb=None, timeout_multiplier=None, env=None): + def __init__(self, exe_wrapper: typing.Optional[typing.List[str]], gdb: bool, + timeout_multiplier: int, env: EnvironmentVariables): self.exe_wrapper = exe_wrapper self.gdb = gdb self.timeout_multiplier = timeout_multiplier self.env = env -def get_sources_string_names(sources): +def get_sources_string_names(sources, backend): ''' For the specified list of @sources which can be strings, Files, or targets, get all the output basenames. @@ -2258,13 +2418,15 @@ names.append(s) elif isinstance(s, (BuildTarget, CustomTarget, CustomTargetIndex, GeneratedList)): names += s.get_outputs() + elif isinstance(s, ExtractedObjects): + names += s.get_outputs(backend) elif isinstance(s, File): names.append(s.fname) else: raise AssertionError('Unknown source type: {!r}'.format(s)) return names -def load(build_dir): +def load(build_dir: str) -> Build: filename = os.path.join(build_dir, 'meson-private', 'build.dat') load_fail_msg = 'Build data file {!r} is corrupted. Try with a fresh build tree.'.format(filename) nonexisting_fail_msg = 'No such build data file as "{!r}".'.format(filename) @@ -2273,8 +2435,13 @@ obj = pickle.load(f) except FileNotFoundError: raise MesonException(nonexisting_fail_msg) - except pickle.UnpicklingError: + except (pickle.UnpicklingError, EOFError): raise MesonException(load_fail_msg) + except AttributeError: + raise MesonException( + "Build data file {!r} references functions or classes that don't " + "exist. This probably means that it was generated with an old " + "version of meson. Try running meson {} --wipe".format(filename, build_dir)) if not isinstance(obj, Build): raise MesonException(load_fail_msg) return obj diff -Nru meson-0.49.0/mesonbuild/cmake/client.py meson-0.52.1/mesonbuild/cmake/client.py --- meson-0.49.0/mesonbuild/cmake/client.py 1970-01-01 00:00:00.000000000 +0000 +++ meson-0.52.1/mesonbuild/cmake/client.py 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,510 @@ +# Copyright 2019 The Meson development team + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This class contains the basic functionality needed to run any interpreter +# or an interpreter-based tool. + +from .common import CMakeException +from .executor import CMakeExecutor +from ..environment import Environment +from ..mesonlib import MachineChoice +from .. import mlog +from contextlib import contextmanager +from subprocess import Popen, PIPE, TimeoutExpired +from typing import List, Optional +import json +import os + +CMAKE_SERVER_BEGIN_STR = '[== "CMake Server" ==[' +CMAKE_SERVER_END_STR = ']== "CMake Server" ==]' + +CMAKE_MESSAGE_TYPES = { + 'error': ['cookie', 'errorMessage'], + 'hello': ['supportedProtocolVersions'], + 'message': ['cookie', 'message'], + 'progress': ['cookie'], + 'reply': ['cookie', 'inReplyTo'], + 'signal': ['cookie', 'name'], +} + +CMAKE_REPLY_TYPES = { + 'handshake': [], + 'configure': [], + 'compute': [], + 'cmakeInputs': ['buildFiles', 'cmakeRootDirectory', 'sourceDirectory'], + 'codemodel': ['configurations'] +} + +# Base CMake server message classes + +class MessageBase: + def __init__(self, msg_type: str, cookie: str): + self.type = msg_type + self.cookie = cookie + + def to_dict(self) -> dict: + return {'type': self.type, 'cookie': self.cookie} + + def log(self) -> None: + mlog.warning('CMake server message of type', mlog.bold(type(self).__name__), 'has no log function') + +class RequestBase(MessageBase): + cookie_counter = 0 + + def __init__(self, msg_type: str): + super().__init__(msg_type, self.gen_cookie()) + + @staticmethod + def gen_cookie(): + RequestBase.cookie_counter += 1 + return 'meson_{}'.format(RequestBase.cookie_counter) + +class ReplyBase(MessageBase): + def __init__(self, cookie: str, in_reply_to: str): + super().__init__('reply', cookie) + self.in_reply_to = in_reply_to + +class SignalBase(MessageBase): + def __init__(self, cookie: str, signal_name: str): + super().__init__('signal', cookie) + self.signal_name = signal_name + + def log(self) -> None: + mlog.log(mlog.bold('CMake signal:'), mlog.yellow(self.signal_name)) + +# Special Message classes + +class Error(MessageBase): + def __init__(self, cookie: str, message: str): + super().__init__('error', cookie) + self.message = message + + def log(self) -> None: + mlog.error(mlog.bold('CMake server error:'), mlog.red(self.message)) + +class Message(MessageBase): + def __init__(self, cookie: str, message: str): + super().__init__('message', cookie) + self.message = message + + def log(self) -> None: + #mlog.log(mlog.bold('CMake:'), self.message) + pass + +class Progress(MessageBase): + def __init__(self, cookie: str): + super().__init__('progress', cookie) + + def log(self) -> None: + pass + +class MessageHello(MessageBase): + def __init__(self, supported_protocol_versions: List[dict]): + super().__init__('hello', '') + self.supported_protocol_versions = supported_protocol_versions + + def supports(self, major: int, minor: Optional[int] = None) -> bool: + for i in self.supported_protocol_versions: + if major == i['major']: + if minor is None or minor == i['minor']: + return True + return False + +# Request classes + +class RequestHandShake(RequestBase): + def __init__(self, src_dir: str, build_dir: str, generator: str, vers_major: int, vers_minor: Optional[int] = None): + super().__init__('handshake') + self.src_dir = src_dir + self.build_dir = build_dir + self.generator = generator + self.vers_major = vers_major + self.vers_minor = vers_minor + + def to_dict(self) -> dict: + vers = {'major': self.vers_major} + if self.vers_minor is not None: + vers['minor'] = self.vers_minor + + # Old CMake versions (3.7) want '/' even on Windows + src_list = os.path.normpath(self.src_dir).split(os.sep) + bld_list = os.path.normpath(self.build_dir).split(os.sep) + + return { + **super().to_dict(), + 'sourceDirectory': '/'.join(src_list), + 'buildDirectory': '/'.join(bld_list), + 'generator': self.generator, + 'protocolVersion': vers + } + +class RequestConfigure(RequestBase): + def __init__(self, args: Optional[List[str]] = None): + super().__init__('configure') + self.args = args + + def to_dict(self) -> dict: + res = super().to_dict() + if self.args: + res['cacheArguments'] = self.args + return res + +class RequestCompute(RequestBase): + def __init__(self): + super().__init__('compute') + +class RequestCMakeInputs(RequestBase): + def __init__(self): + super().__init__('cmakeInputs') + +class RequestCodeModel(RequestBase): + def __init__(self): + super().__init__('codemodel') + +# Reply classes + +class ReplyHandShake(ReplyBase): + def __init__(self, cookie: str): + super().__init__(cookie, 'handshake') + +class ReplyConfigure(ReplyBase): + def __init__(self, cookie: str): + super().__init__(cookie, 'configure') + +class ReplyCompute(ReplyBase): + def __init__(self, cookie: str): + super().__init__(cookie, 'compute') + +class CMakeBuildFile: + def __init__(self, file: str, is_cmake: bool, is_temp: bool): + self.file = file + self.is_cmake = is_cmake + self.is_temp = is_temp + + def __repr__(self): + return '<{}: {}; cmake={}; temp={}>'.format(self.__class__.__name__, self.file, self.is_cmake, self.is_temp) + +class ReplyCMakeInputs(ReplyBase): + def __init__(self, cookie: str, cmake_root: str, src_dir: str, build_files: List[CMakeBuildFile]): + super().__init__(cookie, 'cmakeInputs') + self.cmake_root = cmake_root + self.src_dir = src_dir + self.build_files = build_files + + def log(self) -> None: + mlog.log('CMake root: ', mlog.bold(self.cmake_root)) + mlog.log('Source dir: ', mlog.bold(self.src_dir)) + mlog.log('Build files:', mlog.bold(str(len(self.build_files)))) + with mlog.nested(): + for i in self.build_files: + mlog.log(str(i)) + +def _flags_to_list(raw: str) -> List[str]: + # Convert a raw commandline string into a list of strings + res = [] + curr = '' + escape = False + in_string = False + for i in raw: + if escape: + # If the current char is not a quote, the '\' is probably important + if i not in ['"', "'"]: + curr += '\\' + curr += i + escape = False + elif i == '\\': + escape = True + elif i in ['"', "'"]: + in_string = not in_string + elif i in [' ', '\n']: + if in_string: + curr += i + else: + res += [curr] + curr = '' + else: + curr += i + res += [curr] + res = list(filter(lambda x: len(x) > 0, res)) + return res + +class CMakeFileGroup: + def __init__(self, data: dict): + self.defines = data.get('defines', '') + self.flags = _flags_to_list(data.get('compileFlags', '')) + self.includes = data.get('includePath', []) + self.is_generated = data.get('isGenerated', False) + self.language = data.get('language', 'C') + self.sources = data.get('sources', []) + + # Fix the include directories + tmp = [] + for i in self.includes: + if isinstance(i, dict) and 'path' in i: + tmp += [i['path']] + elif isinstance(i, str): + tmp += [i] + self.includes = tmp + + def log(self) -> None: + mlog.log('flags =', mlog.bold(', '.join(self.flags))) + mlog.log('defines =', mlog.bold(', '.join(self.defines))) + mlog.log('includes =', mlog.bold(', '.join(self.includes))) + mlog.log('is_generated =', mlog.bold('true' if self.is_generated else 'false')) + mlog.log('language =', mlog.bold(self.language)) + mlog.log('sources:') + for i in self.sources: + with mlog.nested(): + mlog.log(i) + +class CMakeTarget: + def __init__(self, data: dict): + self.artifacts = data.get('artifacts', []) + self.src_dir = data.get('sourceDirectory', '') + self.build_dir = data.get('buildDirectory', '') + self.name = data.get('name', '') + self.full_name = data.get('fullName', '') + self.install = data.get('hasInstallRule', False) + self.install_paths = list(set(data.get('installPaths', []))) + self.link_lang = data.get('linkerLanguage', '') + self.link_libraries = _flags_to_list(data.get('linkLibraries', '')) + self.link_flags = _flags_to_list(data.get('linkFlags', '')) + self.link_lang_flags = _flags_to_list(data.get('linkLanguageFlags', '')) + self.link_path = data.get('linkPath', '') + self.type = data.get('type', 'EXECUTABLE') + self.is_generator_provided = data.get('isGeneratorProvided', False) + self.files = [] + + for i in data.get('fileGroups', []): + self.files += [CMakeFileGroup(i)] + + def log(self) -> None: + mlog.log('artifacts =', mlog.bold(', '.join(self.artifacts))) + mlog.log('src_dir =', mlog.bold(self.src_dir)) + mlog.log('build_dir =', mlog.bold(self.build_dir)) + mlog.log('name =', mlog.bold(self.name)) + mlog.log('full_name =', mlog.bold(self.full_name)) + mlog.log('install =', mlog.bold('true' if self.install else 'false')) + mlog.log('install_paths =', mlog.bold(', '.join(self.install_paths))) + mlog.log('link_lang =', mlog.bold(self.link_lang)) + mlog.log('link_libraries =', mlog.bold(', '.join(self.link_libraries))) + mlog.log('link_flags =', mlog.bold(', '.join(self.link_flags))) + mlog.log('link_lang_flags =', mlog.bold(', '.join(self.link_lang_flags))) + mlog.log('link_path =', mlog.bold(self.link_path)) + mlog.log('type =', mlog.bold(self.type)) + mlog.log('is_generator_provided =', mlog.bold('true' if self.is_generator_provided else 'false')) + for idx, i in enumerate(self.files): + mlog.log('Files {}:'.format(idx)) + with mlog.nested(): + i.log() + +class CMakeProject: + def __init__(self, data: dict): + self.src_dir = data.get('sourceDirectory', '') + self.build_dir = data.get('buildDirectory', '') + self.name = data.get('name', '') + self.targets = [] + + for i in data.get('targets', []): + self.targets += [CMakeTarget(i)] + + def log(self) -> None: + mlog.log('src_dir =', mlog.bold(self.src_dir)) + mlog.log('build_dir =', mlog.bold(self.build_dir)) + mlog.log('name =', mlog.bold(self.name)) + for idx, i in enumerate(self.targets): + mlog.log('Target {}:'.format(idx)) + with mlog.nested(): + i.log() + +class CMakeConfiguration: + def __init__(self, data: dict): + self.name = data.get('name', '') + self.projects = [] + for i in data.get('projects', []): + self.projects += [CMakeProject(i)] + + def log(self) -> None: + mlog.log('name =', mlog.bold(self.name)) + for idx, i in enumerate(self.projects): + mlog.log('Project {}:'.format(idx)) + with mlog.nested(): + i.log() + +class ReplyCodeModel(ReplyBase): + def __init__(self, data: dict): + super().__init__(data['cookie'], 'codemodel') + self.configs = [] + for i in data['configurations']: + self.configs += [CMakeConfiguration(i)] + + def log(self) -> None: + mlog.log('CMake code mode:') + for idx, i in enumerate(self.configs): + mlog.log('Configuration {}:'.format(idx)) + with mlog.nested(): + i.log() + +# Main client class + +class CMakeClient: + def __init__(self, env: Environment): + self.env = env + self.proc = None + self.type_map = { + 'error': lambda data: Error(data['cookie'], data['errorMessage']), + 'hello': lambda data: MessageHello(data['supportedProtocolVersions']), + 'message': lambda data: Message(data['cookie'], data['message']), + 'progress': lambda data: Progress(data['cookie']), + 'reply': self.resolve_type_reply, + 'signal': lambda data: SignalBase(data['cookie'], data['name']) + } + + self.reply_map = { + 'handshake': lambda data: ReplyHandShake(data['cookie']), + 'configure': lambda data: ReplyConfigure(data['cookie']), + 'compute': lambda data: ReplyCompute(data['cookie']), + 'cmakeInputs': self.resolve_reply_cmakeInputs, + 'codemodel': lambda data: ReplyCodeModel(data), + } + + def readMessageRaw(self) -> dict: + assert(self.proc is not None) + rawData = [] + begin = False + while self.proc.poll() is None: + line = self.proc.stdout.readline() + if not line: + break + line = line.decode('utf-8') + line = line.strip() + + if begin and line == CMAKE_SERVER_END_STR: + break # End of the message + elif begin: + rawData += [line] + elif line == CMAKE_SERVER_BEGIN_STR: + begin = True # Begin of the message + + if rawData: + return json.loads('\n'.join(rawData)) + raise CMakeException('Failed to read data from the CMake server') + + def readMessage(self) -> MessageBase: + raw_data = self.readMessageRaw() + if 'type' not in raw_data: + raise CMakeException('The "type" attribute is missing from the message') + msg_type = raw_data['type'] + func = self.type_map.get(msg_type, None) + if not func: + raise CMakeException('Recieved unknown message type "{}"'.format(msg_type)) + for i in CMAKE_MESSAGE_TYPES[msg_type]: + if i not in raw_data: + raise CMakeException('Key "{}" is missing from CMake server message type {}'.format(i, msg_type)) + return func(raw_data) + + def writeMessage(self, msg: MessageBase) -> None: + raw_data = '\n{}\n{}\n{}\n'.format(CMAKE_SERVER_BEGIN_STR, json.dumps(msg.to_dict(), indent=2), CMAKE_SERVER_END_STR) + self.proc.stdin.write(raw_data.encode('ascii')) + self.proc.stdin.flush() + + def query(self, request: RequestBase) -> MessageBase: + self.writeMessage(request) + while True: + reply = self.readMessage() + if reply.cookie == request.cookie and reply.type in ['reply', 'error']: + return reply + + reply.log() + + def query_checked(self, request: RequestBase, message: str) -> ReplyBase: + reply = self.query(request) + h = mlog.green('SUCCEEDED') if reply.type == 'reply' else mlog.red('FAILED') + mlog.log(message + ':', h) + if reply.type != 'reply': + reply.log() + raise CMakeException('CMake server query failed') + return reply + + def do_handshake(self, src_dir: str, build_dir: str, generator: str, vers_major: int, vers_minor: Optional[int] = None) -> None: + # CMake prints the hello message on startup + msg = self.readMessage() + if not isinstance(msg, MessageHello): + raise CMakeException('Recieved an unexpected message from the CMake server') + + request = RequestHandShake(src_dir, build_dir, generator, vers_major, vers_minor) + self.query_checked(request, 'CMake server handshake') + + def resolve_type_reply(self, data: dict) -> ReplyBase: + reply_type = data['inReplyTo'] + func = self.reply_map.get(reply_type, None) + if not func: + raise CMakeException('Recieved unknown reply type "{}"'.format(reply_type)) + for i in ['cookie'] + CMAKE_REPLY_TYPES[reply_type]: + if i not in data: + raise CMakeException('Key "{}" is missing from CMake server message type {}'.format(i, type)) + return func(data) + + def resolve_reply_cmakeInputs(self, data: dict) -> ReplyCMakeInputs: + files = [] + for i in data['buildFiles']: + for j in i['sources']: + files += [CMakeBuildFile(j, i['isCMake'], i['isTemporary'])] + return ReplyCMakeInputs(data['cookie'], data['cmakeRootDirectory'], data['sourceDirectory'], files) + + @contextmanager + def connect(self): + self.startup() + try: + yield + finally: + self.shutdown() + + def startup(self) -> None: + if self.proc is not None: + raise CMakeException('The CMake server was already started') + for_machine = MachineChoice.HOST # TODO make parameter + cmake_exe = CMakeExecutor(self.env, '>=3.7', for_machine) + if not cmake_exe.found(): + raise CMakeException('Unable to find CMake') + + mlog.debug('Starting CMake server with CMake', mlog.bold(' '.join(cmake_exe.get_command())), 'version', mlog.cyan(cmake_exe.version())) + self.proc = Popen(cmake_exe.get_command() + ['-E', 'server', '--experimental', '--debug'], stdin=PIPE, stdout=PIPE) + + def shutdown(self) -> None: + if self.proc is None: + return + + mlog.debug('Shutting down the CMake server') + + # Close the pipes to exit + self.proc.stdin.close() + self.proc.stdout.close() + + # Wait for CMake to finish + try: + self.proc.wait(timeout=2) + except TimeoutExpired: + # Terminate CMake if there is a timeout + # terminate() may throw a platform specific exception if the process has already + # terminated. This may be the case if there is a race condition (CMake exited after + # the timeout but before the terminate() call). Additionally, this behavior can + # also be triggered on cygwin if CMake crashes. + # See https://github.com/mesonbuild/meson/pull/4969#issuecomment-499413233 + try: + self.proc.terminate() + except Exception: + pass + + self.proc = None diff -Nru meson-0.49.0/mesonbuild/cmake/common.py meson-0.52.1/mesonbuild/cmake/common.py --- meson-0.49.0/mesonbuild/cmake/common.py 1970-01-01 00:00:00.000000000 +0000 +++ meson-0.52.1/mesonbuild/cmake/common.py 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,21 @@ +# Copyright 2019 The Meson development team + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This class contains the basic functionality needed to run any interpreter +# or an interpreter-based tool. + +from ..mesonlib import MesonException + +class CMakeException(MesonException): + pass diff -Nru meson-0.49.0/mesonbuild/cmake/data/run_ctgt.py meson-0.52.1/mesonbuild/cmake/data/run_ctgt.py --- meson-0.49.0/mesonbuild/cmake/data/run_ctgt.py 1970-01-01 00:00:00.000000000 +0000 +++ meson-0.52.1/mesonbuild/cmake/data/run_ctgt.py 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,59 @@ +#!/usr/bin/env python3 + +import argparse +import subprocess +import shutil +import os +import sys + +commands = [[]] +SEPERATOR = ';;;' + +# Generate CMD parameters +parser = argparse.ArgumentParser(description='Wrapper for add_custom_command') +parser.add_argument('-d', '--directory', type=str, metavar='D', required=True, help='Working directory to cwd to') +parser.add_argument('-o', '--outputs', nargs='+', metavar='O', required=True, help='Expected output files') +parser.add_argument('-O', '--original-outputs', nargs='+', metavar='O', required=True, help='Output files expected by CMake') +parser.add_argument('commands', nargs=argparse.REMAINDER, help='A "{}" seperated list of commands'.format(SEPERATOR)) + +# Parse +args = parser.parse_args() + +if len(args.outputs) != len(args.original_outputs): + print('Length of output list and original output list differ') + sys.exit(1) + +for i in args.commands: + if i == SEPERATOR: + commands += [[]] + continue + + commands[-1] += [i] + +# Execute +for i in commands: + # Skip empty lists + if not i: + continue + + subprocess.run(i, cwd=args.directory) + +# Copy outputs +zipped_outputs = zip(args.outputs, args.original_outputs) +for expected, generated in zipped_outputs: + do_copy = False + if not os.path.exists(expected): + if not os.path.exists(generated): + print('Unable to find generated file. This can cause the build to fail:') + print(generated) + do_copy = False + else: + do_copy = True + elif os.path.exists(generated): + if os.path.getmtime(generated) > os.path.getmtime(expected): + do_copy = True + + if do_copy: + if os.path.exists(expected): + os.remove(expected) + shutil.copyfile(generated, expected) diff -Nru meson-0.49.0/mesonbuild/cmake/executor.py meson-0.52.1/mesonbuild/cmake/executor.py --- meson-0.49.0/mesonbuild/cmake/executor.py 1970-01-01 00:00:00.000000000 +0000 +++ meson-0.52.1/mesonbuild/cmake/executor.py 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,262 @@ +# Copyright 2019 The Meson development team + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This class contains the basic functionality needed to run any interpreter +# or an interpreter-based tool. + +from .. import mlog, mesonlib +from ..mesonlib import PerMachine, Popen_safe, version_compare, MachineChoice +from ..environment import Environment + +from typing import List, Tuple, Optional, TYPE_CHECKING + +if TYPE_CHECKING: + from ..dependencies.base import ExternalProgram + +import re, os, shutil, ctypes + +class CMakeExecutor: + # The class's copy of the CMake path. Avoids having to search for it + # multiple times in the same Meson invocation. + class_cmakebin = PerMachine(None, None) + class_cmakevers = PerMachine(None, None) + class_cmake_cache = {} + + def __init__(self, environment: Environment, version: str, for_machine: MachineChoice, silent: bool = False): + self.min_version = version + self.environment = environment + self.for_machine = for_machine + self.cmakebin, self.cmakevers = self.find_cmake_binary(self.environment, silent=silent) + if self.cmakebin is False: + self.cmakebin = None + return + + if not version_compare(self.cmakevers, self.min_version): + mlog.warning( + 'The version of CMake', mlog.bold(self.cmakebin.get_path()), + 'is', mlog.bold(self.cmakevers), 'but version', mlog.bold(self.min_version), + 'is required') + self.cmakebin = None + return + + def find_cmake_binary(self, environment: Environment, silent: bool = False) -> Tuple['ExternalProgram', str]: + from ..dependencies.base import ExternalProgram + + # Create an iterator of options + def search(): + # Lookup in cross or machine file. + potential_cmakepath = environment.binaries[self.for_machine].lookup_entry('cmake') + if potential_cmakepath is not None: + mlog.debug('CMake binary for %s specified from cross file, native file, or env var as %s.', self.for_machine, potential_cmakepath) + yield ExternalProgram.from_entry('cmake', potential_cmakepath) + # We never fallback if the user-specified option is no good, so + # stop returning options. + return + mlog.debug('CMake binary missing from cross or native file, or env var undefined.') + # Fallback on hard-coded defaults. + # TODO prefix this for the cross case instead of ignoring thing. + if environment.machines.matches_build_machine(self.for_machine): + for potential_cmakepath in environment.default_cmake: + mlog.debug('Trying a default CMake fallback at', potential_cmakepath) + yield ExternalProgram(potential_cmakepath, silent=True) + + # Only search for CMake the first time and store the result in the class + # definition + if CMakeExecutor.class_cmakebin[self.for_machine] is False: + mlog.debug('CMake binary for %s is cached as not found' % self.for_machine) + elif CMakeExecutor.class_cmakebin[self.for_machine] is not None: + mlog.debug('CMake binary for %s is cached.' % self.for_machine) + else: + assert CMakeExecutor.class_cmakebin[self.for_machine] is None + mlog.debug('CMake binary for %s is not cached' % self.for_machine) + for potential_cmakebin in search(): + mlog.debug('Trying CMake binary {} for machine {} at {}' + .format(potential_cmakebin.name, self.for_machine, potential_cmakebin.command)) + version_if_ok = self.check_cmake(potential_cmakebin) + if not version_if_ok: + continue + if not silent: + mlog.log('Found CMake:', mlog.bold(potential_cmakebin.get_path()), + '(%s)' % version_if_ok) + CMakeExecutor.class_cmakebin[self.for_machine] = potential_cmakebin + CMakeExecutor.class_cmakevers[self.for_machine] = version_if_ok + break + else: + if not silent: + mlog.log('Found CMake:', mlog.red('NO')) + # Set to False instead of None to signify that we've already + # searched for it and not found it + CMakeExecutor.class_cmakebin[self.for_machine] = False + CMakeExecutor.class_cmakevers[self.for_machine] = None + + return CMakeExecutor.class_cmakebin[self.for_machine], CMakeExecutor.class_cmakevers[self.for_machine] + + def check_cmake(self, cmakebin: 'ExternalProgram') -> Optional[str]: + if not cmakebin.found(): + mlog.log('Did not find CMake {!r}'.format(cmakebin.name)) + return None + try: + p, out = Popen_safe(cmakebin.get_command() + ['--version'])[0:2] + if p.returncode != 0: + mlog.warning('Found CMake {!r} but couldn\'t run it' + ''.format(' '.join(cmakebin.get_command()))) + return None + except FileNotFoundError: + mlog.warning('We thought we found CMake {!r} but now it\'s not there. How odd!' + ''.format(' '.join(cmakebin.get_command()))) + return None + except PermissionError: + msg = 'Found CMake {!r} but didn\'t have permissions to run it.'.format(' '.join(cmakebin.get_command())) + if not mesonlib.is_windows(): + msg += '\n\nOn Unix-like systems this is often caused by scripts that are not executable.' + mlog.warning(msg) + return None + cmvers = re.sub(r'\s*cmake version\s*', '', out.split('\n')[0]).strip() + return cmvers + + def _cache_key(self, args: List[str], build_dir: str, env): + fenv = frozenset(env.items()) if env is not None else None + targs = tuple(args) + return (self.cmakebin, targs, build_dir, fenv) + + def _call_real(self, args: List[str], build_dir: str, env) -> Tuple[int, str, str]: + os.makedirs(build_dir, exist_ok=True) + cmd = self.cmakebin.get_command() + args + p, out, err = Popen_safe(cmd, env=env, cwd=build_dir) + rc = p.returncode + call = ' '.join(cmd) + mlog.debug("Called `{}` in {} -> {}".format(call, build_dir, rc)) + return rc, out, err + + def call(self, args: List[str], build_dir: str, env=None, disable_cache: bool = False): + if env is None: + env = os.environ + + if disable_cache: + return self._call_real(args, build_dir, env) + + # First check if cached, if not call the real cmake function + cache = CMakeExecutor.class_cmake_cache + key = self._cache_key(args, build_dir, env) + if key not in cache: + cache[key] = self._call_real(args, build_dir, env) + return cache[key] + + def call_with_fake_build(self, args: List[str], build_dir: str, env=None): + # First check the cache + cache = CMakeExecutor.class_cmake_cache + key = self._cache_key(args, build_dir, env) + if key in cache: + return cache[key] + + os.makedirs(build_dir, exist_ok=True) + + # Try to set the correct compiler for C and C++ + # This step is required to make try_compile work inside CMake + fallback = os.path.realpath(__file__) # A file used as a fallback wehen everything else fails + compilers = self.environment.coredata.compilers[MachineChoice.BUILD] + + def make_abs(exe: str, lang: str): + if os.path.isabs(exe): + return exe + + p = shutil.which(exe) + if p is None: + mlog.debug('Failed to find a {} compiler for CMake. This might cause CMake to fail.'.format(lang)) + p = fallback + return p + + def choose_compiler(lang: str): + exe_list = [] + if lang in compilers: + exe_list = compilers[lang].get_exelist() + else: + comp_obj = self.environment.compiler_from_language(lang, MachineChoice.BUILD) + if comp_obj is not None: + exe_list = comp_obj.get_exelist() + + if len(exe_list) == 1: + return make_abs(exe_list[0], lang), '' + elif len(exe_list) == 2: + return make_abs(exe_list[1], lang), make_abs(exe_list[0], lang) + else: + mlog.debug('Failed to find a {} compiler for CMake. This might cause CMake to fail.'.format(lang)) + return fallback, '' + + c_comp, c_launcher = choose_compiler('c') + cxx_comp, cxx_launcher = choose_compiler('cpp') + + # on Windows, choose_compiler returns path with \ as separator - replace by / before writing to CMAKE file + c_comp = c_comp.replace('\\', '/') + c_launcher = c_launcher.replace('\\', '/') + cxx_comp = cxx_comp.replace('\\', '/') + cxx_launcher = cxx_launcher.replace('\\', '/') + + # Reset the CMake cache + with open('{}/CMakeCache.txt'.format(build_dir), 'w') as fp: + fp.write('CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1\n') + + # Fake the compiler files + comp_dir = '{}/CMakeFiles/{}'.format(build_dir, self.cmakevers) + os.makedirs(comp_dir, exist_ok=True) + + c_comp_file = '{}/CMakeCCompiler.cmake'.format(comp_dir) + cxx_comp_file = '{}/CMakeCXXCompiler.cmake'.format(comp_dir) + + if not os.path.exists(c_comp_file): + with open(c_comp_file, 'w') as fp: + fp.write('''# Fake CMake file to skip the boring and slow stuff +set(CMAKE_C_COMPILER "{}") # Should be a valid compiler for try_compile, etc. +set(CMAKE_C_COMPILER_LAUNCHER "{}") # The compiler launcher (if presentt) +set(CMAKE_C_COMPILER_ID "GNU") # Pretend we have found GCC +set(CMAKE_COMPILER_IS_GNUCC 1) +set(CMAKE_C_COMPILER_LOADED 1) +set(CMAKE_C_COMPILER_WORKS TRUE) +set(CMAKE_C_ABI_COMPILED TRUE) +set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) +set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) +set(CMAKE_SIZEOF_VOID_P "{}") +'''.format(c_comp, c_launcher, ctypes.sizeof(ctypes.c_voidp))) + + if not os.path.exists(cxx_comp_file): + with open(cxx_comp_file, 'w') as fp: + fp.write('''# Fake CMake file to skip the boring and slow stuff +set(CMAKE_CXX_COMPILER "{}") # Should be a valid compiler for try_compile, etc. +set(CMAKE_CXX_COMPILER_LAUNCHER "{}") # The compiler launcher (if presentt) +set(CMAKE_CXX_COMPILER_ID "GNU") # Pretend we have found GCC +set(CMAKE_COMPILER_IS_GNUCXX 1) +set(CMAKE_CXX_COMPILER_LOADED 1) +set(CMAKE_CXX_COMPILER_WORKS TRUE) +set(CMAKE_CXX_ABI_COMPILED TRUE) +set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) +set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;mm;CPP) +set(CMAKE_SIZEOF_VOID_P "{}") +'''.format(cxx_comp, cxx_launcher, ctypes.sizeof(ctypes.c_voidp))) + + return self.call(args, build_dir, env) + + def found(self) -> bool: + return self.cmakebin is not None + + def version(self) -> str: + return self.cmakevers + + def executable_path(self) -> str: + return self.cmakebin.get_path() + + def get_command(self): + return self.cmakebin.get_command() + + def machine_choice(self) -> MachineChoice: + return self.for_machine diff -Nru meson-0.49.0/mesonbuild/cmake/generator.py meson-0.52.1/mesonbuild/cmake/generator.py --- meson-0.49.0/mesonbuild/cmake/generator.py 1970-01-01 00:00:00.000000000 +0000 +++ meson-0.52.1/mesonbuild/cmake/generator.py 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,129 @@ +# Copyright 2019 The Meson development team + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from .. import mesonlib + +def parse_generator_expressions(raw: str) -> str: + '''Parse CMake generator expressions + + Most generator expressions are simply ignored for + simplicety, however some are required for some common + use cases. + ''' + + out = '' # type: str + i = 0 # type: int + + def equal(arg: str) -> str: + col_pos = arg.find(',') + if col_pos < 0: + return '0' + else: + return '1' if arg[:col_pos] == arg[col_pos + 1:] else '0' + + def vers_comp(op: str, arg: str) -> str: + col_pos = arg.find(',') + if col_pos < 0: + return '0' + else: + return '1' if mesonlib.version_compare(arg[:col_pos], '{}{}'.format(op, arg[col_pos + 1:])) else '0' + + supported = { + # Boolean functions + 'BOOL': lambda x: '0' if x.upper() in ['0', 'FALSE', 'OFF', 'N', 'NO', 'IGNORE', 'NOTFOUND'] or x.endswith('-NOTFOUND') else '1', + 'AND': lambda x: '1' if all([y == '1' for y in x.split(',')]) else '0', + 'OR': lambda x: '1' if any([y == '1' for y in x.split(',')]) else '0', + 'NOT': lambda x: '0' if x == '1' else '1', + + '0': lambda x: '', + '1': lambda x: x, + + # String operations + 'STREQUAL': equal, + 'EQUAL': equal, + 'VERSION_LESS': lambda x: vers_comp('<', x), + 'VERSION_GREATER': lambda x: vers_comp('>', x), + 'VERSION_EQUAL': lambda x: vers_comp('=', x), + 'VERSION_LESS_EQUAL': lambda x: vers_comp('<=', x), + 'VERSION_GREATER_EQUAL': lambda x: vers_comp('>=', x), + + # String modification + 'LOWER_CASE': lambda x: x.lower(), + 'UPPER_CASE': lambda x: x.upper(), + + # Always assume the BUILD_INTERFACE is valid. + # INSTALL_INTERFACE is always invalid for subprojects and + # it should also never appear in CMake config files, used + # for dependencies + 'INSTALL_INTERFACE': lambda x: '', + 'BUILD_INTERFACE': lambda x: x, + + # Constants + 'ANGLE-R': lambda x: '>', + 'COMMA': lambda x: ',', + 'SEMICOLON': lambda x: ';', + } + + # Recursively evaluate generator expressions + def eval_generator_expressions() -> str: + nonlocal i + i += 2 + + func = '' # type: str + args = '' # type: str + res = '' # type: str + exp = '' # type: str + + # Determine the body of the expression + while i < len(raw): + if raw[i] == '>': + # End of the generator expression + break + elif i < len(raw) - 1 and raw[i] == '$' and raw[i + 1] == '<': + # Nested generator expression + exp += eval_generator_expressions() + else: + # Generator expression body + exp += raw[i] + + i += 1 + + # Split the expression into a function and arguments part + col_pos = exp.find(':') + if col_pos < 0: + func = exp + else: + func = exp[:col_pos] + args = exp[col_pos + 1:] + + func = func.strip() + args = args.strip() + + # Evaluate the function + if func in supported: + res = supported[func](args) + + return res + + while i < len(raw): + if i < len(raw) - 1 and raw[i] == '$' and raw[i + 1] == '<': + # Generator expression detected --> try resolving it + out += eval_generator_expressions() + else: + # Normal string, leave unchanged + out += raw[i] + + i += 1 + + return out diff -Nru meson-0.49.0/mesonbuild/cmake/__init__.py meson-0.52.1/mesonbuild/cmake/__init__.py --- meson-0.49.0/mesonbuild/cmake/__init__.py 1970-01-01 00:00:00.000000000 +0000 +++ meson-0.52.1/mesonbuild/cmake/__init__.py 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,34 @@ +# Copyright 2019 The Meson development team + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This class contains the basic functionality needed to run any interpreter +# or an interpreter-based tool. + +__all__ = [ + 'CMakeClient', + 'CMakeExecutor', + 'CMakeException', + 'CMakeInterpreter', + 'CMakeTarget', + 'CMakeTraceLine', + 'CMakeTraceParser', + 'parse_generator_expressions', +] + +from .common import CMakeException +from .client import CMakeClient +from .executor import CMakeExecutor +from .generator import parse_generator_expressions +from .interpreter import CMakeInterpreter +from .traceparser import CMakeTarget, CMakeTraceLine, CMakeTraceParser diff -Nru meson-0.49.0/mesonbuild/cmake/interpreter.py meson-0.52.1/mesonbuild/cmake/interpreter.py --- meson-0.49.0/mesonbuild/cmake/interpreter.py 1970-01-01 00:00:00.000000000 +0000 +++ meson-0.52.1/mesonbuild/cmake/interpreter.py 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,919 @@ +# Copyright 2019 The Meson development team + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This class contains the basic functionality needed to run any interpreter +# or an interpreter-based tool. + +from .common import CMakeException +from .client import CMakeClient, RequestCMakeInputs, RequestConfigure, RequestCompute, RequestCodeModel, CMakeTarget +from .executor import CMakeExecutor +from .traceparser import CMakeTraceParser, CMakeGeneratorTarget +from .. import mlog +from ..environment import Environment +from ..mesonlib import MachineChoice +from ..compilers.compilers import lang_suffixes, header_suffixes, obj_suffixes, lib_suffixes, is_header +from subprocess import Popen, PIPE +from typing import Any, List, Dict, Optional, TYPE_CHECKING +from threading import Thread +import os, re + +from ..mparser import ( + Token, + BaseNode, + CodeBlockNode, + FunctionNode, + ArrayNode, + ArgumentNode, + AssignmentNode, + BooleanNode, + StringNode, + IdNode, + IndexNode, + MethodNode, + NumberNode, +) + + +if TYPE_CHECKING: + from ..build import Build + from ..backend.backends import Backend + +# Disable all warnings automaticall enabled with --trace and friends +# See https://cmake.org/cmake/help/latest/variable/CMAKE_POLICY_WARNING_CMPNNNN.html +disable_policy_warnings = [ + 'CMP0025', + 'CMP0047', + 'CMP0056', + 'CMP0060', + 'CMP0065', + 'CMP0066', + 'CMP0067', + 'CMP0082', + 'CMP0089', +] + +backend_generator_map = { + 'ninja': 'Ninja', + 'xcode': 'Xcode', + 'vs2010': 'Visual Studio 10 2010', + 'vs2015': 'Visual Studio 15 2017', + 'vs2017': 'Visual Studio 15 2017', + 'vs2019': 'Visual Studio 16 2019', +} + +language_map = { + 'c': 'C', + 'cpp': 'CXX', + 'cuda': 'CUDA', + 'cs': 'CSharp', + 'java': 'Java', + 'fortran': 'Fortran', + 'swift': 'Swift', +} + +target_type_map = { + 'STATIC_LIBRARY': 'static_library', + 'MODULE_LIBRARY': 'shared_module', + 'SHARED_LIBRARY': 'shared_library', + 'EXECUTABLE': 'executable', + 'OBJECT_LIBRARY': 'static_library', + 'INTERFACE_LIBRARY': 'header_only' +} + +target_type_requires_trace = ['INTERFACE_LIBRARY'] + +skip_targets = ['UTILITY'] + +blacklist_compiler_flags = [ + '-Wall', '-Wextra', '-Weverything', '-Werror', '-Wpedantic', '-pedantic', '-w', + '/W1', '/W2', '/W3', '/W4', '/Wall', '/WX', '/w', + '/O1', '/O2', '/Ob', '/Od', '/Og', '/Oi', '/Os', '/Ot', '/Ox', '/Oy', '/Ob0', + '/RTC1', '/RTCc', '/RTCs', '/RTCu', + '/Z7', '/Zi', '/ZI', +] + +blacklist_link_flags = [ + '/machine:x64', '/machine:x86', '/machine:arm', '/machine:ebc', + '/debug', '/debug:fastlink', '/debug:full', '/debug:none', + '/incremental', +] + +blacklist_clang_cl_link_flags = ['/GR', '/EHsc', '/MDd', '/Zi', '/RTC1'] + +blacklist_link_libs = [ + 'kernel32.lib', + 'user32.lib', + 'gdi32.lib', + 'winspool.lib', + 'shell32.lib', + 'ole32.lib', + 'oleaut32.lib', + 'uuid.lib', + 'comdlg32.lib', + 'advapi32.lib' +] + +# Utility functions to generate local keys +def _target_key(tgt_name: str) -> str: + return '__tgt_{}__'.format(tgt_name) + +def _generated_file_key(fname: str) -> str: + return '__gen_{}__'.format(os.path.basename(fname)) + +class ConverterTarget: + lang_cmake_to_meson = {val.lower(): key for key, val in language_map.items()} + rm_so_version = re.compile(r'(\.[0-9]+)+$') + + def __init__(self, target: CMakeTarget, env: Environment): + self.env = env + self.artifacts = target.artifacts + self.src_dir = target.src_dir + self.build_dir = target.build_dir + self.name = target.name + self.full_name = target.full_name + self.type = target.type + self.install = target.install + self.install_dir = '' + self.link_libraries = target.link_libraries + self.link_flags = target.link_flags + target.link_lang_flags + + if target.install_paths: + self.install_dir = target.install_paths[0] + + self.languages = [] + self.sources = [] + self.generated = [] + self.includes = [] + self.link_with = [] + self.object_libs = [] + self.compile_opts = {} + self.public_compile_opts = [] + self.pie = False + + # Project default override options (c_std, cpp_std, etc.) + self.override_options = [] + + for i in target.files: + # Determine the meson language + lang = ConverterTarget.lang_cmake_to_meson.get(i.language.lower(), 'c') + if lang not in self.languages: + self.languages += [lang] + if lang not in self.compile_opts: + self.compile_opts[lang] = [] + + # Add arguments, but avoid duplicates + args = i.flags + args += ['-D{}'.format(x) for x in i.defines] + self.compile_opts[lang] += [x for x in args if x not in self.compile_opts[lang]] + + # Handle include directories + self.includes += [x for x in i.includes if x not in self.includes] + + # Add sources to the right array + if i.is_generated: + self.generated += i.sources + else: + self.sources += i.sources + + def __repr__(self) -> str: + return '<{}: {}>'.format(self.__class__.__name__, self.name) + + std_regex = re.compile(r'([-]{1,2}std=|/std:v?|[-]{1,2}std:)(.*)') + + def postprocess(self, output_target_map: dict, root_src_dir: str, subdir: str, install_prefix: str, trace: CMakeTraceParser) -> None: + # Detect setting the C and C++ standard + for i in ['c', 'cpp']: + if i not in self.compile_opts: + continue + + temp = [] + for j in self.compile_opts[i]: + m = ConverterTarget.std_regex.match(j) + if m: + self.override_options += ['{}_std={}'.format(i, m.group(2))] + elif j in ['-fPIC', '-fpic', '-fPIE', '-fpie']: + self.pie = True + elif j in blacklist_compiler_flags: + pass + else: + temp += [j] + + self.compile_opts[i] = temp + + # Make sure to force enable -fPIC for OBJECT libraries + if self.type.upper() == 'OBJECT_LIBRARY': + self.pie = True + + # Use the CMake trace, if required + if self.type.upper() in target_type_requires_trace: + if self.name in trace.targets: + props = trace.targets[self.name].properties + + self.includes += props.get('INTERFACE_INCLUDE_DIRECTORIES', []) + self.public_compile_opts += props.get('INTERFACE_COMPILE_DEFINITIONS', []) + self.public_compile_opts += props.get('INTERFACE_COMPILE_OPTIONS', []) + self.link_flags += props.get('INTERFACE_LINK_OPTIONS', []) + else: + mlog.warning('CMake: Target', mlog.bold(self.name), 'not found in CMake trace. This can lead to build errors') + + # Fix link libraries + def try_resolve_link_with(path: str) -> Optional[str]: + basename = os.path.basename(path) + candidates = [basename, ConverterTarget.rm_so_version.sub('', basename)] + for i in lib_suffixes: + if not basename.endswith('.' + i): + continue + new_basename = basename[:-len(i) - 1] + new_basename = ConverterTarget.rm_so_version.sub('', new_basename) + new_basename = '{}.{}'.format(new_basename, i) + candidates += [new_basename] + for i in candidates: + if i in output_target_map: + return output_target_map[i] + return None + + temp = [] + for i in self.link_libraries: + # Let meson handle this arcane magic + if ',-rpath,' in i: + continue + if not os.path.isabs(i): + link_with = try_resolve_link_with(i) + if link_with: + self.link_with += [link_with] + continue + + temp += [i] + self.link_libraries = temp + + # Filter out files that are not supported by the language + supported = list(header_suffixes) + list(obj_suffixes) + for i in self.languages: + supported += list(lang_suffixes[i]) + supported = ['.{}'.format(x) for x in supported] + self.sources = [x for x in self.sources if any([x.endswith(y) for y in supported])] + self.generated = [x for x in self.generated if any([x.endswith(y) for y in supported])] + + # Make paths relative + def rel_path(x: str, is_header: bool, is_generated: bool) -> Optional[str]: + if not os.path.isabs(x): + x = os.path.normpath(os.path.join(self.src_dir, x)) + if not os.path.exists(x) and not any([x.endswith(y) for y in obj_suffixes]) and not is_generated: + mlog.warning('CMake: path', mlog.bold(x), 'does not exist. Ignoring. This can lead to build errors') + return None + if os.path.isabs(x) and os.path.commonpath([x, self.env.get_build_dir()]) == self.env.get_build_dir(): + if is_header: + return os.path.relpath(x, os.path.join(self.env.get_build_dir(), subdir)) + else: + return os.path.relpath(x, root_src_dir) + if os.path.isabs(x) and os.path.commonpath([x, root_src_dir]) == root_src_dir: + return os.path.relpath(x, root_src_dir) + return x + + def custom_target(x: str): + key = _generated_file_key(x) + if key in output_target_map: + ctgt = output_target_map[key] + assert(isinstance(ctgt, ConverterCustomTarget)) + ref = ctgt.get_ref(x) + assert(isinstance(ref, CustomTargetReference) and ref.valid()) + return ref + return x + + build_dir_rel = os.path.relpath(self.build_dir, os.path.join(self.env.get_build_dir(), subdir)) + self.includes = list(set([rel_path(x, True, False) for x in set(self.includes)] + [build_dir_rel])) + self.sources = [rel_path(x, False, False) for x in self.sources] + self.generated = [rel_path(x, False, True) for x in self.generated] + + # Resolve custom targets + self.generated = [custom_target(x) for x in self.generated] + + # Remove delete entries + self.includes = [x for x in self.includes if x is not None] + self.sources = [x for x in self.sources if x is not None] + self.generated = [x for x in self.generated if x is not None] + + # Make sure '.' is always in the include directories + if '.' not in self.includes: + self.includes += ['.'] + + # make install dir relative to the install prefix + if self.install_dir and os.path.isabs(self.install_dir): + if os.path.commonpath([self.install_dir, install_prefix]) == install_prefix: + self.install_dir = os.path.relpath(self.install_dir, install_prefix) + + # Remove blacklisted options and libs + def check_flag(flag: str) -> bool: + if flag.lower() in blacklist_link_flags or flag in blacklist_compiler_flags + blacklist_clang_cl_link_flags: + return False + if flag.startswith('/D'): + return False + return True + + self.link_libraries = [x for x in self.link_libraries if x.lower() not in blacklist_link_libs] + self.link_flags = [x for x in self.link_flags if check_flag(x)] + + def process_object_libs(self, obj_target_list: List['ConverterTarget']): + # Try to detect the object library(s) from the generated input sources + temp = [x for x in self.generated if isinstance(x, str)] + temp = [os.path.basename(x) for x in temp] + temp = [x for x in temp if any([x.endswith('.' + y) for y in obj_suffixes])] + temp = [os.path.splitext(x)[0] for x in temp] + # Temp now stores the source filenames of the object files + for i in obj_target_list: + source_files = [os.path.basename(x) for x in i.sources + i.generated] + for j in source_files: + if j in temp: + self.object_libs += [i] + break + + # Filter out object files from the sources + self.generated = [x for x in self.generated if not isinstance(x, str) or not any([x.endswith('.' + y) for y in obj_suffixes])] + + def meson_func(self) -> str: + return target_type_map.get(self.type.upper()) + + def log(self) -> None: + mlog.log('Target', mlog.bold(self.name)) + mlog.log(' -- artifacts: ', mlog.bold(str(self.artifacts))) + mlog.log(' -- full_name: ', mlog.bold(self.full_name)) + mlog.log(' -- type: ', mlog.bold(self.type)) + mlog.log(' -- install: ', mlog.bold('true' if self.install else 'false')) + mlog.log(' -- install_dir: ', mlog.bold(self.install_dir)) + mlog.log(' -- link_libraries: ', mlog.bold(str(self.link_libraries))) + mlog.log(' -- link_with: ', mlog.bold(str(self.link_with))) + mlog.log(' -- object_libs: ', mlog.bold(str(self.object_libs))) + mlog.log(' -- link_flags: ', mlog.bold(str(self.link_flags))) + mlog.log(' -- languages: ', mlog.bold(str(self.languages))) + mlog.log(' -- includes: ', mlog.bold(str(self.includes))) + mlog.log(' -- sources: ', mlog.bold(str(self.sources))) + mlog.log(' -- generated: ', mlog.bold(str(self.generated))) + mlog.log(' -- pie: ', mlog.bold('true' if self.pie else 'false')) + mlog.log(' -- override_opts: ', mlog.bold(str(self.override_options))) + mlog.log(' -- options:') + for key, val in self.compile_opts.items(): + mlog.log(' -', key, '=', mlog.bold(str(val))) + +class CustomTargetReference: + def __init__(self, ctgt: 'ConverterCustomTarget', index: int): + self.ctgt = ctgt # type: ConverterCustomTarget + self.index = index # type: int + + def __repr__(self) -> str: + if self.valid(): + return '<{}: {} [{}]>'.format(self.__class__.__name__, self.ctgt.name, self.ctgt.outputs[self.index]) + else: + return '<{}: INVALID REFERENCE>'.format(self.__class__.__name__) + + def valid(self) -> bool: + return self.ctgt is not None and self.index >= 0 + + def filename(self) -> str: + return self.ctgt.outputs[self.index] + +class ConverterCustomTarget: + tgt_counter = 0 # type: int + + def __init__(self, target: CMakeGeneratorTarget): + self.name = 'custom_tgt_{}'.format(ConverterCustomTarget.tgt_counter) + self.original_outputs = list(target.outputs) + self.outputs = [os.path.basename(x) for x in self.original_outputs] + self.command = target.command + self.working_dir = target.working_dir + self.depends_raw = target.depends + self.inputs = [] + self.depends = [] + + ConverterCustomTarget.tgt_counter += 1 + + def __repr__(self) -> str: + return '<{}: {}>'.format(self.__class__.__name__, self.outputs) + + def postprocess(self, output_target_map: dict, root_src_dir: str, subdir: str, build_dir: str) -> None: + # Default the working directory to the CMake build dir. This + # is not 100% correct, since it should be the value of + # ${CMAKE_CURRENT_BINARY_DIR} when add_custom_command is + # called. However, keeping track of this variable is not + # trivial and the current solution should work in most cases. + if not self.working_dir: + self.working_dir = build_dir + + # relative paths in the working directory are always relative + # to ${CMAKE_CURRENT_BINARY_DIR} (see note above) + if not os.path.isabs(self.working_dir): + self.working_dir = os.path.normpath(os.path.join(build_dir, self.working_dir)) + + # Modify the original outputs if they are relative. Again, + # relative paths are relative to ${CMAKE_CURRENT_BINARY_DIR} + # and the first disclaimer is stil in effect + def ensure_absolute(x: str): + if os.path.isabs(x): + return x + else: + return os.path.normpath(os.path.join(build_dir, x)) + self.original_outputs = [ensure_absolute(x) for x in self.original_outputs] + + # Check if the command is a build target + commands = [] + for i in self.command: + assert(isinstance(i, list)) + cmd = [] + + for j in i: + target_key = _target_key(j) + if target_key in output_target_map: + cmd += [output_target_map[target_key]] + else: + cmd += [j] + + commands += [cmd] + self.command = commands + + # Check dependencies and input files + for i in self.depends_raw: + tgt_key = _target_key(i) + gen_key = _generated_file_key(i) + + if os.path.basename(i) in output_target_map: + self.depends += [output_target_map[os.path.basename(i)]] + elif tgt_key in output_target_map: + self.depends += [output_target_map[tgt_key]] + elif gen_key in output_target_map: + self.inputs += [output_target_map[gen_key].get_ref(i)] + elif not os.path.isabs(i) and os.path.exists(os.path.join(root_src_dir, i)): + self.inputs += [i] + elif os.path.isabs(i) and os.path.exists(i) and os.path.commonpath([i, root_src_dir]) == root_src_dir: + self.inputs += [os.path.relpath(i, root_src_dir)] + + def get_ref(self, fname: str) -> Optional[CustomTargetReference]: + try: + idx = self.outputs.index(os.path.basename(fname)) + return CustomTargetReference(self, idx) + except ValueError: + return None + + def log(self) -> None: + mlog.log('Custom Target', mlog.bold(self.name)) + mlog.log(' -- command: ', mlog.bold(str(self.command))) + mlog.log(' -- outputs: ', mlog.bold(str(self.outputs))) + mlog.log(' -- working_dir: ', mlog.bold(str(self.working_dir))) + mlog.log(' -- depends_raw: ', mlog.bold(str(self.depends_raw))) + mlog.log(' -- inputs: ', mlog.bold(str(self.inputs))) + mlog.log(' -- depends: ', mlog.bold(str(self.depends))) + +class CMakeInterpreter: + def __init__(self, build: 'Build', subdir: str, src_dir: str, install_prefix: str, env: Environment, backend: 'Backend'): + assert(hasattr(backend, 'name')) + self.build = build + self.subdir = subdir + self.src_dir = src_dir + self.build_dir_rel = os.path.join(subdir, '__CMake_build') + self.build_dir = os.path.join(env.get_build_dir(), self.build_dir_rel) + self.install_prefix = install_prefix + self.env = env + self.backend_name = backend.name + self.client = CMakeClient(self.env) + + # Raw CMake results + self.bs_files = [] + self.codemodel = None + self.raw_trace = None + + # Analysed data + self.project_name = '' + self.languages = [] + self.targets = [] + self.custom_targets = [] # type: List[ConverterCustomTarget] + self.trace = CMakeTraceParser() + + # Generated meson data + self.generated_targets = {} + + def configure(self, extra_cmake_options: List[str]) -> None: + for_machine = MachineChoice.HOST # TODO make parameter + # Find CMake + cmake_exe = CMakeExecutor(self.env, '>=3.7', for_machine) + if not cmake_exe.found(): + raise CMakeException('Unable to find CMake') + + generator = backend_generator_map[self.backend_name] + cmake_args = cmake_exe.get_command() + trace_args = ['--trace', '--trace-expand', '--no-warn-unused-cli'] + cmcmp_args = ['-DCMAKE_POLICY_WARNING_{}=OFF'.format(x) for x in disable_policy_warnings] + + # Map meson compiler to CMake variables + for lang, comp in self.env.coredata.compilers[for_machine].items(): + if lang not in language_map: + continue + cmake_lang = language_map[lang] + exelist = comp.get_exelist() + if len(exelist) == 1: + cmake_args += ['-DCMAKE_{}_COMPILER={}'.format(cmake_lang, exelist[0])] + elif len(exelist) == 2: + cmake_args += ['-DCMAKE_{}_COMPILER_LAUNCHER={}'.format(cmake_lang, exelist[0]), + '-DCMAKE_{}_COMPILER={}'.format(cmake_lang, exelist[1])] + if hasattr(comp, 'get_linker_exelist') and comp.get_id() == 'clang-cl': + cmake_args += ['-DCMAKE_LINKER={}'.format(comp.get_linker_exelist()[0])] + cmake_args += ['-G', generator] + cmake_args += ['-DCMAKE_INSTALL_PREFIX={}'.format(self.install_prefix)] + cmake_args += extra_cmake_options + + # Run CMake + mlog.log() + with mlog.nested(): + mlog.log('Configuring the build directory with', mlog.bold('CMake'), 'version', mlog.cyan(cmake_exe.version())) + mlog.log(mlog.bold('Running:'), ' '.join(cmake_args)) + mlog.log(mlog.bold(' - build directory: '), self.build_dir) + mlog.log(mlog.bold(' - source directory: '), self.src_dir) + mlog.log(mlog.bold(' - trace args: '), ' '.join(trace_args)) + mlog.log(mlog.bold(' - disabled policy warnings:'), '[{}]'.format(', '.join(disable_policy_warnings))) + mlog.log() + os.makedirs(self.build_dir, exist_ok=True) + os_env = os.environ.copy() + os_env['LC_ALL'] = 'C' + final_command = cmake_args + trace_args + cmcmp_args + [self.src_dir] + proc = Popen(final_command, stdout=PIPE, stderr=PIPE, cwd=self.build_dir, env=os_env) + + def print_stdout(): + while True: + line = proc.stdout.readline() + if not line: + break + mlog.log(line.decode('utf-8').strip('\n')) + proc.stdout.close() + + t = Thread(target=print_stdout) + t.start() + + # Read stderr line by line and log non trace lines + self.raw_trace = '' + tline_start_reg = re.compile(r'^\s*(.*\.(cmake|txt))\(([0-9]+)\):\s*(\w+)\(.*$') + inside_multiline_trace = False + while True: + line = proc.stderr.readline() + if not line: + break + line = line.decode('utf-8') + if tline_start_reg.match(line): + self.raw_trace += line + inside_multiline_trace = not line.endswith(' )\n') + elif inside_multiline_trace: + self.raw_trace += line + else: + mlog.warning(line.strip('\n')) + + proc.stderr.close() + proc.wait() + + t.join() + + mlog.log() + h = mlog.green('SUCCEEDED') if proc.returncode == 0 else mlog.red('FAILED') + mlog.log('CMake configuration:', h) + if proc.returncode != 0: + raise CMakeException('Failed to configure the CMake subproject') + + def initialise(self, extra_cmake_options: List[str]) -> None: + # Run configure the old way becuse doing it + # with the server doesn't work for some reason + self.configure(extra_cmake_options) + + with self.client.connect(): + generator = backend_generator_map[self.backend_name] + self.client.do_handshake(self.src_dir, self.build_dir, generator, 1) + + # Do a second configure to initialise the server + self.client.query_checked(RequestConfigure(), 'CMake server configure') + + # Generate the build system files + self.client.query_checked(RequestCompute(), 'Generating build system files') + + # Get CMake build system files + bs_reply = self.client.query_checked(RequestCMakeInputs(), 'Querying build system files') + + # Now get the CMake code model + cm_reply = self.client.query_checked(RequestCodeModel(), 'Querying the CMake code model') + + src_dir = bs_reply.src_dir + self.bs_files = [x.file for x in bs_reply.build_files if not x.is_cmake and not x.is_temp] + self.bs_files = [os.path.relpath(os.path.join(src_dir, x), self.env.get_source_dir()) for x in self.bs_files] + self.bs_files = list(set(self.bs_files)) + self.codemodel = cm_reply + + def analyse(self) -> None: + if self.codemodel is None: + raise CMakeException('CMakeInterpreter was not initialized') + + # Clear analyser data + self.project_name = '' + self.languages = [] + self.targets = [] + self.custom_targets = [] + self.trace = CMakeTraceParser(permissive=True) + + # Parse the trace + self.trace.parse(self.raw_trace) + + # Find all targets + for i in self.codemodel.configs: + for j in i.projects: + if not self.project_name: + self.project_name = j.name + for k in j.targets: + if k.type not in skip_targets: + self.targets += [ConverterTarget(k, self.env)] + + for i in self.trace.custom_targets: + self.custom_targets += [ConverterCustomTarget(i)] + + # generate the output_target_map + output_target_map = {} + output_target_map.update({x.full_name: x for x in self.targets}) + output_target_map.update({_target_key(x.name): x for x in self.targets}) + for i in self.targets: + for j in i.artifacts: + output_target_map[os.path.basename(j)] = i + for i in self.custom_targets: + for j in i.original_outputs: + output_target_map[_generated_file_key(j)] = i + object_libs = [] + + # First pass: Basic target cleanup + for i in self.custom_targets: + i.postprocess(output_target_map, self.src_dir, self.subdir, self.build_dir) + for i in self.targets: + i.postprocess(output_target_map, self.src_dir, self.subdir, self.install_prefix, self.trace) + if i.type == 'OBJECT_LIBRARY': + object_libs += [i] + self.languages += [x for x in i.languages if x not in self.languages] + + # Second pass: Detect object library dependencies + for i in self.targets: + i.process_object_libs(object_libs) + + mlog.log('CMake project', mlog.bold(self.project_name), 'has', mlog.bold(str(len(self.targets) + len(self.custom_targets))), 'build targets.') + + def pretend_to_be_meson(self) -> CodeBlockNode: + if not self.project_name: + raise CMakeException('CMakeInterpreter was not analysed') + + def token(tid: str = 'string', val='') -> Token: + return Token(tid, self.subdir, 0, 0, 0, None, val) + + def string(value: str) -> StringNode: + return StringNode(token(val=value)) + + def id_node(value: str) -> IdNode: + return IdNode(token(val=value)) + + def number(value: int) -> NumberNode: + return NumberNode(token(val=value)) + + def nodeify(value): + if isinstance(value, str): + return string(value) + elif isinstance(value, bool): + return BooleanNode(token(), value) + elif isinstance(value, int): + return number(value) + elif isinstance(value, list): + return array(value) + return value + + def indexed(node: BaseNode, index: int) -> IndexNode: + return IndexNode(node, nodeify(index)) + + def array(elements) -> ArrayNode: + args = ArgumentNode(token()) + if not isinstance(elements, list): + elements = [args] + args.arguments += [nodeify(x) for x in elements] + return ArrayNode(args, 0, 0, 0, 0) + + def function(name: str, args=None, kwargs=None) -> FunctionNode: + if args is None: + args = [] + if kwargs is None: + kwargs = {} + args_n = ArgumentNode(token()) + if not isinstance(args, list): + args = [args] + args_n.arguments = [nodeify(x) for x in args] + args_n.kwargs = {k: nodeify(v) for k, v in kwargs.items()} + func_n = FunctionNode(self.subdir, 0, 0, 0, 0, name, args_n) + return func_n + + def method(obj: BaseNode, name: str, args=None, kwargs=None) -> MethodNode: + if args is None: + args = [] + if kwargs is None: + kwargs = {} + args_n = ArgumentNode(token()) + if not isinstance(args, list): + args = [args] + args_n.arguments = [nodeify(x) for x in args] + args_n.kwargs = {k: nodeify(v) for k, v in kwargs.items()} + return MethodNode(self.subdir, 0, 0, obj, name, args_n) + + def assign(var_name: str, value: BaseNode) -> AssignmentNode: + return AssignmentNode(self.subdir, 0, 0, var_name, value) + + # Generate the root code block and the project function call + root_cb = CodeBlockNode(token()) + root_cb.lines += [function('project', [self.project_name] + self.languages)] + + # Add the run script for custom commands + run_script = '{}/data/run_ctgt.py'.format(os.path.dirname(os.path.realpath(__file__))) + run_script_var = 'ctgt_run_script' + root_cb.lines += [assign(run_script_var, function('find_program', [[run_script]], {'required': True}))] + + # Add the targets + processed = {} + + def resolve_ctgt_ref(ref: CustomTargetReference) -> BaseNode: + tgt_var = processed[ref.ctgt.name]['tgt'] + if len(ref.ctgt.outputs) == 1: + return id_node(tgt_var) + else: + return indexed(id_node(tgt_var), ref.index) + + def process_target(tgt: ConverterTarget): + # First handle inter target dependencies + link_with = [] + objec_libs = [] + sources = [] + generated = [] + generated_filenames = [] + custom_targets = [] + for i in tgt.link_with: + assert(isinstance(i, ConverterTarget)) + if i.name not in processed: + process_target(i) + link_with += [id_node(processed[i.name]['tgt'])] + for i in tgt.object_libs: + assert(isinstance(i, ConverterTarget)) + if i.name not in processed: + process_target(i) + objec_libs += [processed[i.name]['tgt']] + + # Generate the source list and handle generated sources + for i in tgt.sources + tgt.generated: + if isinstance(i, CustomTargetReference): + if i.ctgt.name not in processed: + process_custom_target(i.ctgt) + generated += [resolve_ctgt_ref(i)] + generated_filenames += [i.filename()] + if i.ctgt not in custom_targets: + custom_targets += [i.ctgt] + else: + sources += [i] + + # Add all header files from all used custom targets. This + # ensures that all custom targets are built before any + # sources of the current target are compiled and thus all + # header files are present. This step is necessary because + # CMake always ensures that a custom target is executed + # before another target if at least one output is used. + for i in custom_targets: + for j in i.outputs: + if not is_header(j) or j in generated_filenames: + continue + + generated += [resolve_ctgt_ref(i.get_ref(j))] + generated_filenames += [j] + + # Determine the meson function to use for the build target + tgt_func = tgt.meson_func() + if not tgt_func: + raise CMakeException('Unknown target type "{}"'.format(tgt.type)) + + # Determine the variable names + base_name = str(tgt.name) + base_name = base_name.replace('-', '_') + inc_var = '{}_inc'.format(base_name) + src_var = '{}_src'.format(base_name) + dep_var = '{}_dep'.format(base_name) + tgt_var = base_name + + # Generate target kwargs + tgt_kwargs = { + 'link_args': tgt.link_flags + tgt.link_libraries, + 'link_with': link_with, + 'include_directories': id_node(inc_var), + 'install': tgt.install, + 'install_dir': tgt.install_dir, + 'override_options': tgt.override_options, + 'objects': [method(id_node(x), 'extract_all_objects') for x in objec_libs], + } + + # Handle compiler args + for key, val in tgt.compile_opts.items(): + tgt_kwargs['{}_args'.format(key)] = val + + # Handle -fPCI, etc + if tgt_func == 'executable': + tgt_kwargs['pie'] = tgt.pie + elif tgt_func == 'static_library': + tgt_kwargs['pic'] = tgt.pie + + # declare_dependency kwargs + dep_kwargs = { + 'link_args': tgt.link_flags + tgt.link_libraries, + 'link_with': id_node(tgt_var), + 'compile_args': tgt.public_compile_opts, + 'include_directories': id_node(inc_var), + } + + # Generate the function nodes + inc_node = assign(inc_var, function('include_directories', tgt.includes)) + node_list = [inc_node] + if tgt_func == 'header_only': + del dep_kwargs['link_with'] + dep_node = assign(dep_var, function('declare_dependency', kwargs=dep_kwargs)) + node_list += [dep_node] + src_var = '' + tgt_var = '' + else: + src_node = assign(src_var, function('files', sources)) + tgt_node = assign(tgt_var, function(tgt_func, [base_name, [id_node(src_var)] + generated], tgt_kwargs)) + node_list += [src_node, tgt_node] + if tgt_func in ['static_library', 'shared_library']: + dep_node = assign(dep_var, function('declare_dependency', kwargs=dep_kwargs)) + node_list += [dep_node] + else: + dep_var = '' + + # Add the nodes to the ast + root_cb.lines += node_list + processed[tgt.name] = {'inc': inc_var, 'src': src_var, 'dep': dep_var, 'tgt': tgt_var, 'func': tgt_func} + + def process_custom_target(tgt: ConverterCustomTarget) -> None: + # CMake allows to specify multiple commands in a custom target. + # To map this to meson, a helper script is used to execute all + # commands in order. This addtionally allows setting the working + # directory. + + tgt_var = tgt.name # type: str + + def resolve_source(x: Any) -> Any: + if isinstance(x, ConverterTarget): + if x.name not in processed: + process_target(x) + return id_node(x.name) + elif isinstance(x, CustomTargetReference): + if x.ctgt.name not in processed: + process_custom_target(x.ctgt) + return resolve_ctgt_ref(x) + else: + return x + + # Generate the command list + command = [] + command += [id_node(run_script_var)] + command += ['-o', '@OUTPUT@'] + command += ['-O'] + tgt.original_outputs + command += ['-d', tgt.working_dir] + + # Generate the commands. Subcommands are seperated by ';;;' + for cmd in tgt.command: + command += [resolve_source(x) for x in cmd] + [';;;'] + + tgt_kwargs = { + 'input': [resolve_source(x) for x in tgt.inputs], + 'output': tgt.outputs, + 'command': command, + 'depends': [resolve_source(x) for x in tgt.depends], + } + + root_cb.lines += [assign(tgt_var, function('custom_target', [tgt.name], tgt_kwargs))] + processed[tgt.name] = {'inc': None, 'src': None, 'dep': None, 'tgt': tgt_var, 'func': 'custom_target'} + + # Now generate the target function calls + for i in self.custom_targets: + if i.name not in processed: + process_custom_target(i) + for i in self.targets: + if i.name not in processed: + process_target(i) + + self.generated_targets = processed + return root_cb + + def target_info(self, target: str) -> Optional[Dict[str, str]]: + if target in self.generated_targets: + return self.generated_targets[target] + return None + + def target_list(self) -> List[str]: + return list(self.generated_targets.keys()) diff -Nru meson-0.49.0/mesonbuild/cmake/traceparser.py meson-0.52.1/mesonbuild/cmake/traceparser.py --- meson-0.49.0/mesonbuild/cmake/traceparser.py 1970-01-01 00:00:00.000000000 +0000 +++ meson-0.52.1/mesonbuild/cmake/traceparser.py 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,517 @@ +# Copyright 2019 The Meson development team + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This class contains the basic functionality needed to run any interpreter +# or an interpreter-based tool. + +from .common import CMakeException +from .generator import parse_generator_expressions +from .. import mlog + +from typing import List, Tuple, Optional +import re +import os + +class CMakeTraceLine: + def __init__(self, file, line, func, args): + self.file = file + self.line = line + self.func = func.lower() + self.args = args + + def __repr__(self): + s = 'CMake TRACE: {0}:{1} {2}({3})' + return s.format(self.file, self.line, self.func, self.args) + +class CMakeTarget: + def __init__(self, name, target_type, properties=None): + if properties is None: + properties = {} + self.name = name + self.type = target_type + self.properties = properties + + def __repr__(self): + s = 'CMake TARGET:\n -- name: {}\n -- type: {}\n -- properties: {{\n{} }}' + propSTR = '' + for i in self.properties: + propSTR += " '{}': {}\n".format(i, self.properties[i]) + return s.format(self.name, self.type, propSTR) + +class CMakeGeneratorTarget: + def __init__(self): + self.outputs = [] # type: List[str] + self.command = [] # type: List[List[str]] + self.working_dir = None # type: Optional[str] + self.depends = [] # type: List[str] + +class CMakeTraceParser: + def __init__(self, permissive: bool = False): + # Dict of CMake variables: '': ['list', 'of', 'values'] + self.vars = {} + + # Dict of CMakeTarget + self.targets = {} + + # List of targes that were added with add_custom_command to generate files + self.custom_targets = [] # type: List[CMakeGeneratorTarget] + + self.permissive = permissive # type: bool + + def parse(self, trace: str) -> None: + # First parse the trace + lexer1 = self._lex_trace(trace) + + # All supported functions + functions = { + 'set': self._cmake_set, + 'unset': self._cmake_unset, + 'add_executable': self._cmake_add_executable, + 'add_library': self._cmake_add_library, + 'add_custom_command': self._cmake_add_custom_command, + 'add_custom_target': self._cmake_add_custom_target, + 'set_property': self._cmake_set_property, + 'set_target_properties': self._cmake_set_target_properties, + 'target_compile_definitions': self._cmake_target_compile_definitions, + 'target_compile_options': self._cmake_target_compile_options, + 'target_include_directories': self._cmake_target_include_directories, + 'target_link_options': self._cmake_target_link_options, + } + + # Primary pass -- parse everything + for l in lexer1: + # "Execute" the CMake function if supported + fn = functions.get(l.func, None) + if(fn): + fn(l) + + def get_first_cmake_var_of(self, var_list: List[str]) -> List[str]: + # Return the first found CMake variable in list var_list + for i in var_list: + if i in self.vars: + return self.vars[i] + + return [] + + def get_cmake_var(self, var: str) -> List[str]: + # Return the value of the CMake variable var or an empty list if var does not exist + if var in self.vars: + return self.vars[var] + + return [] + + def var_to_bool(self, var): + if var not in self.vars: + return False + + if len(self.vars[var]) < 1: + return False + + if self.vars[var][0].upper() in ['1', 'ON', 'TRUE']: + return True + return False + + def _gen_exception(self, function: str, error: str, tline: CMakeTraceLine) -> None: + # Generate an exception if the parser is not in permissive mode + + if self.permissive: + mlog.debug('CMake trace warning: {}() {}\n{}'.format(function, error, tline)) + return None + raise CMakeException('CMake: {}() {}\n{}'.format(function, error, tline)) + + def _cmake_set(self, tline: CMakeTraceLine) -> None: + """Handler for the CMake set() function in all variaties. + + comes in three flavors: + set( [PARENT_SCOPE]) + set( CACHE [FORCE]) + set(ENV{} ) + + We don't support the ENV variant, and any uses of it will be ignored + silently. the other two variates are supported, with some caveats: + - we don't properly handle scoping, so calls to set() inside a + function without PARENT_SCOPE set could incorrectly shadow the + outer scope. + - We don't honor the type of CACHE arguments + """ + # DOC: https://cmake.org/cmake/help/latest/command/set.html + + # 1st remove PARENT_SCOPE and CACHE from args + args = [] + for i in tline.args: + if not i or i == 'PARENT_SCOPE': + continue + + # Discard everything after the CACHE keyword + if i == 'CACHE': + break + + args.append(i) + + if len(args) < 1: + return self._gen_exception('set', 'requires at least one argument', tline) + + # Now that we've removed extra arguments all that should be left is the + # variable identifier and the value, join the value back together to + # ensure spaces in the value are correctly handled. This assumes that + # variable names don't have spaces. Please don't do that... + identifier = args.pop(0) + value = ' '.join(args) + + if not value: + # Same as unset + if identifier in self.vars: + del self.vars[identifier] + else: + self.vars[identifier] = value.split(';') + + def _cmake_unset(self, tline: CMakeTraceLine): + # DOC: https://cmake.org/cmake/help/latest/command/unset.html + if len(tline.args) < 1: + return self._gen_exception('unset', 'requires at least one argument', tline) + + if tline.args[0] in self.vars: + del self.vars[tline.args[0]] + + def _cmake_add_executable(self, tline: CMakeTraceLine): + # DOC: https://cmake.org/cmake/help/latest/command/add_executable.html + args = list(tline.args) # Make a working copy + + # Make sure the exe is imported + if 'IMPORTED' not in args: + return self._gen_exception('add_executable', 'non imported executables are not supported', tline) + + args.remove('IMPORTED') + + if len(args) < 1: + return self._gen_exception('add_executable', 'requires at least 1 argument', tline) + + self.targets[args[0]] = CMakeTarget(args[0], 'EXECUTABLE', {}) + + def _cmake_add_library(self, tline: CMakeTraceLine): + # DOC: https://cmake.org/cmake/help/latest/command/add_library.html + args = list(tline.args) # Make a working copy + + # Make sure the lib is imported + if 'INTERFACE' in args: + args.remove('INTERFACE') + + if len(args) < 1: + return self._gen_exception('add_library', 'interface library name not specified', tline) + + self.targets[args[0]] = CMakeTarget(args[0], 'INTERFACE', {}) + elif 'IMPORTED' in args: + args.remove('IMPORTED') + + # Now, only look at the first two arguments (target_name and target_type) and ignore the rest + if len(args) < 2: + return self._gen_exception('add_library', 'requires at least 2 arguments', tline) + + self.targets[args[0]] = CMakeTarget(args[0], args[1], {}) + elif 'ALIAS' in args: + args.remove('ALIAS') + + # Now, only look at the first two arguments (target_name and target_ref) and ignore the rest + if len(args) < 2: + return self._gen_exception('add_library', 'requires at least 2 arguments', tline) + + # Simulate the ALIAS with INTERFACE_LINK_LIBRARIES + self.targets[args[0]] = CMakeTarget(args[0], 'ALIAS', {'INTERFACE_LINK_LIBRARIES': [args[1]]}) + elif 'OBJECT' in args: + return self._gen_exception('add_library', 'OBJECT libraries are not supported', tline) + else: + self.targets[args[0]] = CMakeTarget(args[0], 'NORMAL', {}) + + def _cmake_add_custom_command(self, tline: CMakeTraceLine): + # DOC: https://cmake.org/cmake/help/latest/command/add_custom_command.html + args = list(tline.args) # Make a working copy + + if not args: + return self._gen_exception('add_custom_command', 'requires at least 1 argument', tline) + + # Skip the second function signature + if args[0] == 'TARGET': + return self._gen_exception('add_custom_command', 'TARGET syntax is currently not supported', tline) + + magic_keys = ['OUTPUT', 'COMMAND', 'MAIN_DEPENDENCY', 'DEPENDS', 'BYPRODUCTS', + 'IMPLICIT_DEPENDS', 'WORKING_DIRECTORY', 'COMMENT', 'DEPFILE', + 'JOB_POOL', 'VERBATIM', 'APPEND', 'USES_TERMINAL', 'COMMAND_EXPAND_LISTS'] + + target = CMakeGeneratorTarget() + + def handle_output(key: str, target: CMakeGeneratorTarget) -> None: + target.outputs += [key] + + def handle_command(key: str, target: CMakeGeneratorTarget) -> None: + if key == 'ARGS': + return + target.command[-1] += key.split(';') + + def handle_depends(key: str, target: CMakeGeneratorTarget) -> None: + target.depends += [key] + + def handle_working_dir(key: str, target: CMakeGeneratorTarget) -> None: + if target.working_dir is None: + target.working_dir = key + else: + target.working_dir += ' ' + target.working_dir += key + + fn = None + + for i in args: + if i in magic_keys: + if i == 'OUTPUT': + fn = handle_output + elif i == 'DEPENDS': + fn = handle_depends + elif i == 'WORKING_DIRECTORY': + fn = handle_working_dir + elif i == 'COMMAND': + fn = handle_command + target.command += [[]] + else: + fn = None + continue + + if fn is not None: + fn(i, target) + + target.outputs = self._guess_files(target.outputs) + target.depends = self._guess_files(target.depends) + target.command = [self._guess_files(x) for x in target.command] + + self.custom_targets += [target] + + def _cmake_add_custom_target(self, tline: CMakeTraceLine): + # DOC: https://cmake.org/cmake/help/latest/command/add_custom_target.html + # We only the first parameter (the target name) is interesting + if len(tline.args) < 1: + return self._gen_exception('add_custom_target', 'requires at least one argument', tline) + + self.targets[tline.args[0]] = CMakeTarget(tline.args[0], 'CUSTOM', {}) + + def _cmake_set_property(self, tline: CMakeTraceLine) -> None: + # DOC: https://cmake.org/cmake/help/latest/command/set_property.html + args = list(tline.args) + + # We only care for TARGET properties + if args.pop(0) != 'TARGET': + return + + append = False + targets = [] + while args: + curr = args.pop(0) + # XXX: APPEND_STRING is specifically *not* supposed to create a + # list, is treating them as aliases really okay? + if curr == 'APPEND' or curr == 'APPEND_STRING': + append = True + continue + + if curr == 'PROPERTY': + break + + targets.append(curr) + + if not args: + return self._gen_exception('set_property', 'faild to parse argument list', tline) + + if len(args) == 1: + # Tries to set property to nothing so nothing has to be done + return + + identifier = args.pop(0) + value = ' '.join(args).split(';') + if not value: + return + + for i in targets: + if i not in self.targets: + return self._gen_exception('set_property', 'TARGET {} not found'.format(i), tline) + + if identifier not in self.targets[i].properties: + self.targets[i].properties[identifier] = [] + + if append: + self.targets[i].properties[identifier] += value + else: + self.targets[i].properties[identifier] = value + + def _cmake_set_target_properties(self, tline: CMakeTraceLine) -> None: + # DOC: https://cmake.org/cmake/help/latest/command/set_target_properties.html + args = list(tline.args) + + targets = [] + while args: + curr = args.pop(0) + if curr == 'PROPERTIES': + break + + targets.append(curr) + + # Now we need to try to reconsitute the original quoted format of the + # arguments, as a property value could have spaces in it. Unlike + # set_property() this is not context free. There are two approaches I + # can think of, both have drawbacks: + # + # 1. Assume that the property will be capitalized ([A-Z_]), this is + # convention but cmake doesn't require it. + # 2. Maintain a copy of the list here: https://cmake.org/cmake/help/latest/manual/cmake-properties.7.html#target-properties + # + # Neither of these is awesome for obvious reasons. I'm going to try + # option 1 first and fall back to 2, as 1 requires less code and less + # synchroniztion for cmake changes. + + arglist = [] # type: List[Tuple[str, List[str]]] + name = args.pop(0) + values = [] + prop_regex = re.compile(r'^[A-Z_]+$') + for a in args: + if prop_regex.match(a): + if values: + arglist.append((name, ' '.join(values).split(';'))) + name = a + values = [] + else: + values.append(a) + if values: + arglist.append((name, ' '.join(values).split(';'))) + + for name, value in arglist: + for i in targets: + if i not in self.targets: + return self._gen_exception('set_target_properties', 'TARGET {} not found'.format(i), tline) + + self.targets[i].properties[name] = value + + def _cmake_target_compile_definitions(self, tline: CMakeTraceLine) -> None: + # DOC: https://cmake.org/cmake/help/latest/command/target_compile_definitions.html + self._parse_common_target_options('target_compile_definitions', 'COMPILE_DEFINITIONS', 'INTERFACE_COMPILE_DEFINITIONS', tline) + + def _cmake_target_compile_options(self, tline: CMakeTraceLine) -> None: + # DOC: https://cmake.org/cmake/help/latest/command/target_compile_options.html + self._parse_common_target_options('target_compile_options', 'COMPILE_OPTIONS', 'INTERFACE_COMPILE_OPTIONS', tline) + + def _cmake_target_include_directories(self, tline: CMakeTraceLine) -> None: + # DOC: https://cmake.org/cmake/help/latest/command/target_include_directories.html + self._parse_common_target_options('target_include_directories', 'INCLUDE_DIRECTORIES', 'INTERFACE_INCLUDE_DIRECTORIES', tline, ignore=['SYSTEM', 'BEFORE'], paths=True) + + def _cmake_target_link_options(self, tline: CMakeTraceLine) -> None: + # DOC: https://cmake.org/cmake/help/latest/command/target_link_options.html + self._parse_common_target_options('target_link_options', 'LINK_OPTIONS', 'INTERFACE_LINK_OPTIONS', tline) + + def _parse_common_target_options(self, func: str, private_prop: str, interface_prop: str, tline: CMakeTraceLine, ignore: Optional[List[str]] = None, paths: bool = False): + if ignore is None: + ignore = ['BEFORE'] + + args = list(tline.args) + + if len(args) < 1: + return self._gen_exception(func, 'requires at least one argument', tline) + + target = args[0] + if target not in self.targets: + return self._gen_exception(func, 'TARGET {} not found'.format(target), tline) + + interface = [] + private = [] + + mode = 'PUBLIC' + for i in args[1:]: + if i in ignore: + continue + + if i in ['INTERFACE', 'PUBLIC', 'PRIVATE']: + mode = i + continue + + if mode in ['INTERFACE', 'PUBLIC']: + interface += [i] + + if mode in ['PUBLIC', 'PRIVATE']: + private += [i] + + if paths: + interface = self._guess_files(interface) + private = self._guess_files(private) + + interface = [x for x in interface if x] + private = [x for x in private if x] + + for i in [(private_prop, private), (interface_prop, interface)]: + if not i[0] in self.targets[target].properties: + self.targets[target].properties[i[0]] = [] + + self.targets[target].properties[i[0]] += i[1] + + def _lex_trace(self, trace): + # The trace format is: '(): ( )\n' + reg_tline = re.compile(r'\s*(.*\.(cmake|txt))\(([0-9]+)\):\s*(\w+)\(([\s\S]*?) ?\)\s*\n', re.MULTILINE) + reg_other = re.compile(r'[^\n]*\n') + loc = 0 + while loc < len(trace): + mo_file_line = reg_tline.match(trace, loc) + if not mo_file_line: + skip_match = reg_other.match(trace, loc) + if not skip_match: + print(trace[loc:]) + raise CMakeException('Failed to parse CMake trace') + + loc = skip_match.end() + continue + + loc = mo_file_line.end() + + file = mo_file_line.group(1) + line = mo_file_line.group(3) + func = mo_file_line.group(4) + args = mo_file_line.group(5) + args = parse_generator_expressions(args) + args = args.split(' ') + args = list(map(lambda x: x.strip(), args)) + + yield CMakeTraceLine(file, line, func, args) + + def _guess_files(self, broken_list: List[str]) -> List[str]: + #Try joining file paths that contain spaces + + reg_start = re.compile(r'^([A-Za-z]:)?/.*/[^./]+$') + reg_end = re.compile(r'^.*\.[a-zA-Z]+$') + + fixed_list = [] # type: List[str] + curr_str = None # type: Optional[str] + + for i in broken_list: + if curr_str is None: + curr_str = i + elif os.path.isfile(curr_str): + # Abort concatination if curr_str is an existing file + fixed_list += [curr_str] + curr_str = i + elif not reg_start.match(curr_str): + # Abort concatination if curr_str no longer matches the regex + fixed_list += [curr_str] + curr_str = i + elif reg_end.match(i) or os.path.exists('{} {}'.format(curr_str, i)): + # File detected + curr_str = '{} {}'.format(curr_str, i) + fixed_list += [curr_str] + curr_str = None + else: + curr_str = '{} {}'.format(curr_str, i) + + if curr_str: + fixed_list += [curr_str] + return fixed_list diff -Nru meson-0.49.0/mesonbuild/compilers/c_function_attributes.py meson-0.52.1/mesonbuild/compilers/c_function_attributes.py --- meson-0.49.0/mesonbuild/compilers/c_function_attributes.py 2018-12-09 14:27:23.000000000 +0000 +++ meson-0.52.1/mesonbuild/compilers/c_function_attributes.py 2019-08-28 17:15:39.000000000 +0000 @@ -93,8 +93,15 @@ 'visibility': ''' int foo_def(void) __attribute__((visibility("default"))); int foo_hid(void) __attribute__((visibility("hidden"))); - int foo_int(void) __attribute__((visibility("internal"))); - int foo_pro(void) __attribute__((visibility("protected")));''', + int foo_int(void) __attribute__((visibility("internal")));''', + 'visibility:default': + 'int foo(void) __attribute__((visibility("default")));', + 'visibility:hidden': + 'int foo(void) __attribute__((visibility("hidden")));', + 'visibility:internal': + 'int foo(void) __attribute__((visibility("internal")));', + 'visibility:protected': + 'int foo(void) __attribute__((visibility("protected")));', 'warning': 'int foo(void) __attribute__((warning("")));', 'warn_unused_result': diff -Nru meson-0.49.0/mesonbuild/compilers/compilers.py meson-0.52.1/mesonbuild/compilers/compilers.py --- meson-0.49.0/mesonbuild/compilers/compilers.py 2018-12-09 14:27:23.000000000 +0000 +++ meson-0.52.1/mesonbuild/compilers/compilers.py 2019-11-28 17:37:44.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright 2012-2017 The Meson development team +# Copyright 2012-2019 The Meson development team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,17 +12,26 @@ # See the License for the specific language governing permissions and # limitations under the License. -import abc, contextlib, enum, os.path, re, tempfile, shlex -import subprocess +import contextlib, enum, os.path, re, tempfile +import typing +from typing import Optional, Tuple, List -from ..linkers import StaticLinker +from ..linkers import StaticLinker, GnuLikeDynamicLinkerMixin, SolarisDynamicLinker from .. import coredata from .. import mlog from .. import mesonlib from ..mesonlib import ( - EnvironmentException, MesonException, OrderedSet, version_compare, - Popen_safe + EnvironmentException, MachineChoice, MesonException, OrderedSet, + Popen_safe, split_args ) +from ..envconfig import ( + Properties, +) + +if typing.TYPE_CHECKING: + from ..coredata import OptionDictType + from ..environment import Environment + from ..linkers import DynamicLinker # noqa: F401 """This file contains the data files of all compilers Meson knows about. To support a new compiler, add its information below. @@ -30,12 +39,13 @@ header_suffixes = ('h', 'hh', 'hpp', 'hxx', 'H', 'ipp', 'moc', 'vapi', 'di') obj_suffixes = ('o', 'obj', 'res') -lib_suffixes = ('a', 'lib', 'dll', 'dylib', 'so') +lib_suffixes = ('a', 'lib', 'dll', 'dll.a', 'dylib', 'so') # Mapping of language to suffixes of files that should always be in that language # This means we can't include .h headers here since they could be C, C++, ObjC, etc. lang_suffixes = { 'c': ('c',), 'cpp': ('cpp', 'cc', 'cxx', 'c++', 'hh', 'hpp', 'ipp', 'hxx'), + 'cuda': ('cu',), # f90, f95, f03, f08 are for free-form fortran ('f90' recommended) # f, for, ftn, fpp are for fixed-form fortran ('f' or 'for' recommended) 'fortran': ('f90', 'f95', 'f03', 'f08', 'f', 'for', 'ftn', 'fpp'), @@ -56,18 +66,20 @@ clib_langs = ('objcpp', 'cpp', 'objc', 'c', 'fortran',) # List of languages that can be linked with C code directly by the linker # used in build.py:process_compilers() and build.py:get_dynamic_linker() -# XXX: Add Rust to this? -clink_langs = ('d',) + clib_langs +clink_langs = ('d', 'cuda') + clib_langs clink_suffixes = () for _l in clink_langs + ('vala',): clink_suffixes += lang_suffixes[_l] clink_suffixes += ('h', 'll', 's') +# Languages that should use LDFLAGS arguments when linking. +languages_using_ldflags = ('objcpp', 'cpp', 'objc', 'c', 'fortran', 'd', 'cuda') soregex = re.compile(r'.*\.so(\.[0-9]+)?(\.[0-9]+)?(\.[0-9]+)?$') # Environment variables that each lang uses. cflags_mapping = {'c': 'CFLAGS', 'cpp': 'CXXFLAGS', + 'cuda': 'CUFLAGS', 'objc': 'OBJCFLAGS', 'objcpp': 'OBJCXXFLAGS', 'fortran': 'FFLAGS', @@ -75,6 +87,9 @@ 'vala': 'VALAFLAGS', 'rust': 'RUSTFLAGS'} +# execinfo is a compiler lib on BSD +unixy_compiler_internal_libs = ('m', 'c', 'pthread', 'dl', 'rt', 'execinfo') + # All these are only for C-linkable languages; see `clink_langs` above. def sort_clink(lang): @@ -126,89 +141,12 @@ suffix = fname.split('.')[-1] return suffix in lib_suffixes -gnulike_buildtype_args = {'plain': [], - 'debug': [], - 'debugoptimized': [], - 'release': [], - 'minsize': [], - 'custom': [], - } - -armclang_buildtype_args = {'plain': [], - 'debug': ['-O0', '-g'], - 'debugoptimized': ['-O1', '-g'], - 'release': ['-Os'], - 'minsize': ['-Oz'], - 'custom': [], - } - -arm_buildtype_args = {'plain': [], - 'debug': ['-O0', '--debug'], - 'debugoptimized': ['-O1', '--debug'], - 'release': ['-O3', '-Otime'], - 'minsize': ['-O3', '-Ospace'], - 'custom': [], - } - -ccrx_buildtype_args = {'plain': [], +cuda_buildtype_args = {'plain': [], 'debug': [], 'debugoptimized': [], 'release': [], 'minsize': [], - 'custom': [], } - -msvc_buildtype_args = {'plain': [], - 'debug': ["/ZI", "/Ob0", "/Od", "/RTC1"], - 'debugoptimized': ["/Zi", "/Ob1"], - 'release': ["/Ob2", "/Gw"], - 'minsize': ["/Zi", "/Gw"], - 'custom': [], - } - -apple_buildtype_linker_args = {'plain': [], - 'debug': [], - 'debugoptimized': [], - 'release': [], - 'minsize': [], - 'custom': [], - } - -gnulike_buildtype_linker_args = {'plain': [], - 'debug': [], - 'debugoptimized': [], - 'release': ['-Wl,-O1'], - 'minsize': [], - 'custom': [], - } - -arm_buildtype_linker_args = {'plain': [], - 'debug': [], - 'debugoptimized': [], - 'release': [], - 'minsize': [], - 'custom': [], - } - -ccrx_buildtype_linker_args = {'plain': [], - 'debug': [], - 'debugoptimized': [], - 'release': [], - 'minsize': [], - 'custom': [], - } - -msvc_buildtype_linker_args = {'plain': [], - 'debug': [], - 'debugoptimized': [], - # The otherwise implicit REF and ICF linker - # optimisations are disabled by /DEBUG. - # REF implies ICF. - 'release': ['/OPT:REF'], - 'minsize': ['/INCREMENTAL:NO', '/OPT:REF'], - 'custom': [], - } - java_buildtype_args = {'plain': [], 'debug': ['-g'], 'debugoptimized': ['-g'], @@ -272,32 +210,6 @@ 'winspool.lib', 'shell32.lib', 'ole32.lib', 'oleaut32.lib', 'uuid.lib', 'comdlg32.lib', 'advapi32.lib'] -gnu_color_args = {'auto': ['-fdiagnostics-color=auto'], - 'always': ['-fdiagnostics-color=always'], - 'never': ['-fdiagnostics-color=never'], - } - -clang_color_args = {'auto': ['-Xclang', '-fcolor-diagnostics'], - 'always': ['-Xclang', '-fcolor-diagnostics'], - 'never': ['-Xclang', '-fno-color-diagnostics'], - } - -arm_optimization_args = {'0': ['-O0'], - 'g': ['-g'], - '1': ['-O1'], - '2': ['-O2'], - '3': ['-O3'], - 's': [], - } - -armclang_optimization_args = {'0': ['-O0'], - 'g': ['-g'], - '1': ['-O1'], - '2': ['-O2'], - '3': ['-O3'], - 's': ['-Os'] - } - clike_optimization_args = {'0': [], 'g': [], '1': ['-O1'], @@ -306,130 +218,48 @@ 's': ['-Os'], } -gnu_optimization_args = {'0': [], - 'g': ['-Og'], - '1': ['-O1'], - '2': ['-O2'], - '3': ['-O3'], - 's': ['-Os'], - } - -ccrx_optimization_args = {'0': ['-optimize=0'], - 'g': ['-optimize=0'], - '1': ['-optimize=1'], - '2': ['-optimize=2'], - '3': ['-optimize=max'], - 's': ['-optimize=2', '-size'] +cuda_optimization_args = {'0': [], + 'g': ['-O0'], + '1': ['-O1'], + '2': ['-O2'], + '3': ['-O3'], + 's': ['-O3'] } -msvc_optimization_args = {'0': [], - 'g': ['/O0'], - '1': ['/O1'], - '2': ['/O2'], - '3': ['/O2'], - 's': ['/O1'], # Implies /Os. - } +cuda_debug_args = {False: [], + True: ['-g']} clike_debug_args = {False: [], True: ['-g']} -msvc_debug_args = {False: [], - True: []} # Fixme! - -ccrx_debug_args = {False: [], - True: ['-debug']} - -base_options = {'b_pch': coredata.UserBooleanOption('b_pch', 'Use precompiled headers', True), - 'b_lto': coredata.UserBooleanOption('b_lto', 'Use link time optimization', False), - 'b_sanitize': coredata.UserComboOption('b_sanitize', - 'Code sanitizer to use', +base_options = {'b_pch': coredata.UserBooleanOption('Use precompiled headers', True), + 'b_lto': coredata.UserBooleanOption('Use link time optimization', False), + 'b_sanitize': coredata.UserComboOption('Code sanitizer to use', ['none', 'address', 'thread', 'undefined', 'memory', 'address,undefined'], 'none'), - 'b_lundef': coredata.UserBooleanOption('b_lundef', 'Use -Wl,--no-undefined when linking', True), - 'b_asneeded': coredata.UserBooleanOption('b_asneeded', 'Use -Wl,--as-needed when linking', True), - 'b_pgo': coredata.UserComboOption('b_pgo', 'Use profile guided optimization', + 'b_lundef': coredata.UserBooleanOption('Use -Wl,--no-undefined when linking', True), + 'b_asneeded': coredata.UserBooleanOption('Use -Wl,--as-needed when linking', True), + 'b_pgo': coredata.UserComboOption('Use profile guided optimization', ['off', 'generate', 'use'], 'off'), - 'b_coverage': coredata.UserBooleanOption('b_coverage', - 'Enable coverage tracking.', + 'b_coverage': coredata.UserBooleanOption('Enable coverage tracking.', False), - 'b_colorout': coredata.UserComboOption('b_colorout', 'Use colored output', + 'b_colorout': coredata.UserComboOption('Use colored output', ['auto', 'always', 'never'], 'always'), - 'b_ndebug': coredata.UserComboOption('b_ndebug', 'Disable asserts', + 'b_ndebug': coredata.UserComboOption('Disable asserts', ['true', 'false', 'if-release'], 'false'), - 'b_staticpic': coredata.UserBooleanOption('b_staticpic', - 'Build static libraries as position independent', + 'b_staticpic': coredata.UserBooleanOption('Build static libraries as position independent', True), - 'b_pie': coredata.UserBooleanOption('b_pie', - 'Build executables as position independent', + 'b_pie': coredata.UserBooleanOption('Build executables as position independent', False), - 'b_bitcode': coredata.UserBooleanOption('b_bitcode', - 'Generate and embed bitcode (only macOS and iOS)', + 'b_bitcode': coredata.UserBooleanOption('Generate and embed bitcode (only macOS/iOS/tvOS)', False), - 'b_vscrt': coredata.UserComboOption('b_vscrt', 'VS run-time library type to use.', + 'b_vscrt': coredata.UserComboOption('VS run-time library type to use.', ['none', 'md', 'mdd', 'mt', 'mtd', 'from_buildtype'], 'from_buildtype'), } -gnulike_instruction_set_args = {'mmx': ['-mmmx'], - 'sse': ['-msse'], - 'sse2': ['-msse2'], - 'sse3': ['-msse3'], - 'ssse3': ['-mssse3'], - 'sse41': ['-msse4.1'], - 'sse42': ['-msse4.2'], - 'avx': ['-mavx'], - 'avx2': ['-mavx2'], - 'neon': ['-mfpu=neon'], - } - -vs32_instruction_set_args = {'mmx': ['/arch:SSE'], # There does not seem to be a flag just for MMX - 'sse': ['/arch:SSE'], - 'sse2': ['/arch:SSE2'], - 'sse3': ['/arch:AVX'], # VS leaped from SSE2 directly to AVX. - 'sse41': ['/arch:AVX'], - 'sse42': ['/arch:AVX'], - 'avx': ['/arch:AVX'], - 'avx2': ['/arch:AVX2'], - 'neon': None, - } - -# The 64 bit compiler defaults to /arch:avx. -vs64_instruction_set_args = {'mmx': ['/arch:AVX'], - 'sse': ['/arch:AVX'], - 'sse2': ['/arch:AVX'], - 'sse3': ['/arch:AVX'], - 'ssse3': ['/arch:AVX'], - 'sse41': ['/arch:AVX'], - 'sse42': ['/arch:AVX'], - 'avx': ['/arch:AVX'], - 'avx2': ['/arch:AVX2'], - 'neon': None, - } - -gnu_symbol_visibility_args = {'': [], - 'default': ['-fvisibility=default'], - 'internal': ['-fvisibility=internal'], - 'hidden': ['-fvisibility=hidden'], - 'protected': ['-fvisibility=protected'], - 'inlineshidden': ['-fvisibility=hidden', '-fvisibility-inlines-hidden'], - } - -def sanitizer_compile_args(value): - if value == 'none': - return [] - args = ['-fsanitize=' + value] - if 'address' in value: # For -fsanitize=address,undefined - args.append('-fno-omit-frame-pointer') - return args - -def sanitizer_link_args(value): - if value == 'none': - return [] - args = ['-fsanitize=' + value] - return args - def option_enabled(boptions, options, option): try: if option not in boptions: @@ -440,10 +270,9 @@ def get_base_compile_args(options, compiler): args = [] - # FIXME, gcc/clang specific. try: if options['b_lto'].value: - args.append('-flto') + args.extend(compiler.get_lto_compile_args()) except KeyError: pass try: @@ -451,7 +280,7 @@ except KeyError: pass try: - args += sanitizer_compile_args(options['b_sanitize'].value) + args += compiler.sanitizer_compile_args(options['b_sanitize'].value) except KeyError: pass try: @@ -470,7 +299,7 @@ try: if (options['b_ndebug'].value == 'true' or (options['b_ndebug'].value == 'if-release' and - options['buildtype'].value == 'release')): + options['buildtype'].value in {'release', 'plain'})): args += ['-DNDEBUG'] except KeyError: pass @@ -490,14 +319,13 @@ def get_base_link_args(options, linker, is_shared_module): args = [] - # FIXME, gcc/clang specific. try: if options['b_lto'].value: - args.append('-flto') + args.extend(linker.get_lto_link_args()) except KeyError: pass try: - args += sanitizer_link_args(options['b_sanitize'].value) + args += linker.sanitizer_link_args(options['b_sanitize'].value) except KeyError: pass try: @@ -513,18 +341,26 @@ args += linker.get_coverage_link_args() except KeyError: pass - # These do not need a try...except - if not is_shared_module and option_enabled(linker.base_options, options, 'b_lundef'): - args.append('-Wl,--no-undefined') + as_needed = option_enabled(linker.base_options, options, 'b_asneeded') bitcode = option_enabled(linker.base_options, options, 'b_bitcode') # Shared modules cannot be built with bitcode_bundle because # -bitcode_bundle is incompatible with -undefined and -bundle if bitcode and not is_shared_module: - args.append('-Wl,-bitcode_bundle') + args.extend(linker.bitcode_args()) elif as_needed: # -Wl,-dead_strip_dylibs is incompatible with bitcode - args.append(linker.get_asneeded_args()) + args.extend(linker.get_asneeded_args()) + + # Apple's ld (the only one that supports bitcode) does not like any + # -undefined arguments at all, so don't pass these when using bitcode + if not bitcode: + if (not is_shared_module and + option_enabled(linker.base_options, options, 'b_lundef')): + args.extend(linker.no_undefined_link_args()) + else: + args.extend(linker.get_allow_undefined_link_args()) + try: crt_val = options['b_vscrt'].value buildtype = options['buildtype'].value @@ -536,30 +372,6 @@ pass return args -def prepare_rpaths(raw_rpaths, build_dir, from_dir): - internal_format_rpaths = [evaluate_rpath(p, build_dir, from_dir) for p in raw_rpaths] - ordered_rpaths = order_rpaths(internal_format_rpaths) - return ordered_rpaths - -def order_rpaths(rpath_list): - # We want rpaths that point inside our build dir to always override - # those pointing to other places in the file system. This is so built - # binaries prefer our libraries to the ones that may lie somewhere - # in the file system, such as /lib/x86_64-linux-gnu. - # - # The correct thing to do here would be C++'s std::stable_partition. - # Python standard library does not have it, so replicate it with - # sort, which is guaranteed to be stable. - return sorted(rpath_list, key=os.path.isabs) - -def evaluate_rpath(p, build_dir, from_dir): - if p == from_dir: - return '' # relpath errors out in this case - elif os.path.isabs(p): - return p # These can be outside of build dir. - else: - return os.path.relpath(os.path.join(build_dir, p), os.path.join(build_dir, from_dir)) - class CrossNoRunException(MesonException): pass @@ -608,7 +420,7 @@ # Arg prefixes that override by prepending instead of appending prepend_prefixes = ('-I', '-L') # Arg prefixes and args that must be de-duped by returning 2 - dedup2_prefixes = ('-I', '-L', '-D', '-U') + dedup2_prefixes = ('-I', '-isystem', '-L', '-D', '-U') dedup2_suffixes = () dedup2_args = () # Arg prefixes and args that must be de-duped by returning 1 @@ -621,6 +433,9 @@ # Only UNIX shared libraries require this. Others have a fixed extension. dedup1_regex = re.compile(r'([\/\\]|\A)lib.*\.so(\.[0-9]+)?(\.[0-9]+)?(\.[0-9]+)?$') dedup1_args = ('-c', '-S', '-E', '-pipe', '-pthread') + # In generate_link() we add external libs without de-dup, but we must + # *always* de-dup these because they're special arguments to the linker + always_dedup_args = tuple('-l' + lib for lib in unixy_compiler_internal_libs) compiler = None def _check_args(self, args): @@ -704,7 +519,7 @@ return True return False - def to_native(self, copy=False): + def to_native(self, copy: bool = False) -> typing.List[str]: # Check if we need to add --start/end-group for circular dependencies # between static libraries, and for recursively searching for symbols # needed by static libraries that are provided by object files or @@ -713,8 +528,12 @@ new = self.copy() else: new = self - if get_compiler_uses_gnuld(self.compiler): - global soregex + # This covers all ld.bfd, ld.gold, ld.gold, and xild on Linux, which + # all act like (or are) gnu ld + # TODO: this could probably be added to the DynamicLinker instead + if (hasattr(self.compiler, 'linker') and + self.compiler.linker is not None and + isinstance(self.compiler.linker, (GnuLikeDynamicLinkerMixin, SolarisDynamicLinker))): group_start = -1 group_end = -1 for i, each in enumerate(new): @@ -729,13 +548,29 @@ # Last occurrence of a library new.insert(group_end + 1, '-Wl,--end-group') new.insert(group_start, '-Wl,--start-group') + # Remove system/default include paths added with -isystem + if hasattr(self.compiler, 'get_default_include_dirs'): + default_dirs = self.compiler.get_default_include_dirs() + bad_idx_list = [] + for i, each in enumerate(new): + # Remove the -isystem and the path if the path is a dafault path + if (each == '-isystem' and + i < (len(new) - 1) and + new[i + 1] in default_dirs): + bad_idx_list += [i, i + 1] + elif each.startswith('-isystem=') and each[9:] in default_dirs: + bad_idx_list += [i] + elif each.startswith('-isystem') and each[8:] in default_dirs: + bad_idx_list += [i] + for i in reversed(bad_idx_list): + new.pop(i) return self.compiler.unix_args_to_native(new) def append_direct(self, arg): ''' - Append the specified argument without any reordering or de-dup - except for absolute paths where the order of include search directories - is not relevant + Append the specified argument without any reordering or de-dup except + for absolute paths to libraries, etc, which can always be de-duped + safely. ''' if os.path.isabs(arg): self.append(arg) @@ -755,7 +590,7 @@ normal_flags = [] lflags = [] for i in iterable: - if i.startswith('-l') or i.startswith('-L'): + if i not in self.always_dedup_args and (i.startswith('-l') or i.startswith('-L')): lflags.append(i) else: normal_flags.append(i) @@ -830,10 +665,11 @@ # Libraries that are internal compiler implementations, and must not be # manually searched. internal_libs = () - # Cache for the result of compiler checks which can be cached - compiler_check_cache = {} - def __init__(self, exelist, version, **kwargs): + LINKER_PREFIX = None # type: typing.Union[None, str, typing.List[str]] + + def __init__(self, exelist, version, for_machine: MachineChoice, + linker: typing.Optional['DynamicLinker'] = None, **kwargs): if isinstance(exelist, str): self.exelist = [exelist] elif isinstance(exelist, list): @@ -851,14 +687,16 @@ self.full_version = kwargs['full_version'] else: self.full_version = None + self.for_machine = for_machine self.base_options = [] + self.linker = linker def __repr__(self): repr_str = "<{0}: v{1} `{2}`>" return repr_str.format(self.__class__.__name__, self.version, ' '.join(self.exelist)) - def can_compile(self, src): + def can_compile(self, src) -> bool: if hasattr(src, 'fname'): src = src.fname suffix = os.path.splitext(src)[1].lower() @@ -866,36 +704,51 @@ return True return False - def get_id(self): + def get_id(self) -> str: return self.id - def get_language(self): + def get_version_string(self) -> str: + details = [self.id, self.version] + if self.full_version: + details += ['"%s"' % (self.full_version)] + return '(%s)' % (' '.join(details)) + + def get_language(self) -> str: return self.language - def get_display_language(self): + def get_display_language(self) -> str: return self.language.capitalize() - def get_default_suffix(self): + def get_default_suffix(self) -> str: return self.default_suffix - def get_define(self, dname, prefix, env, extra_args, dependencies): + def get_define(self, dname, prefix, env, extra_args, dependencies) -> Tuple[str, bool]: raise EnvironmentException('%s does not support get_define ' % self.get_id()) - def compute_int(self, expression, low, high, guess, prefix, env, extra_args, dependencies): + def compute_int(self, expression, low, high, guess, prefix, env, extra_args, dependencies) -> int: raise EnvironmentException('%s does not support compute_int ' % self.get_id()) - def has_members(self, typename, membernames, prefix, env, *, extra_args=None, dependencies=None): + def compute_parameters_with_absolute_paths(self, parameter_list, build_dir): + raise EnvironmentException('%s does not support compute_parameters_with_absolute_paths ' % self.get_id()) + + def has_members(self, typename, membernames, prefix, env, *, extra_args=None, dependencies=None) -> Tuple[bool, bool]: raise EnvironmentException('%s does not support has_member(s) ' % self.get_id()) - def has_type(self, typename, prefix, env, extra_args, *, dependencies=None): + def has_type(self, typename, prefix, env, extra_args, *, dependencies=None) -> Tuple[bool, bool]: raise EnvironmentException('%s does not support has_type ' % self.get_id()) - def symbols_have_underscore_prefix(self, env): + def symbols_have_underscore_prefix(self, env) -> bool: raise EnvironmentException('%s does not support symbols_have_underscore_prefix ' % self.get_id()) def get_exelist(self): return self.exelist[:] + def get_linker_exelist(self) -> typing.List[str]: + return self.linker.get_exelist() + + def get_linker_output_args(self, outputname: str) -> typing.List[str]: + return self.linker.get_output_args(outputname) + def get_builtin_define(self, *args, **kwargs): raise EnvironmentException('%s does not support get_builtin_define.' % self.id) @@ -905,17 +758,17 @@ def get_always_args(self): return [] - def can_linker_accept_rsp(self): + def can_linker_accept_rsp(self) -> bool: """ Determines whether the linker can accept arguments using the @rsp syntax. """ - return mesonlib.is_windows() + return self.linker.get_accepts_rsp() def get_linker_always_args(self): - return [] + return self.linker.get_always_args() def get_linker_lib_prefix(self): - return '' + return self.linker.get_lib_prefix() def gen_import_library_args(self, implibname): """ @@ -924,36 +777,53 @@ """ return [] - def get_preproc_flags(self): - if self.get_language() in ('c', 'cpp', 'objc', 'objcpp'): - return os.environ.get('CPPFLAGS', '') - return '' + def use_preproc_flags(self) -> bool: + """ + Whether the compiler (or processes it spawns) cares about CPPFLAGS + """ + return self.get_language() in {'c', 'cpp', 'objc', 'objcpp'} - def get_args_from_envvars(self): + def use_ldflags(self) -> bool: + """ + Whether the compiler (or processes it spawns) cares about LDFLAGS + """ + return self.get_language() in languages_using_ldflags + + def get_linker_args_from_envvars(self) -> typing.List[str]: + return self.linker.get_args_from_envvars() + + def get_args_from_envvars(self) -> typing.Tuple[typing.List[str], typing.List[str]]: """ Returns a tuple of (compile_flags, link_flags) for the specified language from the inherited environment """ - def log_var(var, val): + def log_var(var, val: Optional[str]): if val: mlog.log('Appending {} from environment: {!r}'.format(var, val)) + else: + mlog.debug('No {} in the environment, not changing global flags.'.format(var)) lang = self.get_language() - compiler_is_linker = False - if hasattr(self, 'get_linker_exelist'): - compiler_is_linker = (self.get_exelist() == self.get_linker_exelist()) + compiler_is_linker = self.linker is not None and self.linker.invoked_by_compiler() if lang not in cflags_mapping: return [], [] - compile_flags = os.environ.get(cflags_mapping[lang], '') - log_var(cflags_mapping[lang], compile_flags) - compile_flags = shlex.split(compile_flags) + compile_flags = [] # type: typing.List[str] + link_flags = [] # type: typing.List[str] + + env_compile_flags = os.environ.get(cflags_mapping[lang]) + log_var(cflags_mapping[lang], env_compile_flags) + if env_compile_flags is not None: + compile_flags += split_args(env_compile_flags) # Link flags (same for all languages) - link_flags = os.environ.get('LDFLAGS', '') - log_var('LDFLAGS', link_flags) - link_flags = shlex.split(link_flags) + if self.use_ldflags(): + env_link_flags = self.get_linker_args_from_envvars() + else: + env_link_flags = [] + log_var('LDFLAGS', env_link_flags) + link_flags += env_link_flags if compiler_is_linker: # When the compiler is used as a wrapper around the linker (such as # with GCC and Clang), the compile flags can be needed while linking @@ -961,64 +831,84 @@ # this when the linker is stand-alone such as with MSVC C/C++, etc. link_flags = compile_flags + link_flags - # Pre-processor flags (not for fortran or D) - preproc_flags = self.get_preproc_flags() - log_var('CPPFLAGS', preproc_flags) - preproc_flags = shlex.split(preproc_flags) - compile_flags += preproc_flags + # Pre-processor flags for certain languages + if self.use_preproc_flags(): + env_preproc_flags = os.environ.get('CPPFLAGS') + log_var('CPPFLAGS', env_preproc_flags) + if env_preproc_flags is not None: + compile_flags += split_args(env_preproc_flags) return compile_flags, link_flags def get_options(self): opts = {} # build afresh every time - - # Take default values from env variables. - compile_args, link_args = self.get_args_from_envvars() description = 'Extra arguments passed to the {}'.format(self.get_display_language()) opts.update({ self.language + '_args': coredata.UserArrayOption( - self.language + '_args', description + ' compiler', - compile_args, shlex_split=True, user_input=True, allow_dups=True), + [], split_args=True, user_input=True, allow_dups=True), self.language + '_link_args': coredata.UserArrayOption( - self.language + '_link_args', description + ' linker', - link_args, shlex_split=True, user_input=True, allow_dups=True), + [], split_args=True, user_input=True, allow_dups=True), }) return opts + def get_and_default_options(self, properties: Properties): + """ + Take default values from env variables and/or config files. + """ + opts = self.get_options() + + if properties.fallback: + # Get from env vars. + compile_args, link_args = self.get_args_from_envvars() + else: + compile_args = [] + link_args = [] + + for k, o in opts.items(): + if k in properties: + # Get from configuration files. + o.set_value(properties[k]) + elif k == self.language + '_args': + o.set_value(compile_args) + elif k == self.language + '_link_args': + o.set_value(link_args) + + return opts + def get_option_compile_args(self, options): return [] - def get_option_link_args(self, options): - return [] + def get_option_link_args(self, options: 'OptionDictType') -> typing.List[str]: + return self.linker.get_option_args(options) - def check_header(self, *args, **kwargs): + def check_header(self, *args, **kwargs) -> Tuple[bool, bool]: raise EnvironmentException('Language %s does not support header checks.' % self.get_display_language()) - def has_header(self, *args, **kwargs): + def has_header(self, *args, **kwargs) -> Tuple[bool, bool]: raise EnvironmentException('Language %s does not support header checks.' % self.get_display_language()) - def has_header_symbol(self, *args, **kwargs): + def has_header_symbol(self, *args, **kwargs) -> Tuple[bool, bool]: raise EnvironmentException('Language %s does not support header symbol checks.' % self.get_display_language()) - def compiles(self, *args, **kwargs): + def compiles(self, *args, **kwargs) -> Tuple[bool, bool]: raise EnvironmentException('Language %s does not support compile checks.' % self.get_display_language()) - def links(self, *args, **kwargs): + def links(self, *args, **kwargs) -> Tuple[bool, bool]: raise EnvironmentException('Language %s does not support link checks.' % self.get_display_language()) - def run(self, *args, **kwargs): + def run(self, *args, **kwargs) -> RunResult: raise EnvironmentException('Language %s does not support run checks.' % self.get_display_language()) - def sizeof(self, *args, **kwargs): + def sizeof(self, *args, **kwargs) -> int: raise EnvironmentException('Language %s does not support sizeof checks.' % self.get_display_language()) - def alignment(self, *args, **kwargs): + def alignment(self, *args, **kwargs) -> int: raise EnvironmentException('Language %s does not support alignment checks.' % self.get_display_language()) - def has_function(self, *args, **kwargs): + def has_function(self, *args, **kwargs) -> Tuple[bool, bool]: raise EnvironmentException('Language %s does not support function checks.' % self.get_display_language()) @classmethod @@ -1026,33 +916,27 @@ "Always returns a copy that can be independently mutated" return args[:] + @classmethod + def native_args_to_unix(cls, args: typing.List[str]) -> typing.List[str]: + "Always returns a copy that can be independently mutated" + return args[:] + def find_library(self, *args, **kwargs): raise EnvironmentException('Language {} does not support library finding.'.format(self.get_display_language())) def get_library_dirs(self, *args, **kwargs): return () - def has_multi_arguments(self, args, env): - raise EnvironmentException( - 'Language {} does not support has_multi_arguments.'.format( - self.get_display_language())) + def get_program_dirs(self, *args, **kwargs): + return [] - def has_multi_link_arguments(self, args, env): + def has_multi_arguments(self, args, env) -> Tuple[bool, bool]: raise EnvironmentException( - 'Language {} does not support has_multi_link_arguments.'.format( + 'Language {} does not support has_multi_arguments.'.format( self.get_display_language())) - def get_cross_extra_flags(self, environment, link): - extra_flags = [] - if self.is_cross and environment: - if 'properties' in environment.cross_info.config: - props = environment.cross_info.config['properties'] - lang_args_key = self.language + '_args' - extra_flags += props.get(lang_args_key, []) - lang_link_args_key = self.language + '_link_args' - if link: - extra_flags += props.get(lang_link_args_key, []) - return extra_flags + def has_multi_link_arguments(self, args: typing.List[str], env: 'Environment') -> Tuple[bool, bool]: + return self.linker.has_multi_arguments(args, env) def _get_compile_output(self, dirname, mode): # In pre-processor mode, the output is sent to stdout and discarded @@ -1066,26 +950,21 @@ suffix = 'obj' return os.path.join(dirname, 'output.' + suffix) + def get_compiler_args_for_mode(self, mode): + args = [] + args += self.get_always_args() + if mode == 'compile': + args += self.get_compile_only_args() + if mode == 'preprocess': + args += self.get_preprocess_only_args() + return args + @contextlib.contextmanager - def compile(self, code, extra_args=None, mode='link', want_output=False): + def compile(self, code, extra_args=None, *, mode='link', want_output=False, temp_dir=None): if extra_args is None: - textra_args = None extra_args = [] - else: - textra_args = tuple(extra_args) - key = (code, textra_args, mode) - if not want_output: - if key in self.compiler_check_cache: - p = self.compiler_check_cache[key] - mlog.debug('Using cached compile:') - mlog.debug('Cached command line: ', ' '.join(p.commands), '\n') - mlog.debug('Code:\n', code) - mlog.debug('Cached compiler stdout:\n', p.stdo) - mlog.debug('Cached compiler stderr:\n', p.stde) - yield p - return try: - with tempfile.TemporaryDirectory() as tmpdirname: + with tempfile.TemporaryDirectory(dir=temp_dir) as tmpdirname: if isinstance(code, str): srcname = os.path.join(tmpdirname, 'testfile.' + self.default_suffix) @@ -1097,15 +976,11 @@ # Construct the compiler command-line commands = CompilerArgs(self) commands.append(srcname) - commands += self.get_always_args() - if mode == 'compile': - commands += self.get_compile_only_args() # Preprocess mode outputs to stdout, so no output args - if mode == 'preprocess': - commands += self.get_preprocess_only_args() - else: + if mode != 'preprocess': output = self._get_compile_output(tmpdirname, mode) commands += self.get_output_args(output) + commands.extend(self.get_compiler_args_for_mode(mode)) # extra_args must be last because it could contain '/link' to # pass args to VisualStudio's linker. In that case everything # in the command line after '/link' is given to the linker. @@ -1125,8 +1000,7 @@ p.input_name = srcname if want_output: p.output_name = output - else: - self.compiler_check_cache[key] = p + p.cached = False # Make sure that the cached attribute always exists yield p except (PermissionError, OSError): # On Windows antivirus programs and the like hold on to files so @@ -1134,6 +1008,39 @@ # catch OSError because the directory is then no longer empty. pass + @contextlib.contextmanager + def cached_compile(self, code, cdata: coredata.CoreData, *, extra_args=None, mode: str = 'link', temp_dir=None): + assert(isinstance(cdata, coredata.CoreData)) + + # Calculate the key + textra_args = tuple(extra_args) if extra_args is not None else None + key = (tuple(self.exelist), self.version, code, textra_args, mode) + + # Check if not cached + if key not in cdata.compiler_check_cache: + with self.compile(code, extra_args=extra_args, mode=mode, want_output=False, temp_dir=temp_dir) as p: + # Remove all attributes except the following + # This way the object can be serialized + tokeep = ['args', 'commands', 'input_name', 'output_name', + 'pid', 'returncode', 'stdo', 'stde', 'text_mode'] + todel = [x for x in vars(p).keys() if x not in tokeep] + for i in todel: + delattr(p, i) + p.cached = False + cdata.compiler_check_cache[key] = p + yield p + return + + # Return cached + p = cdata.compiler_check_cache[key] + p.cached = True + mlog.debug('Using cached compile:') + mlog.debug('Cached command line: ', ' '.join(p.commands), '\n') + mlog.debug('Code:\n', code) + mlog.debug('Cached compiler stdout:\n', p.stdo) + mlog.debug('Cached compiler stderr:\n', p.stde) + yield p + def get_colorout_args(self, colortype): return [] @@ -1142,19 +1049,23 @@ def get_compile_debugfile_args(self, rel_obj, **kwargs): return [] - def get_link_debugfile_args(self, rel_obj): - return [] + def get_link_debugfile_args(self, targetfile: str) -> typing.List[str]: + return self.linker.get_debugfile_args(targetfile) - def get_std_shared_lib_link_args(self): - return [] + def get_std_shared_lib_link_args(self) -> typing.List[str]: + return self.linker.get_std_shared_lib_args() + + def get_std_shared_module_link_args(self, options: 'OptionDictType') -> typing.List[str]: + return self.linker.get_std_shared_module_args(options) - def get_std_shared_module_link_args(self, options): - return self.get_std_shared_lib_link_args() + def get_link_whole_for(self, args: typing.List[str]) -> typing.List[str]: + return self.linker.get_link_whole_for(args) - def get_link_whole_for(self, args): - if isinstance(args, list) and not args: - return [] - raise EnvironmentException('Language %s does not support linking whole archives.' % self.get_display_language()) + def get_allow_undefined_link_args(self) -> typing.List[str]: + return self.linker.get_allow_undefined_args() + + def no_undefined_link_args(self) -> typing.List[str]: + return self.linker.no_undefined_args() # Compiler arguments needed to enable the given instruction set. # May be [] meaning nothing needed or None meaning the given set @@ -1162,68 +1073,11 @@ def get_instruction_set_args(self, instruction_set): return None - def build_unix_rpath_args(self, build_dir, from_dir, rpath_paths, build_rpath, install_rpath): - if not rpath_paths and not install_rpath and not build_rpath: - return [] - args = [] - if mesonlib.is_osx(): - # Ensure that there is enough space for install_name_tool in-place editing of large RPATHs - args.append('-Wl,-headerpad_max_install_names') - # @loader_path is the equivalent of $ORIGIN on macOS - # https://stackoverflow.com/q/26280738 - origin_placeholder = '@loader_path' - else: - origin_placeholder = '$ORIGIN' - # The rpaths we write must be relative if they point to the build dir, - # because otherwise they have different length depending on the build - # directory. This breaks reproducible builds. - processed_rpaths = prepare_rpaths(rpath_paths, build_dir, from_dir) - # Need to deduplicate rpaths, as macOS's install_name_tool - # is *very* allergic to duplicate -delete_rpath arguments - # when calling depfixer on installation. - all_paths = OrderedSet([os.path.join(origin_placeholder, p) for p in processed_rpaths]) - # Build_rpath is used as-is (it is usually absolute). - if build_rpath != '': - all_paths.add(build_rpath) - - if mesonlib.is_dragonflybsd() or mesonlib.is_openbsd(): - # This argument instructs the compiler to record the value of - # ORIGIN in the .dynamic section of the elf. On Linux this is done - # by default, but is not on dragonfly/openbsd for some reason. Without this - # $ORIGIN in the runtime path will be undefined and any binaries - # linked against local libraries will fail to resolve them. - args.append('-Wl,-z,origin') - - if mesonlib.is_osx(): - # macOS does not support colon-separated strings in LC_RPATH, - # hence we have to pass each path component individually - args += ['-Wl,-rpath,' + rp for rp in all_paths] - else: - # In order to avoid relinking for RPATH removal, the binary needs to contain just - # enough space in the ELF header to hold the final installation RPATH. - paths = ':'.join(all_paths) - if len(paths) < len(install_rpath): - padding = 'X' * (len(install_rpath) - len(paths)) - if not paths: - paths = padding - else: - paths = paths + ':' + padding - args.append('-Wl,-rpath,' + paths) - - if get_compiler_is_linuxlike(self): - # Rpaths to use while linking must be absolute. These are not - # written to the binary. Needed only with GNU ld: - # https://sourceware.org/bugzilla/show_bug.cgi?id=16936 - # Not needed on Windows or other platforms that don't use RPATH - # https://github.com/mesonbuild/meson/issues/1897 - lpaths = ':'.join([os.path.join(build_dir, p) for p in rpath_paths]) - - # clang expands '-Wl,rpath-link,' to ['-rpath-link'] instead of ['-rpath-link',''] - # This eats the next argument, which happens to be 'ldstdc++', causing link failures. - # We can dodge this problem by not adding any rpath_paths if the argument is empty. - if lpaths.strip() != '': - args += ['-Wl,-rpath-link,' + lpaths] - return args + def build_rpath_args(self, env: 'Environment', build_dir: str, from_dir: str, + rpath_paths: str, build_rpath: str, + install_rpath: str) -> typing.List[str]: + return self.linker.build_rpath_args( + env, build_dir, from_dir, rpath_paths, build_rpath, install_rpath) def thread_flags(self, env): return [] @@ -1232,10 +1086,6 @@ raise EnvironmentException('Language %s does not support OpenMP flags.' % self.get_display_language()) def language_stdlib_only_link_flags(self): - # The linker flags needed to link the standard library of the current - # language in. This is needed in cases where you e.g. combine D and C++ - # and both of which need to link their runtime library in or otherwise - # building fails with undefined symbols. return [] def gnu_symbol_visibility_args(self, vistype): @@ -1256,9 +1106,8 @@ m = 'Language {} does not support position-independent executable' raise EnvironmentException(m.format(self.get_display_language())) - def get_pie_link_args(self): - m = 'Language {} does not support position-independent executable' - raise EnvironmentException(m.format(self.get_display_language())) + def get_pie_link_args(self) -> typing.List[str]: + return self.linker.get_pie_args() def get_argument_syntax(self): """Returns the argument family type. @@ -1279,15 +1128,52 @@ raise EnvironmentException( '%s does not support get_profile_use_args ' % self.get_id()) - def get_undefined_link_args(self): - ''' - Get args for allowing undefined symbols when linking to a shared library - ''' - return [] + def get_undefined_link_args(self) -> typing.List[str]: + return self.linker.get_undefined_link_args() def remove_linkerlike_args(self, args): return [x for x in args if not x.startswith('-Wl')] + def get_lto_compile_args(self) -> List[str]: + return [] + + def get_lto_link_args(self) -> List[str]: + return self.linker.get_lto_args() + + def sanitizer_compile_args(self, value: str) -> List[str]: + return [] + + def sanitizer_link_args(self, value: str) -> List[str]: + return self.linker.sanitizer_args(value) + + def get_asneeded_args(self) -> typing.List[str]: + return self.linker.get_asneeded_args() + + def bitcode_args(self) -> typing.List[str]: + return self.linker.bitcode_args() + + def get_linker_debug_crt_args(self) -> typing.List[str]: + return self.linker.get_debug_crt_args() + + def get_buildtype_linker_args(self, buildtype: str) -> typing.List[str]: + return self.linker.get_buildtype_args(buildtype) + + def get_soname_args(self, env: 'Environment', prefix: str, shlib_name: str, + suffix: str, soversion: str, darwin_versions: typing.Tuple[str, str], + is_shared_module: bool) -> typing.List[str]: + return self.linker.get_soname_args( + env, prefix, shlib_name, suffix, soversion, + darwin_versions, is_shared_module) + + def get_target_link_args(self, target): + return target.link_args + + def get_dependency_compile_args(self, dep): + return dep.get_compile_args() + + def get_dependency_link_args(self, dep): + return dep.get_link_args() + @enum.unique class CompilerType(enum.Enum): @@ -1299,6 +1185,7 @@ CLANG_STANDARD = 10 CLANG_OSX = 11 CLANG_MINGW = 12 + CLANG_EMSCRIPTEN = 13 # Possibly clang-cl? ICC_STANDARD = 20 @@ -1309,61 +1196,26 @@ CCRX_WIN = 40 + PGI_STANDARD = 50 + PGI_OSX = 51 + PGI_WIN = 52 + @property def is_standard_compiler(self): - return self.name in ('GCC_STANDARD', 'CLANG_STANDARD', 'ICC_STANDARD') + return self.name in ('GCC_STANDARD', 'CLANG_STANDARD', 'ICC_STANDARD', 'PGI_STANDARD') @property def is_osx_compiler(self): - return self.name in ('GCC_OSX', 'CLANG_OSX', 'ICC_OSX') + return self.name in ('GCC_OSX', 'CLANG_OSX', 'ICC_OSX', 'PGI_OSX') @property def is_windows_compiler(self): - return self.name in ('GCC_MINGW', 'GCC_CYGWIN', 'CLANG_MINGW', 'ICC_WIN', 'ARM_WIN', 'CCRX_WIN') - - -def get_macos_dylib_install_name(prefix, shlib_name, suffix, soversion): - install_name = prefix + shlib_name - if soversion is not None: - install_name += '.' + soversion - install_name += '.dylib' - return '@rpath/' + install_name - -def get_gcc_soname_args(compiler_type, prefix, shlib_name, suffix, soversion, darwin_versions, is_shared_module): - if compiler_type.is_standard_compiler: - sostr = '' if soversion is None else '.' + soversion - return ['-Wl,-soname,%s%s.%s%s' % (prefix, shlib_name, suffix, sostr)] - elif compiler_type.is_windows_compiler: - # For PE/COFF the soname argument has no effect with GNU LD - return [] - elif compiler_type.is_osx_compiler: - if is_shared_module: - return [] - name = get_macos_dylib_install_name(prefix, shlib_name, suffix, soversion) - args = ['-install_name', name] - if darwin_versions: - args += ['-compatibility_version', darwin_versions[0], '-current_version', darwin_versions[1]] - return args - else: - raise RuntimeError('Not implemented yet.') + return self.name in ('GCC_MINGW', 'GCC_CYGWIN', 'CLANG_MINGW', 'ICC_WIN', 'ARM_WIN', 'CCRX_WIN', 'PGI_WIN') def get_compiler_is_linuxlike(compiler): compiler_type = getattr(compiler, 'compiler_type', None) return compiler_type and compiler_type.is_standard_compiler -def get_compiler_uses_gnuld(c): - # FIXME: Perhaps we should detect the linker in the environment? - # FIXME: Assumes that *BSD use GNU ld, but they might start using lld soon - compiler_type = getattr(c, 'compiler_type', None) - return compiler_type in ( - CompilerType.GCC_STANDARD, - CompilerType.GCC_MINGW, - CompilerType.GCC_CYGWIN, - CompilerType.CLANG_STANDARD, - CompilerType.CLANG_MINGW, - CompilerType.ICC_STANDARD, - CompilerType.ICC_WIN) - def get_largefile_args(compiler): ''' Enable transparent large-file-support for 32-bit UNIX systems @@ -1384,622 +1236,3 @@ # transitionary features and must be enabled by programs that use # those features explicitly. return [] - -# TODO: The result from calling compiler should be cached. So that calling this -# function multiple times don't add latency. -def gnulike_default_include_dirs(compiler, lang): - if lang == 'cpp': - lang = 'c++' - env = os.environ.copy() - env["LC_ALL"] = 'C' - cmd = compiler + ['-x{}'.format(lang), '-E', '-v', '-'] - p = subprocess.Popen( - cmd, - stdin=subprocess.DEVNULL, - stderr=subprocess.PIPE, - stdout=subprocess.PIPE, - env=env - ) - stderr = p.stderr.read().decode('utf-8', errors='replace') - parse_state = 0 - paths = [] - for line in stderr.split('\n'): - if parse_state == 0: - if line == '#include "..." search starts here:': - parse_state = 1 - elif parse_state == 1: - if line == '#include <...> search starts here:': - parse_state = 2 - else: - paths.append(line[1:]) - elif parse_state == 2: - if line == 'End of search list.': - break - else: - paths.append(line[1:]) - if len(paths) == 0: - mlog.warning('No include directory found parsing "{cmd}" output'.format(cmd=" ".join(cmd))) - return paths - - -class GnuLikeCompiler(abc.ABC): - """ - GnuLikeCompiler is a common interface to all compilers implementing - the GNU-style commandline interface. This includes GCC, Clang - and ICC. Certain functionality between them is different and requires - that the actual concrete subclass define their own implementation. - """ - 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_pie'] - 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') - - def get_asneeded_args(self): - # GNU ld cannot be installed on macOS - # https://github.com/Homebrew/homebrew-core/issues/17794#issuecomment-328174395 - # Hence, we don't need to differentiate between OS and ld - # for the sake of adding as-needed support - if self.compiler_type.is_osx_compiler: - return '-Wl,-dead_strip_dylibs' - else: - return '-Wl,--as-needed' - - def get_pic_args(self): - if self.compiler_type.is_osx_compiler or self.compiler_type.is_windows_compiler: - return [] # On Window and OS X, pic is always on. - return ['-fPIC'] - - def get_pie_args(self): - return ['-fPIE'] - - def get_pie_link_args(self): - return ['-pie'] - - def get_buildtype_args(self, buildtype): - return gnulike_buildtype_args[buildtype] - - @abc.abstractmethod - def get_optimization_args(self, optimization_level): - raise NotImplementedError("get_optimization_args not implemented") - - def get_debug_args(self, is_debug): - return clike_debug_args[is_debug] - - def get_buildtype_linker_args(self, buildtype): - if self.compiler_type.is_osx_compiler: - return apple_buildtype_linker_args[buildtype] - return gnulike_buildtype_linker_args[buildtype] - - @abc.abstractmethod - def get_pch_suffix(self): - raise NotImplementedError("get_pch_suffix not implemented") - - def split_shlib_to_parts(self, fname): - return os.path.dirname(fname), fname - - def get_soname_args(self, *args): - return get_gcc_soname_args(self.compiler_type, *args) - - def get_std_shared_lib_link_args(self): - return ['-shared'] - - def get_std_shared_module_link_args(self, options): - if self.compiler_type.is_osx_compiler: - return ['-bundle', '-Wl,-undefined,dynamic_lookup'] - return ['-shared'] - - def get_link_whole_for(self, args): - if self.compiler_type.is_osx_compiler: - result = [] - for a in args: - result += ['-Wl,-force_load', a] - return result - return ['-Wl,--whole-archive'] + args + ['-Wl,--no-whole-archive'] - - def get_instruction_set_args(self, instruction_set): - return gnulike_instruction_set_args.get(instruction_set, None) - - def get_default_include_dirs(self): - return gnulike_default_include_dirs(self.exelist, self.language) - - @abc.abstractmethod - def openmp_flags(self): - raise NotImplementedError("openmp_flags not implemented") - - def gnu_symbol_visibility_args(self, vistype): - return gnu_symbol_visibility_args[vistype] - - def gen_vs_module_defs_args(self, defsfile): - if not isinstance(defsfile, str): - raise RuntimeError('Module definitions file should be str') - # On Windows targets, .def files may be specified on the linker command - # line like an object file. - if self.compiler_type.is_windows_compiler: - return [defsfile] - # For other targets, discard the .def file. - return [] - - def get_argument_syntax(self): - return 'gcc' - - def get_profile_generate_args(self): - return ['-fprofile-generate'] - - def get_profile_use_args(self): - return ['-fprofile-use', '-fprofile-correction'] - - def get_allow_undefined_link_args(self): - if self.compiler_type.is_osx_compiler: - # Apple ld - return ['-Wl,-undefined,dynamic_lookup'] - elif self.compiler_type.is_windows_compiler: - # For PE/COFF this is impossible - return [] - else: - # GNU ld and LLVM lld - return ['-Wl,--allow-shlib-undefined'] - - -class GnuCompiler(GnuLikeCompiler): - """ - GnuCompiler represents an actual GCC in its many incarnations. - Compilers imitating GCC (Clang/Intel) should use the GnuLikeCompiler ABC. - """ - def __init__(self, compiler_type, defines): - super().__init__(compiler_type) - self.id = 'gcc' - self.defines = defines or {} - self.base_options.append('b_colorout') - - def get_colorout_args(self, colortype): - if mesonlib.version_compare(self.version, '>=4.9.0'): - return gnu_color_args[colortype][:] - return [] - - def get_warn_args(self, level): - args = super().get_warn_args(level) - if mesonlib.version_compare(self.version, '<4.8.0') and '-Wpedantic' in args: - # -Wpedantic was added in 4.8.0 - # https://gcc.gnu.org/gcc-4.8/changes.html - args[args.index('-Wpedantic')] = '-pedantic' - return args - - def has_builtin_define(self, define): - return define in self.defines - - def get_builtin_define(self, define): - if define in self.defines: - return self.defines[define] - - def get_optimization_args(self, optimization_level): - return gnu_optimization_args[optimization_level] - - def get_pch_suffix(self): - return 'gch' - - def get_gui_app_args(self, value): - if self.compiler_type.is_windows_compiler and value: - return ['-mwindows'] - return [] - - def openmp_flags(self): - return ['-fopenmp'] - - -class ElbrusCompiler(GnuCompiler): - # Elbrus compiler is nearly like GCC, but does not support - # PCH, LTO, sanitizers and color output as of version 1.21.x. - def __init__(self, compiler_type, defines): - GnuCompiler.__init__(self, compiler_type, defines) - self.id = 'lcc' - self.base_options = ['b_pgo', 'b_coverage', - 'b_ndebug', 'b_staticpic', - 'b_lundef', 'b_asneeded'] - - # FIXME: use _build_wrapper to call this so that linker flags from the env - # get applied - def get_library_dirs(self, env): - os_env = os.environ.copy() - os_env['LC_ALL'] = 'C' - stdo = Popen_safe(self.exelist + ['--print-search-dirs'], env=os_env)[1] - paths = () - for line in stdo.split('\n'): - if line.startswith('libraries:'): - # lcc does not include '=' in --print-search-dirs output. - libstr = line.split(' ', 1)[1] - paths = (os.path.realpath(p) for p in libstr.split(':')) - break - return paths - - def get_program_dirs(self, env): - os_env = os.environ.copy() - os_env['LC_ALL'] = 'C' - stdo = Popen_safe(self.exelist + ['--print-search-dirs'], env=os_env)[1] - paths = () - for line in stdo.split('\n'): - if line.startswith('programs:'): - # lcc does not include '=' in --print-search-dirs output. - libstr = line.split(' ', 1)[1] - paths = (os.path.realpath(p) for p in libstr.split(':')) - break - return paths - - -class ClangCompiler(GnuLikeCompiler): - def __init__(self, compiler_type): - super().__init__(compiler_type) - self.id = 'clang' - self.base_options.append('b_colorout') - if self.compiler_type.is_osx_compiler: - self.base_options.append('b_bitcode') - # All Clang backends can also do LLVM IR - self.can_compile_suffixes.add('ll') - - def get_colorout_args(self, colortype): - return clang_color_args[colortype][:] - - def get_optimization_args(self, optimization_level): - return clike_optimization_args[optimization_level] - - def get_pch_suffix(self): - return 'pch' - - def get_pch_use_args(self, pch_dir, header): - # Workaround for Clang bug http://llvm.org/bugs/show_bug.cgi?id=15136 - # This flag is internal to Clang (or at least not documented on the man page) - # so it might change semantics at any time. - return ['-include-pch', os.path.join(pch_dir, self.get_pch_name(header))] - - def has_multi_arguments(self, args, env): - myargs = ['-Werror=unknown-warning-option', '-Werror=unused-command-line-argument'] - if mesonlib.version_compare(self.version, '>=3.6.0'): - myargs.append('-Werror=ignored-optimization-argument') - return super().has_multi_arguments( - myargs + args, - env) - - def has_function(self, funcname, prefix, env, *, extra_args=None, dependencies=None): - if extra_args is None: - extra_args = [] - # Starting with XCode 8, we need to pass this to force linker - # visibility to obey OS X and iOS minimum version targets with - # -mmacosx-version-min, -miphoneos-version-min, etc. - # https://github.com/Homebrew/homebrew-core/issues/3727 - if self.compiler_type.is_osx_compiler and version_compare(self.version, '>=8.0'): - extra_args.append('-Wl,-no_weak_imports') - return super().has_function(funcname, prefix, env, extra_args=extra_args, - dependencies=dependencies) - - def openmp_flags(self): - if version_compare(self.version, '>=3.8.0'): - return ['-fopenmp'] - elif version_compare(self.version, '>=3.7.0'): - return ['-fopenmp=libomp'] - else: - # Shouldn't work, but it'll be checked explicitly in the OpenMP dependency. - return [] - - -class ArmclangCompiler: - def __init__(self, compiler_type): - if not self.is_cross: - raise EnvironmentException('armclang supports only cross-compilation.') - # Check whether 'armlink.exe' is available in path - self.linker_exe = 'armlink.exe' - args = '--vsn' - try: - p, stdo, stderr = Popen_safe(self.linker_exe, args) - except OSError as e: - err_msg = 'Unknown linker\nRunning "{0}" gave \n"{1}"'.format(' '.join([self.linker_exe] + [args]), e) - raise EnvironmentException(err_msg) - # Verify the armlink version - ver_str = re.search('.*Component.*', stdo) - if ver_str: - ver_str = ver_str.group(0) - else: - EnvironmentException('armlink version string not found') - # Using the regular expression from environment.search_version, - # which is used for searching compiler version - version_regex = '(?=15.0.0'): - return ['-qopenmp'] - else: - return ['-openmp'] - - def compiles(self, *args, **kwargs): - # This covers a case that .get('foo', []) doesn't, that extra_args is - # defined and is None - extra_args = kwargs.get('extra_args') or [] - kwargs['extra_args'] = [ - extra_args, - '-diag-error', '10006', # ignoring unknown option - '-diag-error', '10148', # Option not supported - '-diag-error', '1292', # unknown __attribute__ - ] - return super().compiles(*args, **kwargs) - - def get_profile_generate_args(self): - return ['-prof-gen=threadsafe'] - - def get_profile_use_args(self): - return ['-prof-use'] - - -class ArmCompiler: - # Functionality that is common to all ARM family compilers. - def __init__(self, compiler_type): - if not self.is_cross: - raise EnvironmentException('armcc supports only cross-compilation.') - self.id = 'arm' - self.compiler_type = compiler_type - default_warn_args = [] - self.warn_args = {'1': default_warn_args, - '2': default_warn_args + [], - '3': default_warn_args + []} - # Assembly - self.can_compile_suffixes.add('s') - - def can_linker_accept_rsp(self): - return False - - def get_pic_args(self): - # FIXME: Add /ropi, /rwpi, /fpic etc. qualifiers to --apcs - return [] - - def get_buildtype_args(self, buildtype): - return arm_buildtype_args[buildtype] - - def get_buildtype_linker_args(self, buildtype): - return arm_buildtype_linker_args[buildtype] - - # Override CCompiler.get_always_args - def get_always_args(self): - return [] - - # Override CCompiler.get_dependency_gen_args - def get_dependency_gen_args(self, outtarget, outfile): - return [] - - # Override CCompiler.get_std_shared_lib_link_args - def get_std_shared_lib_link_args(self): - return [] - - def get_pch_use_args(self, pch_dir, header): - # FIXME: Add required arguments - # NOTE from armcc user guide: - # "Support for Precompiled Header (PCH) files is deprecated from ARM Compiler 5.05 - # onwards on all platforms. Note that ARM Compiler on Windows 8 never supported - # PCH files." - return [] - - def get_pch_suffix(self): - # NOTE from armcc user guide: - # "Support for Precompiled Header (PCH) files is deprecated from ARM Compiler 5.05 - # onwards on all platforms. Note that ARM Compiler on Windows 8 never supported - # PCH files." - return 'pch' - - def thread_flags(self, env): - return [] - - def thread_link_flags(self, env): - return [] - - def get_linker_exelist(self): - args = ['armlink'] - return args - - def get_coverage_args(self): - return [] - - def get_coverage_link_args(self): - return [] - - def get_optimization_args(self, optimization_level): - return arm_optimization_args[optimization_level] - - def get_debug_args(self, is_debug): - return clike_debug_args[is_debug] - -class CcrxCompiler: - def __init__(self, compiler_type): - if not self.is_cross: - raise EnvironmentException('ccrx supports only cross-compilation.') - # Check whether 'rlink.exe' is available in path - self.linker_exe = 'rlink.exe' - args = '--version' - try: - p, stdo, stderr = Popen_safe(self.linker_exe, args) - except OSError as e: - err_msg = 'Unknown linker\nRunning "{0}" gave \n"{1}"'.format(' '.join([self.linker_exe] + [args]), e) - raise EnvironmentException(err_msg) - self.id = 'ccrx' - self.compiler_type = compiler_type - # Assembly - self.can_compile_suffixes.update('s') - default_warn_args = [] - self.warn_args = {'1': default_warn_args, - '2': default_warn_args + [], - '3': default_warn_args + []} - - def can_linker_accept_rsp(self): - return False - - def get_pic_args(self): - # PIC support is not enabled by default for CCRX, - # if users want to use it, they need to add the required arguments explicitly - return [] - - def get_buildtype_args(self, buildtype): - return ccrx_buildtype_args[buildtype] - - def get_buildtype_linker_args(self, buildtype): - return ccrx_buildtype_linker_args[buildtype] - - # Override CCompiler.get_std_shared_lib_link_args - def get_std_shared_lib_link_args(self): - return [] - - def get_pch_suffix(self): - return 'pch' - - def get_pch_use_args(self, pch_dir, header): - return [] - - # Override CCompiler.get_dependency_gen_args - def get_dependency_gen_args(self, outtarget, outfile): - return [] - - # Override CCompiler.build_rpath_args - def build_rpath_args(self, build_dir, from_dir, rpath_paths, build_rpath, install_rpath): - return [] - - def thread_flags(self, env): - return [] - - def thread_link_flags(self, env): - return [] - - def get_linker_exelist(self): - return [self.linker_exe] - - def get_linker_lib_prefix(self): - return '-lib=' - - def get_coverage_args(self): - return [] - - def get_coverage_link_args(self): - return [] - - def get_optimization_args(self, optimization_level): - return ccrx_optimization_args[optimization_level] - - def get_debug_args(self, is_debug): - return ccrx_debug_args[is_debug] - - @classmethod - def unix_args_to_native(cls, args): - result = [] - for i in args: - if i.startswith('-D'): - i = '-define=' + i[2:] - if i.startswith('-I'): - i = '-include=' + i[2:] - if i.startswith('-Wl,-rpath='): - continue - elif i == '--print-search-dirs': - continue - elif i.startswith('-L'): - continue - result.append(i) - return result diff -Nru meson-0.49.0/mesonbuild/compilers/cpp.py meson-0.52.1/mesonbuild/compilers/cpp.py --- meson-0.49.0/mesonbuild/compilers/cpp.py 2018-12-09 14:27:23.000000000 +0000 +++ meson-0.52.1/mesonbuild/compilers/cpp.py 2019-11-28 17:37:44.000000000 +0000 @@ -12,38 +12,55 @@ # See the License for the specific language governing permissions and # limitations under the License. +import copy import functools import os.path +import typing from .. import coredata from .. import mlog -from ..mesonlib import MesonException, version_compare +from ..mesonlib import MesonException, MachineChoice, version_compare -from .c import CCompiler, VisualStudioCCompiler, ClangClCCompiler from .compilers import ( gnu_winlibs, msvc_winlibs, - ClangCompiler, - GnuCompiler, - ElbrusCompiler, - IntelCompiler, - ArmCompiler, - ArmclangCompiler, - CcrxCompiler, + Compiler, ) -from .c_function_attributes import CXX_FUNC_ATTRIBUTES +from .c_function_attributes import CXX_FUNC_ATTRIBUTES, C_FUNC_ATTRIBUTES +from .mixins.clike import CLikeCompiler +from .mixins.ccrx import CcrxCompiler +from .mixins.arm import ArmCompiler, ArmclangCompiler +from .mixins.visualstudio import VisualStudioLikeCompiler +from .mixins.gnu import GnuCompiler +from .mixins.intel import IntelGnuLikeCompiler, IntelVisualStudioLikeCompiler +from .mixins.clang import ClangCompiler +from .mixins.elbrus import ElbrusCompiler +from .mixins.pgi import PGICompiler +from .mixins.islinker import BasicLinkerIsCompilerMixin, LinkerEnvVarsMixin + + +def non_msvc_eh_options(eh, args): + if eh == 'none': + args.append('-fno-exceptions') + elif eh == 's' or eh == 'c': + mlog.warning('non-MSVC compilers do not support ' + eh + ' exception handling.' + + 'You may want to set eh to \'default\'.') -class CPPCompiler(CCompiler): +class CPPCompiler(CLikeCompiler, Compiler): @classmethod def attribute_check_func(cls, name): - return CXX_FUNC_ATTRIBUTES.get(name, super().attribute_check_func(name)) + try: + return CXX_FUNC_ATTRIBUTES.get(name, C_FUNC_ATTRIBUTES[name]) + except KeyError: + raise MesonException('Unknown function attribute "{}"'.format(name)) - def __init__(self, exelist, version, is_cross, exe_wrap, **kwargs): + def __init__(self, exelist, version, for_machine: MachineChoice, is_cross: bool, + exe_wrap: typing.Optional[str] = None, **kwargs): # If a child ObjCPP class has already set it, don't set it ourselves - if not hasattr(self, 'language'): - self.language = 'cpp' - CCompiler.__init__(self, exelist, version, is_cross, exe_wrap, **kwargs) + self.language = 'cpp' + Compiler.__init__(self, exelist, version, for_machine, **kwargs) + CLikeCompiler.__init__(self, is_cross, exe_wrap) def get_display_language(self): return 'C++' @@ -52,7 +69,7 @@ return ['-nostdinc++'] def sanity_check(self, work_dir, environment): - code = 'class breakCCompiler;int main(int argc, char **argv) { return 0; }\n' + code = 'class breakCCompiler;int main() { return 0; }\n' return self.sanity_check_impl(work_dir, environment, 'sanitycheckcpp.cc', code) def get_compiler_check_args(self): @@ -63,10 +80,11 @@ def has_header_symbol(self, hname, symbol, prefix, env, *, extra_args=None, dependencies=None): # Check if it's a C-like symbol - if super().has_header_symbol(hname, symbol, prefix, env, - extra_args=extra_args, - dependencies=dependencies): - return True + found, cached = super().has_header_symbol(hname, symbol, prefix, env, + extra_args=extra_args, + dependencies=dependencies) + if found: + return True, cached # Check if it's a class or a template if extra_args is None: extra_args = [] @@ -88,7 +106,7 @@ # 2. even if it did have an env object, that might contain another more # recent -std= argument, which might lead to a cascaded failure. CPP_TEST = 'int i = static_cast(0);' - with self.compile(code=CPP_TEST, extra_args=[cpp_std_value], mode='compile') as p: + with self.compile(CPP_TEST, extra_args=[cpp_std_value], mode='compile') as p: if p.returncode == 0: mlog.debug('Compiler accepts {}:'.format(cpp_std_value), 'YES') return True @@ -113,8 +131,8 @@ 'gnu++17': 'gnu++1z' } - # Currently, remapping is only supported for Clang and GCC - assert(self.id in frozenset(['clang', 'gcc'])) + # Currently, remapping is only supported for Clang, Elbrus and GCC + assert(self.id in frozenset(['clang', 'lcc', 'gcc', 'emscripten'])) if cpp_std not in CPP_FALLBACKS: # 'c++03' and 'c++98' don't have fallback types @@ -129,17 +147,21 @@ class ClangCPPCompiler(ClangCompiler, CPPCompiler): - def __init__(self, exelist, version, compiler_type, is_cross, exe_wrapper=None, **kwargs): - CPPCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwargs) + def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwargs): + CPPCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwargs) ClangCompiler.__init__(self, compiler_type) default_warn_args = ['-Wall', '-Winvalid-pch', '-Wnon-virtual-dtor'] - self.warn_args = {'1': default_warn_args, + self.warn_args = {'0': [], + '1': default_warn_args, '2': default_warn_args + ['-Wextra'], '3': default_warn_args + ['-Wextra', '-Wpedantic']} def get_options(self): opts = CPPCompiler.get_options(self) - opts.update({'cpp_std': coredata.UserComboOption('cpp_std', 'C++ language standard to use', + opts.update({'cpp_eh': coredata.UserComboOption('C++ exception handling type.', + ['none', 'default', 'a', 's', 'sc'], + 'default'), + 'cpp_std': coredata.UserComboOption('C++ language standard to use', ['none', 'c++98', 'c++03', 'c++11', 'c++14', 'c++17', 'c++1z', 'c++2a', 'gnu++11', 'gnu++14', 'gnu++17', 'gnu++1z', 'gnu++2a'], 'none')}) @@ -150,6 +172,9 @@ std = options['cpp_std'] if std.value != 'none': args.append(self._find_best_cpp_std(std.value)) + + non_msvc_eh_options(options['cpp_eh'].value, args) + return args def get_option_link_args(self, options): @@ -159,18 +184,49 @@ return ['-lstdc++'] +class EmscriptenCPPCompiler(LinkerEnvVarsMixin, BasicLinkerIsCompilerMixin, ClangCPPCompiler): + def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwargs): + if not is_cross: + raise MesonException('Emscripten compiler can only be used for cross compilation.') + ClangCPPCompiler.__init__(self, exelist, version, compiler_type, for_machine, is_cross, exe_wrapper, **kwargs) + self.id = 'emscripten' + + def get_option_compile_args(self, options): + args = [] + std = options['cpp_std'] + if std.value != 'none': + args.append(self._find_best_cpp_std(std.value)) + return args + + def get_option_link_args(self, options): + return [] + + def get_soname_args(self, *args, **kwargs): + raise MesonException('Emscripten does not support shared libraries.') + + def get_allow_undefined_link_args(self) -> typing.List[str]: + return ['-s', 'ERROR_ON_UNDEFINED_SYMBOLS=0'] + + def get_linker_output_args(self, output: str) -> typing.List[str]: + return ['-o', output] + + class ArmclangCPPCompiler(ArmclangCompiler, CPPCompiler): - def __init__(self, exelist, version, compiler_type, is_cross, exe_wrapper=None, **kwargs): - CPPCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwargs) + def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwargs): + CPPCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwargs) ArmclangCompiler.__init__(self, compiler_type) default_warn_args = ['-Wall', '-Winvalid-pch', '-Wnon-virtual-dtor'] - self.warn_args = {'1': default_warn_args, + self.warn_args = {'0': [], + '1': default_warn_args, '2': default_warn_args + ['-Wextra'], '3': default_warn_args + ['-Wextra', '-Wpedantic']} def get_options(self): opts = CPPCompiler.get_options(self) - opts.update({'cpp_std': coredata.UserComboOption('cpp_std', 'C++ language standard to use', + opts.update({'cpp_eh': coredata.UserComboOption('C++ exception handling type.', + ['none', 'default', 'a', 's', 'sc'], + 'default'), + 'cpp_std': coredata.UserComboOption('C++ language standard to use', ['none', 'c++98', 'c++03', 'c++11', 'c++14', 'c++17', 'gnu++98', 'gnu++03', 'gnu++11', 'gnu++14', 'gnu++17'], 'none')}) @@ -181,6 +237,9 @@ std = options['cpp_std'] if std.value != 'none': args.append('-std=' + std.value) + + non_msvc_eh_options(options['cpp_eh'].value, args) + return args def get_option_link_args(self, options): @@ -188,26 +247,29 @@ class GnuCPPCompiler(GnuCompiler, CPPCompiler): - def __init__(self, exelist, version, compiler_type, is_cross, exe_wrap, defines, **kwargs): - CPPCompiler.__init__(self, exelist, version, is_cross, exe_wrap, **kwargs) + def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrap, defines, **kwargs): + CPPCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrap, **kwargs) GnuCompiler.__init__(self, compiler_type, defines) default_warn_args = ['-Wall', '-Winvalid-pch', '-Wnon-virtual-dtor'] - self.warn_args = {'1': default_warn_args, + self.warn_args = {'0': [], + '1': default_warn_args, '2': default_warn_args + ['-Wextra'], '3': default_warn_args + ['-Wextra', '-Wpedantic']} def get_options(self): opts = CPPCompiler.get_options(self) - opts.update({'cpp_std': coredata.UserComboOption('cpp_std', 'C++ language standard to use', + opts.update({'cpp_eh': coredata.UserComboOption('C++ exception handling type.', + ['none', 'default', 'a', 's', 'sc'], + 'default'), + 'cpp_std': coredata.UserComboOption('C++ language standard to use', ['none', 'c++98', 'c++03', 'c++11', 'c++14', 'c++17', 'c++1z', 'c++2a', 'gnu++03', 'gnu++11', 'gnu++14', 'gnu++17', 'gnu++1z', 'gnu++2a'], 'none'), - 'cpp_debugstl': coredata.UserBooleanOption('cpp_debugstl', - 'STL debug mode', + 'cpp_debugstl': coredata.UserBooleanOption('STL debug mode', False)}) if self.compiler_type.is_windows_compiler: opts.update({ - 'cpp_winlibs': coredata.UserArrayOption('cpp_winlibs', 'Standard Win libraries to link against', + 'cpp_winlibs': coredata.UserArrayOption('Standard Win libraries to link against', gnu_winlibs), }) return opts @@ -216,6 +278,9 @@ std = options['cpp_std'] if std.value != 'none': args.append(self._find_best_cpp_std(std.value)) + + non_msvc_eh_options(options['cpp_eh'].value, args) + if options['cpp_debugstl'].value: args.append('-D_GLIBCXX_DEBUG=1') return args @@ -232,39 +297,50 @@ return ['-lstdc++'] +class PGICPPCompiler(PGICompiler, CPPCompiler): + def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwargs): + CPPCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwargs) + PGICompiler.__init__(self, compiler_type) + class ElbrusCPPCompiler(GnuCPPCompiler, ElbrusCompiler): - def __init__(self, exelist, version, compiler_type, is_cross, exe_wrapper=None, defines=None, **kwargs): - GnuCPPCompiler.__init__(self, exelist, version, compiler_type, is_cross, exe_wrapper, defines, **kwargs) + def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, defines=None, **kwargs): + GnuCPPCompiler.__init__(self, exelist, version, compiler_type, for_machine, is_cross, exe_wrapper, defines, **kwargs) ElbrusCompiler.__init__(self, compiler_type, defines) # It does not support c++/gnu++ 17 and 1z, but still does support 0x, 1y, and gnu++98. def get_options(self): opts = CPPCompiler.get_options(self) - opts['cpp_std'] = coredata.UserComboOption('cpp_std', 'C++ language standard to use', - ['none', 'c++98', 'c++03', 'c++0x', 'c++11', 'c++14', 'c++1y', - 'gnu++98', 'gnu++03', 'gnu++0x', 'gnu++11', 'gnu++14', 'gnu++1y'], - 'none') + opts.update({'cpp_eh': coredata.UserComboOption('C++ exception handling type.', + ['none', 'default', 'a', 's', 'sc'], + 'default'), + 'cpp_std': coredata.UserComboOption('C++ language standard to use', + ['none', 'c++98', 'c++03', 'c++0x', 'c++11', 'c++14', 'c++1y', + 'gnu++98', 'gnu++03', 'gnu++0x', 'gnu++11', 'gnu++14', 'gnu++1y'], + 'none'), + 'cpp_debugstl': coredata.UserBooleanOption('STL debug mode', + False)}) return opts # Elbrus C++ compiler does not have lchmod, but there is only linker warning, not compiler error. # So we should explicitly fail at this case. def has_function(self, funcname, prefix, env, *, extra_args=None, dependencies=None): if funcname == 'lchmod': - return False + return False, False else: return super().has_function(funcname, prefix, env, extra_args=extra_args, dependencies=dependencies) -class IntelCPPCompiler(IntelCompiler, CPPCompiler): - def __init__(self, exelist, version, compiler_type, is_cross, exe_wrap, **kwargs): - CPPCompiler.__init__(self, exelist, version, is_cross, exe_wrap, **kwargs) - IntelCompiler.__init__(self, compiler_type) +class IntelCPPCompiler(IntelGnuLikeCompiler, CPPCompiler): + def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrap, **kwargs): + CPPCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrap, **kwargs) + IntelGnuLikeCompiler.__init__(self, compiler_type) self.lang_header = 'c++-header' default_warn_args = ['-Wall', '-w3', '-diag-disable:remark', '-Wpch-messages', '-Wnon-virtual-dtor'] - self.warn_args = {'1': default_warn_args, + self.warn_args = {'0': [], + '1': default_warn_args, '2': default_warn_args + ['-Wextra'], '3': default_warn_args + ['-Wextra']} @@ -282,11 +358,13 @@ c_stds += ['c++17'] if version_compare(self.version, '>=17.0.0'): g_stds += ['gnu++14'] - opts.update({'cpp_std': coredata.UserComboOption('cpp_std', 'C++ language standard to use', + opts.update({'cpp_eh': coredata.UserComboOption('C++ exception handling type.', + ['none', 'default', 'a', 's', 'sc'], + 'default'), + 'cpp_std': coredata.UserComboOption('C++ language standard to use', ['none'] + c_stds + g_stds, 'none'), - 'cpp_debugstl': coredata.UserBooleanOption('cpp_debugstl', - 'STL debug mode', + 'cpp_debugstl': coredata.UserBooleanOption('STL debug mode', False)}) return opts @@ -299,6 +377,8 @@ 'gnu++03': 'gnu++98' } args.append('-std=' + remap_cpp03.get(std.value, std.value)) + if options['cpp_eh'].value == 'none': + args.append('-fno-exceptions') if options['cpp_debugstl'].value: args.append('-D_GLIBCXX_DEBUG=1') return args @@ -307,35 +387,33 @@ return [] -class VisualStudioCPPCompiler(VisualStudioCCompiler, CPPCompiler): - def __init__(self, exelist, version, is_cross, exe_wrap, is_64): - CPPCompiler.__init__(self, exelist, version, is_cross, exe_wrap) - VisualStudioCCompiler.__init__(self, exelist, version, is_cross, exe_wrap, is_64) - self.base_options = ['b_pch', 'b_vscrt'] # FIXME add lto, pgo and the like +class VisualStudioLikeCPPCompilerMixin: - def get_options(self): - cpp_stds = ['none', 'c++11', 'vc++11'] - if self.id == 'clang-cl': - cpp_stds.extend(['c++14', 'vc++14', 'c++17', 'vc++17', 'c++latest']) - else: - # Visual Studio 2015 and later - if version_compare(self.version, '>=19'): - cpp_stds.extend(['c++14', 'vc++14', 'c++latest', 'vc++latest']) - # Visual Studio 2017 and later - if version_compare(self.version, '>=19.11'): - cpp_stds.extend(['c++17', 'vc++17']) + """Mixin for C++ specific method overrides in MSVC-like compilers.""" - opts = CPPCompiler.get_options(self) - opts.update({'cpp_eh': coredata.UserComboOption('cpp_eh', - 'C++ exception handling type.', - ['none', 'a', 's', 'sc'], - 'sc'), - 'cpp_std': coredata.UserComboOption('cpp_std', - 'C++ language standard to use', + VC_VERSION_MAP = { + 'none': (True, None), + 'vc++11': (True, 11), + 'vc++14': (True, 14), + 'vc++17': (True, 17), + 'vc++latest': (True, "latest"), + 'c++11': (False, 11), + 'c++14': (False, 14), + 'c++17': (False, 17), + 'c++latest': (False, "latest"), + } + + def get_option_link_args(self, options): + return options['cpp_winlibs'].value[:] + + def _get_options_impl(self, opts, cpp_stds: typing.List[str]): + opts.update({'cpp_eh': coredata.UserComboOption('C++ exception handling type.', + ['none', 'default', 'a', 's', 'sc'], + 'default'), + 'cpp_std': coredata.UserComboOption('C++ language standard to use', cpp_stds, 'none'), - 'cpp_winlibs': coredata.UserArrayOption('cpp_winlibs', - 'Windows libs to link against.', + 'cpp_winlibs': coredata.UserArrayOption('Windows libs to link against.', msvc_winlibs)}) return opts @@ -343,62 +421,116 @@ args = [] eh = options['cpp_eh'] - if eh.value != 'none': + if eh.value == 'default': + args.append('/EHsc') + elif eh.value != 'none': args.append('/EH' + eh.value) - vc_version_map = { - 'none': (True, None), - 'vc++11': (True, 11), - 'vc++14': (True, 14), - 'vc++17': (True, 17), - 'c++11': (False, 11), - 'c++14': (False, 14), - 'c++17': (False, 17)} - - permissive, ver = vc_version_map[options['cpp_std'].value] - - if ver is None: - pass - elif ver == 11: - # Note: there is no explicit flag for supporting C++11; we attempt to do the best we can - # which means setting the C++ standard version to C++14, in compilers that support it - # (i.e., after VS2015U3) - # if one is using anything before that point, one cannot set the standard. - if self.id == 'clang-cl' or version_compare(self.version, '>=19.00.24210'): - mlog.warning('MSVC does not support C++11; ' - 'attempting best effort; setting the standard to C++14') - args.append('/std:c++14') - else: - mlog.warning('This version of MSVC does not support cpp_std arguments') - else: + permissive, ver = self.VC_VERSION_MAP[options['cpp_std'].value] + + if ver is not None: args.append('/std:c++{}'.format(ver)) - if not permissive and version_compare(self.version, '>=19.11'): + if not permissive: args.append('/permissive-') return args - def get_option_link_args(self, options): - return options['cpp_winlibs'].value[:] - def get_compiler_check_args(self): - # Visual Studio C++ compiler doesn't support -fpermissive, - # so just use the plain C args. - return VisualStudioCCompiler.get_compiler_check_args(self) - -class ClangClCPPCompiler(VisualStudioCPPCompiler, ClangClCCompiler): - def __init__(self, exelist, version, is_cross, exe_wrap, is_64): - VisualStudioCPPCompiler.__init__(self, exelist, version, is_cross, exe_wrap, is_64) + # XXX: this is a hack because so much GnuLike stuff is in the base CPPCompiler class. + return CLikeCompiler.get_compiler_check_args(self) + + +class CPP11AsCPP14Mixin: + + """Mixin class for VisualStudio and ClangCl to replace C++11 std with C++14. + + This is a limitation of Clang and MSVC that ICL doesn't share. + """ + + def get_option_compile_args(self, options): + # Note: there is no explicit flag for supporting C++11; we attempt to do the best we can + # which means setting the C++ standard version to C++14, in compilers that support it + # (i.e., after VS2015U3) + # if one is using anything before that point, one cannot set the standard. + if options['cpp_std'].value in {'vc++11', 'c++11'}: + mlog.warning(self.id, 'does not support C++11;', + 'attempting best effort; setting the standard to C++14') + # Don't mutate anything we're going to change, we need to use + # deepcopy since we're messing with members, and we can't simply + # copy the members because the option proxy doesn't support it. + options = copy.deepcopy(options) + if options['cpp_std'].value == 'vc++11': + options['cpp_std'].value = 'vc++14' + else: + options['cpp_std'].value = 'c++14' + return super().get_option_compile_args(options) + + +class VisualStudioCPPCompiler(CPP11AsCPP14Mixin, VisualStudioLikeCPPCompilerMixin, VisualStudioLikeCompiler, CPPCompiler): + def __init__(self, exelist, version, for_machine: MachineChoice, is_cross: bool, exe_wrap, target, **kwargs): + CPPCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrap, **kwargs) + VisualStudioLikeCompiler.__init__(self, target) + self.base_options = ['b_pch', 'b_vscrt'] # FIXME add lto, pgo and the like + self.id = 'msvc' + + def get_options(self): + cpp_stds = ['none', 'c++11', 'vc++11'] + # Visual Studio 2015 and later + if version_compare(self.version, '>=19'): + cpp_stds.extend(['c++14', 'c++latest', 'vc++latest']) + # Visual Studio 2017 and later + if version_compare(self.version, '>=19.11'): + cpp_stds.extend(['vc++14', 'c++17', 'vc++17']) + return self._get_options_impl(super().get_options(), cpp_stds) + + def get_option_compile_args(self, options): + if options['cpp_std'].value != 'none' and version_compare(self.version, '<19.00.24210'): + mlog.warning('This version of MSVC does not support cpp_std arguments') + options = copy.copy(options) + options['cpp_std'].value = 'none' + + args = super().get_option_compile_args(options) + + if version_compare(self.version, '<19.11'): + try: + i = args.index('/permissive-') + except ValueError: + return args + del args[i] + return args + +class ClangClCPPCompiler(CPP11AsCPP14Mixin, VisualStudioLikeCPPCompilerMixin, VisualStudioLikeCompiler, CPPCompiler): + def __init__(self, exelist, version, for_machine: MachineChoice, is_cross, exe_wrap, target, **kwargs): + CPPCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrap, **kwargs) + VisualStudioLikeCompiler.__init__(self, target) self.id = 'clang-cl' + def get_options(self): + cpp_stds = ['none', 'c++11', 'vc++11', 'c++14', 'vc++14', 'c++17', 'vc++17', 'c++latest'] + return self._get_options_impl(super().get_options(), cpp_stds) + + +class IntelClCPPCompiler(VisualStudioLikeCPPCompilerMixin, IntelVisualStudioLikeCompiler, CPPCompiler): + + def __init__(self, exelist, version, for_machine: MachineChoice, is_cross, exe_wrap, target, **kwargs): + CPPCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrap, **kwargs) + IntelVisualStudioLikeCompiler.__init__(self, target) + + def get_options(self): + # This has only been tested with verison 19.0, + cpp_stds = ['none', 'c++11', 'vc++11', 'c++14', 'vc++14', 'c++17', 'vc++17', 'c++latest'] + return self._get_options_impl(super().get_options(), cpp_stds) + + class ArmCPPCompiler(ArmCompiler, CPPCompiler): - def __init__(self, exelist, version, compiler_type, is_cross, exe_wrap=None, **kwargs): - CPPCompiler.__init__(self, exelist, version, is_cross, exe_wrap, **kwargs) + def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrap=None, **kwargs): + CPPCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrap, **kwargs) ArmCompiler.__init__(self, compiler_type) def get_options(self): opts = CPPCompiler.get_options(self) - opts.update({'cpp_std': coredata.UserComboOption('cpp_std', 'C++ language standard to use', + opts.update({'cpp_std': coredata.UserComboOption('C++ language standard to use', ['none', 'c++03', 'c++11'], 'none')}) return opts @@ -420,8 +552,8 @@ class CcrxCPPCompiler(CcrxCompiler, CPPCompiler): - def __init__(self, exelist, version, compiler_type, is_cross, exe_wrap=None, **kwargs): - CPPCompiler.__init__(self, exelist, version, is_cross, exe_wrap, **kwargs) + def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrap=None, **kwargs): + CPPCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrap, **kwargs) CcrxCompiler.__init__(self, compiler_type) # Override CCompiler.get_always_args @@ -437,9 +569,6 @@ def get_output_args(self, target): return ['-output=obj=%s' % target] - def get_linker_output_args(self, outputname): - return ['-output=%s' % outputname] - def get_option_link_args(self, options): return [] diff -Nru meson-0.49.0/mesonbuild/compilers/c.py meson-0.52.1/mesonbuild/compilers/c.py --- meson-0.49.0/mesonbuild/compilers/c.py 2018-12-09 14:27:23.000000000 +0000 +++ meson-0.52.1/mesonbuild/compilers/c.py 2019-11-28 17:37:44.000000000 +0000 @@ -12,51 +12,31 @@ # See the License for the specific language governing permissions and # limitations under the License. -import re -import glob import os.path -import subprocess -import functools -import itertools -from pathlib import Path +import typing -from .. import mlog from .. import coredata -from . import compilers -from ..mesonlib import ( - EnvironmentException, MesonException, version_compare, Popen_safe, listify, - for_windows, for_darwin, for_cygwin, for_haiku, for_openbsd, -) +from ..mesonlib import MachineChoice, MesonException, mlog, version_compare from .c_function_attributes import C_FUNC_ATTRIBUTES - +from .mixins.clike import CLikeCompiler +from .mixins.ccrx import CcrxCompiler +from .mixins.arm import ArmCompiler, ArmclangCompiler +from .mixins.visualstudio import VisualStudioLikeCompiler +from .mixins.gnu import GnuCompiler +from .mixins.intel import IntelGnuLikeCompiler, IntelVisualStudioLikeCompiler +from .mixins.clang import ClangCompiler +from .mixins.elbrus import ElbrusCompiler +from .mixins.pgi import PGICompiler +from .mixins.islinker import BasicLinkerIsCompilerMixin, LinkerEnvVarsMixin from .compilers import ( - get_largefile_args, gnu_winlibs, msvc_winlibs, - vs32_instruction_set_args, - vs64_instruction_set_args, - ArmCompiler, - ArmclangCompiler, - ClangCompiler, Compiler, - CompilerArgs, - CrossNoRunException, - GnuCompiler, - ElbrusCompiler, - IntelCompiler, - RunResult, - CcrxCompiler, + CompilerType, ) -gnu_compiler_internal_libs = ('m', 'c', 'pthread', 'dl', 'rt') - -class CCompiler(Compiler): - # TODO: Replace this manual cache with functools.lru_cache - library_dirs_cache = {} - program_dirs_cache = {} - find_library_cache = {} - internal_libs = gnu_compiler_internal_libs +class CCompiler(CLikeCompiler, Compiler): @staticmethod def attribute_check_func(name): @@ -65,319 +45,20 @@ except KeyError: raise MesonException('Unknown function attribute "{}"'.format(name)) - def __init__(self, exelist, version, is_cross, exe_wrapper=None, **kwargs): + def __init__(self, exelist, version, for_machine: MachineChoice, is_cross: bool, + exe_wrapper: typing.Optional[str] = None, **kwargs): # If a child ObjC or CPP class has already set it, don't set it ourselves - if not hasattr(self, 'language'): - self.language = 'c' - super().__init__(exelist, version, **kwargs) - self.id = 'unknown' - self.is_cross = is_cross - self.can_compile_suffixes.add('h') - # If the exe wrapper was not found, pretend it wasn't set so that the - # sanity check is skipped and compiler checks use fallbacks. - if not exe_wrapper or not exe_wrapper.found(): - self.exe_wrapper = None - else: - self.exe_wrapper = exe_wrapper.get_command() - - # Set to None until we actually need to check this - self.has_fatal_warnings_link_arg = None - - def needs_static_linker(self): - return True # When compiling static libraries, so yes. - - def get_always_args(self): - ''' - Args that are always-on for all C compilers other than MSVC - ''' - return ['-pipe'] + get_largefile_args(self) - - def get_linker_debug_crt_args(self): - """ - Arguments needed to select a debug crt for the linker - This is only needed for MSVC - """ - return [] + self.language = 'c' + Compiler.__init__(self, exelist, version, for_machine, **kwargs) + CLikeCompiler.__init__(self, is_cross, exe_wrapper) def get_no_stdinc_args(self): return ['-nostdinc'] - def get_no_stdlib_link_args(self): - return ['-nostdlib'] - - def get_warn_args(self, level): - return self.warn_args[level] - - def get_no_warn_args(self): - # Almost every compiler uses this for disabling warnings - return ['-w'] - - def get_soname_args(self, *args): - return [] - - def split_shlib_to_parts(self, fname): - return None, fname - - # The default behavior is this, override in MSVC - @functools.lru_cache(maxsize=None) - def build_rpath_args(self, build_dir, from_dir, rpath_paths, build_rpath, install_rpath): - if 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): - return ['-MD', '-MQ', outtarget, '-MF', outfile] - - def depfile_for_object(self, objfile): - return objfile + '.' + self.get_depfile_suffix() - - def get_depfile_suffix(self): - return 'd' - - def get_exelist(self): - return self.exelist[:] - - def get_linker_exelist(self): - return self.exelist[:] - - def get_preprocess_only_args(self): - return ['-E', '-P'] - - def get_compile_only_args(self): - return ['-c'] - - def get_no_optimization_args(self): - return ['-O0'] - - def get_compiler_check_args(self): - ''' - Get arguments useful for compiler checks such as being permissive in - the code quality and not doing any optimization. - ''' - return self.get_no_optimization_args() - - def get_output_args(self, target): - return ['-o', target] - - def get_linker_output_args(self, outputname): - return ['-o', outputname] - - def get_coverage_args(self): - return ['--coverage'] - - def get_coverage_link_args(self): - return ['--coverage'] - - def get_werror_args(self): - return ['-Werror'] - - def get_std_exe_link_args(self): - return [] - - def get_include_args(self, path, is_system): - if path == '': - path = '.' - if is_system: - return ['-isystem', path] - return ['-I' + path] - - def get_std_shared_lib_link_args(self): - return ['-shared'] - - @functools.lru_cache() - def _get_search_dirs(self, env): - extra_args = ['--print-search-dirs'] - stdo = None - with self._build_wrapper('', env, extra_args=extra_args, - dependencies=None, mode='compile', - want_output=True) as p: - stdo = p.stdo - return stdo - - @staticmethod - def _split_fetch_real_dirs(pathstr, sep=':'): - paths = [] - for p in pathstr.split(sep): - # GCC returns paths like this: - # /usr/lib/gcc/x86_64-linux-gnu/8/../../../../x86_64-linux-gnu/lib - # It would make sense to normalize them to get rid of the .. parts - # Sadly when you are on a merged /usr fs it also kills these: - # /lib/x86_64-linux-gnu - # since /lib is a symlink to /usr/lib. This would mean - # paths under /lib would be considered not a "system path", - # which is wrong and breaks things. Store everything, just to be sure. - pobj = Path(p) - unresolved = pobj.as_posix() - if pobj.exists(): - if unresolved not in paths: - paths.append(unresolved) - try: - resolved = Path(p).resolve().as_posix() - if resolved not in paths: - paths.append(resolved) - except FileNotFoundError: - pass - return tuple(paths) - - def get_compiler_dirs(self, env, name): - ''' - Get dirs from the compiler, either `libraries:` or `programs:` - ''' - stdo = self._get_search_dirs(env) - for line in stdo.split('\n'): - if line.startswith(name + ':'): - return CCompiler._split_fetch_real_dirs(line.split('=', 1)[1]) - return () - - @functools.lru_cache() - def get_library_dirs(self, env, elf_class = None): - dirs = self.get_compiler_dirs(env, 'libraries') - if elf_class is None or elf_class == 0: - return dirs - - # if we do have an elf class for 32-bit or 64-bit, we want to check that - # the directory in question contains libraries of the appropriate class. Since - # system directories aren't mixed, we only need to check one file for each - # directory and go by that. If we can't check the file for some reason, assume - # the compiler knows what it's doing, and accept the directory anyway. - retval = [] - for d in dirs: - files = [f for f in os.listdir(d) if f.endswith('.so') and os.path.isfile(os.path.join(d, f))] - # if no files, accept directory and move on - if len(files) == 0: - retval.append(d) - continue - file_to_check = os.path.join(d, files[0]) - with open(file_to_check, 'rb') as fd: - header = fd.read(5) - # if file is not an ELF file, it's weird, but accept dir - # if it is elf, and the class matches, accept dir - if header[1:4] != b'ELF' or int(header[4]) == elf_class: - retval.append(d) - # at this point, it's an ELF file which doesn't match the - # appropriate elf_class, so skip this one - pass - return tuple(retval) - - @functools.lru_cache() - def get_program_dirs(self, env): - ''' - Programs used by the compiler. Also where toolchain DLLs such as - libstdc++-6.dll are found with MinGW. - ''' - return self.get_compiler_dirs(env, 'programs') - - def get_pic_args(self): - return ['-fPIC'] - - def name_string(self): - return ' '.join(self.exelist) - - def get_pch_use_args(self, pch_dir, header): - return ['-include', os.path.basename(header)] - - def get_pch_name(self, header_name): - return os.path.basename(header_name) + '.' + self.get_pch_suffix() - - def get_linker_search_args(self, dirname): - return ['-L' + dirname] - - def get_default_include_dirs(self): - return [] - - def gen_export_dynamic_link_args(self, env): - if for_windows(env.is_cross_build(), env) or for_cygwin(env.is_cross_build(), env): - return ['-Wl,--export-all-symbols'] - elif for_darwin(env.is_cross_build(), env): - return [] - else: - return ['-Wl,-export-dynamic'] - - def gen_import_library_args(self, implibname): - """ - The name of the outputted import library - - This implementation is used only on Windows by compilers that use GNU ld - """ - return ['-Wl,--out-implib=' + implibname] - - def sanity_check_impl(self, work_dir, environment, sname, code): - mlog.debug('Sanity testing ' + self.get_display_language() + ' compiler:', ' '.join(self.exelist)) - mlog.debug('Is cross compiler: %s.' % str(self.is_cross)) - - extra_flags = [] - source_name = os.path.join(work_dir, sname) - binname = sname.rsplit('.', 1)[0] - if self.is_cross: - binname += '_cross' - if self.exe_wrapper is None: - # Linking cross built apps is painful. You can't really - # tell if you should use -nostdlib or not and for example - # on OSX the compiler binary is the same but you need - # a ton of compiler flags to differentiate between - # arm and x86_64. So just compile. - extra_flags += self.get_cross_extra_flags(environment, link=False) - extra_flags += self.get_compile_only_args() - else: - extra_flags += self.get_cross_extra_flags(environment, link=True) - # Is a valid executable output for all toolchains and platforms - binname += '.exe' - # Write binary check source - binary_name = os.path.join(work_dir, binname) - with open(source_name, 'w') as ofile: - ofile.write(code) - # Compile sanity check - cmdlist = self.exelist + extra_flags + [source_name] + self.get_output_args(binary_name) - pc, stdo, stde = Popen_safe(cmdlist, cwd=work_dir) - mlog.debug('Sanity check compiler command line:', ' '.join(cmdlist)) - mlog.debug('Sanity check compile stdout:') - mlog.debug(stdo) - mlog.debug('-----\nSanity check compile stderr:') - mlog.debug(stde) - mlog.debug('-----') - if pc.returncode != 0: - raise EnvironmentException('Compiler {0} can not compile programs.'.format(self.name_string())) - # Run sanity check - if self.is_cross: - if self.exe_wrapper is None: - # Can't check if the binaries run so we have to assume they do - return - cmdlist = self.exe_wrapper + [binary_name] - else: - cmdlist = [binary_name] - mlog.debug('Running test binary command: ' + ' '.join(cmdlist)) - try: - pe = subprocess.Popen(cmdlist) - except Exception as e: - raise EnvironmentException('Could not invoke sanity test executable: %s.' % str(e)) - pe.wait() - if pe.returncode != 0: - raise EnvironmentException('Executables created by {0} compiler {1} are not runnable.'.format(self.language, self.name_string())) - def sanity_check(self, work_dir, environment): - code = 'int main(int argc, char **argv) { int class=0; return class; }\n' + code = 'int main() { int class=0; return class; }\n' return self.sanity_check_impl(work_dir, environment, 'sanitycheckc.c', code) - def check_header(self, hname, prefix, env, *, extra_args=None, dependencies=None): - fargs = {'prefix': prefix, 'header': hname} - code = '''{prefix} - #include <{header}>''' - return self.compiles(code.format(**fargs), env, extra_args=extra_args, - dependencies=dependencies) - - def has_header(self, hname, prefix, env, *, extra_args=None, dependencies=None): - fargs = {'prefix': prefix, 'header': hname} - code = '''{prefix} - #ifdef __has_include - #if !__has_include("{header}") - #error "Header '{header}' could not be found" - #endif - #else - #include <{header}> - #endif''' - return self.compiles(code.format(**fargs), env, extra_args=extra_args, - dependencies=dependencies, mode='preprocess') - def has_header_symbol(self, hname, symbol, prefix, env, *, extra_args=None, dependencies=None): fargs = {'prefix': prefix, 'header': hname, 'symbol': symbol} t = '''{prefix} @@ -387,756 +68,38 @@ #ifndef {symbol} {symbol}; #endif - }}''' - return self.compiles(t.format(**fargs), env, extra_args=extra_args, - dependencies=dependencies) - - def _get_compiler_check_args(self, env, extra_args, dependencies, mode='compile'): - if extra_args is None: - extra_args = [] - else: - extra_args = listify(extra_args) - extra_args = listify([e(mode) if callable(e) else e for e in extra_args]) - - if dependencies is None: - dependencies = [] - elif not isinstance(dependencies, list): - dependencies = [dependencies] - # Collect compiler arguments - args = CompilerArgs(self) - for d in dependencies: - # Add compile flags needed by dependencies - args += d.get_compile_args() - if d.need_threads(): - args += self.thread_flags(env) - elif d.need_openmp(): - args += self.openmp_flags() - if mode == 'link': - # Add link flags needed to find dependencies - args += d.get_link_args() - if d.need_threads(): - args += self.thread_link_flags(env) - # Select a CRT if needed since we're linking - if mode == 'link': - args += self.get_linker_debug_crt_args() - # Read c_args/cpp_args/etc from the cross-info file (if needed) - args += self.get_cross_extra_flags(env, link=(mode == 'link')) - if not self.is_cross: - if mode == 'preprocess': - # Add CPPFLAGS from the env. - args += env.coredata.get_external_preprocess_args(self.language) - elif mode == 'compile': - # Add CFLAGS/CXXFLAGS/OBJCFLAGS/OBJCXXFLAGS from the env - sys_args = env.coredata.get_external_args(self.language) - # Apparently it is a thing to inject linker flags both - # via CFLAGS _and_ LDFLAGS, even though the former are - # also used during linking. These flags can break - # argument checks. Thanks, Autotools. - cleaned_sys_args = self.remove_linkerlike_args(sys_args) - args += cleaned_sys_args - elif mode == 'link': - # Add LDFLAGS from the env - args += env.coredata.get_external_link_args(self.language) - args += self.get_compiler_check_args() - # extra_args must override all other arguments, so we add them last - args += extra_args - return args - - def compiles(self, code, env, *, extra_args=None, dependencies=None, mode='compile'): - with self._build_wrapper(code, env, extra_args, dependencies, mode) as p: - return p.returncode == 0 - - def _build_wrapper(self, code, env, extra_args, dependencies=None, mode='compile', want_output=False): - args = self._get_compiler_check_args(env, extra_args, dependencies, mode) - return self.compile(code, args, mode, want_output=want_output) - - def links(self, code, env, *, extra_args=None, dependencies=None): - return self.compiles(code, env, extra_args=extra_args, - dependencies=dependencies, mode='link') - - def run(self, code, env, *, extra_args=None, dependencies=None): - if self.is_cross and self.exe_wrapper is None: - raise CrossNoRunException('Can not run test applications in this cross environment.') - with self._build_wrapper(code, env, extra_args, dependencies, mode='link', want_output=True) as p: - if p.returncode != 0: - mlog.debug('Could not compile test file %s: %d\n' % ( - p.input_name, - p.returncode)) - return RunResult(False) - if self.is_cross: - cmdlist = self.exe_wrapper + [p.output_name] - else: - cmdlist = p.output_name - try: - pe, so, se = Popen_safe(cmdlist) - except Exception as e: - mlog.debug('Could not run: %s (error: %s)\n' % (cmdlist, e)) - return RunResult(False) - - mlog.debug('Program stdout:\n') - mlog.debug(so) - mlog.debug('Program stderr:\n') - mlog.debug(se) - return RunResult(True, pe.returncode, so, se) - - def _compile_int(self, expression, prefix, env, extra_args, dependencies): - fargs = {'prefix': prefix, 'expression': expression} - t = '''#include - {prefix} - int main() {{ static int a[1-2*!({expression})]; a[0]=0; return 0; }}''' - return self.compiles(t.format(**fargs), env, extra_args=extra_args, - dependencies=dependencies) - - def cross_compute_int(self, expression, low, high, guess, prefix, env, extra_args, dependencies): - # Try user's guess first - if isinstance(guess, int): - if self._compile_int('%s == %d' % (expression, guess), prefix, env, extra_args, dependencies): - return guess - - # If no bounds are given, compute them in the limit of int32 - maxint = 0x7fffffff - minint = -0x80000000 - if not isinstance(low, int) or not isinstance(high, int): - if self._compile_int('%s >= 0' % (expression), prefix, env, extra_args, dependencies): - low = cur = 0 - while self._compile_int('%s > %d' % (expression, cur), prefix, env, extra_args, dependencies): - low = cur + 1 - if low > maxint: - raise EnvironmentException('Cross-compile check overflowed') - cur = cur * 2 + 1 - if cur > maxint: - cur = maxint - high = cur - else: - low = cur = -1 - while self._compile_int('%s < %d' % (expression, cur), prefix, env, extra_args, dependencies): - high = cur - 1 - if high < minint: - raise EnvironmentException('Cross-compile check overflowed') - cur = cur * 2 - if cur < minint: - cur = minint - low = cur - else: - # Sanity check limits given by user - if high < low: - raise EnvironmentException('high limit smaller than low limit') - condition = '%s <= %d && %s >= %d' % (expression, high, expression, low) - if not self._compile_int(condition, prefix, env, extra_args, dependencies): - raise EnvironmentException('Value out of given range') - - # Binary search - while low != high: - cur = low + int((high - low) / 2) - if self._compile_int('%s <= %d' % (expression, cur), prefix, env, extra_args, dependencies): - high = cur - else: - low = cur + 1 - - return low - - def compute_int(self, expression, low, high, guess, prefix, env, *, extra_args=None, dependencies=None): - if extra_args is None: - extra_args = [] - if self.is_cross: - return self.cross_compute_int(expression, low, high, guess, prefix, env, extra_args, dependencies) - fargs = {'prefix': prefix, 'expression': expression} - t = '''#include - {prefix} - int main(int argc, char **argv) {{ - printf("%ld\\n", (long)({expression})); return 0; - }};''' - res = self.run(t.format(**fargs), env, extra_args=extra_args, - dependencies=dependencies) - if not res.compiled: - return -1 - if res.returncode != 0: - raise EnvironmentException('Could not run compute_int test binary.') - return int(res.stdout) - - def cross_sizeof(self, typename, prefix, env, *, extra_args=None, dependencies=None): - if extra_args is None: - extra_args = [] - fargs = {'prefix': prefix, 'type': typename} - t = '''#include - {prefix} - int main(int argc, char **argv) {{ - {type} something; }}''' - if not self.compiles(t.format(**fargs), env, extra_args=extra_args, - dependencies=dependencies): - return -1 - return self.cross_compute_int('sizeof(%s)' % typename, None, None, None, prefix, env, extra_args, dependencies) - - def sizeof(self, typename, prefix, env, *, extra_args=None, dependencies=None): - if extra_args is None: - extra_args = [] - fargs = {'prefix': prefix, 'type': typename} - if self.is_cross: - return self.cross_sizeof(typename, prefix, env, extra_args=extra_args, - dependencies=dependencies) - t = '''#include - {prefix} - int main(int argc, char **argv) {{ - printf("%ld\\n", (long)(sizeof({type}))); - return 0; - }};''' - res = self.run(t.format(**fargs), env, extra_args=extra_args, - dependencies=dependencies) - if not res.compiled: - return -1 - if res.returncode != 0: - raise EnvironmentException('Could not run sizeof test binary.') - return int(res.stdout) - - def cross_alignment(self, typename, prefix, env, *, extra_args=None, dependencies=None): - if extra_args is None: - extra_args = [] - fargs = {'prefix': prefix, 'type': typename} - t = '''#include - {prefix} - int main(int argc, char **argv) {{ - {type} something; - }}''' - if not self.compiles(t.format(**fargs), env, extra_args=extra_args, - dependencies=dependencies): - return -1 - t = '''#include - {prefix} - struct tmp {{ - char c; - {type} target; - }};''' - return self.cross_compute_int('offsetof(struct tmp, target)', None, None, None, t.format(**fargs), env, extra_args, dependencies) - - def alignment(self, typename, prefix, env, *, extra_args=None, dependencies=None): - if extra_args is None: - extra_args = [] - if self.is_cross: - return self.cross_alignment(typename, prefix, env, extra_args=extra_args, - dependencies=dependencies) - fargs = {'prefix': prefix, 'type': typename} - t = '''#include - #include - {prefix} - struct tmp {{ - char c; - {type} target; - }}; - int main(int argc, char **argv) {{ - printf("%d", (int)offsetof(struct tmp, target)); - return 0; - }}''' - res = self.run(t.format(**fargs), env, extra_args=extra_args, - dependencies=dependencies) - if not res.compiled: - raise EnvironmentException('Could not compile alignment test.') - if res.returncode != 0: - raise EnvironmentException('Could not run alignment test binary.') - align = int(res.stdout) - if align == 0: - raise EnvironmentException('Could not determine alignment of %s. Sorry. You might want to file a bug.' % typename) - return align - - def get_define(self, dname, prefix, env, extra_args, dependencies): - delim = '"MESON_GET_DEFINE_DELIMITER"' - fargs = {'prefix': prefix, 'define': dname, 'delim': delim} - code = ''' - {prefix} - #ifndef {define} - # define {define} - #endif - {delim}\n{define}''' - args = self._get_compiler_check_args(env, extra_args, dependencies, - mode='preprocess').to_native() - with self.compile(code.format(**fargs), args, 'preprocess') as p: - if p.returncode != 0: - raise EnvironmentException('Could not get define {!r}'.format(dname)) - # Get the preprocessed value after the delimiter, - # minus the extra newline at the end and - # merge string literals. - return CCompiler.concatenate_string_literals(p.stdo.split(delim + '\n')[-1][:-1]) - - def get_return_value(self, fname, rtype, prefix, env, extra_args, dependencies): - if rtype == 'string': - fmt = '%s' - cast = '(char*)' - elif rtype == 'int': - fmt = '%lli' - cast = '(long long int)' - else: - raise AssertionError('BUG: Unknown return type {!r}'.format(rtype)) - fargs = {'prefix': prefix, 'f': fname, 'cast': cast, 'fmt': fmt} - code = '''{prefix} - #include - int main(int argc, char *argv[]) {{ - printf ("{fmt}", {cast} {f}()); - }}'''.format(**fargs) - res = self.run(code, env, extra_args=extra_args, dependencies=dependencies) - if not res.compiled: - m = 'Could not get return value of {}()' - raise EnvironmentException(m.format(fname)) - if rtype == 'string': - return res.stdout - elif rtype == 'int': - try: - return int(res.stdout.strip()) - except ValueError: - m = 'Return value of {}() is not an int' - raise EnvironmentException(m.format(fname)) - - @staticmethod - def _no_prototype_templ(): - """ - Try to find the function without a prototype from a header by defining - our own dummy prototype and trying to link with the C library (and - whatever else the compiler links in by default). This is very similar - to the check performed by Autoconf for AC_CHECK_FUNCS. - """ - # Define the symbol to something else since it is defined by the - # includes or defines listed by the user or by the compiler. This may - # include, for instance _GNU_SOURCE which must be defined before - # limits.h, which includes features.h - # Then, undef the symbol to get rid of it completely. - head = ''' - #define {func} meson_disable_define_of_{func} - {prefix} - #include - #undef {func} - ''' - # Override any GCC internal prototype and declare our own definition for - # the symbol. Use char because that's unlikely to be an actual return - # value for a function which ensures that we override the definition. - head += ''' - #ifdef __cplusplus - extern "C" - #endif - char {func} (); - ''' - # The actual function call - main = ''' - int main () {{ - return {func} (); - }}''' - return head, main - - @staticmethod - def _have_prototype_templ(): - """ - Returns a head-er and main() call that uses the headers listed by the - user for the function prototype while checking if a function exists. - """ - # Add the 'prefix', aka defines, includes, etc that the user provides - # This may include, for instance _GNU_SOURCE which must be defined - # before limits.h, which includes features.h - head = '{prefix}\n#include \n' - # We don't know what the function takes or returns, so return it as an int. - # Just taking the address or comparing it to void is not enough because - # compilers are smart enough to optimize it away. The resulting binary - # is not run so we don't care what the return value is. - main = '''\nint main() {{ - void *a = (void*) &{func}; - long b = (long) a; - return (int) b; - }}''' - return head, main - - def has_function(self, funcname, prefix, env, *, extra_args=None, dependencies=None): - """ - First, this function looks for the symbol in the default libraries - provided by the compiler (stdlib + a few others usually). If that - fails, it checks if any of the headers specified in the prefix provide - an implementation of the function, and if that fails, it checks if it's - implemented as a compiler-builtin. - """ - if extra_args is None: - extra_args = [] - - # Short-circuit if the check is already provided by the cross-info file - varname = 'has function ' + funcname - varname = varname.replace(' ', '_') - if self.is_cross: - val = env.cross_info.config['properties'].get(varname, None) - if val is not None: - if isinstance(val, bool): - return val - raise EnvironmentException('Cross variable {0} is not a boolean.'.format(varname)) - - fargs = {'prefix': prefix, 'func': funcname} - - # glibc defines functions that are not available on Linux as stubs that - # fail with ENOSYS (such as e.g. lchmod). In this case we want to fail - # instead of detecting the stub as a valid symbol. - # We already included limits.h earlier to ensure that these are defined - # for stub functions. - stubs_fail = ''' - #if defined __stub_{func} || defined __stub___{func} - fail fail fail this function is not going to work - #endif - ''' - - # If we have any includes in the prefix supplied by the user, assume - # that the user wants us to use the symbol prototype defined in those - # includes. If not, then try to do the Autoconf-style check with - # a dummy prototype definition of our own. - # This is needed when the linker determines symbol availability from an - # SDK based on the prototype in the header provided by the SDK. - # Ignoring this prototype would result in the symbol always being - # marked as available. - if '#include' in prefix: - head, main = self._have_prototype_templ() - else: - head, main = self._no_prototype_templ() - templ = head + stubs_fail + main - - if self.links(templ.format(**fargs), env, extra_args=extra_args, - dependencies=dependencies): - return True - - # MSVC does not have compiler __builtin_-s. - if self.get_id() == 'msvc': - return False - - # Detect function as a built-in - # - # Some functions like alloca() are defined as compiler built-ins which - # are inlined by the compiler and you can't take their address, so we - # need to look for them differently. On nice compilers like clang, we - # can just directly use the __has_builtin() macro. - fargs['no_includes'] = '#include' not in prefix - t = '''{prefix} - int main() {{ - #ifdef __has_builtin - #if !__has_builtin(__builtin_{func}) - #error "__builtin_{func} not found" - #endif - #elif ! defined({func}) - /* Check for __builtin_{func} only if no includes were added to the - * prefix above, which means no definition of {func} can be found. - * We would always check for this, but we get false positives on - * MSYS2 if we do. Their toolchain is broken, but we can at least - * give them a workaround. */ - #if {no_includes:d} - __builtin_{func}; - #else - #error "No definition for __builtin_{func} found in the prefix" - #endif - #endif - }}''' - return self.links(t.format(**fargs), env, extra_args=extra_args, - dependencies=dependencies) - - def has_members(self, typename, membernames, prefix, env, *, extra_args=None, dependencies=None): - if extra_args is None: - extra_args = [] - fargs = {'prefix': prefix, 'type': typename, 'name': 'foo'} - # Create code that accesses all members - members = '' - for member in membernames: - members += '{}.{};\n'.format(fargs['name'], member) - fargs['members'] = members - t = '''{prefix} - void bar() {{ - {type} {name}; - {members} - }};''' return self.compiles(t.format(**fargs), env, extra_args=extra_args, dependencies=dependencies) - def has_type(self, typename, prefix, env, extra_args, dependencies=None): - fargs = {'prefix': prefix, 'type': typename} - t = '''{prefix} - void bar() {{ - sizeof({type}); - }};''' - return self.compiles(t.format(**fargs), env, extra_args=extra_args, - dependencies=dependencies) - - def symbols_have_underscore_prefix(self, env): - ''' - Check if the compiler prefixes an underscore to global C symbols - ''' - symbol_name = b'meson_uscore_prefix' - code = '''#ifdef __cplusplus - extern "C" { - #endif - void ''' + symbol_name.decode() + ''' () {} - #ifdef __cplusplus - } - #endif - ''' - args = self.get_cross_extra_flags(env, link=False) - args += self.get_compiler_check_args() - n = 'symbols_have_underscore_prefix' - with self.compile(code, args, 'compile', want_output=True) as p: - if p.returncode != 0: - m = 'BUG: Unable to compile {!r} check: {}' - raise RuntimeError(m.format(n, p.stdo)) - if not os.path.isfile(p.output_name): - m = 'BUG: Can\'t find compiled test code for {!r} check' - raise RuntimeError(m.format(n)) - with open(p.output_name, 'rb') as o: - for line in o: - # Check if the underscore form of the symbol is somewhere - # in the output file. - if b'_' + symbol_name in line: - return True - # Else, check if the non-underscored form is present - elif symbol_name in line: - return False - raise RuntimeError('BUG: {!r} check failed unexpectedly'.format(n)) - - def _get_patterns(self, env, prefixes, suffixes, shared=False): - patterns = [] - for p in prefixes: - for s in suffixes: - patterns.append(p + '{}.' + s) - if shared and for_openbsd(self.is_cross, env): - # Shared libraries on OpenBSD can be named libfoo.so.X.Y: - # https://www.openbsd.org/faq/ports/specialtopics.html#SharedLibs - # - # This globbing is probably the best matching we can do since regex - # is expensive. It's wrong in many edge cases, but it will match - # correctly-named libraries and hopefully no one on OpenBSD names - # their files libfoo.so.9a.7b.1.0 - patterns.append('lib{}.so.[0-9]*.[0-9]*') - return patterns - - def get_library_naming(self, env, libtype, strict=False): - ''' - Get library prefixes and suffixes for the target platform ordered by - priority - ''' - stlibext = ['a'] - # We've always allowed libname to be both `foo` and `libfoo`, - # and now people depend on it - if strict and not isinstance(self, VisualStudioCCompiler): # lib prefix is not usually used with msvc - prefixes = ['lib'] - else: - prefixes = ['lib', ''] - # Library suffixes and prefixes - if for_darwin(env.is_cross_build(), env): - shlibext = ['dylib', 'so'] - elif for_windows(env.is_cross_build(), env): - # FIXME: .lib files can be import or static so we should read the - # file, figure out which one it is, and reject the wrong kind. - if isinstance(self, VisualStudioCCompiler): - shlibext = ['lib'] - else: - shlibext = ['dll.a', 'lib', 'dll'] - # Yep, static libraries can also be foo.lib - stlibext += ['lib'] - elif for_cygwin(env.is_cross_build(), env): - shlibext = ['dll', 'dll.a'] - prefixes = ['cyg'] + prefixes - else: - # Linux/BSDs - shlibext = ['so'] - patterns = [] - # Search priority - if libtype in ('default', 'shared-static'): - patterns += self._get_patterns(env, prefixes, shlibext, True) - patterns += self._get_patterns(env, prefixes, stlibext, False) - elif libtype == 'static-shared': - patterns += self._get_patterns(env, prefixes, stlibext, False) - patterns += self._get_patterns(env, prefixes, shlibext, True) - elif libtype == 'shared': - patterns += self._get_patterns(env, prefixes, shlibext, True) - elif libtype == 'static': - patterns += self._get_patterns(env, prefixes, stlibext, False) - else: - raise AssertionError('BUG: unknown libtype {!r}'.format(libtype)) - return tuple(patterns) - - @staticmethod - def _sort_shlibs_openbsd(libs): - filtered = [] - for lib in libs: - # Validate file as a shared library of type libfoo.so.X.Y - ret = lib.rsplit('.so.', maxsplit=1) - if len(ret) != 2: - continue - try: - float(ret[1]) - except ValueError: - continue - filtered.append(lib) - float_cmp = lambda x: float(x.rsplit('.so.', maxsplit=1)[1]) - return sorted(filtered, key=float_cmp, reverse=True) - - @classmethod - def _get_trials_from_pattern(cls, pattern, directory, libname): - f = Path(directory) / pattern.format(libname) - # Globbing for OpenBSD - if '*' in pattern: - # NOTE: globbing matches directories and broken symlinks - # so we have to do an isfile test on it later - return cls._sort_shlibs_openbsd(glob.glob(str(f))) - return [f.as_posix()] - - @staticmethod - def _get_file_from_list(files): - for f in files: - if os.path.isfile(f): - return f - return None - - @functools.lru_cache() - def output_is_64bit(self, env): - ''' - returns true if the output produced is 64-bit, false if 32-bit - ''' - return self.sizeof('void *', '', env) == 8 - - def find_library_real(self, libname, env, extra_dirs, code, libtype): - # First try if we can just add the library as -l. - # Gcc + co seem to prefer builtin lib dirs to -L dirs. - # Only try to find std libs if no extra dirs specified. - if not extra_dirs or libname in self.internal_libs: - args = ['-l' + libname] - largs = self.linker_to_compiler_args(self.get_allow_undefined_link_args()) - if self.links(code, env, extra_args=(args + largs)): - return args - # Don't do a manual search for internal libs - if libname in self.internal_libs: - return None - # Not found or we want to use a specific libtype? Try to find the - # library file itself. - patterns = self.get_library_naming(env, libtype) - # try to detect if we are 64-bit or 32-bit. If we can't - # detect, we will just skip path validity checks done in - # get_library_dirs() call - try: - if self.output_is_64bit(env): - elf_class = 2 - else: - elf_class = 1 - except: - elf_class = 0 - # Search in the specified dirs, and then in the system libraries - for d in itertools.chain(extra_dirs, self.get_library_dirs(env, elf_class)): - for p in patterns: - trial = self._get_trials_from_pattern(p, d, libname) - if not trial: - continue - # We just check whether the library exists. We can't do a link - # check because the library might have unresolved symbols that - # require other libraries. - trial = self._get_file_from_list(trial) - if not trial: - continue - return [trial] - return None - - def find_library_impl(self, libname, env, extra_dirs, code, libtype): - # These libraries are either built-in or invalid - if libname in self.ignore_libs: - return [] - if isinstance(extra_dirs, str): - extra_dirs = [extra_dirs] - key = (tuple(self.exelist), libname, tuple(extra_dirs), code, libtype) - if key not in self.find_library_cache: - value = self.find_library_real(libname, env, extra_dirs, code, libtype) - self.find_library_cache[key] = value - else: - value = self.find_library_cache[key] - if value is None: - return None - return value[:] - - def find_library(self, libname, env, extra_dirs, libtype='default'): - code = 'int main(int argc, char **argv) { return 0; }' - return self.find_library_impl(libname, env, extra_dirs, code, libtype) - - def thread_flags(self, env): - if for_haiku(self.is_cross, env) or for_darwin(self.is_cross, env): - return [] - return ['-pthread'] - - def thread_link_flags(self, env): - if for_haiku(self.is_cross, env) or for_darwin(self.is_cross, env): - return [] - return ['-pthread'] - - def linker_to_compiler_args(self, args): - return args - - def has_arguments(self, args, env, code, mode): - return self.compiles(code, env, extra_args=args, mode=mode) - - def has_multi_arguments(self, args, env): - for arg in args[:]: - # some compilers, e.g. GCC, don't warn for unsupported warning-disable - # flags, so when we are testing a flag like "-Wno-forgotten-towel", also - # check the equivalent enable flag too "-Wforgotten-towel" - if arg.startswith('-Wno-'): - args.append('-W' + arg[5:]) - if arg.startswith('-Wl,'): - mlog.warning('{} looks like a linker argument, ' - 'but has_argument and other similar methods only ' - 'support checking compiler arguments. Using them ' - 'to check linker arguments are never supported, ' - 'and results are likely to be wrong regardless of ' - 'the compiler you are using. has_link_argument or ' - 'other similar method can be used instead.' - .format(arg)) - code = 'int i;\n' - return self.has_arguments(args, env, code, mode='compile') - - def has_multi_link_arguments(self, args, env): - # First time we check for link flags we need to first check if we have - # --fatal-warnings, otherwise some linker checks could give some - # false positive. - fatal_warnings_args = ['-Wl,--fatal-warnings'] - if self.has_fatal_warnings_link_arg is None: - self.has_fatal_warnings_link_arg = False - self.has_fatal_warnings_link_arg = self.has_multi_link_arguments(fatal_warnings_args, env) - - if self.has_fatal_warnings_link_arg: - args = fatal_warnings_args + args - - args = self.linker_to_compiler_args(args) - code = 'int main(int argc, char **argv) { return 0; }' - return self.has_arguments(args, env, code, mode='link') - - @staticmethod - def concatenate_string_literals(s): - pattern = re.compile(r'(?P
.*([^\\]")|^")(?P([^\\"]|\\.)*)"\s+"(?P([^\\"]|\\.)*)(?P".*)')
-        ret = s
-        m = pattern.match(ret)
-        while m:
-            ret = ''.join(m.group('pre', 'str1', 'str2', 'post'))
-            m = pattern.match(ret)
-        return ret
-
-    def has_func_attribute(self, name, env):
-        # Just assume that if we're not on windows that dllimport and dllexport
-        # don't work
-        if not (for_windows(env.is_cross_build(), env) or
-                for_cygwin(env.is_cross_build(), env)):
-            if name in ['dllimport', 'dllexport']:
-                return False
-
-        # Clang and GCC both return warnings if the __attribute__ is undefined,
-        # so set -Werror
-        return self.compiles(self.attribute_check_func(name), env, extra_args='-Werror')
-
 
 class ClangCCompiler(ClangCompiler, CCompiler):
-    def __init__(self, exelist, version, compiler_type, is_cross, exe_wrapper=None, **kwargs):
-        CCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwargs)
+    def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwargs):
+        CCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwargs)
         ClangCompiler.__init__(self, compiler_type)
         default_warn_args = ['-Wall', '-Winvalid-pch']
-        self.warn_args = {'1': default_warn_args,
+        self.warn_args = {'0': [],
+                          '1': default_warn_args,
                           '2': default_warn_args + ['-Wextra'],
                           '3': default_warn_args + ['-Wextra', '-Wpedantic']}
 
     def get_options(self):
         opts = CCompiler.get_options(self)
-        opts.update({'c_std': coredata.UserComboOption('c_std', 'C language standard to use',
-                                                       ['none', 'c89', 'c99', 'c11',
-                                                        'gnu89', 'gnu99', 'gnu11'],
+        c_stds = ['c89', 'c99', 'c11']
+        g_stds = ['gnu89', 'gnu99', 'gnu11']
+        # https://releases.llvm.org/6.0.0/tools/clang/docs/ReleaseNotes.html
+        # https://en.wikipedia.org/wiki/Xcode#Latest_versions
+        v = '>=10.0.0' if self.compiler_type is CompilerType.CLANG_OSX else '>=6.0.0'
+        if version_compare(self.version, v):
+            c_stds += ['c17']
+            g_stds += ['gnu17']
+        v = '>=11.0.0' if self.compiler_type is CompilerType.CLANG_OSX else '>=8.0.0'
+        if version_compare(self.version, v):
+            c_stds += ['c18']
+            g_stds += ['gnu18']
+        opts.update({'c_std': coredata.UserComboOption('C language standard to use',
+                                                       ['none'] + c_stds + g_stds,
                                                        'none')})
         return opts
 
@@ -1150,25 +113,40 @@
     def get_option_link_args(self, options):
         return []
 
-    def get_linker_always_args(self):
-        basic = super().get_linker_always_args()
-        if self.compiler_type.is_osx_compiler:
-            return basic + ['-Wl,-headerpad_max_install_names']
-        return basic
+
+class EmscriptenCCompiler(LinkerEnvVarsMixin, BasicLinkerIsCompilerMixin, ClangCCompiler):
+    def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwargs):
+        if not is_cross:
+            raise MesonException('Emscripten compiler can only be used for cross compilation.')
+        ClangCCompiler.__init__(self, exelist, version, compiler_type, for_machine, is_cross, exe_wrapper, **kwargs)
+        self.id = 'emscripten'
+
+    def get_option_link_args(self, options):
+        return []
+
+    def get_soname_args(self, *args, **kwargs):
+        raise MesonException('Emscripten does not support shared libraries.')
+
+    def get_allow_undefined_link_args(self) -> typing.List[str]:
+        return ['-s', 'ERROR_ON_UNDEFINED_SYMBOLS=0']
+
+    def get_linker_output_args(self, output: str) -> typing.List[str]:
+        return ['-o', output]
 
 
 class ArmclangCCompiler(ArmclangCompiler, CCompiler):
-    def __init__(self, exelist, version, compiler_type, is_cross, exe_wrapper=None, **kwargs):
-        CCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwargs)
+    def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwargs):
+        CCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwargs)
         ArmclangCompiler.__init__(self, compiler_type)
         default_warn_args = ['-Wall', '-Winvalid-pch']
-        self.warn_args = {'1': default_warn_args,
+        self.warn_args = {'0': [],
+                          '1': default_warn_args,
                           '2': default_warn_args + ['-Wextra'],
                           '3': default_warn_args + ['-Wextra', '-Wpedantic']}
 
     def get_options(self):
         opts = CCompiler.get_options(self)
-        opts.update({'c_std': coredata.UserComboOption('c_std', 'C language standard to use',
+        opts.update({'c_std': coredata.UserComboOption('C language standard to use',
                                                        ['none', 'c90', 'c99', 'c11',
                                                         'gnu90', 'gnu99', 'gnu11'],
                                                        'none')})
@@ -1186,23 +164,29 @@
 
 
 class GnuCCompiler(GnuCompiler, CCompiler):
-    def __init__(self, exelist, version, compiler_type, is_cross, exe_wrapper=None, defines=None, **kwargs):
-        CCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwargs)
+    def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, defines=None, **kwargs):
+        CCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwargs)
         GnuCompiler.__init__(self, compiler_type, defines)
         default_warn_args = ['-Wall', '-Winvalid-pch']
-        self.warn_args = {'1': default_warn_args,
+        self.warn_args = {'0': [],
+                          '1': default_warn_args,
                           '2': default_warn_args + ['-Wextra'],
                           '3': default_warn_args + ['-Wextra', '-Wpedantic']}
 
     def get_options(self):
         opts = CCompiler.get_options(self)
-        opts.update({'c_std': coredata.UserComboOption('c_std', 'C language standard to use',
-                                                       ['none', 'c89', 'c99', 'c11',
-                                                        'gnu89', 'gnu99', 'gnu11'],
+        c_stds = ['c89', 'c99', 'c11']
+        g_stds = ['gnu89', 'gnu99', 'gnu11']
+        v = '>=8.0.0'
+        if version_compare(self.version, v):
+            c_stds += ['c17', 'c18']
+            g_stds += ['gnu17', 'gnu18']
+        opts.update({'c_std': coredata.UserComboOption('C language standard to use',
+                                                       ['none'] + c_stds + g_stds,
                                                        'none')})
         if self.compiler_type.is_windows_compiler:
             opts.update({
-                'c_winlibs': coredata.UserArrayOption('c_winlibs', 'Standard Win libraries to link against',
+                'c_winlibs': coredata.UserArrayOption('Standard Win libraries to link against',
                                                       gnu_winlibs), })
         return opts
 
@@ -1222,15 +206,21 @@
         return ['-fpch-preprocess', '-include', os.path.basename(header)]
 
 
+class PGICCompiler(PGICompiler, CCompiler):
+    def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwargs):
+        CCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwargs)
+        PGICompiler.__init__(self, compiler_type)
+
+
 class ElbrusCCompiler(GnuCCompiler, ElbrusCompiler):
-    def __init__(self, exelist, version, compiler_type, is_cross, exe_wrapper=None, defines=None, **kwargs):
-        GnuCCompiler.__init__(self, exelist, version, compiler_type, is_cross, exe_wrapper, defines, **kwargs)
+    def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, defines=None, **kwargs):
+        GnuCCompiler.__init__(self, exelist, version, compiler_type, for_machine, is_cross, exe_wrapper, defines, **kwargs)
         ElbrusCompiler.__init__(self, compiler_type, defines)
 
     # It does support some various ISO standards and c/gnu 90, 9x, 1x in addition to those which GNU CC supports.
     def get_options(self):
         opts = CCompiler.get_options(self)
-        opts.update({'c_std': coredata.UserComboOption('c_std', 'C language standard to use',
+        opts.update({'c_std': coredata.UserComboOption('C language standard to use',
                                                        ['none', 'c89', 'c90', 'c9x', 'c99', 'c1x', 'c11',
                                                         'gnu89', 'gnu90', 'gnu9x', 'gnu99', 'gnu1x', 'gnu11',
                                                         'iso9899:2011', 'iso9899:1990', 'iso9899:199409', 'iso9899:1999'],
@@ -1241,20 +231,21 @@
     # So we should explicitly fail at this case.
     def has_function(self, funcname, prefix, env, *, extra_args=None, dependencies=None):
         if funcname == 'lchmod':
-            return False
+            return False, False
         else:
             return super().has_function(funcname, prefix, env,
                                         extra_args=extra_args,
                                         dependencies=dependencies)
 
 
-class IntelCCompiler(IntelCompiler, CCompiler):
-    def __init__(self, exelist, version, compiler_type, is_cross, exe_wrapper=None, **kwargs):
-        CCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwargs)
-        IntelCompiler.__init__(self, compiler_type)
+class IntelCCompiler(IntelGnuLikeCompiler, CCompiler):
+    def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwargs):
+        CCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwargs)
+        IntelGnuLikeCompiler.__init__(self, compiler_type)
         self.lang_header = 'c-header'
         default_warn_args = ['-Wall', '-w3', '-diag-disable:remark']
-        self.warn_args = {'1': default_warn_args,
+        self.warn_args = {'0': [],
+                          '1': default_warn_args,
                           '2': default_warn_args + ['-Wextra'],
                           '3': default_warn_args + ['-Wextra']}
 
@@ -1264,7 +255,7 @@
         g_stds = ['gnu89', 'gnu99']
         if version_compare(self.version, '>=16.0.0'):
             c_stds += ['c11']
-        opts.update({'c_std': coredata.UserComboOption('c_std', 'C language standard to use',
+        opts.update({'c_std': coredata.UserComboOption('C language standard to use',
                                                        ['none'] + c_stds + g_stds,
                                                        'none')})
         return opts
@@ -1277,330 +268,71 @@
         return args
 
 
-class VisualStudioCCompiler(CCompiler):
-    std_warn_args = ['/W3']
-    std_opt_args = ['/O2']
-    ignore_libs = gnu_compiler_internal_libs
-    internal_libs = ()
-
-    crt_args = {'none': [],
-                'md': ['/MD'],
-                'mdd': ['/MDd'],
-                'mt': ['/MT'],
-                'mtd': ['/MTd'],
-                }
-
-    def __init__(self, exelist, version, is_cross, exe_wrap, is_64):
-        CCompiler.__init__(self, exelist, version, is_cross, exe_wrap)
-        self.id = 'msvc'
-        # /showIncludes is needed for build dependency tracking in Ninja
-        # See: https://ninja-build.org/manual.html#_deps
-        self.always_args = ['/nologo', '/showIncludes']
-        self.warn_args = {'1': ['/W2'],
-                          '2': ['/W3'],
-                          '3': ['/W4']}
-        self.base_options = ['b_pch', 'b_ndebug', 'b_vscrt'] # FIXME add lto, pgo and the like
-        self.is_64 = is_64
-
-    # Override CCompiler.get_always_args
-    def get_always_args(self):
-        return self.always_args
+class VisualStudioLikeCCompilerMixin:
 
-    def get_linker_debug_crt_args(self):
-        """
-        Arguments needed to select a debug crt for the linker
-
-        Sometimes we need to manually select the CRT (C runtime) to use with
-        MSVC. One example is when trying to link with static libraries since
-        MSVC won't auto-select a CRT for us in that case and will error out
-        asking us to select one.
-        """
-        return ['/MDd']
-
-    def get_buildtype_args(self, buildtype):
-        args = compilers.msvc_buildtype_args[buildtype]
-        if self.id == 'msvc' and version_compare(self.version, '<18.0'):
-            args = [arg for arg in args if arg != '/Gw']
-        return args
-
-    def get_buildtype_linker_args(self, buildtype):
-        return compilers.msvc_buildtype_linker_args[buildtype]
-
-    def get_pch_suffix(self):
-        return 'pch'
-
-    def get_pch_name(self, header):
-        chopped = os.path.basename(header).split('.')[:-1]
-        chopped.append(self.get_pch_suffix())
-        pchname = '.'.join(chopped)
-        return pchname
-
-    def get_pch_use_args(self, pch_dir, header):
-        base = os.path.basename(header)
-        if self.id == 'clang-cl':
-            base = header
-        pchname = self.get_pch_name(header)
-        return ['/FI' + base, '/Yu' + base, '/Fp' + os.path.join(pch_dir, pchname)]
-
-    def get_preprocess_only_args(self):
-        return ['/EP']
-
-    def get_compile_only_args(self):
-        return ['/c']
-
-    def get_no_optimization_args(self):
-        return ['/Od']
-
-    def get_output_args(self, target):
-        if target.endswith('.exe'):
-            return ['/Fe' + target]
-        return ['/Fo' + target]
-
-    def get_optimization_args(self, optimization_level):
-        return compilers.msvc_optimization_args[optimization_level]
-
-    def get_debug_args(self, is_debug):
-        return compilers.msvc_debug_args[is_debug]
-
-    def get_dependency_gen_args(self, outtarget, outfile):
-        return []
-
-    def get_linker_exelist(self):
-        # FIXME, should have same path as compiler.
-        # FIXME, should be controllable via cross-file.
-        if self.id == 'clang-cl':
-            return ['lld-link']
-        else:
-            return ['link']
-
-    def get_linker_always_args(self):
-        return ['/nologo']
-
-    def get_linker_output_args(self, outputname):
-        return ['/OUT:' + outputname]
-
-    def get_linker_search_args(self, dirname):
-        return ['/LIBPATH:' + dirname]
-
-    def linker_to_compiler_args(self, args):
-        return ['/link'] + args
-
-    def get_gui_app_args(self, value):
-        # the default is for the linker to guess the subsystem based on presence
-        # of main or WinMain symbols, so always be explicit
-        if value:
-            return ['/SUBSYSTEM:WINDOWS']
-        else:
-            return ['/SUBSYSTEM:CONSOLE']
-
-    def get_pic_args(self):
-        return [] # PIC is handled by the loader on Windows
-
-    def gen_export_dynamic_link_args(self, env):
-        return [] # Not applicable with MSVC
-
-    def get_std_shared_lib_link_args(self):
-        return ['/DLL']
-
-    def gen_vs_module_defs_args(self, defsfile):
-        if not isinstance(defsfile, str):
-            raise RuntimeError('Module definitions file should be str')
-        # With MSVC, DLLs only export symbols that are explicitly exported,
-        # so if a module defs file is specified, we use that to export symbols
-        return ['/DEF:' + defsfile]
-
-    def gen_pch_args(self, header, source, pchname):
-        objname = os.path.splitext(pchname)[0] + '.obj'
-        return objname, ['/Yc' + header, '/Fp' + pchname, '/Fo' + objname]
-
-    def gen_import_library_args(self, implibname):
-        "The name of the outputted import library"
-        return ['/IMPLIB:' + implibname]
-
-    def build_rpath_args(self, build_dir, from_dir, rpath_paths, build_rpath, install_rpath):
-        return []
-
-    def openmp_flags(self):
-        return ['/openmp']
-
-    # FIXME, no idea what these should be.
-    def thread_flags(self, env):
-        return []
-
-    def thread_link_flags(self, env):
-        return []
+    """Shared methods that apply to MSVC-like C compilers."""
 
     def get_options(self):
-        opts = CCompiler.get_options(self)
-        opts.update({'c_winlibs': coredata.UserArrayOption('c_winlibs',
-                                                           'Windows libs to link against.',
+        opts = super().get_options()
+        opts.update({'c_winlibs': coredata.UserArrayOption('Windows libs to link against.',
                                                            msvc_winlibs)})
         return opts
 
     def get_option_link_args(self, options):
         return options['c_winlibs'].value[:]
 
-    @classmethod
-    def unix_args_to_native(cls, args):
-        result = []
-        for i in args:
-            # -mms-bitfields is specific to MinGW-GCC
-            # -pthread is only valid for GCC
-            if i in ('-mms-bitfields', '-pthread'):
-                continue
-            if i.startswith('-L'):
-                i = '/LIBPATH:' + i[2:]
-            # Translate GNU-style -lfoo library name to the import library
-            elif i.startswith('-l'):
-                name = i[2:]
-                if name in cls.ignore_libs:
-                    # With MSVC, these are provided by the C runtime which is
-                    # linked in by default
-                    continue
-                else:
-                    i = name + '.lib'
-            # -pthread in link flags is only used on Linux
-            elif i == '-pthread':
-                continue
-            result.append(i)
-        return result
+class VisualStudioCCompiler(VisualStudioLikeCompiler, VisualStudioLikeCCompilerMixin, CCompiler):
 
-    def get_werror_args(self):
-        return ['/WX']
+    def __init__(self, exelist, version, for_machine: MachineChoice, is_cross, exe_wrap, target: str, **kwargs):
+        CCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrap, **kwargs)
+        VisualStudioLikeCompiler.__init__(self, target)
+        self.id = 'msvc'
 
-    def get_include_args(self, path, is_system):
-        if path == '':
-            path = '.'
-        # msvc does not have a concept of system header dirs.
-        return ['-I' + path]
-
-    # Visual Studio is special. It ignores some arguments it does not
-    # understand and you can't tell it to error out on those.
-    # http://stackoverflow.com/questions/15259720/how-can-i-make-the-microsoft-c-compiler-treat-unknown-flags-as-errors-rather-t
-    def has_arguments(self, args, env, code, mode):
-        warning_text = '4044' if mode == 'link' else '9002'
-        if self.id == 'clang-cl' and mode != 'link':
-            args = args + ['-Werror=unknown-argument']
-        with self._build_wrapper(code, env, extra_args=args, mode=mode) as p:
-            if p.returncode != 0:
-                return False
-            return not(warning_text in p.stde or warning_text in p.stdo)
-
-    def get_compile_debugfile_args(self, rel_obj, pch=False):
-        pdbarr = rel_obj.split('.')[:-1]
-        pdbarr += ['pdb']
-        args = ['/Fd' + '.'.join(pdbarr)]
-        # When generating a PDB file with PCH, all compile commands write
-        # to the same PDB file. Hence, we need to serialize the PDB
-        # writes using /FS since we do parallel builds. This slows down the
-        # build obviously, which is why we only do this when PCH is on.
-        # This was added in Visual Studio 2013 (MSVC 18.0). Before that it was
-        # always on: https://msdn.microsoft.com/en-us/library/dn502518.aspx
-        if pch and self.id == 'msvc' and version_compare(self.version, '>=18.0'):
-            args = ['/FS'] + args
-        return args
+class ClangClCCompiler(VisualStudioLikeCompiler, VisualStudioLikeCCompilerMixin, CCompiler):
+    def __init__(self, exelist, version, for_machine: MachineChoice, is_cross, exe_wrap, target, **kwargs):
+        CCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrap, **kwargs)
+        VisualStudioLikeCompiler.__init__(self, target)
+        self.id = 'clang-cl'
 
-    def get_link_debugfile_args(self, targetfile):
-        pdbarr = targetfile.split('.')[:-1]
-        pdbarr += ['pdb']
-        return ['/DEBUG', '/PDB:' + '.'.join(pdbarr)]
-
-    def get_link_whole_for(self, args):
-        # Only since VS2015
-        args = listify(args)
-        return ['/WHOLEARCHIVE:' + x for x in args]
-
-    def get_instruction_set_args(self, instruction_set):
-        if self.is_64:
-            return vs64_instruction_set_args.get(instruction_set, None)
-        if self.id == 'msvc' and self.version.split('.')[0] == '16' and instruction_set == 'avx':
-            # VS documentation says that this exists and should work, but
-            # it does not. The headers do not contain AVX intrinsics
-            # and the can not be called.
-            return None
-        return vs32_instruction_set_args.get(instruction_set, None)
-
-    def get_toolset_version(self):
-        if self.id == 'clang-cl':
-            # I have no idea
-            return '14.1'
 
-        # See boost/config/compiler/visualc.cpp for up to date mapping
-        try:
-            version = int(''.join(self.version.split('.')[0:2]))
-        except ValueError:
-            return None
-        if version < 1310:
-            return '7.0'
-        elif version < 1400:
-            return '7.1' # (Visual Studio 2003)
-        elif version < 1500:
-            return '8.0' # (Visual Studio 2005)
-        elif version < 1600:
-            return '9.0' # (Visual Studio 2008)
-        elif version < 1700:
-            return '10.0' # (Visual Studio 2010)
-        elif version < 1800:
-            return '11.0' # (Visual Studio 2012)
-        elif version < 1900:
-            return '12.0' # (Visual Studio 2013)
-        elif version < 1910:
-            return '14.0' # (Visual Studio 2015)
-        elif version < 1920:
-            return '14.1' # (Visual Studio 2017)
-        return None
-
-    def get_default_include_dirs(self):
-        if 'INCLUDE' not in os.environ:
-            return []
-        return os.environ['INCLUDE'].split(os.pathsep)
-
-    def get_crt_compile_args(self, crt_val, buildtype):
-        if crt_val in self.crt_args:
-            return self.crt_args[crt_val]
-        assert(crt_val == 'from_buildtype')
-        # Match what build type flags used to do.
-        if buildtype == 'plain':
-            return []
-        elif buildtype == 'debug':
-            return self.crt_args['mdd']
-        elif buildtype == 'debugoptimized':
-            return self.crt_args['md']
-        elif buildtype == 'release':
-            return self.crt_args['md']
-        elif buildtype == 'minsize':
-            return self.crt_args['md']
-        else:
-            assert(buildtype == 'custom')
-            raise EnvironmentException('Requested C runtime based on buildtype, but buildtype is "custom".')
+class IntelClCCompiler(IntelVisualStudioLikeCompiler, VisualStudioLikeCCompilerMixin, CCompiler):
 
-    def has_func_attribute(self, name, env):
-        # MSVC doesn't have __attribute__ like Clang and GCC do, so just return
-        # false without compiling anything
-        return name in ['dllimport', 'dllexport']
+    """Intel "ICL" compiler abstraction."""
 
-    def get_argument_syntax(self):
-        return 'msvc'
+    __have_warned = False
 
-    def get_allow_undefined_link_args(self):
-        # link.exe
-        return ['/FORCE:UNRESOLVED']
+    def __init__(self, exelist, version, for_machine: MachineChoice, is_cross, exe_wrap, target, **kwargs):
+        CCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrap, **kwargs)
+        IntelVisualStudioLikeCompiler.__init__(self, target)
 
+    def get_options(self):
+        opts = super().get_options()
+        c_stds = ['none', 'c89', 'c99', 'c11']
+        opts.update({'c_std': coredata.UserComboOption('C language standard to use',
+                                                       c_stds,
+                                                       'none')})
+        return opts
 
-class ClangClCCompiler(VisualStudioCCompiler):
-    def __init__(self, exelist, version, is_cross, exe_wrap, is_64):
-        super().__init__(exelist, version, is_cross, exe_wrap, is_64)
-        self.id = 'clang-cl'
+    def get_option_compile_args(self, options):
+        args = []
+        std = options['c_std']
+        if std.value == 'c89':
+            if not self.__have_warned:
+                self.__have_warned = True
+                mlog.warning("ICL doesn't explicitly implement c89, setting the standard to 'none', which is close.")
+        elif std.value != 'none':
+            args.append('/Qstd:' + std.value)
+        return args
 
 
 class ArmCCompiler(ArmCompiler, CCompiler):
-    def __init__(self, exelist, version, compiler_type, is_cross, exe_wrapper=None, **kwargs):
-        CCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwargs)
+    def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwargs):
+        CCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwargs)
         ArmCompiler.__init__(self, compiler_type)
 
     def get_options(self):
         opts = CCompiler.get_options(self)
-        opts.update({'c_std': coredata.UserComboOption('c_std', 'C language standard to use',
+        opts.update({'c_std': coredata.UserComboOption('C language standard to use',
                                                        ['none', 'c90', 'c99'],
                                                        'none')})
         return opts
@@ -1613,8 +345,8 @@
         return args
 
 class CcrxCCompiler(CcrxCompiler, CCompiler):
-    def __init__(self, exelist, version, compiler_type, is_cross, exe_wrapper=None, **kwargs):
-        CCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwargs)
+    def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwargs):
+        CCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwargs)
         CcrxCompiler.__init__(self, compiler_type)
 
     # Override CCompiler.get_always_args
@@ -1623,7 +355,7 @@
 
     def get_options(self):
         opts = CCompiler.get_options(self)
-        opts.update({'c_std': coredata.UserComboOption('c_std', 'C language standard to use',
+        opts.update({'c_std': coredata.UserComboOption('C language standard to use',
                                                        ['none', 'c89', 'c99'],
                                                        'none')})
         return opts
@@ -1646,8 +378,8 @@
     def get_output_args(self, target):
         return ['-output=obj=%s' % target]
 
-    def get_linker_output_args(self, outputname):
-        return ['-output=%s' % outputname]
+    def get_werror_args(self):
+        return ['-change_message=error']
 
     def get_include_args(self, path, is_system):
         if path == '':
diff -Nru meson-0.49.0/mesonbuild/compilers/cs.py meson-0.52.1/mesonbuild/compilers/cs.py
--- meson-0.49.0/mesonbuild/compilers/cs.py	2018-10-31 09:31:20.000000000 +0000
+++ meson-0.52.1/mesonbuild/compilers/cs.py	2019-11-28 17:37:44.000000000 +0000
@@ -17,7 +17,8 @@
 from ..mesonlib import EnvironmentException
 from ..mesonlib import is_windows
 
-from .compilers import Compiler, mono_buildtype_args
+from .compilers import Compiler, MachineChoice, mono_buildtype_args
+from .mixins.islinker import BasicLinkerIsCompilerMixin
 
 cs_optimization_args = {'0': [],
                         'g': [],
@@ -27,11 +28,12 @@
                         's': ['-optimize+'],
                         }
 
-class CsCompiler(Compiler):
-    def __init__(self, exelist, version, id, runner=None):
+class CsCompiler(BasicLinkerIsCompilerMixin, Compiler):
+    def __init__(self, exelist, version, for_machine: MachineChoice, comp_id, runner=None):
         self.language = 'cs'
-        super().__init__(exelist, version)
-        self.id = id
+        super().__init__(exelist, version, for_machine)
+        self.id = comp_id
+        self.is_cross = False
         self.runner = runner
 
     def get_display_language(self):
@@ -49,18 +51,12 @@
     def get_link_args(self, fname):
         return ['-r:' + fname]
 
-    def get_soname_args(self, *args):
-        return []
-
     def get_werror_args(self):
         return ['-warnaserror']
 
     def split_shlib_to_parts(self, fname):
         return None, fname
 
-    def build_rpath_args(self, build_dir, from_dir, rpath_paths, build_rpath, install_rpath):
-        return []
-
     def get_dependency_gen_args(self, outtarget, outfile):
         return []
 
@@ -70,15 +66,9 @@
     def get_compile_only_args(self):
         return []
 
-    def get_linker_output_args(self, outputname):
-        return []
-
     def get_coverage_args(self):
         return []
 
-    def get_coverage_link_args(self):
-        return []
-
     def get_std_exe_link_args(self):
         return []
 
@@ -88,6 +78,15 @@
     def get_pic_args(self):
         return []
 
+    def compute_parameters_with_absolute_paths(self, parameter_list, build_dir):
+        for idx, i in enumerate(parameter_list):
+            if i[:2] == '-L':
+                parameter_list[idx] = i[:2] + os.path.normpath(os.path.join(build_dir, i[2:]))
+            if i[:5] == '-lib:':
+                parameter_list[idx] = i[:5] + os.path.normpath(os.path.join(build_dir, i[5:]))
+
+        return parameter_list
+
     def name_string(self):
         return ' '.join(self.exelist)
 
@@ -132,15 +131,16 @@
     def get_optimization_args(self, optimization_level):
         return cs_optimization_args[optimization_level]
 
+
 class MonoCompiler(CsCompiler):
-    def __init__(self, exelist, version):
-        super().__init__(exelist, version, 'mono',
+    def __init__(self, exelist, version, for_machine: MachineChoice):
+        super().__init__(exelist, version, for_machine, 'mono',
                          'mono')
 
 
 class VisualStudioCsCompiler(CsCompiler):
-    def __init__(self, exelist, version):
-        super().__init__(exelist, version, 'csc')
+    def __init__(self, exelist, version, for_machine: MachineChoice):
+        super().__init__(exelist, version, for_machine, 'csc')
 
     def get_buildtype_args(self, buildtype):
         res = mono_buildtype_args[buildtype]
diff -Nru meson-0.49.0/mesonbuild/compilers/cuda.py meson-0.52.1/mesonbuild/compilers/cuda.py
--- meson-0.49.0/mesonbuild/compilers/cuda.py	1970-01-01 00:00:00.000000000 +0000
+++ meson-0.52.1/mesonbuild/compilers/cuda.py	2019-11-28 17:37:44.000000000 +0000
@@ -0,0 +1,314 @@
+# Copyright 2012-2017 The Meson development team
+
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+
+#     http://www.apache.org/licenses/LICENSE-2.0
+
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import os.path
+import typing
+from functools import partial
+
+from .. import coredata
+from .. import mlog
+from ..mesonlib import EnvironmentException, MachineChoice, Popen_safe, OptionOverrideProxy, is_windows
+from .compilers import (Compiler, cuda_buildtype_args, cuda_optimization_args,
+                        cuda_debug_args)
+
+if typing.TYPE_CHECKING:
+    from ..environment import Environment  # noqa: F401
+
+
+class CudaCompiler(Compiler):
+
+    LINKER_PREFIX = '-Xlinker='
+
+    _universal_flags = {'compiler': ['-I', '-D', '-U', '-E'], 'linker': ['-l', '-L']}
+
+    def __init__(self, exelist, version, for_machine: MachineChoice, is_cross, exe_wrapper, host_compiler, **kwargs):
+        if not hasattr(self, 'language'):
+            self.language = 'cuda'
+        super().__init__(exelist, version, for_machine, **kwargs)
+        self.is_cross = is_cross
+        self.exe_wrapper = exe_wrapper
+        self.host_compiler = host_compiler
+        self.base_options = host_compiler.base_options
+        self.id = 'nvcc'
+        self.warn_args = {level: self._to_host_flags(flags) for level, flags in host_compiler.warn_args.items()}
+
+    @classmethod
+    def _to_host_flags(cls, flags, phase='compiler'):
+        return list(map(partial(cls._to_host_flag, phase=phase), flags))
+
+    @classmethod
+    def _to_host_flag(cls, flag, phase):
+        if not flag[0] in ['-', '/'] or flag[:2] in cls._universal_flags[phase]:
+            return flag
+
+        return '-X{}={}'.format(phase, flag)
+
+    def needs_static_linker(self):
+        return False
+
+    def get_always_args(self):
+        return []
+
+    def get_display_language(self):
+        return 'Cuda'
+
+    def get_no_stdinc_args(self):
+        return []
+
+    def thread_link_flags(self, environment):
+        return self._to_host_flags(self.host_compiler.thread_link_flags(environment))
+
+    def sanity_check(self, work_dir, environment):
+        mlog.debug('Sanity testing ' + self.get_display_language() + ' compiler:', ' '.join(self.exelist))
+        mlog.debug('Is cross compiler: %s.' % str(self.is_cross))
+
+        sname = 'sanitycheckcuda.cu'
+        code = r'''
+        #include 
+        #include 
+
+        __global__ void kernel (void) {}
+
+        int main(void){
+            struct cudaDeviceProp prop;
+            int count, i;
+            cudaError_t ret = cudaGetDeviceCount(&count);
+            if(ret != cudaSuccess){
+                fprintf(stderr, "%d\n", (int)ret);
+            }else{
+                for(i=0;i
+        using {symbol};
+        int main () {{ return 0; }}'''
+        return self.compiles(t.format(**fargs), env, extra_args, dependencies)
+
+    def get_options(self):
+        opts = super().get_options()
+        opts.update({'cuda_std': coredata.UserComboOption('C++ language standard to use',
+                                                          ['none', 'c++03', 'c++11', 'c++14'],
+                                                          'none')})
+        return opts
+
+    def _to_host_compiler_options(self, options):
+        overrides = {name: opt.value for name, opt in options.copy().items()}
+        return OptionOverrideProxy(overrides, self.host_compiler.get_options())
+
+    def get_option_compile_args(self, options):
+        args = []
+        # On Windows, the version of the C++ standard used by nvcc is dictated by
+        # the combination of CUDA version and MSVC verion; the --std= is thus ignored
+        # and attempting to use it will result in a warning: https://stackoverflow.com/a/51272091/741027
+        if not is_windows():
+            std = options['cuda_std']
+            if std.value != 'none':
+                args.append('--std=' + std.value)
+
+        return args + self._to_host_flags(self.host_compiler.get_option_compile_args(self._to_host_compiler_options(options)))
+
+    @classmethod
+    def _cook_link_args(cls, args: typing.List[str]) -> typing.List[str]:
+        # Prepare link args for nvcc
+        cooked = []  # type: typing.List[str]
+        for arg in args:
+            if arg.startswith('-Wl,'): # strip GNU-style -Wl prefix
+                arg = arg.replace('-Wl,', '', 1)
+            arg = arg.replace(' ', '\\') # espace whitespace
+            cooked.append(arg)
+        return cls._to_host_flags(cooked, 'linker')
+
+    def get_option_link_args(self, options):
+        return self._cook_link_args(self.host_compiler.get_option_link_args(self._to_host_compiler_options(options)))
+
+    def name_string(self):
+        return ' '.join(self.exelist)
+
+    def get_soname_args(self, *args):
+        return self._cook_link_args(self.host_compiler.get_soname_args(*args))
+
+    def get_dependency_gen_args(self, outtarget, outfile):
+        return []
+
+    def get_compile_only_args(self):
+        return ['-c']
+
+    def get_no_optimization_args(self):
+        return ['-O0']
+
+    def get_optimization_args(self, optimization_level):
+        # alternatively, consider simply redirecting this to the host compiler, which would
+        # give us more control over options like "optimize for space" (which nvcc doesn't support):
+        # return self._to_host_flags(self.host_compiler.get_optimization_args(optimization_level))
+        return cuda_optimization_args[optimization_level]
+
+    def get_debug_args(self, is_debug):
+        return cuda_debug_args[is_debug]
+
+    def get_werror_args(self):
+        return ['-Werror=cross-execution-space-call,deprecated-declarations,reorder']
+
+    def get_warn_args(self, level):
+        return self.warn_args[level]
+
+    def get_buildtype_args(self, buildtype):
+        # nvcc doesn't support msvc's "Edit and Continue" PDB format; "downgrade" to
+        # a regular PDB to avoid cl's warning to that effect (D9025 : overriding '/ZI' with '/Zi')
+        host_args = ['/Zi' if arg == '/ZI' else arg for arg in self.host_compiler.get_buildtype_args(buildtype)]
+        return cuda_buildtype_args[buildtype] + self._to_host_flags(host_args)
+
+    def get_include_args(self, path, is_system):
+        if path == '':
+            path = '.'
+        return ['-I' + path]
+
+    def get_compile_debugfile_args(self, rel_obj, **kwargs):
+        return self._to_host_flags(self.host_compiler.get_compile_debugfile_args(rel_obj, **kwargs))
+
+    def get_link_debugfile_args(self, targetfile):
+        return self._cook_link_args(self.host_compiler.get_link_debugfile_args(targetfile))
+
+    def depfile_for_object(self, objfile):
+        return objfile + '.' + self.get_depfile_suffix()
+
+    def get_depfile_suffix(self):
+        return 'd'
+
+    def get_linker_debug_crt_args(self) -> typing.List[str]:
+        return self._cook_link_args(self.host_compiler.get_linker_debug_crt_args())
+
+    def get_buildtype_linker_args(self, buildtype):
+        return self._cook_link_args(self.host_compiler.get_buildtype_linker_args(buildtype))
+
+    def build_rpath_args(self, env: 'Environment', build_dir: str, from_dir: str,
+                         rpath_paths: str, build_rpath: str,
+                         install_rpath: str) -> typing.List[str]:
+        return self._cook_link_args(self.host_compiler.build_rpath_args(
+            env, build_dir, from_dir, rpath_paths, build_rpath, install_rpath))
+
+    def linker_to_compiler_args(self, args):
+        return args
+
+    def get_pic_args(self):
+        return self._to_host_flags(self.host_compiler.get_pic_args())
+
+    def compute_parameters_with_absolute_paths(self, parameter_list, build_dir):
+        return []
+
+    def get_output_args(self, target: str) -> typing.List[str]:
+        return ['-o', target]
+
+    def get_std_exe_link_args(self) -> typing.List[str]:
+        return self._cook_link_args(self.host_compiler.get_std_exe_link_args())
+
+    def get_crt_compile_args(self, crt_val, buildtype):
+        return self._to_host_flags(self.host_compiler.get_crt_compile_args(crt_val, buildtype))
+
+    def get_crt_link_args(self, crt_val, buildtype):
+        # nvcc defaults to static, release version of msvc runtime and provides no
+        # native option to override it; override it with /NODEFAULTLIB
+        host_link_arg_overrides = []
+        host_crt_compile_args = self.host_compiler.get_crt_compile_args(crt_val, buildtype)
+        if any(arg in ['/MDd', '/MD', '/MTd'] for arg in host_crt_compile_args):
+            host_link_arg_overrides += ['/NODEFAULTLIB:LIBCMT.lib']
+        return self._cook_link_args(host_link_arg_overrides + self.host_compiler.get_crt_link_args(crt_val, buildtype))
+
+    def get_target_link_args(self, target):
+        return self._cook_link_args(super().get_target_link_args(target))
+
+    def get_dependency_compile_args(self, dep):
+        return self._to_host_flags(super().get_dependency_compile_args(dep))
+
+    def get_dependency_link_args(self, dep):
+        return self._cook_link_args(super().get_dependency_link_args(dep))
diff -Nru meson-0.49.0/mesonbuild/compilers/d.py meson-0.52.1/mesonbuild/compilers/d.py
--- meson-0.49.0/mesonbuild/compilers/d.py	2018-12-09 14:27:16.000000000 +0000
+++ meson-0.52.1/mesonbuild/compilers/d.py	2019-11-28 17:37:44.000000000 +0000
@@ -13,21 +13,23 @@
 # limitations under the License.
 
 import os.path, subprocess
+import typing
 
-from ..mesonlib import EnvironmentException, version_compare, is_windows, is_osx
+from ..mesonlib import (
+    EnvironmentException, MachineChoice, version_compare, is_windows, is_osx
+)
 
 from .compilers import (
     CompilerType,
     d_dmd_buildtype_args,
     d_gdc_buildtype_args,
     d_ldc_buildtype_args,
-    get_gcc_soname_args,
-    gnu_color_args,
-    gnu_optimization_args,
     clike_debug_args,
     Compiler,
     CompilerArgs,
 )
+from .mixins.gnu import GnuCompiler
+from .mixins.islinker import LinkerEnvVarsMixin, BasicLinkerIsCompilerMixin
 
 d_feature_args = {'gcc':  {'unittest': '-funittest',
                            'debug': '-fdebug',
@@ -62,45 +64,10 @@
                          's': ['-O'],
                          }
 
-class DCompiler(Compiler):
-    mscrt_args = {
-        'none': ['-mscrtlib='],
-        'md': ['-mscrtlib=msvcrt'],
-        'mdd': ['-mscrtlib=msvcrtd'],
-        'mt': ['-mscrtlib=libcmt'],
-        'mtd': ['-mscrtlib=libcmtd'],
-    }
-
-    def __init__(self, exelist, version, is_cross, arch, **kwargs):
-        self.language = 'd'
-        super().__init__(exelist, version, **kwargs)
-        self.id = 'unknown'
-        self.is_cross = is_cross
-        self.arch = arch
-
-    def sanity_check(self, work_dir, environment):
-        source_name = os.path.join(work_dir, 'sanity.d')
-        output_name = os.path.join(work_dir, 'dtest')
-        with open(source_name, 'w') as ofile:
-            ofile.write('''void main() { }''')
-        pc = subprocess.Popen(self.exelist + self.get_output_args(output_name) + self.get_target_arch_args() + [source_name], cwd=work_dir)
-        pc.wait()
-        if pc.returncode != 0:
-            raise EnvironmentException('D compiler %s can not compile programs.' % self.name_string())
-        if subprocess.call(output_name) != 0:
-            raise EnvironmentException('Executables created by D compiler %s are not runnable.' % self.name_string())
-
-    def needs_static_linker(self):
-        return True
 
-    def name_string(self):
-        return ' '.join(self.exelist)
-
-    def get_exelist(self):
-        return self.exelist
+class DmdLikeCompilerMixin:
 
-    def get_linker_exelist(self):
-        return self.exelist[:]
+    LINKER_PREFIX = '-L'
 
     def get_output_args(self, target):
         return ['-of=' + target]
@@ -111,6 +78,19 @@
     def get_include_args(self, path, is_system):
         return ['-I=' + path]
 
+    def compute_parameters_with_absolute_paths(self, parameter_list, build_dir):
+        for idx, i in enumerate(parameter_list):
+            if i[:3] == '-I=':
+                parameter_list[idx] = i[:3] + os.path.normpath(os.path.join(build_dir, i[3:]))
+            if i[:4] == '-L-L':
+                parameter_list[idx] = i[:4] + os.path.normpath(os.path.join(build_dir, i[4:]))
+            if i[:5] == '-L=-L':
+                parameter_list[idx] = i[:5] + os.path.normpath(os.path.join(build_dir, i[5:]))
+            if i[:6] == '-Wl,-L':
+                parameter_list[idx] = i[:6] + os.path.normpath(os.path.join(build_dir, i[6:]))
+
+        return parameter_list
+
     def get_warn_args(self, level):
         return ['-wi']
 
@@ -121,11 +101,6 @@
         # DMD and LDC does not currently return Makefile-compatible dependency info.
         return []
 
-    def get_linker_search_args(self, dirname):
-        # -L is recognized as "add this to the search path" by the linker,
-        # while the compiler recognizes it as "pass to linker".
-        return ['-Wl,-L' + dirname]
-
     def get_coverage_args(self):
         return ['-cov']
 
@@ -146,21 +121,6 @@
             return []
         return ['-fPIC']
 
-    def get_std_shared_lib_link_args(self):
-        return ['-shared']
-
-    def get_soname_args(self, *args):
-        # FIXME: Make this work for cross-compiling
-        if is_windows():
-            return []
-        elif is_osx():
-            soname_args = get_gcc_soname_args(CompilerType.GCC_OSX, *args)
-            if soname_args:
-                return ['-Wl,' + ','.join(soname_args)]
-            return []
-
-        return get_gcc_soname_args(CompilerType.GCC_STANDARD, *args)
-
     def get_feature_args(self, kwargs, build_to_src):
         res = []
         if 'unittest' in kwargs:
@@ -254,7 +214,7 @@
     def gen_import_library_args(self, implibname):
         return ['-Wl,--out-implib=' + implibname]
 
-    def build_rpath_args(self, build_dir, from_dir, rpath_paths, build_rpath, install_rpath):
+    def build_rpath_args(self, env, build_dir, from_dir, rpath_paths, build_rpath, install_rpath):
         if is_windows():
             return []
 
@@ -273,54 +233,6 @@
                 paths = paths + ':' + padding
         return ['-Wl,-rpath,{}'.format(paths)]
 
-    def _get_compiler_check_args(self, env, extra_args, dependencies, mode='compile'):
-        if callable(extra_args):
-            extra_args = extra_args(mode)
-        if extra_args is None:
-            extra_args = []
-        elif isinstance(extra_args, str):
-            extra_args = [extra_args]
-        if dependencies is None:
-            dependencies = []
-        elif not isinstance(dependencies, list):
-            dependencies = [dependencies]
-        # Collect compiler arguments
-        args = CompilerArgs(self)
-        for d in dependencies:
-            # Add compile flags needed by dependencies
-            args += d.get_compile_args()
-            if mode == 'link':
-                # Add link flags needed to find dependencies
-                args += d.get_link_args()
-
-        if mode == 'compile':
-            # Add DFLAGS from the env
-            args += env.coredata.get_external_args(self.language)
-        elif mode == 'link':
-            # Add LDFLAGS from the env
-            args += env.coredata.get_external_link_args(self.language)
-        # extra_args must override all other arguments, so we add them last
-        args += extra_args
-        return args
-
-    def compiles(self, code, env, *, extra_args=None, dependencies=None, mode='compile'):
-        args = self._get_compiler_check_args(env, extra_args, dependencies, mode)
-
-        with self.compile(code, args, mode) as p:
-            return p.returncode == 0
-
-    def has_multi_arguments(self, args, env):
-        return self.compiles('int i;\n', env, extra_args=args)
-
-    def get_target_arch_args(self):
-        # LDC2 on Windows targets to current OS architecture, but
-        # it should follow the target specified by the MSVC toolchain.
-        if is_windows():
-            if self.arch == 'x86_64':
-                return ['-m64']
-            return ['-m32']
-        return []
-
     @classmethod
     def translate_args_to_nongnu(cls, args):
         dcargs = []
@@ -342,6 +254,10 @@
             # Translate common D arguments here.
             if arg == '-pthread':
                 continue
+            if arg.startswith('-fstack-protector'):
+                continue
+            if arg.startswith('-D'):
+                continue
             if arg.startswith('-Wl,'):
                 # Translate linker arguments here.
                 linkargs = arg[arg.index(',') + 1:].split(',')
@@ -360,7 +276,25 @@
                 # translate library link flag
                 dcargs.append('-L=' + arg)
                 continue
-            elif arg.startswith('-L'):
+            elif arg.startswith('-isystem'):
+                # translate -isystem system include path
+                # this flag might sometimes be added by C library Cflags via
+                # pkg-config.
+                # NOTE: -isystem and -I are not 100% equivalent, so this is just
+                # a workaround for the most common cases.
+                if arg.startswith('-isystem='):
+                    dcargs.append('-I=' + arg[9:])
+                else:
+                    dcargs.append('-I' + arg[8:])
+                continue
+            elif arg.startswith('-idirafter'):
+                # same as -isystem, but appends the path instead
+                if arg.startswith('-idirafter='):
+                    dcargs.append('-I=' + arg[11:])
+                else:
+                    dcargs.append('-I' + arg[10:])
+                continue
+            elif arg.startswith('-L/') or arg.startswith('-L./'):
                 # we need to handle cases where -L is set by e.g. a pkg-config
                 # setting to select a linker search path. We can however not
                 # unconditionally prefix '-L' with '-L' because the user might
@@ -453,6 +387,200 @@
             assert(buildtype == 'custom')
             raise EnvironmentException('Requested C runtime based on buildtype, but buildtype is "custom".')
 
+    def get_soname_args(self, *args, **kwargs) -> typing.List[str]:
+        # LDC and DMD actually do use a linker, but they proxy all of that with
+        # their own arguments
+        soargs = []
+        for arg in Compiler.get_soname_args(self, *args, **kwargs):
+            soargs.append('-L=' + arg)
+        return soargs
+
+    def get_allow_undefined_link_args(self) -> typing.List[str]:
+        args = []
+        for arg in self.linker.get_allow_undefined_args():
+            args.append('-L=' + arg)
+        return args
+
+
+class DCompiler(Compiler):
+    mscrt_args = {
+        'none': ['-mscrtlib='],
+        'md': ['-mscrtlib=msvcrt'],
+        'mdd': ['-mscrtlib=msvcrtd'],
+        'mt': ['-mscrtlib=libcmt'],
+        'mtd': ['-mscrtlib=libcmtd'],
+    }
+
+    def __init__(self, exelist, version, for_machine: MachineChoice, arch, **kwargs):
+        self.language = 'd'
+        super().__init__(exelist, version, for_machine, **kwargs)
+        self.id = 'unknown'
+        self.arch = arch
+
+    def sanity_check(self, work_dir, environment):
+        source_name = os.path.join(work_dir, 'sanity.d')
+        output_name = os.path.join(work_dir, 'dtest')
+        with open(source_name, 'w') as ofile:
+            ofile.write('''void main() { }''')
+        pc = subprocess.Popen(self.exelist + self.get_output_args(output_name) + self.get_target_arch_args() + [source_name], cwd=work_dir)
+        pc.wait()
+        if pc.returncode != 0:
+            raise EnvironmentException('D compiler %s can not compile programs.' % self.name_string())
+        if subprocess.call(output_name) != 0:
+            raise EnvironmentException('Executables created by D compiler %s are not runnable.' % self.name_string())
+
+    def needs_static_linker(self):
+        return True
+
+    def depfile_for_object(self, objfile):
+        return objfile + '.' + self.get_depfile_suffix()
+
+    def get_depfile_suffix(self):
+        return 'deps'
+
+    def get_pic_args(self):
+        if is_windows():
+            return []
+        return ['-fPIC']
+
+    def get_feature_args(self, kwargs, build_to_src):
+        res = []
+        if 'unittest' in kwargs:
+            unittest = kwargs.pop('unittest')
+            unittest_arg = d_feature_args[self.id]['unittest']
+            if not unittest_arg:
+                raise EnvironmentException('D compiler %s does not support the "unittest" feature.' % self.name_string())
+            if unittest:
+                res.append(unittest_arg)
+
+        if 'debug' in kwargs:
+            debug_level = -1
+            debugs = kwargs.pop('debug')
+            if not isinstance(debugs, list):
+                debugs = [debugs]
+
+            debug_arg = d_feature_args[self.id]['debug']
+            if not debug_arg:
+                raise EnvironmentException('D compiler %s does not support conditional debug identifiers.' % self.name_string())
+
+            # Parse all debug identifiers and the largest debug level identifier
+            for d in debugs:
+                if isinstance(d, int):
+                    if d > debug_level:
+                        debug_level = d
+                elif isinstance(d, str) and d.isdigit():
+                    if int(d) > debug_level:
+                        debug_level = int(d)
+                else:
+                    res.append('{0}={1}'.format(debug_arg, d))
+
+            if debug_level >= 0:
+                res.append('{0}={1}'.format(debug_arg, debug_level))
+
+        if 'versions' in kwargs:
+            version_level = -1
+            versions = kwargs.pop('versions')
+            if not isinstance(versions, list):
+                versions = [versions]
+
+            version_arg = d_feature_args[self.id]['version']
+            if not version_arg:
+                raise EnvironmentException('D compiler %s does not support conditional version identifiers.' % self.name_string())
+
+            # Parse all version identifiers and the largest version level identifier
+            for v in versions:
+                if isinstance(v, int):
+                    if v > version_level:
+                        version_level = v
+                elif isinstance(v, str) and v.isdigit():
+                    if int(v) > version_level:
+                        version_level = int(v)
+                else:
+                    res.append('{0}={1}'.format(version_arg, v))
+
+            if version_level >= 0:
+                res.append('{0}={1}'.format(version_arg, version_level))
+
+        if 'import_dirs' in kwargs:
+            import_dirs = kwargs.pop('import_dirs')
+            if not isinstance(import_dirs, list):
+                import_dirs = [import_dirs]
+
+            import_dir_arg = d_feature_args[self.id]['import_dir']
+            if not import_dir_arg:
+                raise EnvironmentException('D compiler %s does not support the "string import directories" feature.' % self.name_string())
+            for idir_obj in import_dirs:
+                basedir = idir_obj.get_curdir()
+                for idir in idir_obj.get_incdirs():
+                    # Avoid superfluous '/.' at the end of paths when d is '.'
+                    if idir not in ('', '.'):
+                        expdir = os.path.join(basedir, idir)
+                    else:
+                        expdir = basedir
+                    srctreedir = os.path.join(build_to_src, expdir)
+                    res.append('{0}{1}'.format(import_dir_arg, srctreedir))
+
+        if kwargs:
+            raise EnvironmentException('Unknown D compiler feature(s) selected: %s' % ', '.join(kwargs.keys()))
+
+        return res
+
+    def get_buildtype_linker_args(self, buildtype):
+        if buildtype != 'plain':
+            return self.get_target_arch_args()
+        return []
+
+    def get_std_exe_link_args(self):
+        return []
+
+    def _get_compiler_check_args(self, env, extra_args, dependencies, mode='compile'):
+        if callable(extra_args):
+            extra_args = extra_args(mode)
+        if extra_args is None:
+            extra_args = []
+        elif isinstance(extra_args, str):
+            extra_args = [extra_args]
+        if dependencies is None:
+            dependencies = []
+        elif not isinstance(dependencies, list):
+            dependencies = [dependencies]
+        # Collect compiler arguments
+        args = CompilerArgs(self)
+        for d in dependencies:
+            # Add compile flags needed by dependencies
+            args += d.get_compile_args()
+            if mode == 'link':
+                # Add link flags needed to find dependencies
+                args += d.get_link_args()
+
+        if mode == 'compile':
+            # Add DFLAGS from the env
+            args += env.coredata.get_external_args(self.for_machine, self.language)
+        elif mode == 'link':
+            # Add LDFLAGS from the env
+            args += env.coredata.get_external_link_args(self.for_machine, self.language)
+        # extra_args must override all other arguments, so we add them last
+        args += extra_args
+        return args
+
+    def compiles(self, code, env, *, extra_args=None, dependencies=None, mode='compile'):
+        args = self._get_compiler_check_args(env, extra_args, dependencies, mode)
+
+        with self.cached_compile(code, env.coredata, extra_args=args, mode=mode) as p:
+            return p.returncode == 0, p.cached
+
+    def has_multi_arguments(self, args, env):
+        return self.compiles('int i;\n', env, extra_args=args)
+
+    def get_target_arch_args(self):
+        # LDC2 on Windows targets to current OS architecture, but
+        # it should follow the target specified by the MSVC toolchain.
+        if is_windows():
+            if self.arch == 'x86_64':
+                return ['-m64']
+            return ['-m32']
+        return []
+
     def get_crt_compile_args(self, crt_val, buildtype):
         return []
 
@@ -462,12 +590,21 @@
     def thread_link_flags(self, env):
         return ['-pthread']
 
-class GnuDCompiler(DCompiler):
-    def __init__(self, exelist, version, is_cross, arch, **kwargs):
-        DCompiler.__init__(self, exelist, version, is_cross, arch, **kwargs)
+    def name_string(self):
+        return ' '.join(self.exelist)
+
+
+class GnuDCompiler(DCompiler, GnuCompiler):
+
+    # we mostly want DCompiler, but that gives us the Compiler.LINKER_PREFIX instead
+    LINKER_PREFIX = GnuCompiler.LINKER_PREFIX
+
+    def __init__(self, exelist, version, for_machine: MachineChoice, arch, **kwargs):
+        DCompiler.__init__(self, exelist, version, for_machine, arch, **kwargs)
         self.id = 'gcc'
         default_warn_args = ['-Wall', '-Wdeprecated']
-        self.warn_args = {'1': default_warn_args,
+        self.warn_args = {'0': [],
+                          '1': default_warn_args,
                           '2': default_warn_args + ['-Wextra'],
                           '3': default_warn_args + ['-Wextra', '-Wpedantic']}
         self.base_options = ['b_colorout', 'b_sanitize', 'b_staticpic', 'b_vscrt']
@@ -479,47 +616,37 @@
 
     def get_colorout_args(self, colortype):
         if self._has_color_support:
-            return gnu_color_args[colortype][:]
+            super().get_colorout_args(colortype)
         return []
 
     def get_dependency_gen_args(self, outtarget, outfile):
-        if not self._has_deps_support:
-            return []
-        return ['-MD', '-MQ', outtarget, '-MF', outfile]
-
-    def get_output_args(self, target):
-        return ['-o', target]
-
-    def get_linker_output_args(self, target):
-        return ['-o', target]
-
-    def get_include_args(self, path, is_system):
-        return ['-I' + path]
+        if self._has_deps_support:
+            return super().get_dependency_gen_args(outtarget, outfile)
+        return []
 
     def get_warn_args(self, level):
         return self.warn_args[level]
 
-    def get_werror_args(self):
-        return ['-Werror']
-
-    def get_linker_search_args(self, dirname):
-        return ['-L' + dirname]
-
     def get_coverage_args(self):
         return []
 
     def get_buildtype_args(self, buildtype):
         return d_gdc_buildtype_args[buildtype]
 
-    def build_rpath_args(self, build_dir, from_dir, rpath_paths, build_rpath, install_rpath):
-        return self.build_unix_rpath_args(build_dir, from_dir, rpath_paths, build_rpath, install_rpath)
+    def compute_parameters_with_absolute_paths(self, parameter_list, build_dir):
+        for idx, i in enumerate(parameter_list):
+            if i[:2] == '-I' or i[:2] == '-L':
+                parameter_list[idx] = i[:2] + os.path.normpath(os.path.join(build_dir, i[2:]))
 
-    def get_optimization_args(self, optimization_level):
-        return gnu_optimization_args[optimization_level]
+        return parameter_list
+
+    def get_allow_undefined_link_args(self) -> typing.List[str]:
+        return self.linker.get_allow_undefined_args()
 
-class LLVMDCompiler(DCompiler):
-    def __init__(self, exelist, version, is_cross, arch, **kwargs):
-        DCompiler.__init__(self, exelist, version, is_cross, arch, **kwargs)
+
+class LLVMDCompiler(DmdLikeCompilerMixin, LinkerEnvVarsMixin, BasicLinkerIsCompilerMixin, DCompiler):
+    def __init__(self, exelist, version, for_machine: MachineChoice, arch, **kwargs):
+        DCompiler.__init__(self, exelist, version, for_machine, arch, **kwargs)
         self.id = 'llvm'
         self.base_options = ['b_coverage', 'b_colorout', 'b_vscrt']
 
@@ -531,8 +658,10 @@
     def get_warn_args(self, level):
         if level == '2' or level == '3':
             return ['-wi', '-dw']
-        else:
+        elif level == '1':
             return ['-wi']
+        else:
+            return []
 
     def get_buildtype_args(self, buildtype):
         if buildtype != 'plain':
@@ -542,6 +671,9 @@
     def get_pic_args(self):
         return ['-relocation-model=pic']
 
+    def get_std_shared_lib_link_args(self):
+        return ['-shared']
+
     def get_crt_link_args(self, crt_val, buildtype):
         return self.get_crt_args(crt_val, buildtype)
 
@@ -553,9 +685,9 @@
         return ldc_optimization_args[optimization_level]
 
 
-class DmdDCompiler(DCompiler):
-    def __init__(self, exelist, version, is_cross, arch, **kwargs):
-        DCompiler.__init__(self, exelist, version, is_cross, arch, **kwargs)
+class DmdDCompiler(DmdLikeCompilerMixin, LinkerEnvVarsMixin, BasicLinkerIsCompilerMixin, DCompiler):
+    def __init__(self, exelist, version, for_machine: MachineChoice, arch, **kwargs):
+        DCompiler.__init__(self, exelist, version, for_machine, arch, **kwargs)
         self.id = 'dmd'
         self.base_options = ['b_coverage', 'b_colorout', 'b_vscrt']
 
@@ -581,7 +713,15 @@
         return []
 
     def get_std_shared_lib_link_args(self):
-        return ['-shared', '-defaultlib=libphobos2.so']
+        libname = 'libphobos2.so'
+        if is_windows():
+            if self.arch == 'x86_64':
+                libname = 'phobos64.lib'
+            elif self.arch == 'x86_mscoff':
+                libname = 'phobos32mscoff.lib'
+            else:
+                libname = 'phobos.lib'
+        return ['-shared', '-defaultlib=' + libname]
 
     def get_target_arch_args(self):
         # DMD32 and DMD64 on 64-bit Windows defaults to 32-bit (OMF).
diff -Nru meson-0.49.0/mesonbuild/compilers/fortran.py meson-0.52.1/mesonbuild/compilers/fortran.py
--- meson-0.49.0/mesonbuild/compilers/fortran.py	2018-12-09 14:27:23.000000000 +0000
+++ meson-0.52.1/mesonbuild/compilers/fortran.py	2019-11-28 17:37:44.000000000 +0000
@@ -12,86 +12,80 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-from .c import CCompiler
+from pathlib import Path
+from typing import List
+import subprocess, os
+import typing
+
 from .compilers import (
     CompilerType,
-    apple_buildtype_linker_args,
-    gnulike_buildtype_args,
-    gnulike_buildtype_linker_args,
-    gnu_optimization_args,
     clike_debug_args,
     Compiler,
-    GnuCompiler,
-    ElbrusCompiler,
-    IntelCompiler,
 )
+from .mixins.clike import CLikeCompiler
+from .mixins.gnu import (
+    GnuCompiler, gnulike_buildtype_args, gnu_optimization_args,
+)
+from .mixins.intel import IntelGnuLikeCompiler, IntelVisualStudioLikeCompiler
+from .mixins.clang import ClangCompiler
+from .mixins.elbrus import ElbrusCompiler
+from .mixins.pgi import PGICompiler
+from .. import mlog
 
-from mesonbuild.mesonlib import EnvironmentException, is_osx
-import subprocess, os
+from mesonbuild.mesonlib import (
+    EnvironmentException, MachineChoice, is_osx, LibType
+)
 
-class FortranCompiler(Compiler):
-    library_dirs_cache = CCompiler.library_dirs_cache
-    program_dirs_cache = CCompiler.library_dirs_cache
-    find_library_cache = CCompiler.library_dirs_cache
 
-    def __init__(self, exelist, version, is_cross, exe_wrapper=None, **kwargs):
+class FortranCompiler(CLikeCompiler, Compiler):
+
+    def __init__(self, exelist, version, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwargs):
         self.language = 'fortran'
-        Compiler.__init__(self, exelist, version, **kwargs)
-        cc = CCompiler(exelist, version, is_cross, exe_wrapper, **kwargs)
+        Compiler.__init__(self, exelist, version, for_machine, **kwargs)
+        CLikeCompiler.__init__(self, is_cross, exe_wrapper)
         self.id = 'unknown'
-        self.is_cross = cc.is_cross
-        self.exe_wrapper = cc.exe_wrapper
 
     def get_display_language(self):
         return 'Fortran'
 
-    def needs_static_linker(self):
-        return CCompiler.needs_static_linker(self)
-
-    def get_always_args(self):
-        return CCompiler.get_always_args(self)
-
-    def get_linker_debug_crt_args(self):
-        return CCompiler.get_linker_debug_crt_args(self)
-
-    def get_no_stdinc_args(self):
-        return CCompiler.get_no_stdinc_args(self)
-
-    def get_no_stdlib_link_args(self):
-        return CCompiler.get_no_stdlib_link_args(self)
-
-    def get_warn_args(self, level):
-        return CCompiler.get_warn_args(self, level)
-
-    def get_no_warn_args(self):
-        return CCompiler.get_no_warn_args(self)
-
-    def get_soname_args(self, *args):
-        return CCompiler.get_soname_args(self, *args)
-
-    def sanity_check(self, work_dir, environment):
-        source_name = os.path.join(work_dir, 'sanitycheckf.f90')
-        binary_name = os.path.join(work_dir, 'sanitycheckf')
-        with open(source_name, 'w') as ofile:
-            ofile.write('''program prog
-     print *, "Fortran compilation is working."
-end program prog
-''')
-        extra_flags = self.get_cross_extra_flags(environment, link=True)
-        pc = subprocess.Popen(self.exelist + extra_flags + [source_name, '-o', binary_name])
-        pc.wait()
-        if pc.returncode != 0:
+    def sanity_check(self, work_dir: Path, environment):
+        """
+        Check to be sure a minimal program can compile and execute
+          with this compiler & platform.
+        """
+        work_dir = Path(work_dir)
+        source_name = work_dir / 'sanitycheckf.f90'
+        binary_name = work_dir / 'sanitycheckf'
+        if binary_name.is_file():
+            binary_name.unlink()
+
+        source_name.write_text('print *, "Fortran compilation is working."; end')
+
+        extra_flags = environment.coredata.get_external_args(self.for_machine, self.language)
+        extra_flags += environment.coredata.get_external_link_args(self.for_machine, self.language)
+        extra_flags += self.get_always_args()
+        # %% build the test executable "sanitycheckf"
+        # cwd=work_dir is necessary on Windows especially for Intel compilers to avoid error: cannot write on sanitycheckf.obj
+        # this is a defect with how Windows handles files and ifort's object file-writing behavior vis concurrent ProcessPoolExecutor.
+        # This simple workaround solves the issue.
+        # FIXME: cwd=str(work_dir) is for Python 3.5 on Windows, when 3.5 is deprcated, this can become cwd=work_dir
+        returncode = subprocess.run(self.exelist + extra_flags + [str(source_name), '-o', str(binary_name)],
+                                    cwd=str(work_dir)).returncode
+        if returncode != 0:
             raise EnvironmentException('Compiler %s can not compile programs.' % self.name_string())
         if self.is_cross:
             if self.exe_wrapper is None:
                 # Can't check if the binaries run so we have to assume they do
                 return
-            cmdlist = self.exe_wrapper + [binary_name]
+            cmdlist = self.exe_wrapper + [str(binary_name)]
         else:
-            cmdlist = [binary_name]
-        pe = subprocess.Popen(cmdlist, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
-        pe.wait()
-        if pe.returncode != 0:
+            cmdlist = [str(binary_name)]
+        # %% Run the test executable
+        try:
+            returncode = subprocess.run(cmdlist, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL).returncode
+            if returncode != 0:
+                raise EnvironmentException('Executables created by Fortran compiler %s are not runnable.' % self.name_string())
+        except OSError:
             raise EnvironmentException('Executables created by Fortran compiler %s are not runnable.' % self.name_string())
 
     def get_std_warn_args(self, level):
@@ -106,64 +100,11 @@
     def get_debug_args(self, is_debug):
         return clike_debug_args[is_debug]
 
-    def get_buildtype_linker_args(self, buildtype):
-        if is_osx():
-            return apple_buildtype_linker_args[buildtype]
-        return gnulike_buildtype_linker_args[buildtype]
-
-    def split_shlib_to_parts(self, fname):
-        return CCompiler.split_shlib_to_parts(self, fname)
-
-    def build_rpath_args(self, *args):
-        return CCompiler.build_rpath_args(self, *args)
-
     def get_dependency_gen_args(self, outtarget, outfile):
         return []
 
-    def depfile_for_object(self, objfile):
-        return CCompiler.depfile_for_object(self, objfile)
-
-    def get_depfile_suffix(self):
-        return CCompiler.get_depfile_suffix(self)
-
-    def get_exelist(self):
-        return CCompiler.get_exelist(self)
-
-    def get_linker_exelist(self):
-        return CCompiler.get_linker_exelist(self)
-
     def get_preprocess_only_args(self):
-        return ['-cpp'] + CCompiler.get_preprocess_only_args(self)
-
-    def get_compile_only_args(self):
-        return CCompiler.get_compile_only_args(self)
-
-    def get_no_optimization_args(self):
-        return CCompiler.get_no_optimization_args(self)
-
-    def get_compiler_check_args(self):
-        return CCompiler.get_compiler_check_args(self)
-
-    def get_output_args(self, target):
-        return CCompiler.get_output_args(self, target)
-
-    def get_linker_output_args(self, outputname):
-        return CCompiler.get_linker_output_args(self, outputname)
-
-    def get_coverage_args(self):
-        return CCompiler.get_coverage_args(self)
-
-    def get_coverage_link_args(self):
-        return CCompiler.get_coverage_link_args(self)
-
-    def get_werror_args(self):
-        return CCompiler.get_werror_args(self)
-
-    def get_std_exe_link_args(self):
-        return CCompiler.get_std_exe_link_args(self)
-
-    def get_include_args(self, path, is_system):
-        return CCompiler.get_include_args(self, path, is_system)
+        return ['-cpp'] + super().get_preprocess_only_args()
 
     def get_module_incdir_args(self):
         return ('-I', )
@@ -171,96 +112,58 @@
     def get_module_outdir_args(self, path):
         return ['-module', path]
 
-    def module_name_to_filename(self, module_name):
-        return module_name.lower() + '.mod'
-
-    def get_std_shared_lib_link_args(self):
-        return CCompiler.get_std_shared_lib_link_args(self)
-
-    def _get_search_dirs(self, *args, **kwargs):
-        return CCompiler._get_search_dirs(self, *args, **kwargs)
-
-    def get_compiler_dirs(self, *args, **kwargs):
-        return CCompiler.get_compiler_dirs(self, *args, **kwargs)
+    def compute_parameters_with_absolute_paths(self, parameter_list, build_dir):
+        for idx, i in enumerate(parameter_list):
+            if i[:2] == '-I' or i[:2] == '-L':
+                parameter_list[idx] = i[:2] + os.path.normpath(os.path.join(build_dir, i[2:]))
+
+        return parameter_list
+
+    def module_name_to_filename(self, module_name: str) -> str:
+        if '_' in module_name:  # submodule
+            s = module_name.lower()
+            if self.id in ('gcc', 'intel'):
+                filename = s.replace('_', '@') + '.smod'
+            elif self.id in ('pgi', 'flang'):
+                filename = s.replace('_', '-') + '.mod'
+            else:
+                filename = s + '.mod'
+        else:  # module
+            filename = module_name.lower() + '.mod'
 
-    def get_library_dirs(self, *args, **kwargs):
-        return CCompiler.get_library_dirs(self, *args, **kwargs)
+        return filename
 
-    def get_pic_args(self):
-        return CCompiler.get_pic_args(self)
-
-    def name_string(self):
-        return CCompiler.name_string(self)
-
-    def get_linker_search_args(self, dirname):
-        return CCompiler.get_linker_search_args(self, dirname)
-
-    def get_default_include_dirs(self):
-        return CCompiler.get_default_include_dirs(self)
-
-    def gen_export_dynamic_link_args(self, env):
-        return CCompiler.gen_export_dynamic_link_args(self, env)
-
-    def gen_import_library_args(self, implibname):
-        return CCompiler.gen_import_library_args(self, implibname)
-
-    def _get_compiler_check_args(self, env, extra_args, dependencies, mode='compile'):
-        return CCompiler._get_compiler_check_args(self, env, extra_args, dependencies, mode='compile')
-
-    def compiles(self, code, env, *, extra_args=None, dependencies=None, mode='compile'):
-        return CCompiler.compiles(self, code, env, extra_args=extra_args,
-                                  dependencies=dependencies, mode=mode)
-
-    def _build_wrapper(self, code, env, extra_args, dependencies=None, mode='compile', want_output=False):
-        return CCompiler._build_wrapper(self, code, env, extra_args, dependencies, mode, want_output)
-
-    def links(self, code, env, *, extra_args=None, dependencies=None):
-        return CCompiler.links(self, code, env, extra_args=extra_args,
-                               dependencies=dependencies)
-
-    def run(self, code, env, *, extra_args=None, dependencies=None):
-        return CCompiler.run(self, code, env, extra_args, dependencies)
-
-    def _get_patterns(self, *args, **kwargs):
-        return CCompiler._get_patterns(self, *args, **kwargs)
-
-    def get_library_naming(self, *args, **kwargs):
-        return CCompiler.get_library_naming(self, *args, **kwargs)
-
-    def find_library_real(self, *args):
-        return CCompiler.find_library_real(self, *args)
-
-    def find_library_impl(self, *args):
-        return CCompiler.find_library_impl(self, *args)
-
-    def find_library(self, libname, env, extra_dirs, libtype='default'):
-        code = '''program main
-            call exit(0)
-        end program main'''
+    def find_library(self, libname, env, extra_dirs, libtype: LibType = LibType.PREFER_SHARED):
+        code = '''stop; end program'''
         return self.find_library_impl(libname, env, extra_dirs, code, libtype)
 
-    def thread_flags(self, env):
-        return CCompiler.thread_flags(self, env)
-
-    def thread_link_flags(self, env):
-        return CCompiler.thread_link_flags(self, env)
-
-    def linker_to_compiler_args(self, args):
-        return CCompiler.linker_to_compiler_args(self, args)
-
-    def has_arguments(self, args, env, code, mode):
-        return CCompiler.has_arguments(self, args, env, code, mode)
-
     def has_multi_arguments(self, args, env):
-        return CCompiler.has_multi_arguments(self, args, env)
+        for arg in args[:]:
+            # some compilers, e.g. GCC, don't warn for unsupported warning-disable
+            # flags, so when we are testing a flag like "-Wno-forgotten-towel", also
+            # check the equivalent enable flag too "-Wforgotten-towel"
+            if arg.startswith('-Wno-'):
+                args.append('-W' + arg[5:])
+            if arg.startswith('-Wl,'):
+                mlog.warning('{} looks like a linker argument, '
+                             'but has_argument and other similar methods only '
+                             'support checking compiler arguments. Using them '
+                             'to check linker arguments are never supported, '
+                             'and results are likely to be wrong regardless of '
+                             'the compiler you are using. has_link_argument or '
+                             'other similar method can be used instead.'
+                             .format(arg))
+        code = 'stop; end program'
+        return self.has_arguments(args, env, code, mode='compile')
 
 
 class GnuFortranCompiler(GnuCompiler, FortranCompiler):
-    def __init__(self, exelist, version, compiler_type, is_cross, exe_wrapper=None, defines=None, **kwargs):
-        FortranCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwargs)
+    def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, defines=None, **kwargs):
+        FortranCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwargs)
         GnuCompiler.__init__(self, compiler_type, defines)
         default_warn_args = ['-Wall']
-        self.warn_args = {'1': default_warn_args,
+        self.warn_args = {'0': [],
+                          '1': default_warn_args,
                           '2': default_warn_args + ['-Wextra'],
                           '3': default_warn_args + ['-Wextra', '-Wpedantic']}
 
@@ -276,18 +179,21 @@
     def language_stdlib_only_link_flags(self):
         return ['-lgfortran', '-lm']
 
-
 class ElbrusFortranCompiler(GnuFortranCompiler, ElbrusCompiler):
-    def __init__(self, exelist, version, compiler_type, is_cross, exe_wrapper=None, defines=None, **kwargs):
-        GnuFortranCompiler.__init__(self, exelist, version, compiler_type, is_cross, exe_wrapper, defines, **kwargs)
+    def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, defines=None, **kwargs):
+        GnuFortranCompiler.__init__(self, exelist, version, compiler_type, for_machine, is_cross, exe_wrapper, defines, **kwargs)
         ElbrusCompiler.__init__(self, compiler_type, defines)
 
 class G95FortranCompiler(FortranCompiler):
-    def __init__(self, exelist, version, is_cross, exe_wrapper=None, **kwags):
-        FortranCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwags)
+
+    LINKER_PREFIX = '-Wl,'
+
+    def __init__(self, exelist, version, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwags):
+        FortranCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwags)
         self.id = 'g95'
         default_warn_args = ['-Wall']
-        self.warn_args = {'1': default_warn_args,
+        self.warn_args = {'0': [],
+                          '1': default_warn_args,
                           '2': default_warn_args + ['-Wextra'],
                           '3': default_warn_args + ['-Wextra', '-pedantic']}
 
@@ -300,8 +206,11 @@
 
 
 class SunFortranCompiler(FortranCompiler):
-    def __init__(self, exelist, version, is_cross, exe_wrapper=None, **kwags):
-        FortranCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwags)
+
+    LINKER_PREFIX = '-Wl,'
+
+    def __init__(self, exelist, version, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwags):
+        FortranCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwags)
         self.id = 'sun'
 
     def get_dependency_gen_args(self, outtarget, outfile):
@@ -323,16 +232,17 @@
         return ['-xopenmp']
 
 
-class IntelFortranCompiler(IntelCompiler, FortranCompiler):
-    def __init__(self, exelist, version, is_cross, exe_wrapper=None, **kwags):
+class IntelFortranCompiler(IntelGnuLikeCompiler, FortranCompiler):
+    def __init__(self, exelist, version, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwags):
         self.file_suffixes = ('f90', 'f', 'for', 'ftn', 'fpp')
-        FortranCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwags)
+        FortranCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwags)
         # FIXME: Add support for OS X and Windows in detect_fortran_compiler so
         # we are sent the type of compiler
-        IntelCompiler.__init__(self, CompilerType.ICC_STANDARD)
+        IntelGnuLikeCompiler.__init__(self, CompilerType.ICC_STANDARD)
         self.id = 'intel'
         default_warn_args = ['-warn', 'general', '-warn', 'truncated_source']
-        self.warn_args = {'1': default_warn_args,
+        self.warn_args = {'0': [],
+                          '1': default_warn_args,
                           '2': default_warn_args + ['-warn', 'unused'],
                           '3': ['-warn', 'all']}
 
@@ -348,13 +258,48 @@
     def language_stdlib_only_link_flags(self):
         return ['-lifcore', '-limf']
 
+    def get_dependency_gen_args(self, outtarget: str, outfile: str) -> typing.List[str]:
+        return ['-gen-dep=' + outtarget, '-gen-depformat=make']
+
+
+class IntelClFortranCompiler(IntelVisualStudioLikeCompiler, FortranCompiler):
+
+    file_suffixes = ['f90', 'f', 'for', 'ftn', 'fpp']
+    always_args = ['/nologo']
+
+    BUILD_ARGS = {
+        'plain': [],
+        'debug': ["/Zi", "/Od"],
+        'debugoptimized': ["/Zi", "/O1"],
+        'release': ["/O2"],
+        'minsize': ["/Os"],
+        'custom': [],
+    }
+
+    def __init__(self, exelist, for_machine: MachineChoice, version, is_cross, target: str, exe_wrapper=None, **kwargs):
+        FortranCompiler.__init__(self, exelist, for_machine, version, is_cross, exe_wrapper, **kwargs)
+        IntelVisualStudioLikeCompiler.__init__(self, target)
+
+        default_warn_args = ['/warn:general', '/warn:truncated_source']
+        self.warn_args = {'0': [],
+                          '1': default_warn_args,
+                          '2': default_warn_args + ['/warn:unused'],
+                          '3': ['/warn:all']}
+
+    def get_module_outdir_args(self, path) -> List[str]:
+        return ['/module:' + path]
+
+    def get_buildtype_args(self, buildtype: str) -> List[str]:
+        return self.BUILD_ARGS[buildtype]
+
 
 class PathScaleFortranCompiler(FortranCompiler):
-    def __init__(self, exelist, version, is_cross, exe_wrapper=None, **kwags):
-        FortranCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwags)
+    def __init__(self, exelist, version, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwags):
+        FortranCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwags)
         self.id = 'pathscale'
         default_warn_args = ['-fullwarn']
-        self.warn_args = {'1': default_warn_args,
+        self.warn_args = {'0': [],
+                          '1': default_warn_args,
                           '2': default_warn_args,
                           '3': default_warn_args}
 
@@ -362,31 +307,36 @@
         return ['-mp']
 
 
-class PGIFortranCompiler(FortranCompiler):
-    def __init__(self, exelist, version, is_cross, exe_wrapper=None, **kwags):
-        FortranCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwags)
-        self.id = 'pgi'
+class PGIFortranCompiler(PGICompiler, FortranCompiler):
+    def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwags):
+        FortranCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwags)
+        PGICompiler.__init__(self, compiler_type)
+
+    def language_stdlib_only_link_flags(self) -> List[str]:
+        return ['-lpgf90rtl', '-lpgf90', '-lpgf90_rpm1', '-lpgf902',
+                '-lpgf90rtl', '-lpgftnrtl', '-lrt']
+
+class FlangFortranCompiler(ClangCompiler, FortranCompiler):
+    def __init__(self, exelist, version, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwags):
+        FortranCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwags)
+        ClangCompiler.__init__(self, CompilerType.CLANG_STANDARD)
+        self.id = 'flang'
         default_warn_args = ['-Minform=inform']
-        self.warn_args = {'1': default_warn_args,
+        self.warn_args = {'0': [],
+                          '1': default_warn_args,
                           '2': default_warn_args,
                           '3': default_warn_args}
 
-    def get_module_incdir_args(self):
-        return ('-module', )
-
-    def get_no_warn_args(self):
-        return ['-silent']
-
-    def openmp_flags(self):
-        return ['-fopenmp']
-
+    def language_stdlib_only_link_flags(self) -> List[str]:
+        return ['-lflang', '-lpgmath']
 
 class Open64FortranCompiler(FortranCompiler):
-    def __init__(self, exelist, version, is_cross, exe_wrapper=None, **kwags):
-        FortranCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwags)
+    def __init__(self, exelist, version, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwags):
+        FortranCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwags)
         self.id = 'open64'
         default_warn_args = ['-fullwarn']
-        self.warn_args = {'1': default_warn_args,
+        self.warn_args = {'0': [],
+                          '1': default_warn_args,
                           '2': default_warn_args,
                           '3': default_warn_args}
 
@@ -395,8 +345,8 @@
 
 
 class NAGFortranCompiler(FortranCompiler):
-    def __init__(self, exelist, version, is_cross, exe_wrapper=None, **kwags):
-        FortranCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwags)
+    def __init__(self, exelist, version, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwags):
+        FortranCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwags)
         self.id = 'nagfor'
 
     def get_warn_args(self, level):
diff -Nru meson-0.49.0/mesonbuild/compilers/__init__.py meson-0.52.1/mesonbuild/compilers/__init__.py
--- meson-0.49.0/mesonbuild/compilers/__init__.py	2018-12-09 14:27:16.000000000 +0000
+++ meson-0.52.1/mesonbuild/compilers/__init__.py	2019-11-28 17:37:44.000000000 +0000
@@ -15,6 +15,7 @@
 # Public symbols for compilers sub-package when using 'from . import compilers'
 __all__ = [
     'CompilerType',
+    'Compiler',
 
     'all_languages',
     'base_options',
@@ -22,7 +23,6 @@
     'clink_langs',
     'c_suffixes',
     'cpp_suffixes',
-    'get_macos_dylib_install_name',
     'get_base_compile_args',
     'get_base_link_args',
     'is_assembly',
@@ -32,7 +32,6 @@
     'is_object',
     'is_source',
     'lang_suffixes',
-    'sanitizer_compile_args',
     'sort_clink',
 
     'ArmCCompiler',
@@ -61,29 +60,37 @@
     'GnuDCompiler',
     'GnuFortranCompiler',
     'ElbrusFortranCompiler',
+    'FlangFortranCompiler',
     'GnuObjCCompiler',
     'GnuObjCPPCompiler',
-    'IntelCompiler',
+    'IntelGnuLikeCompiler',
+    'IntelVisualStudioLikeCompiler',
     'IntelCCompiler',
     'IntelCPPCompiler',
+    'IntelClCCompiler',
+    'IntelClCPPCompiler',
     'IntelFortranCompiler',
+    'IntelClFortranCompiler',
     'JavaCompiler',
     'LLVMDCompiler',
     'MonoCompiler',
+    'CudaCompiler',
     'VisualStudioCsCompiler',
     'NAGFortranCompiler',
     'ObjCCompiler',
     'ObjCPPCompiler',
     'Open64FortranCompiler',
     'PathScaleFortranCompiler',
+    'PGICCompiler',
+    'PGICPPCompiler',
     'PGIFortranCompiler',
     'RustCompiler',
     'CcrxCCompiler',
-    'CcrxCompiler',
     'CcrxCPPCompiler',
     'SunFortranCompiler',
     'SwiftCompiler',
     'ValaCompiler',
+    'VisualStudioLikeCompiler',
     'VisualStudioCCompiler',
     'VisualStudioCPPCompiler',
 ]
@@ -91,13 +98,13 @@
 # Bring symbols from each module into compilers sub-package namespace
 from .compilers import (
     CompilerType,
+    Compiler,
     all_languages,
     base_options,
     clib_langs,
     clink_langs,
     c_suffixes,
     cpp_suffixes,
-    get_macos_dylib_install_name,
     get_base_compile_args,
     get_base_link_args,
     is_header,
@@ -107,13 +114,8 @@
     is_object,
     is_library,
     lang_suffixes,
-    sanitizer_compile_args,
     sort_clink,
-    ClangCompiler,
     CompilerArgs,
-    GnuCompiler,
-    IntelCompiler,
-    CcrxCompiler,
 )
 from .c import (
     CCompiler,
@@ -123,7 +125,10 @@
     ClangClCCompiler,
     GnuCCompiler,
     ElbrusCCompiler,
+    EmscriptenCCompiler,
     IntelCCompiler,
+    IntelClCCompiler,
+    PGICCompiler,
     CcrxCCompiler,
     VisualStudioCCompiler,
 )
@@ -135,7 +140,10 @@
     ClangClCPPCompiler,
     GnuCPPCompiler,
     ElbrusCPPCompiler,
+    EmscriptenCPPCompiler,
     IntelCPPCompiler,
+    IntelClCPPCompiler,
+    PGICPPCompiler,
     CcrxCPPCompiler,
     VisualStudioCPPCompiler,
 )
@@ -146,12 +154,15 @@
     GnuDCompiler,
     LLVMDCompiler,
 )
+from .cuda import CudaCompiler
 from .fortran import (
     FortranCompiler,
     G95FortranCompiler,
     GnuFortranCompiler,
     ElbrusFortranCompiler,
+    FlangFortranCompiler,
     IntelFortranCompiler,
+    IntelClFortranCompiler,
     NAGFortranCompiler,
     Open64FortranCompiler,
     PathScaleFortranCompiler,
@@ -172,3 +183,7 @@
 from .rust import RustCompiler
 from .swift import SwiftCompiler
 from .vala import ValaCompiler
+from .mixins.visualstudio import VisualStudioLikeCompiler
+from .mixins.gnu import GnuCompiler
+from .mixins.intel import IntelGnuLikeCompiler, IntelVisualStudioLikeCompiler
+from .mixins.clang import ClangCompiler
diff -Nru meson-0.49.0/mesonbuild/compilers/java.py meson-0.52.1/mesonbuild/compilers/java.py
--- meson-0.49.0/mesonbuild/compilers/java.py	2018-08-25 08:05:43.000000000 +0000
+++ meson-0.52.1/mesonbuild/compilers/java.py	2019-11-28 17:37:44.000000000 +0000
@@ -14,35 +14,28 @@
 
 import os.path, shutil, subprocess
 
-from ..mesonlib import EnvironmentException
+from ..mesonlib import EnvironmentException, MachineChoice
 
 from .compilers import Compiler, java_buildtype_args
+from .mixins.islinker import BasicLinkerIsCompilerMixin
 
-class JavaCompiler(Compiler):
-    def __init__(self, exelist, version):
+class JavaCompiler(BasicLinkerIsCompilerMixin, Compiler):
+    def __init__(self, exelist, version, for_machine: MachineChoice):
         self.language = 'java'
-        super().__init__(exelist, version)
+        super().__init__(exelist, version, for_machine)
         self.id = 'unknown'
+        self.is_cross = False
         self.javarunner = 'java'
 
-    def get_soname_args(self, *args):
-        return []
-
     def get_werror_args(self):
         return ['-Werror']
 
     def split_shlib_to_parts(self, fname):
         return None, fname
 
-    def build_rpath_args(self, build_dir, from_dir, rpath_paths, build_rpath, install_rpath):
-        return []
-
     def get_dependency_gen_args(self, outtarget, outfile):
         return []
 
-    def get_linker_exelist(self):
-        return self.exelist[:]
-
     def get_compile_only_args(self):
         return []
 
@@ -51,15 +44,9 @@
             subdir = './'
         return ['-d', subdir, '-s', subdir]
 
-    def get_linker_output_args(self, outputname):
-        return []
-
     def get_coverage_args(self):
         return []
 
-    def get_coverage_link_args(self):
-        return []
-
     def get_std_exe_link_args(self):
         return []
 
@@ -81,6 +68,15 @@
     def get_buildtype_args(self, buildtype):
         return java_buildtype_args[buildtype]
 
+    def compute_parameters_with_absolute_paths(self, parameter_list, build_dir):
+        for idx, i in enumerate(parameter_list):
+            if i in ['-cp', '-classpath', '-sourcepath'] and idx + 1 < len(parameter_list):
+                path_list = parameter_list[idx + 1].split(os.pathsep)
+                path_list = [os.path.normpath(os.path.join(build_dir, x)) for x in path_list]
+                parameter_list[idx + 1] = os.pathsep.join(path_list)
+
+        return parameter_list
+
     def sanity_check(self, work_dir, environment):
         src = 'SanityCheck.java'
         obj = 'SanityCheck'
diff -Nru meson-0.49.0/mesonbuild/compilers/mixins/arm.py meson-0.52.1/mesonbuild/compilers/mixins/arm.py
--- meson-0.49.0/mesonbuild/compilers/mixins/arm.py	1970-01-01 00:00:00.000000000 +0000
+++ meson-0.52.1/mesonbuild/compilers/mixins/arm.py	2019-11-28 17:37:44.000000000 +0000
@@ -0,0 +1,201 @@
+# Copyright 2012-2019 The Meson development team
+
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+
+#     http://www.apache.org/licenses/LICENSE-2.0
+
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Representations specific to the arm family of compilers."""
+
+import os
+import re
+import typing
+
+from ... import mesonlib
+from ..compilers import clike_debug_args
+from .clang import clang_color_args
+
+if typing.TYPE_CHECKING:
+    from ..compilers import CompilerType
+    from ...environment import Environment
+
+arm_buildtype_args = {
+    'plain': [],
+    'debug': ['-O0', '--debug'],
+    'debugoptimized': ['-O1', '--debug'],
+    'release': ['-O3', '-Otime'],
+    'minsize': ['-O3', '-Ospace'],
+    'custom': [],
+}  # type: typing.Dict[str, typing.List[str]]
+
+arm_optimization_args = {
+    '0': ['-O0'],
+    'g': ['-g'],
+    '1': ['-O1'],
+    '2': ['-O2'],
+    '3': ['-O3'],
+    's': [],
+}  # type: typing.Dict[str, typing.List[str]]
+
+armclang_buildtype_args = {
+    'plain': [],
+    'debug': ['-O0', '-g'],
+    'debugoptimized': ['-O1', '-g'],
+    'release': ['-Os'],
+    'minsize': ['-Oz'],
+    'custom': [],
+}  # type: typing.Dict[str, typing.List[str]]
+
+armclang_optimization_args = {
+    '0': ['-O0'],
+    'g': ['-g'],
+    '1': ['-O1'],
+    '2': ['-O2'],
+    '3': ['-O3'],
+    's': ['-Os']
+}  # type: typing.Dict[str, typing.List[str]]
+
+
+class ArmCompiler:
+    # Functionality that is common to all ARM family compilers.
+    def __init__(self, compiler_type: 'CompilerType'):
+        if not self.is_cross:
+            raise mesonlib.EnvironmentException('armcc supports only cross-compilation.')
+        self.id = 'arm'
+        self.compiler_type = compiler_type
+        default_warn_args = []  # type: typing.List[str]
+        self.warn_args = {'0': [],
+                          '1': default_warn_args,
+                          '2': default_warn_args + [],
+                          '3': default_warn_args + []}
+        # Assembly
+        self.can_compile_suffixes.add('s')
+
+
+    def get_pic_args(self) -> typing.List[str]:
+        # FIXME: Add /ropi, /rwpi, /fpic etc. qualifiers to --apcs
+        return []
+
+    def get_buildtype_args(self, buildtype: str) -> typing.List[str]:
+        return arm_buildtype_args[buildtype]
+
+    # Override CCompiler.get_always_args
+    def get_always_args(self) -> typing.List[str]:
+        return []
+
+    # Override CCompiler.get_dependency_gen_args
+    def get_dependency_gen_args(self, outtarget: str, outfile: str) -> typing.List[str]:
+        return []
+
+    def get_pch_use_args(self, pch_dir: str, header: str) -> typing.List[str]:
+        # FIXME: Add required arguments
+        # NOTE from armcc user guide:
+        # "Support for Precompiled Header (PCH) files is deprecated from ARM Compiler 5.05
+        # onwards on all platforms. Note that ARM Compiler on Windows 8 never supported
+        # PCH files."
+        return []
+
+    def get_pch_suffix(self) -> str:
+        # NOTE from armcc user guide:
+        # "Support for Precompiled Header (PCH) files is deprecated from ARM Compiler 5.05
+        # onwards on all platforms. Note that ARM Compiler on Windows 8 never supported
+        # PCH files."
+        return 'pch'
+
+    def thread_flags(self, env: 'Environment') -> typing.List[str]:
+        return []
+
+    def get_coverage_args(self) -> typing.List[str]:
+        return []
+
+    def get_optimization_args(self, optimization_level: str) -> typing.List[str]:
+        return arm_optimization_args[optimization_level]
+
+    def get_debug_args(self, is_debug: bool) -> typing.List[str]:
+        return clike_debug_args[is_debug]
+
+    def compute_parameters_with_absolute_paths(self, parameter_list: typing.List[str], build_dir: str) -> typing.List[str]:
+        for idx, i in enumerate(parameter_list):
+            if i[:2] == '-I' or i[:2] == '-L':
+                parameter_list[idx] = i[:2] + os.path.normpath(os.path.join(build_dir, i[2:]))
+
+        return parameter_list
+
+
+class ArmclangCompiler:
+    def __init__(self, compiler_type: 'CompilerType'):
+        if not self.is_cross:
+            raise mesonlib.EnvironmentException('armclang supports only cross-compilation.')
+        # Check whether 'armlink' is available in path
+        self.linker_exe = 'armlink'
+        args = '--vsn'
+        try:
+            p, stdo, stderr = mesonlib.Popen_safe(self.linker_exe, args)
+        except OSError as e:
+            err_msg = 'Unknown linker\nRunning "{0}" gave \n"{1}"'.format(' '.join([self.linker_exe] + [args]), e)
+            raise mesonlib.EnvironmentException(err_msg)
+        # Verify the armlink version
+        ver_str = re.search('.*Component.*', stdo)
+        if ver_str:
+            ver_str = ver_str.group(0)
+        else:
+            mesonlib.EnvironmentException('armlink version string not found')
+        assert ver_str  # makes mypy happy
+        # Using the regular expression from environment.search_version,
+        # which is used for searching compiler version
+        version_regex = r'(? typing.List[str]:
+        # PIC support is not enabled by default for ARM,
+        # if users want to use it, they need to add the required arguments explicitly
+        return []
+
+    def get_colorout_args(self, colortype: str) -> typing.List[str]:
+        return clang_color_args[colortype][:]
+
+    def get_buildtype_args(self, buildtype: str) -> typing.List[str]:
+        return armclang_buildtype_args[buildtype]
+
+    def get_pch_suffix(self) -> str:
+        return 'gch'
+
+    def get_pch_use_args(self, pch_dir: str, header: str) -> typing.List[str]:
+        # Workaround for Clang bug http://llvm.org/bugs/show_bug.cgi?id=15136
+        # This flag is internal to Clang (or at least not documented on the man page)
+        # so it might change semantics at any time.
+        return ['-include-pch', os.path.join(pch_dir, self.get_pch_name(header))]
+
+    # Override CCompiler.get_dependency_gen_args
+    def get_dependency_gen_args(self, outtarget: str, outfile: str) -> typing.List[str]:
+        return []
+
+    def get_optimization_args(self, optimization_level: str) -> typing.List[str]:
+        return armclang_optimization_args[optimization_level]
+
+    def get_debug_args(self, is_debug: bool) -> typing.List[str]:
+        return clike_debug_args[is_debug]
+
+    def compute_parameters_with_absolute_paths(self, parameter_list: typing.List[str], build_dir: str) -> typing.List[str]:
+        for idx, i in enumerate(parameter_list):
+            if i[:2] == '-I' or i[:2] == '-L':
+                parameter_list[idx] = i[:2] + os.path.normpath(os.path.join(build_dir, i[2:]))
+
+        return parameter_list
diff -Nru meson-0.49.0/mesonbuild/compilers/mixins/ccrx.py meson-0.52.1/mesonbuild/compilers/mixins/ccrx.py
--- meson-0.49.0/mesonbuild/compilers/mixins/ccrx.py	1970-01-01 00:00:00.000000000 +0000
+++ meson-0.52.1/mesonbuild/compilers/mixins/ccrx.py	2019-11-28 17:37:44.000000000 +0000
@@ -0,0 +1,118 @@
+# Copyright 2012-2019 The Meson development team
+
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+
+#     http://www.apache.org/licenses/LICENSE-2.0
+
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Representations specific to the Renesas CC-RX compiler family."""
+
+import os
+import typing
+
+from ...mesonlib import Popen_safe, EnvironmentException
+
+if typing.TYPE_CHECKING:
+    from ..compilers import CompilerType
+    from ...environment import Environment
+
+ccrx_buildtype_args = {
+    'plain': [],
+    'debug': [],
+    'debugoptimized': [],
+    'release': [],
+    'minsize': [],
+    'custom': [],
+}  # type: typing.Dict[str, typing.List[str]]
+
+ccrx_optimization_args = {
+    '0': ['-optimize=0'],
+    'g': ['-optimize=0'],
+    '1': ['-optimize=1'],
+    '2': ['-optimize=2'],
+    '3': ['-optimize=max'],
+    's': ['-optimize=2', '-size']
+}  # type: typing.Dict[str, typing.List[str]]
+
+ccrx_debug_args = {
+    False: [],
+    True: ['-debug']
+}  # type: typing.Dict[bool, typing.List[str]]
+
+
+class CcrxCompiler:
+    def __init__(self, compiler_type: 'CompilerType'):
+        if not self.is_cross:
+            raise EnvironmentException('ccrx supports only cross-compilation.')
+        self.id = 'ccrx'
+        self.compiler_type = compiler_type
+        # Assembly
+        self.can_compile_suffixes.update('s')
+        default_warn_args = []  # type: typing.List[str]
+        self.warn_args = {'0': [],
+                          '1': default_warn_args,
+                          '2': default_warn_args + [],
+                          '3': default_warn_args + []}
+
+    def get_pic_args(self) -> typing.List[str]:
+        # PIC support is not enabled by default for CCRX,
+        # if users want to use it, they need to add the required arguments explicitly
+        return []
+
+    def get_buildtype_args(self, buildtype: str) -> typing.List[str]:
+        return ccrx_buildtype_args[buildtype]
+
+    def get_pch_suffix(self) -> str:
+        return 'pch'
+
+    def get_pch_use_args(self, pch_dir: str, header: str) -> typing.List[str]:
+        return []
+
+    # Override CCompiler.get_dependency_gen_args
+    def get_dependency_gen_args(self, outtarget: str, outfile: str) -> typing.List[str]:
+        return []
+
+    def thread_flags(self, env: 'Environment') -> typing.List[str]:
+        return []
+
+    def get_coverage_args(self) -> typing.List[str]:
+        return []
+
+    def get_optimization_args(self, optimization_level: str) -> typing.List[str]:
+        return ccrx_optimization_args[optimization_level]
+
+    def get_debug_args(self, is_debug: bool) -> typing.List[str]:
+        return ccrx_debug_args[is_debug]
+
+    @classmethod
+    def unix_args_to_native(cls, args: typing.List[str]) -> typing.List[str]:
+        result = []
+        for i in args:
+            if i.startswith('-D'):
+                i = '-define=' + i[2:]
+            if i.startswith('-I'):
+                i = '-include=' + i[2:]
+            if i.startswith('-Wl,-rpath='):
+                continue
+            elif i == '--print-search-dirs':
+                continue
+            elif i.startswith('-L'):
+                continue
+            elif not i.startswith('-lib=') and i.endswith(('.a', '.lib')):
+                i = '-lib=' + i
+            result.append(i)
+        return result
+
+    def compute_parameters_with_absolute_paths(self, parameter_list: typing.List[str], build_dir: str) -> typing.List[str]:
+        for idx, i in enumerate(parameter_list):
+            if i[:9] == '-include=':
+                parameter_list[idx] = i[:9] + os.path.normpath(os.path.join(build_dir, i[9:]))
+
+        return parameter_list
diff -Nru meson-0.49.0/mesonbuild/compilers/mixins/clang.py meson-0.52.1/mesonbuild/compilers/mixins/clang.py
--- meson-0.49.0/mesonbuild/compilers/mixins/clang.py	1970-01-01 00:00:00.000000000 +0000
+++ meson-0.52.1/mesonbuild/compilers/mixins/clang.py	2019-11-28 17:37:44.000000000 +0000
@@ -0,0 +1,90 @@
+# Copyright 2019 The meson development team
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Abstractions for the LLVM/Clang compiler family."""
+
+import os
+import typing
+
+from .gnu import GnuLikeCompiler
+from ..compilers import clike_optimization_args
+from ... import mesonlib
+
+if typing.TYPE_CHECKING:
+    from ..compilers import CompilerType
+    from ...environment import Environment
+    from ...dependencies import Dependency  # noqa: F401
+
+clang_color_args = {
+    'auto': ['-Xclang', '-fcolor-diagnostics'],
+    'always': ['-Xclang', '-fcolor-diagnostics'],
+    'never': ['-Xclang', '-fno-color-diagnostics'],
+}  # type: typing.Dict[str, typing.List[str]]
+
+
+class ClangCompiler(GnuLikeCompiler):
+    def __init__(self, compiler_type: 'CompilerType'):
+        super().__init__(compiler_type)
+        self.id = 'clang'
+        self.base_options.append('b_colorout')
+        if self.compiler_type.is_osx_compiler:
+            self.base_options.append('b_bitcode')
+        # All Clang backends can also do LLVM IR
+        self.can_compile_suffixes.add('ll')
+
+    def get_colorout_args(self, colortype: str) -> typing.List[str]:
+        return clang_color_args[colortype][:]
+
+    def get_optimization_args(self, optimization_level: str) -> typing.List[str]:
+        return clike_optimization_args[optimization_level]
+
+    def get_pch_suffix(self) -> str:
+        return 'pch'
+
+    def get_pch_use_args(self, pch_dir: str, header: str) -> typing.List[str]:
+        # Workaround for Clang bug http://llvm.org/bugs/show_bug.cgi?id=15136
+        # This flag is internal to Clang (or at least not documented on the man page)
+        # so it might change semantics at any time.
+        return ['-include-pch', os.path.join(pch_dir, self.get_pch_name(header))]
+
+    def has_multi_arguments(self, args: typing.List[str], env: 'Environment') -> typing.List[str]:
+        myargs = ['-Werror=unknown-warning-option', '-Werror=unused-command-line-argument']
+        if mesonlib.version_compare(self.version, '>=3.6.0'):
+            myargs.append('-Werror=ignored-optimization-argument')
+        return super().has_multi_arguments(
+            myargs + args,
+            env)
+
+    def has_function(self, funcname: str, prefix: str, env: 'Environment', *,
+                     extra_args: typing.Optional[typing.List[str]] = None,
+                     dependencies: typing.Optional[typing.List['Dependency']] = None) -> bool:
+        if extra_args is None:
+            extra_args = []
+        # Starting with XCode 8, we need to pass this to force linker
+        # visibility to obey OS X/iOS/tvOS minimum version targets with
+        # -mmacosx-version-min, -miphoneos-version-min, -mtvos-version-min etc.
+        # https://github.com/Homebrew/homebrew-core/issues/3727
+        if self.compiler_type.is_osx_compiler and mesonlib.version_compare(self.version, '>=8.0'):
+            extra_args.append('-Wl,-no_weak_imports')
+        return super().has_function(funcname, prefix, env, extra_args=extra_args,
+                                    dependencies=dependencies)
+
+    def openmp_flags(self) -> typing.List[str]:
+        if mesonlib.version_compare(self.version, '>=3.8.0'):
+            return ['-fopenmp']
+        elif mesonlib.version_compare(self.version, '>=3.7.0'):
+            return ['-fopenmp=libomp']
+        else:
+            # Shouldn't work, but it'll be checked explicitly in the OpenMP dependency.
+            return []
diff -Nru meson-0.49.0/mesonbuild/compilers/mixins/clike.py meson-0.52.1/mesonbuild/compilers/mixins/clike.py
--- meson-0.49.0/mesonbuild/compilers/mixins/clike.py	1970-01-01 00:00:00.000000000 +0000
+++ meson-0.52.1/mesonbuild/compilers/mixins/clike.py	2019-11-28 17:37:44.000000000 +0000
@@ -0,0 +1,1128 @@
+# Copyright 2012-2017 The Meson development team
+
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+
+#     http://www.apache.org/licenses/LICENSE-2.0
+
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+"""Mixin classes to be shared between C and C++ compilers.
+
+Without this we'll end up with awful diamond inherintance problems. The goal
+of this is to have mixin's, which are classes that are designed *not* to be
+standalone, they only work through inheritance.
+"""
+
+import functools
+import glob
+import itertools
+import os
+import re
+import subprocess
+import typing
+from pathlib import Path
+
+from ... import mesonlib
+from ...mesonlib import LibType
+from ... import mlog
+from .. import compilers
+from .visualstudio import VisualStudioLikeCompiler
+
+if typing.TYPE_CHECKING:
+    from ...environment import Environment
+
+
+class CLikeCompiler:
+
+    """Shared bits for the C and CPP Compilers."""
+
+    # TODO: Replace this manual cache with functools.lru_cache
+    library_dirs_cache = {}
+    program_dirs_cache = {}
+    find_library_cache = {}
+    find_framework_cache = {}
+    internal_libs = compilers.unixy_compiler_internal_libs
+
+    def __init__(self, is_cross: bool, exe_wrapper: typing.Optional[str] = None):
+        # If a child ObjC or CPP class has already set it, don't set it ourselves
+        self.is_cross = is_cross
+        self.can_compile_suffixes.add('h')
+        # If the exe wrapper was not found, pretend it wasn't set so that the
+        # sanity check is skipped and compiler checks use fallbacks.
+        if not exe_wrapper or not exe_wrapper.found():
+            self.exe_wrapper = None
+        else:
+            self.exe_wrapper = exe_wrapper.get_command()
+
+    def needs_static_linker(self):
+        return True # When compiling static libraries, so yes.
+
+    def get_always_args(self):
+        '''
+        Args that are always-on for all C compilers other than MSVC
+        '''
+        return ['-pipe'] + compilers.get_largefile_args(self)
+
+    def get_no_stdinc_args(self):
+        return ['-nostdinc']
+
+    def get_no_stdlib_link_args(self):
+        return ['-nostdlib']
+
+    def get_warn_args(self, level):
+        return self.warn_args[level]
+
+    def get_no_warn_args(self):
+        # Almost every compiler uses this for disabling warnings
+        return ['-w']
+
+    def split_shlib_to_parts(self, fname):
+        return None, fname
+
+    def depfile_for_object(self, objfile):
+        return objfile + '.' + self.get_depfile_suffix()
+
+    def get_depfile_suffix(self):
+        return 'd'
+
+    def get_exelist(self):
+        return self.exelist[:]
+
+    def get_preprocess_only_args(self):
+        return ['-E', '-P']
+
+    def get_compile_only_args(self):
+        return ['-c']
+
+    def get_no_optimization_args(self):
+        return ['-O0']
+
+    def get_compiler_check_args(self):
+        '''
+        Get arguments useful for compiler checks such as being permissive in
+        the code quality and not doing any optimization.
+        '''
+        return self.get_no_optimization_args()
+
+    def get_output_args(self, target):
+        return ['-o', target]
+
+    def get_coverage_args(self):
+        return ['--coverage']
+
+    def get_coverage_link_args(self) -> typing.List[str]:
+        return self.linker.get_coverage_args()
+
+    def get_werror_args(self):
+        return ['-Werror']
+
+    def get_std_exe_link_args(self):
+        # TODO: is this a linker property?
+        return []
+
+    def get_include_args(self, path, is_system):
+        if path == '':
+            path = '.'
+        if is_system:
+            return ['-isystem', path]
+        return ['-I' + path]
+
+    def get_compiler_dirs(self, env: 'Environment', name: str) -> typing.List[str]:
+        '''
+        Get dirs from the compiler, either `libraries:` or `programs:`
+        '''
+        return []
+
+    @functools.lru_cache()
+    def get_library_dirs(self, env, elf_class = None):
+        dirs = self.get_compiler_dirs(env, 'libraries')
+        if elf_class is None or elf_class == 0:
+            return dirs
+
+        # if we do have an elf class for 32-bit or 64-bit, we want to check that
+        # the directory in question contains libraries of the appropriate class. Since
+        # system directories aren't mixed, we only need to check one file for each
+        # directory and go by that. If we can't check the file for some reason, assume
+        # the compiler knows what it's doing, and accept the directory anyway.
+        retval = []
+        for d in dirs:
+            files = [f for f in os.listdir(d) if f.endswith('.so') and os.path.isfile(os.path.join(d, f))]
+            # if no files, accept directory and move on
+            if not files:
+                retval.append(d)
+                continue
+            file_to_check = os.path.join(d, files[0])
+            with open(file_to_check, 'rb') as fd:
+                header = fd.read(5)
+                # if file is not an ELF file, it's weird, but accept dir
+                # if it is elf, and the class matches, accept dir
+                if header[1:4] != b'ELF' or int(header[4]) == elf_class:
+                    retval.append(d)
+                # at this point, it's an ELF file which doesn't match the
+                # appropriate elf_class, so skip this one
+                pass
+        return tuple(retval)
+
+    @functools.lru_cache()
+    def get_program_dirs(self, env):
+        '''
+        Programs used by the compiler. Also where toolchain DLLs such as
+        libstdc++-6.dll are found with MinGW.
+        '''
+        return self.get_compiler_dirs(env, 'programs')
+
+    def get_pic_args(self) -> typing.List[str]:
+        return ['-fPIC']
+
+    def name_string(self) -> str:
+        return ' '.join(self.exelist)
+
+    def get_pch_use_args(self, pch_dir: str, header: str) -> typing.List[str]:
+        return ['-include', os.path.basename(header)]
+
+    def get_pch_name(self, header_name: str) -> str:
+        return os.path.basename(header_name) + '.' + self.get_pch_suffix()
+
+    def get_linker_search_args(self, dirname: str) -> typing.List[str]:
+        return self.linker.get_search_args(dirname)
+
+    def get_default_include_dirs(self):
+        return []
+
+    def gen_export_dynamic_link_args(self, env: 'Environment') -> typing.List[str]:
+        return self.linker.export_dynamic_args(env)
+
+    def gen_import_library_args(self, implibname: str) -> typing.List[str]:
+        return self.linker.import_library_args(implibname)
+
+    def sanity_check_impl(self, work_dir, environment, sname, code):
+        mlog.debug('Sanity testing ' + self.get_display_language() + ' compiler:', ' '.join(self.exelist))
+        mlog.debug('Is cross compiler: %s.' % str(self.is_cross))
+
+        source_name = os.path.join(work_dir, sname)
+        binname = sname.rsplit('.', 1)[0]
+        mode = 'link'
+        if self.is_cross:
+            binname += '_cross'
+            if self.exe_wrapper is None:
+                # Linking cross built apps is painful. You can't really
+                # tell if you should use -nostdlib or not and for example
+                # on OSX the compiler binary is the same but you need
+                # a ton of compiler flags to differentiate between
+                # arm and x86_64. So just compile.
+                mode = 'compile'
+        cargs, largs = self._get_basic_compiler_args(environment, mode)
+        extra_flags = cargs + self.linker_to_compiler_args(largs)
+
+        # Is a valid executable output for all toolchains and platforms
+        binname += '.exe'
+        # Write binary check source
+        binary_name = os.path.join(work_dir, binname)
+        with open(source_name, 'w') as ofile:
+            ofile.write(code)
+        # Compile sanity check
+        # NOTE: extra_flags must be added at the end. On MSVC, it might contain a '/link' argument
+        # after which all further arguments will be passed directly to the linker
+        cmdlist = self.exelist + [source_name] + self.get_output_args(binary_name) + extra_flags
+        pc, stdo, stde = mesonlib.Popen_safe(cmdlist, cwd=work_dir)
+        mlog.debug('Sanity check compiler command line:', ' '.join(cmdlist))
+        mlog.debug('Sanity check compile stdout:')
+        mlog.debug(stdo)
+        mlog.debug('-----\nSanity check compile stderr:')
+        mlog.debug(stde)
+        mlog.debug('-----')
+        if pc.returncode != 0:
+            raise mesonlib.EnvironmentException('Compiler {0} can not compile programs.'.format(self.name_string()))
+        # Run sanity check
+        if self.is_cross:
+            if self.exe_wrapper is None:
+                # Can't check if the binaries run so we have to assume they do
+                return
+            cmdlist = self.exe_wrapper + [binary_name]
+        else:
+            cmdlist = [binary_name]
+        mlog.debug('Running test binary command: ' + ' '.join(cmdlist))
+        try:
+            pe = subprocess.Popen(cmdlist)
+        except Exception as e:
+            raise mesonlib.EnvironmentException('Could not invoke sanity test executable: %s.' % str(e))
+        pe.wait()
+        if pe.returncode != 0:
+            raise mesonlib.EnvironmentException('Executables created by {0} compiler {1} are not runnable.'.format(self.language, self.name_string()))
+
+    def sanity_check(self, work_dir, environment):
+        code = 'int main() { int class=0; return class; }\n'
+        return self.sanity_check_impl(work_dir, environment, 'sanitycheckc.c', code)
+
+    def check_header(self, hname, prefix, env, *, extra_args=None, dependencies=None):
+        fargs = {'prefix': prefix, 'header': hname}
+        code = '''{prefix}
+        #include <{header}>'''
+        return self.compiles(code.format(**fargs), env, extra_args=extra_args,
+                             dependencies=dependencies)
+
+    def has_header(self, hname, prefix, env, *, extra_args=None, dependencies=None, disable_cache=False):
+        fargs = {'prefix': prefix, 'header': hname}
+        code = '''{prefix}
+        #ifdef __has_include
+         #if !__has_include("{header}")
+          #error "Header '{header}' could not be found"
+         #endif
+        #else
+         #include <{header}>
+        #endif'''
+        return self.compiles(code.format(**fargs), env, extra_args=extra_args,
+                             dependencies=dependencies, mode='preprocess', disable_cache=disable_cache)
+
+    def has_header_symbol(self, hname, symbol, prefix, env, *, extra_args=None, dependencies=None):
+        fargs = {'prefix': prefix, 'header': hname, 'symbol': symbol}
+        t = '''{prefix}
+        #include <{header}>
+        int main () {{
+            /* If it's not defined as a macro, try to use as a symbol */
+            #ifndef {symbol}
+                {symbol};
+            #endif
+            return 0;
+        }}'''
+        return self.compiles(t.format(**fargs), env, extra_args=extra_args,
+                             dependencies=dependencies)
+
+    def _get_basic_compiler_args(self, env, mode):
+        cargs, largs = [], []
+        # Select a CRT if needed since we're linking
+        if mode == 'link':
+            cargs += self.get_linker_debug_crt_args()
+
+        # Add CFLAGS/CXXFLAGS/OBJCFLAGS/OBJCXXFLAGS and CPPFLAGS from the env
+        sys_args = env.coredata.get_external_args(self.for_machine, self.language)
+        # Apparently it is a thing to inject linker flags both
+        # via CFLAGS _and_ LDFLAGS, even though the former are
+        # also used during linking. These flags can break
+        # argument checks. Thanks, Autotools.
+        cleaned_sys_args = self.remove_linkerlike_args(sys_args)
+        cargs += cleaned_sys_args
+
+        if mode == 'link':
+            # Add LDFLAGS from the env
+            sys_ld_args = env.coredata.get_external_link_args(self.for_machine, self.language)
+            # CFLAGS and CXXFLAGS go to both linking and compiling, but we want them
+            # to only appear on the command line once. Remove dupes.
+            largs += [x for x in sys_ld_args if x not in sys_args]
+
+        cargs += self.get_compiler_args_for_mode(mode)
+        return cargs, largs
+
+    def _get_compiler_check_args(self, env, extra_args, dependencies, mode='compile'):
+        if extra_args is None:
+            extra_args = []
+        else:
+            extra_args = mesonlib.listify(extra_args)
+        extra_args = mesonlib.listify([e(mode) if callable(e) else e for e in extra_args])
+
+        if dependencies is None:
+            dependencies = []
+        elif not isinstance(dependencies, list):
+            dependencies = [dependencies]
+        # Collect compiler arguments
+        cargs = compilers.CompilerArgs(self)
+        largs = []
+        for d in dependencies:
+            # Add compile flags needed by dependencies
+            cargs += d.get_compile_args()
+            if mode == 'link':
+                # Add link flags needed to find dependencies
+                largs += d.get_link_args()
+
+        ca, la = self._get_basic_compiler_args(env, mode)
+        cargs += ca
+        largs += la
+
+        cargs += self.get_compiler_check_args()
+
+        # on MSVC compiler and linker flags must be separated by the "/link" argument
+        # at this point, the '/link' argument may already be part of extra_args, otherwise, it is added here
+        if self.linker_to_compiler_args([]) == ['/link'] and largs != [] and not ('/link' in extra_args):
+            extra_args += ['/link']
+
+        args = cargs + extra_args + largs
+        return args
+
+    def compiles(self, code, env, *, extra_args=None, dependencies=None, mode='compile', disable_cache=False):
+        with self._build_wrapper(code, env, extra_args, dependencies, mode, disable_cache=disable_cache) as p:
+            return p.returncode == 0, p.cached
+
+    def _build_wrapper(self, code, env, extra_args, dependencies=None, mode='compile', want_output=False, disable_cache=False, temp_dir=None):
+        args = self._get_compiler_check_args(env, extra_args, dependencies, mode)
+        if disable_cache or want_output:
+            return self.compile(code, extra_args=args, mode=mode, want_output=want_output, temp_dir=env.scratch_dir)
+        return self.cached_compile(code, env.coredata, extra_args=args, mode=mode, temp_dir=env.scratch_dir)
+
+    def links(self, code, env, *, extra_args=None, dependencies=None, disable_cache=False):
+        return self.compiles(code, env, extra_args=extra_args,
+                             dependencies=dependencies, mode='link', disable_cache=disable_cache)
+
+    def run(self, code: str, env, *, extra_args=None, dependencies=None):
+        if self.is_cross and self.exe_wrapper is None:
+            raise compilers.CrossNoRunException('Can not run test applications in this cross environment.')
+        with self._build_wrapper(code, env, extra_args, dependencies, mode='link', want_output=True) as p:
+            if p.returncode != 0:
+                mlog.debug('Could not compile test file %s: %d\n' % (
+                    p.input_name,
+                    p.returncode))
+                return compilers.RunResult(False)
+            if self.is_cross:
+                cmdlist = self.exe_wrapper + [p.output_name]
+            else:
+                cmdlist = p.output_name
+            try:
+                pe, so, se = mesonlib.Popen_safe(cmdlist)
+            except Exception as e:
+                mlog.debug('Could not run: %s (error: %s)\n' % (cmdlist, e))
+                return compilers.RunResult(False)
+
+        mlog.debug('Program stdout:\n')
+        mlog.debug(so)
+        mlog.debug('Program stderr:\n')
+        mlog.debug(se)
+        return compilers.RunResult(True, pe.returncode, so, se)
+
+    def _compile_int(self, expression, prefix, env, extra_args, dependencies):
+        fargs = {'prefix': prefix, 'expression': expression}
+        t = '''#include 
+        {prefix}
+        int main() {{ static int a[1-2*!({expression})]; a[0]=0; return 0; }}'''
+        return self.compiles(t.format(**fargs), env, extra_args=extra_args,
+                             dependencies=dependencies)[0]
+
+    def cross_compute_int(self, expression, low, high, guess, prefix, env, extra_args, dependencies):
+        # Try user's guess first
+        if isinstance(guess, int):
+            if self._compile_int('%s == %d' % (expression, guess), prefix, env, extra_args, dependencies):
+                return guess
+
+        # If no bounds are given, compute them in the limit of int32
+        maxint = 0x7fffffff
+        minint = -0x80000000
+        if not isinstance(low, int) or not isinstance(high, int):
+            if self._compile_int('%s >= 0' % (expression), prefix, env, extra_args, dependencies):
+                low = cur = 0
+                while self._compile_int('%s > %d' % (expression, cur), prefix, env, extra_args, dependencies):
+                    low = cur + 1
+                    if low > maxint:
+                        raise mesonlib.EnvironmentException('Cross-compile check overflowed')
+                    cur = cur * 2 + 1
+                    if cur > maxint:
+                        cur = maxint
+                high = cur
+            else:
+                low = cur = -1
+                while self._compile_int('%s < %d' % (expression, cur), prefix, env, extra_args, dependencies):
+                    high = cur - 1
+                    if high < minint:
+                        raise mesonlib.EnvironmentException('Cross-compile check overflowed')
+                    cur = cur * 2
+                    if cur < minint:
+                        cur = minint
+                low = cur
+        else:
+            # Sanity check limits given by user
+            if high < low:
+                raise mesonlib.EnvironmentException('high limit smaller than low limit')
+            condition = '%s <= %d && %s >= %d' % (expression, high, expression, low)
+            if not self._compile_int(condition, prefix, env, extra_args, dependencies):
+                raise mesonlib.EnvironmentException('Value out of given range')
+
+        # Binary search
+        while low != high:
+            cur = low + int((high - low) / 2)
+            if self._compile_int('%s <= %d' % (expression, cur), prefix, env, extra_args, dependencies):
+                high = cur
+            else:
+                low = cur + 1
+
+        return low
+
+    def compute_int(self, expression, low, high, guess, prefix, env, *, extra_args=None, dependencies=None):
+        if extra_args is None:
+            extra_args = []
+        if self.is_cross:
+            return self.cross_compute_int(expression, low, high, guess, prefix, env, extra_args, dependencies)
+        fargs = {'prefix': prefix, 'expression': expression}
+        t = '''#include
+        {prefix}
+        int main() {{
+            printf("%ld\\n", (long)({expression}));
+            return 0;
+        }};'''
+        res = self.run(t.format(**fargs), env, extra_args=extra_args,
+                       dependencies=dependencies)
+        if not res.compiled:
+            return -1
+        if res.returncode != 0:
+            raise mesonlib.EnvironmentException('Could not run compute_int test binary.')
+        return int(res.stdout)
+
+    def cross_sizeof(self, typename, prefix, env, *, extra_args=None, dependencies=None):
+        if extra_args is None:
+            extra_args = []
+        fargs = {'prefix': prefix, 'type': typename}
+        t = '''#include 
+        {prefix}
+        int main() {{
+            {type} something;
+            return 0;
+        }}'''
+        if not self.compiles(t.format(**fargs), env, extra_args=extra_args,
+                             dependencies=dependencies)[0]:
+            return -1
+        return self.cross_compute_int('sizeof(%s)' % typename, None, None, None, prefix, env, extra_args, dependencies)
+
+    def sizeof(self, typename, prefix, env, *, extra_args=None, dependencies=None):
+        if extra_args is None:
+            extra_args = []
+        fargs = {'prefix': prefix, 'type': typename}
+        if self.is_cross:
+            return self.cross_sizeof(typename, prefix, env, extra_args=extra_args,
+                                     dependencies=dependencies)
+        t = '''#include
+        {prefix}
+        int main() {{
+            printf("%ld\\n", (long)(sizeof({type})));
+            return 0;
+        }};'''
+        res = self.run(t.format(**fargs), env, extra_args=extra_args,
+                       dependencies=dependencies)
+        if not res.compiled:
+            return -1
+        if res.returncode != 0:
+            raise mesonlib.EnvironmentException('Could not run sizeof test binary.')
+        return int(res.stdout)
+
+    def cross_alignment(self, typename, prefix, env, *, extra_args=None, dependencies=None):
+        if extra_args is None:
+            extra_args = []
+        fargs = {'prefix': prefix, 'type': typename}
+        t = '''#include 
+        {prefix}
+        int main() {{
+            {type} something;
+            return 0;
+        }}'''
+        if not self.compiles(t.format(**fargs), env, extra_args=extra_args,
+                             dependencies=dependencies)[0]:
+            return -1
+        t = '''#include 
+        {prefix}
+        struct tmp {{
+            char c;
+            {type} target;
+        }};'''
+        return self.cross_compute_int('offsetof(struct tmp, target)', None, None, None, t.format(**fargs), env, extra_args, dependencies)
+
+    def alignment(self, typename, prefix, env, *, extra_args=None, dependencies=None):
+        if extra_args is None:
+            extra_args = []
+        if self.is_cross:
+            return self.cross_alignment(typename, prefix, env, extra_args=extra_args,
+                                        dependencies=dependencies)
+        fargs = {'prefix': prefix, 'type': typename}
+        t = '''#include 
+        #include 
+        {prefix}
+        struct tmp {{
+            char c;
+            {type} target;
+        }};
+        int main() {{
+            printf("%d", (int)offsetof(struct tmp, target));
+            return 0;
+        }}'''
+        res = self.run(t.format(**fargs), env, extra_args=extra_args,
+                       dependencies=dependencies)
+        if not res.compiled:
+            raise mesonlib.EnvironmentException('Could not compile alignment test.')
+        if res.returncode != 0:
+            raise mesonlib.EnvironmentException('Could not run alignment test binary.')
+        align = int(res.stdout)
+        if align == 0:
+            raise mesonlib.EnvironmentException('Could not determine alignment of %s. Sorry. You might want to file a bug.' % typename)
+        return align
+
+    def get_define(self, dname, prefix, env, extra_args, dependencies, disable_cache=False):
+        delim = '"MESON_GET_DEFINE_DELIMITER"'
+        fargs = {'prefix': prefix, 'define': dname, 'delim': delim}
+        code = '''
+        {prefix}
+        #ifndef {define}
+        # define {define}
+        #endif
+        {delim}\n{define}'''
+        args = self._get_compiler_check_args(env, extra_args, dependencies,
+                                             mode='preprocess').to_native()
+        func = lambda: self.cached_compile(code.format(**fargs), env.coredata, extra_args=args, mode='preprocess')
+        if disable_cache:
+            func = lambda: self.compile(code.format(**fargs), extra_args=args, mode='preprocess', temp_dir=env.scratch_dir)
+        with func() as p:
+            cached = p.cached
+            if p.returncode != 0:
+                raise mesonlib.EnvironmentException('Could not get define {!r}'.format(dname))
+        # Get the preprocessed value after the delimiter,
+        # minus the extra newline at the end and
+        # merge string literals.
+        return self.concatenate_string_literals(p.stdo.split(delim + '\n')[-1][:-1]), cached
+
+    def get_return_value(self, fname, rtype, prefix, env, extra_args, dependencies):
+        if rtype == 'string':
+            fmt = '%s'
+            cast = '(char*)'
+        elif rtype == 'int':
+            fmt = '%lli'
+            cast = '(long long int)'
+        else:
+            raise AssertionError('BUG: Unknown return type {!r}'.format(rtype))
+        fargs = {'prefix': prefix, 'f': fname, 'cast': cast, 'fmt': fmt}
+        code = '''{prefix}
+        #include 
+        int main() {{
+            printf ("{fmt}", {cast} {f}());
+            return 0;
+        }}'''.format(**fargs)
+        res = self.run(code, env, extra_args=extra_args, dependencies=dependencies)
+        if not res.compiled:
+            m = 'Could not get return value of {}()'
+            raise mesonlib.EnvironmentException(m.format(fname))
+        if rtype == 'string':
+            return res.stdout
+        elif rtype == 'int':
+            try:
+                return int(res.stdout.strip())
+            except ValueError:
+                m = 'Return value of {}() is not an int'
+                raise mesonlib.EnvironmentException(m.format(fname))
+
+    @staticmethod
+    def _no_prototype_templ():
+        """
+        Try to find the function without a prototype from a header by defining
+        our own dummy prototype and trying to link with the C library (and
+        whatever else the compiler links in by default). This is very similar
+        to the check performed by Autoconf for AC_CHECK_FUNCS.
+        """
+        # Define the symbol to something else since it is defined by the
+        # includes or defines listed by the user or by the compiler. This may
+        # include, for instance _GNU_SOURCE which must be defined before
+        # limits.h, which includes features.h
+        # Then, undef the symbol to get rid of it completely.
+        head = '''
+        #define {func} meson_disable_define_of_{func}
+        {prefix}
+        #include 
+        #undef {func}
+        '''
+        # Override any GCC internal prototype and declare our own definition for
+        # the symbol. Use char because that's unlikely to be an actual return
+        # value for a function which ensures that we override the definition.
+        head += '''
+        #ifdef __cplusplus
+        extern "C"
+        #endif
+        char {func} ();
+        '''
+        # The actual function call
+        main = '''
+        int main () {{
+          return {func} ();
+        }}'''
+        return head, main
+
+    @staticmethod
+    def _have_prototype_templ():
+        """
+        Returns a head-er and main() call that uses the headers listed by the
+        user for the function prototype while checking if a function exists.
+        """
+        # Add the 'prefix', aka defines, includes, etc that the user provides
+        # This may include, for instance _GNU_SOURCE which must be defined
+        # before limits.h, which includes features.h
+        head = '{prefix}\n#include \n'
+        # We don't know what the function takes or returns, so return it as an int.
+        # Just taking the address or comparing it to void is not enough because
+        # compilers are smart enough to optimize it away. The resulting binary
+        # is not run so we don't care what the return value is.
+        main = '''\nint main() {{
+            void *a = (void*) &{func};
+            long b = (long) a;
+            return (int) b;
+        }}'''
+        return head, main
+
+    def has_function(self, funcname, prefix, env, *, extra_args=None, dependencies=None):
+        """
+        First, this function looks for the symbol in the default libraries
+        provided by the compiler (stdlib + a few others usually). If that
+        fails, it checks if any of the headers specified in the prefix provide
+        an implementation of the function, and if that fails, it checks if it's
+        implemented as a compiler-builtin.
+        """
+        if extra_args is None:
+            extra_args = []
+
+        # Short-circuit if the check is already provided by the cross-info file
+        varname = 'has function ' + funcname
+        varname = varname.replace(' ', '_')
+        if self.is_cross:
+            val = env.properties.host.get(varname, None)
+            if val is not None:
+                if isinstance(val, bool):
+                    return val, False
+                raise mesonlib.EnvironmentException('Cross variable {0} is not a boolean.'.format(varname))
+
+        fargs = {'prefix': prefix, 'func': funcname}
+
+        # glibc defines functions that are not available on Linux as stubs that
+        # fail with ENOSYS (such as e.g. lchmod). In this case we want to fail
+        # instead of detecting the stub as a valid symbol.
+        # We already included limits.h earlier to ensure that these are defined
+        # for stub functions.
+        stubs_fail = '''
+        #if defined __stub_{func} || defined __stub___{func}
+        fail fail fail this function is not going to work
+        #endif
+        '''
+
+        # If we have any includes in the prefix supplied by the user, assume
+        # that the user wants us to use the symbol prototype defined in those
+        # includes. If not, then try to do the Autoconf-style check with
+        # a dummy prototype definition of our own.
+        # This is needed when the linker determines symbol availability from an
+        # SDK based on the prototype in the header provided by the SDK.
+        # Ignoring this prototype would result in the symbol always being
+        # marked as available.
+        if '#include' in prefix:
+            head, main = self._have_prototype_templ()
+        else:
+            head, main = self._no_prototype_templ()
+        templ = head + stubs_fail + main
+
+        res, cached = self.links(templ.format(**fargs), env, extra_args=extra_args,
+                                 dependencies=dependencies)
+        if res:
+            return True, cached
+
+        # MSVC does not have compiler __builtin_-s.
+        if self.get_id() in {'msvc', 'intel-cl'}:
+            return False, False
+
+        # Detect function as a built-in
+        #
+        # Some functions like alloca() are defined as compiler built-ins which
+        # are inlined by the compiler and you can't take their address, so we
+        # need to look for them differently. On nice compilers like clang, we
+        # can just directly use the __has_builtin() macro.
+        fargs['no_includes'] = '#include' not in prefix
+        t = '''{prefix}
+        int main() {{
+        #ifdef __has_builtin
+            #if !__has_builtin(__builtin_{func})
+                #error "__builtin_{func} not found"
+            #endif
+        #elif ! defined({func})
+            /* Check for __builtin_{func} only if no includes were added to the
+             * prefix above, which means no definition of {func} can be found.
+             * We would always check for this, but we get false positives on
+             * MSYS2 if we do. Their toolchain is broken, but we can at least
+             * give them a workaround. */
+            #if {no_includes:d}
+                __builtin_{func};
+            #else
+                #error "No definition for __builtin_{func} found in the prefix"
+            #endif
+        #endif
+        return 0;
+        }}'''
+        return self.links(t.format(**fargs), env, extra_args=extra_args,
+                          dependencies=dependencies)
+
+    def has_members(self, typename, membernames, prefix, env, *, extra_args=None, dependencies=None):
+        if extra_args is None:
+            extra_args = []
+        fargs = {'prefix': prefix, 'type': typename, 'name': 'foo'}
+        # Create code that accesses all members
+        members = ''
+        for member in membernames:
+            members += '{}.{};\n'.format(fargs['name'], member)
+        fargs['members'] = members
+        t = '''{prefix}
+        void bar() {{
+            {type} {name};
+            {members}
+        }};'''
+        return self.compiles(t.format(**fargs), env, extra_args=extra_args,
+                             dependencies=dependencies)
+
+    def has_type(self, typename, prefix, env, extra_args, dependencies=None):
+        fargs = {'prefix': prefix, 'type': typename}
+        t = '''{prefix}
+        void bar() {{
+            sizeof({type});
+        }};'''
+        return self.compiles(t.format(**fargs), env, extra_args=extra_args,
+                             dependencies=dependencies)
+
+    def symbols_have_underscore_prefix(self, env):
+        '''
+        Check if the compiler prefixes an underscore to global C symbols
+        '''
+        symbol_name = b'meson_uscore_prefix'
+        code = '''#ifdef __cplusplus
+        extern "C" {
+        #endif
+        void ''' + symbol_name.decode() + ''' () {}
+        #ifdef __cplusplus
+        }
+        #endif
+        '''
+        args = self.get_compiler_check_args()
+        n = 'symbols_have_underscore_prefix'
+        with self._build_wrapper(code, env, extra_args=args, mode='compile', want_output=True, temp_dir=env.scratch_dir) as p:
+            if p.returncode != 0:
+                m = 'BUG: Unable to compile {!r} check: {}'
+                raise RuntimeError(m.format(n, p.stdo))
+            if not os.path.isfile(p.output_name):
+                m = 'BUG: Can\'t find compiled test code for {!r} check'
+                raise RuntimeError(m.format(n))
+            with open(p.output_name, 'rb') as o:
+                for line in o:
+                    # Check if the underscore form of the symbol is somewhere
+                    # in the output file.
+                    if b'_' + symbol_name in line:
+                        mlog.debug("Symbols have underscore prefix: YES")
+                        return True
+                    # Else, check if the non-underscored form is present
+                    elif symbol_name in line:
+                        mlog.debug("Symbols have underscore prefix: NO")
+                        return False
+        raise RuntimeError('BUG: {!r} check failed unexpectedly'.format(n))
+
+    def _get_patterns(self, env, prefixes, suffixes, shared=False):
+        patterns = []
+        for p in prefixes:
+            for s in suffixes:
+                patterns.append(p + '{}.' + s)
+        if shared and env.machines[self.for_machine].is_openbsd():
+            # Shared libraries on OpenBSD can be named libfoo.so.X.Y:
+            # https://www.openbsd.org/faq/ports/specialtopics.html#SharedLibs
+            #
+            # This globbing is probably the best matching we can do since regex
+            # is expensive. It's wrong in many edge cases, but it will match
+            # correctly-named libraries and hopefully no one on OpenBSD names
+            # their files libfoo.so.9a.7b.1.0
+            for p in prefixes:
+                patterns.append(p + '{}.so.[0-9]*.[0-9]*')
+        return patterns
+
+    def get_library_naming(self, env, libtype: LibType, strict=False):
+        '''
+        Get library prefixes and suffixes for the target platform ordered by
+        priority
+        '''
+        stlibext = ['a']
+        # We've always allowed libname to be both `foo` and `libfoo`, and now
+        # people depend on it. Also, some people use prebuilt `foo.so` instead
+        # of `libfoo.so` for unknown reasons, and may also want to create
+        # `foo.so` by setting name_prefix to ''
+        if strict and not isinstance(self, VisualStudioLikeCompiler): # lib prefix is not usually used with msvc
+            prefixes = ['lib']
+        else:
+            prefixes = ['lib', '']
+        # Library suffixes and prefixes
+        if env.machines[self.for_machine].is_darwin():
+            shlibext = ['dylib', 'so']
+        elif env.machines[self.for_machine].is_windows():
+            # FIXME: .lib files can be import or static so we should read the
+            # file, figure out which one it is, and reject the wrong kind.
+            if isinstance(self, VisualStudioLikeCompiler):
+                shlibext = ['lib']
+            else:
+                shlibext = ['dll.a', 'lib', 'dll']
+            # Yep, static libraries can also be foo.lib
+            stlibext += ['lib']
+        elif env.machines[self.for_machine].is_cygwin():
+            shlibext = ['dll', 'dll.a']
+            prefixes = ['cyg'] + prefixes
+        else:
+            # Linux/BSDs
+            shlibext = ['so']
+        # Search priority
+        if libtype is LibType.PREFER_SHARED:
+            patterns = self._get_patterns(env, prefixes, shlibext, True)
+            patterns.extend([x for x in self._get_patterns(env, prefixes, stlibext, False) if x not in patterns])
+        elif libtype is LibType.PREFER_STATIC:
+            patterns = self._get_patterns(env, prefixes, stlibext, False)
+            patterns.extend([x for x in self._get_patterns(env, prefixes, shlibext, True) if x not in patterns])
+        elif libtype is LibType.SHARED:
+            patterns = self._get_patterns(env, prefixes, shlibext, True)
+        else:
+            assert libtype is LibType.STATIC
+            patterns = self._get_patterns(env, prefixes, stlibext, False)
+        return tuple(patterns)
+
+    @staticmethod
+    def _sort_shlibs_openbsd(libs):
+        filtered = []
+        for lib in libs:
+            # Validate file as a shared library of type libfoo.so.X.Y
+            ret = lib.rsplit('.so.', maxsplit=1)
+            if len(ret) != 2:
+                continue
+            try:
+                float(ret[1])
+            except ValueError:
+                continue
+            filtered.append(lib)
+        float_cmp = lambda x: float(x.rsplit('.so.', maxsplit=1)[1])
+        return sorted(filtered, key=float_cmp, reverse=True)
+
+    @classmethod
+    def _get_trials_from_pattern(cls, pattern, directory, libname):
+        f = Path(directory) / pattern.format(libname)
+        # Globbing for OpenBSD
+        if '*' in pattern:
+            # NOTE: globbing matches directories and broken symlinks
+            # so we have to do an isfile test on it later
+            return [Path(x) for x in cls._sort_shlibs_openbsd(glob.glob(str(f)))]
+        return [f]
+
+    @staticmethod
+    def _get_file_from_list(env, files: typing.List[str]) -> Path:
+        '''
+        We just check whether the library exists. We can't do a link check
+        because the library might have unresolved symbols that require other
+        libraries. On macOS we check if the library matches our target
+        architecture.
+        '''
+        # If not building on macOS for Darwin, do a simple file check
+        files = [Path(f) for f in files]
+        if not env.machines.host.is_darwin() or not env.machines.build.is_darwin():
+            for f in files:
+                if f.is_file():
+                    return f
+        # Run `lipo` and check if the library supports the arch we want
+        for f in files:
+            if not f.is_file():
+                continue
+            archs = mesonlib.darwin_get_object_archs(f)
+            if archs and env.machines.host.cpu_family in archs:
+                return f
+            else:
+                mlog.debug('Rejected {}, supports {} but need {}'
+                           .format(f, archs, env.machines.host.cpu_family))
+        return None
+
+    @functools.lru_cache()
+    def output_is_64bit(self, env):
+        '''
+        returns true if the output produced is 64-bit, false if 32-bit
+        '''
+        return self.sizeof('void *', '', env) == 8
+
+    def find_library_real(self, libname, env, extra_dirs, code, libtype: LibType):
+        # First try if we can just add the library as -l.
+        # Gcc + co seem to prefer builtin lib dirs to -L dirs.
+        # Only try to find std libs if no extra dirs specified.
+        # The built-in search procedure will always favour .so and then always
+        # search for .a. This is only allowed if libtype is LibType.PREFER_SHARED
+        if ((not extra_dirs and libtype is LibType.PREFER_SHARED) or
+                libname in self.internal_libs):
+            cargs = ['-l' + libname]
+            largs = self.get_allow_undefined_link_args()
+            extra_args = cargs + self.linker_to_compiler_args(largs)
+
+            if self.links(code, env, extra_args=extra_args, disable_cache=True)[0]:
+                return cargs
+            # Don't do a manual search for internal libs
+            if libname in self.internal_libs:
+                return None
+        # Not found or we want to use a specific libtype? Try to find the
+        # library file itself.
+        patterns = self.get_library_naming(env, libtype)
+        # try to detect if we are 64-bit or 32-bit. If we can't
+        # detect, we will just skip path validity checks done in
+        # get_library_dirs() call
+        try:
+            if self.output_is_64bit(env):
+                elf_class = 2
+            else:
+                elf_class = 1
+        except (mesonlib.MesonException, KeyError): # TODO evaluate if catching KeyError is wanted here
+            elf_class = 0
+        # Search in the specified dirs, and then in the system libraries
+        for d in itertools.chain(extra_dirs, self.get_library_dirs(env, elf_class)):
+            for p in patterns:
+                trial = self._get_trials_from_pattern(p, d, libname)
+                if not trial:
+                    continue
+                trial = self._get_file_from_list(env, trial)
+                if not trial:
+                    continue
+                return [trial.as_posix()]
+        return None
+
+    def find_library_impl(self, libname, env, extra_dirs, code, libtype: LibType):
+        # These libraries are either built-in or invalid
+        if libname in self.ignore_libs:
+            return []
+        if isinstance(extra_dirs, str):
+            extra_dirs = [extra_dirs]
+        key = (tuple(self.exelist), libname, tuple(extra_dirs), code, libtype)
+        if key not in self.find_library_cache:
+            value = self.find_library_real(libname, env, extra_dirs, code, libtype)
+            self.find_library_cache[key] = value
+        else:
+            value = self.find_library_cache[key]
+        if value is None:
+            return None
+        return value[:]
+
+    def find_library(self, libname, env, extra_dirs, libtype: LibType = LibType.PREFER_SHARED):
+        code = 'int main() { return 0; }'
+        return self.find_library_impl(libname, env, extra_dirs, code, libtype)
+
+    def find_framework_paths(self, env):
+        '''
+        These are usually /Library/Frameworks and /System/Library/Frameworks,
+        unless you select a particular macOS SDK with the -isysroot flag.
+        You can also add to this by setting -F in CFLAGS.
+        '''
+        if self.id != 'clang':
+            raise mesonlib.MesonException('Cannot find framework path with non-clang compiler')
+        # Construct the compiler command-line
+        commands = self.get_exelist() + ['-v', '-E', '-']
+        commands += self.get_always_args()
+        # Add CFLAGS/CXXFLAGS/OBJCFLAGS/OBJCXXFLAGS from the env
+        commands += env.coredata.get_external_args(self.for_machine, self.language)
+        mlog.debug('Finding framework path by running: ', ' '.join(commands), '\n')
+        os_env = os.environ.copy()
+        os_env['LC_ALL'] = 'C'
+        _, _, stde = mesonlib.Popen_safe(commands, env=os_env, stdin=subprocess.PIPE)
+        paths = []
+        for line in stde.split('\n'):
+            if '(framework directory)' not in line:
+                continue
+            # line is of the form:
+            # ` /path/to/framework (framework directory)`
+            paths.append(line[:-21].strip())
+        return paths
+
+    def find_framework_real(self, name, env, extra_dirs, allow_system):
+        code = 'int main() { return 0; }'
+        link_args = []
+        for d in extra_dirs:
+            link_args += ['-F' + d]
+        # We can pass -Z to disable searching in the system frameworks, but
+        # then we must also pass -L/usr/lib to pick up libSystem.dylib
+        extra_args = [] if allow_system else ['-Z', '-L/usr/lib']
+        link_args += ['-framework', name]
+        if self.links(code, env, extra_args=(extra_args + link_args), disable_cache=True)[0]:
+            return link_args
+
+    def find_framework_impl(self, name, env, extra_dirs, allow_system):
+        if isinstance(extra_dirs, str):
+            extra_dirs = [extra_dirs]
+        key = (tuple(self.exelist), name, tuple(extra_dirs), allow_system)
+        if key in self.find_framework_cache:
+            value = self.find_framework_cache[key]
+        else:
+            value = self.find_framework_real(name, env, extra_dirs, allow_system)
+            self.find_framework_cache[key] = value
+        if value is None:
+            return None
+        return value[:]
+
+    def find_framework(self, name, env, extra_dirs, allow_system=True):
+        '''
+        Finds the framework with the specified name, and returns link args for
+        the same or returns None when the framework is not found.
+        '''
+        if self.id != 'clang':
+            raise mesonlib.MesonException('Cannot find frameworks with non-clang compiler')
+        return self.find_framework_impl(name, env, extra_dirs, allow_system)
+
+    def get_crt_compile_args(self, crt_val: str, buildtype: str) -> typing.List[str]:
+        return []
+
+    def get_crt_link_args(self, crt_val: str, buildtype: str) -> typing.List[str]:
+        return []
+
+    def thread_flags(self, env):
+        host_m = env.machines[self.for_machine]
+        if host_m.is_haiku() or host_m.is_darwin():
+            return []
+        return ['-pthread']
+
+    def thread_link_flags(self, env: 'Environment') -> typing.List[str]:
+        return self.linker.thread_flags(env)
+
+    def linker_to_compiler_args(self, args):
+        return args
+
+    def has_arguments(self, args, env, code, mode):
+        return self.compiles(code, env, extra_args=args, mode=mode)
+
+    def has_multi_arguments(self, args, env):
+        for arg in args[:]:
+            # some compilers, e.g. GCC, don't warn for unsupported warning-disable
+            # flags, so when we are testing a flag like "-Wno-forgotten-towel", also
+            # check the equivalent enable flag too "-Wforgotten-towel"
+            if arg.startswith('-Wno-'):
+                args.append('-W' + arg[5:])
+            if arg.startswith('-Wl,'):
+                mlog.warning('{} looks like a linker argument, '
+                             'but has_argument and other similar methods only '
+                             'support checking compiler arguments. Using them '
+                             'to check linker arguments are never supported, '
+                             'and results are likely to be wrong regardless of '
+                             'the compiler you are using. has_link_argument or '
+                             'other similar method can be used instead.'
+                             .format(arg))
+        code = 'int i;\n'
+        return self.has_arguments(args, env, code, mode='compile')
+
+    def has_multi_link_arguments(self, args, env):
+        # First time we check for link flags we need to first check if we have
+        # --fatal-warnings, otherwise some linker checks could give some
+        # false positive.
+        args = self.linker.fatal_warnings() + args
+        args = self.linker_to_compiler_args(args)
+        code = 'int main() { return 0; }'
+        return self.has_arguments(args, env, code, mode='link')
+
+    @staticmethod
+    def concatenate_string_literals(s):
+        pattern = re.compile(r'(?P
.*([^\\]")|^")(?P([^\\"]|\\.)*)"\s+"(?P([^\\"]|\\.)*)(?P".*)')
+        ret = s
+        m = pattern.match(ret)
+        while m:
+            ret = ''.join(m.group('pre', 'str1', 'str2', 'post'))
+            m = pattern.match(ret)
+        return ret
+
+    def has_func_attribute(self, name, env):
+        # Just assume that if we're not on windows that dllimport and dllexport
+        # don't work
+        m = env.machines[self.for_machine]
+        if not (m.is_windows() or m.is_cygwin()):
+            if name in ['dllimport', 'dllexport']:
+                return False, False
+
+        # Clang and GCC both return warnings if the __attribute__ is undefined,
+        # so set -Werror
+        return self.compiles(self.attribute_check_func(name), env, extra_args='-Werror')
diff -Nru meson-0.49.0/mesonbuild/compilers/mixins/elbrus.py meson-0.52.1/mesonbuild/compilers/mixins/elbrus.py
--- meson-0.49.0/mesonbuild/compilers/mixins/elbrus.py	1970-01-01 00:00:00.000000000 +0000
+++ meson-0.52.1/mesonbuild/compilers/mixins/elbrus.py	2019-11-28 17:37:44.000000000 +0000
@@ -0,0 +1,60 @@
+# Copyright 2019 The meson development team
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Abstractions for the Elbrus family of compilers."""
+
+import os
+import typing
+
+from .gnu import GnuCompiler
+from ...mesonlib import Popen_safe
+
+if typing.TYPE_CHECKING:
+    from ..compilers import CompilerType
+    from ...environment import Environment
+
+
+class ElbrusCompiler(GnuCompiler):
+    # Elbrus compiler is nearly like GCC, but does not support
+    # PCH, LTO, sanitizers and color output as of version 1.21.x.
+    def __init__(self, compiler_type: 'CompilerType', defines: typing.Dict[str, str]):
+        GnuCompiler.__init__(self, compiler_type, defines)
+        self.id = 'lcc'
+        self.base_options = ['b_pgo', 'b_coverage',
+                             'b_ndebug', 'b_staticpic',
+                             'b_lundef', 'b_asneeded']
+
+    # FIXME: use _build_wrapper to call this so that linker flags from the env
+    # get applied
+    def get_library_dirs(self, env: 'Environment', elf_class: typing.Optional[int] = None) -> typing.List[str]:
+        os_env = os.environ.copy()
+        os_env['LC_ALL'] = 'C'
+        stdo = Popen_safe(self.exelist + ['--print-search-dirs'], env=os_env)[1]
+        for line in stdo.split('\n'):
+            if line.startswith('libraries:'):
+                # lcc does not include '=' in --print-search-dirs output.
+                libstr = line.split(' ', 1)[1]
+                return [os.path.realpath(p) for p in libstr.split(':')]
+        return []
+
+    def get_program_dirs(self, env: 'Environment') -> typing.List[str]:
+        os_env = os.environ.copy()
+        os_env['LC_ALL'] = 'C'
+        stdo = Popen_safe(self.exelist + ['--print-search-dirs'], env=os_env)[1]
+        for line in stdo.split('\n'):
+            if line.startswith('programs:'):
+                # lcc does not include '=' in --print-search-dirs output.
+                libstr = line.split(' ', 1)[1]
+                return [os.path.realpath(p) for p in libstr.split(':')]
+        return []
diff -Nru meson-0.49.0/mesonbuild/compilers/mixins/gnu.py meson-0.52.1/mesonbuild/compilers/mixins/gnu.py
--- meson-0.49.0/mesonbuild/compilers/mixins/gnu.py	1970-01-01 00:00:00.000000000 +0000
+++ meson-0.52.1/mesonbuild/compilers/mixins/gnu.py	2019-11-28 17:37:44.000000000 +0000
@@ -0,0 +1,345 @@
+# Copyright 2019 The meson development team
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Provides mixins for GNU compilers and GNU-like compilers."""
+
+import abc
+import functools
+import os
+import pathlib
+import re
+import subprocess
+import typing
+
+from ... import mesonlib
+from ... import mlog
+
+if typing.TYPE_CHECKING:
+    from ..compilers import CompilerType
+    from ...coredata import UserOption  # noqa: F401
+    from ...environment import Environment
+
+# XXX: prevent circular references.
+# FIXME: this really is a posix interface not a c-like interface
+clike_debug_args = {
+    False: [],
+    True: ['-g'],
+}  # type: typing.Dict[bool, typing.List[str]]
+
+gnulike_buildtype_args = {
+    'plain': [],
+    'debug': [],
+    'debugoptimized': [],
+    'release': [],
+    'minsize': [],
+    'custom': [],
+}  # type: typing.Dict[str, typing.List[str]]
+
+gnu_optimization_args = {
+    '0': [],
+    'g': ['-Og'],
+    '1': ['-O1'],
+    '2': ['-O2'],
+    '3': ['-O3'],
+    's': ['-Os'],
+}  # type: typing.Dict[str, typing.List[str]]
+
+gnulike_instruction_set_args = {
+    'mmx': ['-mmmx'],
+    'sse': ['-msse'],
+    'sse2': ['-msse2'],
+    'sse3': ['-msse3'],
+    'ssse3': ['-mssse3'],
+    'sse41': ['-msse4.1'],
+    'sse42': ['-msse4.2'],
+    'avx': ['-mavx'],
+    'avx2': ['-mavx2'],
+    'neon': ['-mfpu=neon'],
+}  # type: typing.Dict[str, typing.List[str]]
+
+gnu_symbol_visibility_args = {
+    '': [],
+    'default': ['-fvisibility=default'],
+    'internal': ['-fvisibility=internal'],
+    'hidden': ['-fvisibility=hidden'],
+    'protected': ['-fvisibility=protected'],
+    'inlineshidden': ['-fvisibility=hidden', '-fvisibility-inlines-hidden'],
+}  # type: typing.Dict[str, typing.List[str]]
+
+gnu_color_args = {
+    'auto': ['-fdiagnostics-color=auto'],
+    'always': ['-fdiagnostics-color=always'],
+    'never': ['-fdiagnostics-color=never'],
+}  # type: typing.Dict[str, typing.List[str]]
+
+
+@functools.lru_cache(maxsize=None)
+def gnulike_default_include_dirs(compiler: typing.Tuple[str], lang: str) -> typing.List[str]:
+    lang_map = {
+        'c': 'c',
+        'cpp': 'c++',
+        'objc': 'objective-c',
+        'objcpp': 'objective-c++'
+    }
+    if lang not in lang_map:
+        return []
+    lang = lang_map[lang]
+    env = os.environ.copy()
+    env["LC_ALL"] = 'C'
+    cmd = list(compiler) + ['-x{}'.format(lang), '-E', '-v', '-']
+    p = subprocess.Popen(
+        cmd,
+        stdin=subprocess.DEVNULL,
+        stderr=subprocess.PIPE,
+        stdout=subprocess.PIPE,
+        env=env
+    )
+    stderr = p.stderr.read().decode('utf-8', errors='replace')
+    parse_state = 0
+    paths = []
+    for line in stderr.split('\n'):
+        if parse_state == 0:
+            if line == '#include "..." search starts here:':
+                parse_state = 1
+        elif parse_state == 1:
+            if line == '#include <...> search starts here:':
+                parse_state = 2
+            else:
+                paths.append(line[1:])
+        elif parse_state == 2:
+            if line == 'End of search list.':
+                break
+            else:
+                paths.append(line[1:])
+    if not paths:
+        mlog.warning('No include directory found parsing "{cmd}" output'.format(cmd=" ".join(cmd)))
+    return paths
+
+
+class GnuLikeCompiler(metaclass=abc.ABCMeta):
+    """
+    GnuLikeCompiler is a common interface to all compilers implementing
+    the GNU-style commandline interface. This includes GCC, Clang
+    and ICC. Certain functionality between them is different and requires
+    that the actual concrete subclass define their own implementation.
+    """
+
+    LINKER_PREFIX = '-Wl,'
+
+    def __init__(self, compiler_type: 'CompilerType'):
+        self.compiler_type = compiler_type
+        self.base_options = ['b_pch', 'b_lto', 'b_pgo', 'b_sanitize', 'b_coverage',
+                             'b_ndebug', 'b_staticpic', 'b_pie']
+        if not (self.compiler_type.is_windows_compiler or mesonlib.is_openbsd()):
+            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')
+
+    def get_pic_args(self) -> typing.List[str]:
+        if self.compiler_type.is_osx_compiler or self.compiler_type.is_windows_compiler:
+            return [] # On Window and OS X, pic is always on.
+        return ['-fPIC']
+
+    def get_pie_args(self) -> typing.List[str]:
+        return ['-fPIE']
+
+    def get_buildtype_args(self, buildtype: str) -> typing.List[str]:
+        return gnulike_buildtype_args[buildtype]
+
+    @abc.abstractmethod
+    def get_optimization_args(self, optimization_level: str) -> typing.List[str]:
+        raise NotImplementedError("get_optimization_args not implemented")
+
+    def get_debug_args(self, is_debug: bool) -> typing.List[str]:
+        return clike_debug_args[is_debug]
+
+    @abc.abstractmethod
+    def get_pch_suffix(self) -> str:
+        raise NotImplementedError("get_pch_suffix not implemented")
+
+    def split_shlib_to_parts(self, fname: str) -> typing.Tuple[str, str]:
+        return os.path.dirname(fname), fname
+
+    def get_instruction_set_args(self, instruction_set: str) -> typing.Optional[typing.List[str]]:
+        return gnulike_instruction_set_args.get(instruction_set, None)
+
+    def get_default_include_dirs(self) -> typing.List[str]:
+        return gnulike_default_include_dirs(tuple(self.exelist), self.language)
+
+    @abc.abstractmethod
+    def openmp_flags(self) -> typing.List[str]:
+        raise NotImplementedError("openmp_flags not implemented")
+
+    def gnu_symbol_visibility_args(self, vistype: str) -> typing.List[str]:
+        return gnu_symbol_visibility_args[vistype]
+
+    def gen_vs_module_defs_args(self, defsfile: str) -> typing.List[str]:
+        if not isinstance(defsfile, str):
+            raise RuntimeError('Module definitions file should be str')
+        # On Windows targets, .def files may be specified on the linker command
+        # line like an object file.
+        if self.compiler_type.is_windows_compiler:
+            return [defsfile]
+        # For other targets, discard the .def file.
+        return []
+
+    def get_argument_syntax(self) -> str:
+        return 'gcc'
+
+    def get_profile_generate_args(self) -> typing.List[str]:
+        return ['-fprofile-generate']
+
+    def get_profile_use_args(self) -> typing.List[str]:
+        return ['-fprofile-use', '-fprofile-correction']
+
+    def get_gui_app_args(self, value: bool) -> typing.List[str]:
+        if self.compiler_type.is_windows_compiler:
+            return ['-mwindows' if value else '-mconsole']
+        return []
+
+    def compute_parameters_with_absolute_paths(self, parameter_list: typing.List[str], build_dir: str) -> typing.List[str]:
+        for idx, i in enumerate(parameter_list):
+            if i[:2] == '-I' or i[:2] == '-L':
+                parameter_list[idx] = i[:2] + os.path.normpath(os.path.join(build_dir, i[2:]))
+
+        return parameter_list
+
+    @functools.lru_cache()
+    def _get_search_dirs(self, env: 'Environment') -> str:
+        extra_args = ['--print-search-dirs']
+        stdo = None
+        with self._build_wrapper('', env, extra_args=extra_args,
+                                 dependencies=None, mode='compile',
+                                 want_output=True) as p:
+            stdo = p.stdo
+        return stdo
+
+    def _split_fetch_real_dirs(self, pathstr: str) -> typing.List[str]:
+        # We need to use the path separator used by the compiler for printing
+        # lists of paths ("gcc --print-search-dirs"). By default
+        # we assume it uses the platform native separator.
+        pathsep = os.pathsep
+
+        # clang uses ':' instead of ';' on Windows https://reviews.llvm.org/D61121
+        # so we need to repair things like 'C:\foo:C:\bar'
+        if pathsep == ';':
+            pathstr = re.sub(r':([^/\\])', r';\1', pathstr)
+
+        # pathlib treats empty paths as '.', so filter those out
+        paths = [p for p in pathstr.split(pathsep) if p]
+
+        result = []
+        for p in paths:
+            # GCC returns paths like this:
+            # /usr/lib/gcc/x86_64-linux-gnu/8/../../../../x86_64-linux-gnu/lib
+            # It would make sense to normalize them to get rid of the .. parts
+            # Sadly when you are on a merged /usr fs it also kills these:
+            # /lib/x86_64-linux-gnu
+            # since /lib is a symlink to /usr/lib. This would mean
+            # paths under /lib would be considered not a "system path",
+            # which is wrong and breaks things. Store everything, just to be sure.
+            pobj = pathlib.Path(p)
+            unresolved = pobj.as_posix()
+            if pobj.exists():
+                if unresolved not in result:
+                    result.append(unresolved)
+                try:
+                    resolved = pathlib.Path(p).resolve().as_posix()
+                    if resolved not in result:
+                        result.append(resolved)
+                except FileNotFoundError:
+                    pass
+        return result
+
+    def get_compiler_dirs(self, env: 'Environment', name: str) -> typing.List[str]:
+        '''
+        Get dirs from the compiler, either `libraries:` or `programs:`
+        '''
+        stdo = self._get_search_dirs(env)
+        for line in stdo.split('\n'):
+            if line.startswith(name + ':'):
+                return self._split_fetch_real_dirs(line.split('=', 1)[1])
+        return []
+
+    def get_lto_compile_args(self) -> typing.List[str]:
+        return ['-flto']
+
+    def sanitizer_compile_args(self, value: str) -> typing.List[str]:
+        if value == 'none':
+            return []
+        args = ['-fsanitize=' + value]
+        if 'address' in value:  # for -fsanitize=address,undefined
+            args.append('-fno-omit-frame-pointer')
+        return args
+
+    def get_output_args(self, target: str) -> typing.List[str]:
+        return ['-o', target]
+
+    def get_dependency_gen_args(self, outtarget, outfile):
+        return ['-MD', '-MQ', outtarget, '-MF', outfile]
+
+    def get_compile_only_args(self) -> typing.List[str]:
+        return ['-c']
+
+    def get_include_args(self, path: str, is_system: bool) -> typing.List[str]:
+        if not path:
+            path = '.'
+        if is_system:
+            return ['-isystem' + path]
+        return ['-I' + path]
+
+
+class GnuCompiler(GnuLikeCompiler):
+    """
+    GnuCompiler represents an actual GCC in its many incarnations.
+    Compilers imitating GCC (Clang/Intel) should use the GnuLikeCompiler ABC.
+    """
+
+    def __init__(self, compiler_type: 'CompilerType', defines: typing.Dict[str, str]):
+        super().__init__(compiler_type)
+        self.id = 'gcc'
+        self.defines = defines or {}
+        self.base_options.append('b_colorout')
+
+    def get_colorout_args(self, colortype: str) -> typing.List[str]:
+        if mesonlib.version_compare(self.version, '>=4.9.0'):
+            return gnu_color_args[colortype][:]
+        return []
+
+    def get_warn_args(self, level: str) -> typing.List[str]:
+        args = super().get_warn_args(level)
+        if mesonlib.version_compare(self.version, '<4.8.0') and '-Wpedantic' in args:
+            # -Wpedantic was added in 4.8.0
+            # https://gcc.gnu.org/gcc-4.8/changes.html
+            args[args.index('-Wpedantic')] = '-pedantic'
+        return args
+
+    def has_builtin_define(self, define: str) -> bool:
+        return define in self.defines
+
+    def get_builtin_define(self, define: str) -> typing.Optional[str]:
+        if define in self.defines:
+            return self.defines[define]
+        return None
+
+    def get_optimization_args(self, optimization_level: str) -> typing.List[str]:
+        return gnu_optimization_args[optimization_level]
+
+    def get_pch_suffix(self) -> str:
+        return 'gch'
+
+    def openmp_flags(self) -> typing.List[str]:
+        return ['-fopenmp']
diff -Nru meson-0.49.0/mesonbuild/compilers/mixins/intel.py meson-0.52.1/mesonbuild/compilers/mixins/intel.py
--- meson-0.49.0/mesonbuild/compilers/mixins/intel.py	1970-01-01 00:00:00.000000000 +0000
+++ meson-0.52.1/mesonbuild/compilers/mixins/intel.py	2019-11-28 17:37:44.000000000 +0000
@@ -0,0 +1,137 @@
+# Copyright 2019 The meson development team
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Abstractions for the Intel Compiler families.
+
+Intel provides both a posix/gcc-like compiler (ICC) and an msvc-like compiler
+(ICL).
+"""
+
+import os
+import typing
+
+from ... import mesonlib
+from ..compilers import CompilerType
+from .gnu import GnuLikeCompiler
+from .visualstudio import VisualStudioLikeCompiler
+
+if typing.TYPE_CHECKING:
+    import subprocess  # noqa: F401
+
+# XXX: avoid circular dependencies
+# TODO: this belongs in a posix compiler class
+clike_optimization_args = {
+    '0': [],
+    'g': [],
+    '1': ['-O1'],
+    '2': ['-O2'],
+    '3': ['-O3'],
+    's': ['-Os'],
+}  # type: typing.Dict[str, typing.List[str]]
+
+
+# Tested on linux for ICC 14.0.3, 15.0.6, 16.0.4, 17.0.1, 19.0.0
+class IntelGnuLikeCompiler(GnuLikeCompiler):
+
+    def __init__(self, compiler_type: 'CompilerType'):
+        super().__init__(compiler_type)
+        # As of 19.0.0 ICC doesn't have sanitizer, color, or lto support.
+        #
+        # It does have IPO, which serves much the same purpose as LOT, but
+        # there is an unfortunate rule for using IPO (you can't control the
+        # name of the output file) which break assumptions meson makes
+        self.base_options = ['b_pch', 'b_lundef', 'b_asneeded', 'b_pgo',
+                             'b_coverage', 'b_ndebug', 'b_staticpic', 'b_pie']
+        self.id = 'intel'
+        self.lang_header = 'none'
+
+    def get_optimization_args(self, optimization_level: str) -> typing.List[str]:
+        return clike_optimization_args[optimization_level]
+
+    def get_pch_suffix(self) -> str:
+        return 'pchi'
+
+    def get_pch_use_args(self, pch_dir: str, header: str) -> typing.List[str]:
+        return ['-pch', '-pch_dir', os.path.join(pch_dir), '-x',
+                self.lang_header, '-include', header, '-x', 'none']
+
+    def get_pch_name(self, header_name: str) -> str:
+        return os.path.basename(header_name) + '.' + self.get_pch_suffix()
+
+    def openmp_flags(self) -> typing.List[str]:
+        if mesonlib.version_compare(self.version, '>=15.0.0'):
+            return ['-qopenmp']
+        else:
+            return ['-openmp']
+
+    def compiles(self, *args, **kwargs) -> typing.Tuple[bool, bool]:
+        # This covers a case that .get('foo', []) doesn't, that extra_args is
+        # defined and is None
+        extra_args = kwargs.get('extra_args') or []
+        kwargs['extra_args'] = [
+            extra_args,
+            '-diag-error', '10006',  # ignoring unknown option
+            '-diag-error', '10148',  # Option not supported
+            '-diag-error', '10155',  # ignoring argument required
+            '-diag-error', '10156',  # ignoring not argument allowed
+            '-diag-error', '10157',  # Ignoring argument of the wrong type
+            '-diag-error', '10158',  # Argument must be separate. Can be hit by trying an option like -foo-bar=foo when -foo=bar is a valid option but -foo-bar isn't
+            '-diag-error', '1292',   # unknown __attribute__
+        ]
+        return super().compiles(*args, **kwargs)
+
+    def get_profile_generate_args(self) -> typing.List[str]:
+        return ['-prof-gen=threadsafe']
+
+    def get_profile_use_args(self) -> typing.List[str]:
+        return ['-prof-use']
+
+
+class IntelVisualStudioLikeCompiler(VisualStudioLikeCompiler):
+
+    """Abstractions for ICL, the Intel compiler on Windows."""
+
+    def __init__(self, target: str):
+        super().__init__(target)
+        self.compiler_type = CompilerType.ICC_WIN
+        self.id = 'intel-cl'
+
+    def compile(self, code, *, extra_args: typing.Optional[typing.List[str]] = None, **kwargs) -> typing.Iterator['subprocess.Popen']:
+        # This covers a case that .get('foo', []) doesn't, that extra_args is
+        if kwargs.get('mode', 'compile') != 'link':
+            extra_args = extra_args.copy() if extra_args is not None else []
+            extra_args.extend([
+                '/Qdiag-error:10006',  # ignoring unknown option
+                '/Qdiag-error:10148',  # Option not supported
+                '/Qdiag-error:10155',  # ignoring argument required
+                '/Qdiag-error:10156',  # ignoring not argument allowed
+                '/Qdiag-error:10157',  # Ignoring argument of the wrong type
+                '/Qdiag-error:10158',  # Argument must be separate. Can be hit by trying an option like -foo-bar=foo when -foo=bar is a valid option but -foo-bar isn't
+            ])
+        return super().compile(code, extra_args, **kwargs)
+
+    def get_toolset_version(self) -> typing.Optional[str]:
+        # Avoid circular dependencies....
+        from ...environment import search_version
+
+        # ICL provides a cl.exe that returns the version of MSVC it tries to
+        # emulate, so we'll get the version from that and pass it to the same
+        # function the real MSVC uses to calculate the toolset version.
+        _, _, err = mesonlib.Popen_safe(['cl.exe'])
+        v1, v2, *_ = search_version(err).split('.')
+        version = int(v1 + v2)
+        return self._calculate_toolset_version(version)
+
+    def openmp_flags(self) -> typing.List[str]:
+        return ['/Qopenmp']
diff -Nru meson-0.49.0/mesonbuild/compilers/mixins/islinker.py meson-0.52.1/mesonbuild/compilers/mixins/islinker.py
--- meson-0.49.0/mesonbuild/compilers/mixins/islinker.py	1970-01-01 00:00:00.000000000 +0000
+++ meson-0.52.1/mesonbuild/compilers/mixins/islinker.py	2019-10-14 21:38:13.000000000 +0000
@@ -0,0 +1,132 @@
+# Copyright 2019 The Meson development team
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Mixins for compilers that *are* linkers.
+
+While many compilers (such as gcc and clang) are used by meson to dispatch
+linker commands and other (like MSVC) are not, a few (such as DMD) actually
+are both the linker and compiler in one binary. This module provides mixin
+classes for those cases.
+"""
+
+import os
+import typing
+
+from ... import mesonlib
+
+if typing.TYPE_CHECKING:
+    from ...coredata import OptionDictType
+    from ...environment import Environment
+
+
+class LinkerEnvVarsMixin:
+
+    """Mixin reading LDFLAGS from the environment."""
+
+    def get_linker_args_from_envvars(self) -> typing.List[str]:
+        flags = os.environ.get('LDFLAGS')
+        if not flags:
+            return []
+        return mesonlib.split_args(flags)
+
+
+class BasicLinkerIsCompilerMixin:
+
+    """Provides a baseline of methods that a linker would implement.
+
+    In every case this provides a "no" or "empty" answer. If a compiler
+    implements any of these it needs a different mixin or to override that
+    functionality itself.
+    """
+
+    def sanitizer_link_args(self, value: str) -> typing.List[str]:
+        return []
+
+    def get_lto_link_args(self) -> typing.List[str]:
+        return []
+
+    def can_linker_accept_rsp(self) -> bool:
+        return mesonlib.is_windows()
+
+    def get_linker_exelist(self) -> typing.List[str]:
+        return self.exelist.copy()
+
+    def get_linker_output_args(self, output: str) -> typing.List[str]:
+        return []
+
+    def get_linker_always_args(self) -> typing.List[str]:
+        return []
+
+    def get_linker_lib_prefix(self) -> str:
+        return ''
+
+    def get_option_link_args(self, options: 'OptionDictType') -> typing.List[str]:
+        return []
+
+    def has_multi_link_args(self, args: typing.List[str], env: 'Environment') -> typing.Tuple[bool, bool]:
+        return False, False
+
+    def get_link_debugfile_args(self, targetfile: str) -> typing.List[str]:
+        return []
+
+    def get_std_shared_lib_link_args(self) -> typing.List[str]:
+        return []
+
+    def get_std_shared_module_args(self, options: 'OptionDictType') -> typing.List[str]:
+        return self.get_std_shared_lib_link_args()
+
+    def get_link_whole_for(self, args: typing.List[str]) -> typing.List[str]:
+        raise mesonlib.EnvironmentException(
+            'Linker {} does not support link_whole'.format(self.id))
+
+    def get_allow_undefined_link_args(self) -> typing.List[str]:
+        raise mesonlib.EnvironmentException(
+            'Linker {} does not support allow undefined'.format(self.id))
+
+    def get_pie_link_args(self) -> typing.List[str]:
+        m = 'Linker {} does not support position-independent executable'
+        raise mesonlib.EnvironmentException(m.format(self.id))
+
+    def get_undefined_link_args(self) -> typing.List[str]:
+        return []
+
+    def get_coverage_link_args(self) -> typing.List[str]:
+        m = "Linker {} doesn't implement coverage data generation.".format(self.id)
+        raise mesonlib.EnvironmentException(m)
+
+    def no_undefined_link_args(self) -> typing.List[str]:
+        return []
+
+    def bitcode_args(self) -> typing.List[str]:
+        raise mesonlib.MesonException("This linker doesn't support bitcode bundles")
+
+    def get_soname_args(self, for_machine: 'mesonlib.MachineChoice',
+                        prefix: str, shlib_name: str, suffix: str, soversion: str,
+                        darwin_versions: typing.Tuple[str, str],
+                        is_shared_module: bool) -> typing.List[str]:
+        raise mesonlib.MesonException("This linker doesn't support soname args")
+
+    def build_rpath_args(self, env: 'Environment', build_dir: str, from_dir: str,
+                         rpath_paths: str, build_rpath: str,
+                         install_rpath: str) -> typing.List[str]:
+        return []
+
+    def get_linker_debug_crt_args(self) -> typing.List[str]:
+        return []
+
+    def get_asneeded_args(self) -> typing.List[str]:
+        return []
+
+    def get_buildtype_linker_args(self, buildtype: str) -> typing.List[str]:
+        return []
diff -Nru meson-0.49.0/mesonbuild/compilers/mixins/pgi.py meson-0.52.1/mesonbuild/compilers/mixins/pgi.py
--- meson-0.49.0/mesonbuild/compilers/mixins/pgi.py	1970-01-01 00:00:00.000000000 +0000
+++ meson-0.52.1/mesonbuild/compilers/mixins/pgi.py	2019-11-28 17:37:44.000000000 +0000
@@ -0,0 +1,103 @@
+# Copyright 2019 The meson development team
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Abstractions for the PGI family of compilers."""
+
+import typing
+import os
+from pathlib import Path
+
+from ..compilers import clike_debug_args, clike_optimization_args
+
+if typing.TYPE_CHECKING:
+    from ..compilers import CompilerType
+
+pgi_buildtype_args = {
+    'plain': [],
+    'debug': [],
+    'debugoptimized': [],
+    'release': [],
+    'minsize': [],
+    'custom': [],
+}  # type: typing.Dict[str, typing.List[str]]
+
+
+class PGICompiler:
+    def __init__(self, compiler_type: 'CompilerType'):
+        self.base_options = ['b_pch']
+        self.id = 'pgi'
+        self.compiler_type = compiler_type
+
+        default_warn_args = ['-Minform=inform']
+        self.warn_args = {'0': [],
+                          '1': default_warn_args,
+                          '2': default_warn_args,
+                          '3': default_warn_args}
+
+    def get_module_incdir_args(self) -> typing.Tuple[str]:
+        return ('-module', )
+
+    def get_no_warn_args(self) -> typing.List[str]:
+        return ['-silent']
+
+    def gen_import_library_args(self, implibname: str) -> typing.List[str]:
+        return []
+
+    def get_pic_args(self) -> typing.List[str]:
+        # PGI -fPIC is Linux only.
+        if self.compiler_type.is_standard_compiler:
+            return ['-fPIC']
+        return []
+
+    def openmp_flags(self) -> typing.List[str]:
+        return ['-mp']
+
+    def get_buildtype_args(self, buildtype: str) -> typing.List[str]:
+        return pgi_buildtype_args[buildtype]
+
+    def get_optimization_args(self, optimization_level: str) -> typing.List[str]:
+        return clike_optimization_args[optimization_level]
+
+    def get_debug_args(self, is_debug: bool) -> typing.List[str]:
+        return clike_debug_args[is_debug]
+
+    def compute_parameters_with_absolute_paths(self, parameter_list: typing.List[str], build_dir: str) -> typing.List[str]:
+        for idx, i in enumerate(parameter_list):
+            if i[:2] == '-I' or i[:2] == '-L':
+                parameter_list[idx] = i[:2] + os.path.normpath(os.path.join(build_dir, i[2:]))
+        return parameter_list
+
+    def get_dependency_gen_args(self, outtarget: str, outfile: str) -> typing.List[str]:
+        return []
+
+    def get_always_args(self) -> typing.List[str]:
+        return []
+
+    def get_pch_suffix(self) -> str:
+        # PGI defaults to .pch suffix for PCH on Linux and Windows with --pch option
+        return 'pch'
+
+    def get_pch_use_args(self, pch_dir: str, header: str) -> typing.List[str]:
+        # PGI supports PCH for C++ only.
+        hdr = Path(pch_dir).resolve().parent / header
+        if self.language == 'cpp':
+            return ['--pch',
+                    '--pch_dir', str(hdr.parent),
+                    '-I{}'.format(hdr.parent)]
+        else:
+            return []
+
+    def thread_flags(self, env):
+        # PGI cannot accept -pthread, it's already threaded
+        return []
diff -Nru meson-0.49.0/mesonbuild/compilers/mixins/visualstudio.py meson-0.52.1/mesonbuild/compilers/mixins/visualstudio.py
--- meson-0.49.0/mesonbuild/compilers/mixins/visualstudio.py	1970-01-01 00:00:00.000000000 +0000
+++ meson-0.52.1/mesonbuild/compilers/mixins/visualstudio.py	2019-11-28 17:37:44.000000000 +0000
@@ -0,0 +1,381 @@
+# Copyright 2019 The meson development team
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Abstractions to simplify compilers that implement an MSVC compatible
+interface.
+"""
+
+import abc
+import os
+import typing
+
+from ... import mesonlib
+from ... import mlog
+
+if typing.TYPE_CHECKING:
+    from ...environment import Environment
+
+vs32_instruction_set_args = {
+    'mmx': ['/arch:SSE'], # There does not seem to be a flag just for MMX
+    'sse': ['/arch:SSE'],
+    'sse2': ['/arch:SSE2'],
+    'sse3': ['/arch:AVX'], # VS leaped from SSE2 directly to AVX.
+    'sse41': ['/arch:AVX'],
+    'sse42': ['/arch:AVX'],
+    'avx': ['/arch:AVX'],
+    'avx2': ['/arch:AVX2'],
+    'neon': None,
+}  # typing.Dicst[str, typing.Optional[typing.List[str]]]
+
+# The 64 bit compiler defaults to /arch:avx.
+vs64_instruction_set_args = {
+    'mmx': ['/arch:AVX'],
+    'sse': ['/arch:AVX'],
+    'sse2': ['/arch:AVX'],
+    'sse3': ['/arch:AVX'],
+    'ssse3': ['/arch:AVX'],
+    'sse41': ['/arch:AVX'],
+    'sse42': ['/arch:AVX'],
+    'avx': ['/arch:AVX'],
+    'avx2': ['/arch:AVX2'],
+    'neon': None,
+}  # typing.Dicst[str, typing.Optional[typing.List[str]]]
+
+msvc_buildtype_args = {
+    'plain': [],
+    'debug': ["/ZI", "/Ob0", "/Od", "/RTC1"],
+    'debugoptimized': ["/Zi", "/Ob1"],
+    'release': ["/Ob2", "/Gw"],
+    'minsize': ["/Zi", "/Gw"],
+    'custom': [],
+}  # type: typing.Dict[str, typing.List[str]]
+
+msvc_optimization_args = {
+    '0': [],
+    'g': ['/O0'],
+    '1': ['/O1'],
+    '2': ['/O2'],
+    '3': ['/O2'],
+    's': ['/O1'], # Implies /Os.
+}  # type: typing.Dict[str, typing.List[str]]
+
+msvc_debug_args = {
+    False: [],
+    True: []  # Fixme!
+}  # type: typing.Dict[bool, typing.List[str]]
+
+
+class VisualStudioLikeCompiler(metaclass=abc.ABCMeta):
+
+    """A common interface for all compilers implementing an MSVC-style
+    interface.
+
+    A number of compilers attempt to mimic MSVC, with varying levels of
+    success, such as Clang-CL and ICL (the Intel C/C++ Compiler for Windows).
+    This classs implements as much common logic as possible.
+    """
+
+    std_warn_args = ['/W3']
+    std_opt_args = ['/O2']
+    # XXX: this is copied in this patch only to avoid circular dependencies
+    #ignore_libs = unixy_compiler_internal_libs
+    ignore_libs = ('m', 'c', 'pthread', 'dl', 'rt', 'execinfo')
+    internal_libs = ()
+
+    crt_args = {
+        'none': [],
+        'md': ['/MD'],
+        'mdd': ['/MDd'],
+        'mt': ['/MT'],
+        'mtd': ['/MTd'],
+    }  # type: typing.Dict[str, typing.List[str]]
+
+    # /showIncludes is needed for build dependency tracking in Ninja
+    # See: https://ninja-build.org/manual.html#_deps
+    always_args = ['/nologo', '/showIncludes']
+    warn_args = {
+        '0': ['/W1'],
+        '1': ['/W2'],
+        '2': ['/W3'],
+        '3': ['/W4'],
+    }  # type: typing.Dict[str, typing.List[str]]
+
+    def __init__(self, target: str):
+        self.base_options = ['b_pch', 'b_ndebug', 'b_vscrt'] # FIXME add lto, pgo and the like
+        self.target = target
+        self.is_64 = ('x64' in target) or ('x86_64' in target)
+        # do some canonicalization of target machine
+        if 'x86_64' in target:
+            self.machine = 'x64'
+        elif '86' in target:
+            self.machine = 'x86'
+        else:
+            self.machine = target
+        self.linker.machine = self.machine
+
+    # Override CCompiler.get_always_args
+    def get_always_args(self) -> typing.List[str]:
+        return self.always_args
+
+    def get_buildtype_args(self, buildtype: str) -> typing.List[str]:
+        args = msvc_buildtype_args[buildtype]
+        if self.id == 'msvc' and mesonlib.version_compare(self.version, '<18.0'):
+            args = [arg for arg in args if arg != '/Gw']
+        return args
+
+    def get_pch_suffix(self) -> str:
+        return 'pch'
+
+    def get_pch_name(self, header: str) -> str:
+        chopped = os.path.basename(header).split('.')[:-1]
+        chopped.append(self.get_pch_suffix())
+        pchname = '.'.join(chopped)
+        return pchname
+
+    def get_pch_use_args(self, pch_dir: str, header: str) -> typing.List[str]:
+        base = os.path.basename(header)
+        if self.id == 'clang-cl':
+            base = header
+        pchname = self.get_pch_name(header)
+        return ['/FI' + base, '/Yu' + base, '/Fp' + os.path.join(pch_dir, pchname)]
+
+    def get_preprocess_only_args(self) -> typing.List[str]:
+        return ['/EP']
+
+    def get_compile_only_args(self) -> typing.List[str]:
+        return ['/c']
+
+    def get_no_optimization_args(self) -> typing.List[str]:
+        return ['/Od']
+
+    def get_output_args(self, target: str) -> typing.List[str]:
+        if target.endswith('.exe'):
+            return ['/Fe' + target]
+        return ['/Fo' + target]
+
+    def get_optimization_args(self, optimization_level: str) -> typing.List[str]:
+        return msvc_optimization_args[optimization_level]
+
+    def get_debug_args(self, is_debug: bool) -> typing.List[str]:
+        return msvc_debug_args[is_debug]
+
+    def get_dependency_gen_args(self, outtarget: str, outfile: str) -> typing.List[str]:
+        return []
+
+    def linker_to_compiler_args(self, args: typing.List[str]) -> typing.List[str]:
+        return ['/link'] + args
+
+    def get_gui_app_args(self, value: bool) -> typing.List[str]:
+        # the default is for the linker to guess the subsystem based on presence
+        # of main or WinMain symbols, so always be explicit
+        if value:
+            return ['/SUBSYSTEM:WINDOWS']
+        else:
+            return ['/SUBSYSTEM:CONSOLE']
+
+    def get_pic_args(self) -> typing.List[str]:
+        return [] # PIC is handled by the loader on Windows
+
+    def gen_vs_module_defs_args(self, defsfile: str) -> typing.List[str]:
+        if not isinstance(defsfile, str):
+            raise RuntimeError('Module definitions file should be str')
+        # With MSVC, DLLs only export symbols that are explicitly exported,
+        # so if a module defs file is specified, we use that to export symbols
+        return ['/DEF:' + defsfile]
+
+    def gen_pch_args(self, header: str, source: str, pchname: str) -> typing.Tuple[str, typing.List[str]]:
+        objname = os.path.splitext(pchname)[0] + '.obj'
+        return objname, ['/Yc' + header, '/Fp' + pchname, '/Fo' + objname]
+
+    def gen_import_library_args(self, implibname: str) -> typing.List[str]:
+        "The name of the outputted import library"
+        return ['/IMPLIB:' + implibname]
+
+    def openmp_flags(self) -> typing.List[str]:
+        return ['/openmp']
+
+    # FIXME, no idea what these should be.
+    def thread_flags(self, env: 'Environment') -> typing.List[str]:
+        return []
+
+    @classmethod
+    def unix_args_to_native(cls, args: typing.List[str]) -> typing.List[str]:
+        result = []
+        for i in args:
+            # -mms-bitfields is specific to MinGW-GCC
+            # -pthread is only valid for GCC
+            if i in ('-mms-bitfields', '-pthread'):
+                continue
+            if i.startswith('-L'):
+                i = '/LIBPATH:' + i[2:]
+            # Translate GNU-style -lfoo library name to the import library
+            elif i.startswith('-l'):
+                name = i[2:]
+                if name in cls.ignore_libs:
+                    # With MSVC, these are provided by the C runtime which is
+                    # linked in by default
+                    continue
+                else:
+                    i = name + '.lib'
+            elif i.startswith('-isystem'):
+                # just use /I for -isystem system include path s
+                if i.startswith('-isystem='):
+                    i = '/I' + i[9:]
+                else:
+                    i = '/I' + i[8:]
+            elif i.startswith('-idirafter'):
+                # same as -isystem, but appends the path instead
+                if i.startswith('-idirafter='):
+                    i = '/I' + i[11:]
+                else:
+                    i = '/I' + i[10:]
+            # -pthread in link flags is only used on Linux
+            elif i == '-pthread':
+                continue
+            result.append(i)
+        return result
+
+    @classmethod
+    def native_args_to_unix(cls, args: typing.List[str]) -> typing.List[str]:
+        result = []
+        for arg in args:
+            if arg.startswith('/LIBPATH:'):
+                result.append('-L' + arg[9:])
+            elif arg.endswith(('.a', '.lib')) and not os.path.isabs(arg):
+                result.append('-l' + arg)
+            else:
+                result.append(arg)
+        return result
+
+    def get_werror_args(self) -> typing.List[str]:
+        return ['/WX']
+
+    def get_include_args(self, path: str, is_system: bool) -> typing.List[str]:
+        if path == '':
+            path = '.'
+        # msvc does not have a concept of system header dirs.
+        return ['-I' + path]
+
+    def compute_parameters_with_absolute_paths(self, parameter_list: typing.List[str], build_dir: str) -> typing.List[str]:
+        for idx, i in enumerate(parameter_list):
+            if i[:2] == '-I' or i[:2] == '/I':
+                parameter_list[idx] = i[:2] + os.path.normpath(os.path.join(build_dir, i[2:]))
+            elif i[:9] == '/LIBPATH:':
+                parameter_list[idx] = i[:9] + os.path.normpath(os.path.join(build_dir, i[9:]))
+
+        return parameter_list
+
+    # Visual Studio is special. It ignores some arguments it does not
+    # understand and you can't tell it to error out on those.
+    # http://stackoverflow.com/questions/15259720/how-can-i-make-the-microsoft-c-compiler-treat-unknown-flags-as-errors-rather-t
+    def has_arguments(self, args: typing.List[str], env: 'Environment', code, mode: str) -> typing.Tuple[bool, bool]:
+        warning_text = '4044' if mode == 'link' else '9002'
+        if self.id == 'clang-cl' and mode != 'link':
+            args = args + ['-Werror=unknown-argument']
+        with self._build_wrapper(code, env, extra_args=args, mode=mode) as p:
+            if p.returncode != 0:
+                return False, p.cached
+            return not(warning_text in p.stde or warning_text in p.stdo), p.cached
+
+    def get_compile_debugfile_args(self, rel_obj: str, pch: bool = False) -> typing.List[str]:
+        pdbarr = rel_obj.split('.')[:-1]
+        pdbarr += ['pdb']
+        args = ['/Fd' + '.'.join(pdbarr)]
+        # When generating a PDB file with PCH, all compile commands write
+        # to the same PDB file. Hence, we need to serialize the PDB
+        # writes using /FS since we do parallel builds. This slows down the
+        # build obviously, which is why we only do this when PCH is on.
+        # This was added in Visual Studio 2013 (MSVC 18.0). Before that it was
+        # always on: https://msdn.microsoft.com/en-us/library/dn502518.aspx
+        if pch and self.id == 'msvc' and mesonlib.version_compare(self.version, '>=18.0'):
+            args = ['/FS'] + args
+        return args
+
+    def get_instruction_set_args(self, instruction_set: str) -> typing.Optional[typing.List[str]]:
+        if self.is_64:
+            return vs64_instruction_set_args.get(instruction_set, None)
+        if self.id == 'msvc' and self.version.split('.')[0] == '16' and instruction_set == 'avx':
+            # VS documentation says that this exists and should work, but
+            # it does not. The headers do not contain AVX intrinsics
+            # and the can not be called.
+            return None
+        return vs32_instruction_set_args.get(instruction_set, None)
+
+    def _calculate_toolset_version(self, version: int) -> typing.Optional[str]:
+        if version < 1310:
+            return '7.0'
+        elif version < 1400:
+            return '7.1' # (Visual Studio 2003)
+        elif version < 1500:
+            return '8.0' # (Visual Studio 2005)
+        elif version < 1600:
+            return '9.0' # (Visual Studio 2008)
+        elif version < 1700:
+            return '10.0' # (Visual Studio 2010)
+        elif version < 1800:
+            return '11.0' # (Visual Studio 2012)
+        elif version < 1900:
+            return '12.0' # (Visual Studio 2013)
+        elif version < 1910:
+            return '14.0' # (Visual Studio 2015)
+        elif version < 1920:
+            return '14.1' # (Visual Studio 2017)
+        elif version < 1930:
+            return '14.2' # (Visual Studio 2019)
+        mlog.warning('Could not find toolset for version {!r}'.format(self.version))
+        return None
+
+    def get_toolset_version(self) -> typing.Optional[str]:
+        if self.id == 'clang-cl':
+            # I have no idea
+            return '14.1'
+
+        # See boost/config/compiler/visualc.cpp for up to date mapping
+        try:
+            version = int(''.join(self.version.split('.')[0:2]))
+        except ValueError:
+            return None
+        return self._calculate_toolset_version(version)
+
+    def get_default_include_dirs(self) -> typing.List[str]:
+        if 'INCLUDE' not in os.environ:
+            return []
+        return os.environ['INCLUDE'].split(os.pathsep)
+
+    def get_crt_compile_args(self, crt_val: str, buildtype: str) -> typing.List[str]:
+        if crt_val in self.crt_args:
+            return self.crt_args[crt_val]
+        assert(crt_val == 'from_buildtype')
+        # Match what build type flags used to do.
+        if buildtype == 'plain':
+            return []
+        elif buildtype == 'debug':
+            return self.crt_args['mdd']
+        elif buildtype == 'debugoptimized':
+            return self.crt_args['md']
+        elif buildtype == 'release':
+            return self.crt_args['md']
+        elif buildtype == 'minsize':
+            return self.crt_args['md']
+        else:
+            assert(buildtype == 'custom')
+            raise mesonlib.EnvironmentException('Requested C runtime based on buildtype, but buildtype is "custom".')
+
+    def has_func_attribute(self, name: str, env: 'Environment') -> typing.Tuple[bool, bool]:
+        # MSVC doesn't have __attribute__ like Clang and GCC do, so just return
+        # false without compiling anything
+        return name in ['dllimport', 'dllexport'], False
+
+    def get_argument_syntax(self) -> str:
+        return 'msvc'
diff -Nru meson-0.49.0/mesonbuild/compilers/objcpp.py meson-0.52.1/mesonbuild/compilers/objcpp.py
--- meson-0.49.0/mesonbuild/compilers/objcpp.py	2018-10-31 09:31:57.000000000 +0000
+++ meson-0.52.1/mesonbuild/compilers/objcpp.py	2019-11-28 17:37:44.000000000 +0000
@@ -13,16 +13,20 @@
 # limitations under the License.
 
 import os.path, subprocess
+import typing
 
-from ..mesonlib import EnvironmentException
+from ..mesonlib import EnvironmentException, MachineChoice
 
-from .cpp import CPPCompiler
-from .compilers import ClangCompiler, GnuCompiler
+from .mixins.clike import CLikeCompiler
+from .compilers import Compiler
+from .mixins.gnu import GnuCompiler
+from .mixins.clang import ClangCompiler
 
-class ObjCPPCompiler(CPPCompiler):
-    def __init__(self, exelist, version, is_cross, exe_wrap):
+class ObjCPPCompiler(CLikeCompiler, Compiler):
+    def __init__(self, exelist, version, for_machine: MachineChoice, is_cross: bool, exe_wrap: typing.Optional[str], **kwargs):
         self.language = 'objcpp'
-        CPPCompiler.__init__(self, exelist, version, is_cross, exe_wrap)
+        Compiler.__init__(self, exelist, version, for_machine, **kwargs)
+        CLikeCompiler.__init__(self, is_cross, exe_wrap)
 
     def get_display_language(self):
         return 'Objective-C++'
@@ -31,13 +35,15 @@
         # TODO try to use sanity_check_impl instead of duplicated code
         source_name = os.path.join(work_dir, 'sanitycheckobjcpp.mm')
         binary_name = os.path.join(work_dir, 'sanitycheckobjcpp')
-        extra_flags = self.get_cross_extra_flags(environment, link=False)
+        extra_flags = environment.coredata.get_external_args(self.for_machine, self.language)
         if self.is_cross:
             extra_flags += self.get_compile_only_args()
+        else:
+            extra_flags += environment.coredata.get_external_link_args(self.for_machine, self.language)
         with open(source_name, 'w') as ofile:
             ofile.write('#import\n'
                         'class MyClass;'
-                        'int main(int argc, char **argv) { return 0; }\n')
+                        'int main() { return 0; }\n')
         pc = subprocess.Popen(self.exelist + extra_flags + [source_name, '-o', binary_name])
         pc.wait()
         if pc.returncode != 0:
@@ -52,21 +58,22 @@
 
 
 class GnuObjCPPCompiler(GnuCompiler, ObjCPPCompiler):
-    def __init__(self, exelist, version, compiler_type, is_cross, exe_wrapper=None, defines=None):
-        ObjCPPCompiler.__init__(self, exelist, version, is_cross, exe_wrapper)
+    def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, defines=None, **kwargs):
+        ObjCPPCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwargs)
         GnuCompiler.__init__(self, compiler_type, defines)
         default_warn_args = ['-Wall', '-Winvalid-pch', '-Wnon-virtual-dtor']
-        self.warn_args = {'1': default_warn_args,
+        self.warn_args = {'0': [],
+                          '1': default_warn_args,
                           '2': default_warn_args + ['-Wextra'],
                           '3': default_warn_args + ['-Wextra', '-Wpedantic']}
 
 
 class ClangObjCPPCompiler(ClangCompiler, ObjCPPCompiler):
-    def __init__(self, exelist, version, compiler_type, is_cross, exe_wrapper=None):
-        ObjCPPCompiler.__init__(self, exelist, version, is_cross, exe_wrapper)
+    def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwargs):
+        ObjCPPCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwargs)
         ClangCompiler.__init__(self, compiler_type)
         default_warn_args = ['-Wall', '-Winvalid-pch', '-Wnon-virtual-dtor']
-        self.warn_args = {'1': default_warn_args,
+        self.warn_args = {'0': [],
+                          '1': default_warn_args,
                           '2': default_warn_args + ['-Wextra'],
                           '3': default_warn_args + ['-Wextra', '-Wpedantic']}
-        self.base_options = ['b_pch', 'b_lto', 'b_pgo', 'b_sanitize', 'b_coverage']
diff -Nru meson-0.49.0/mesonbuild/compilers/objc.py meson-0.52.1/mesonbuild/compilers/objc.py
--- meson-0.49.0/mesonbuild/compilers/objc.py	2018-10-31 09:31:57.000000000 +0000
+++ meson-0.52.1/mesonbuild/compilers/objc.py	2019-11-28 17:37:44.000000000 +0000
@@ -13,16 +13,20 @@
 # limitations under the License.
 
 import os.path, subprocess
+import typing
 
-from ..mesonlib import EnvironmentException
+from ..mesonlib import EnvironmentException, MachineChoice
 
-from .c import CCompiler
-from .compilers import ClangCompiler, GnuCompiler
+from .compilers import Compiler
+from .mixins.clike import CLikeCompiler
+from .mixins.gnu import GnuCompiler
+from .mixins.clang import ClangCompiler
 
-class ObjCCompiler(CCompiler):
-    def __init__(self, exelist, version, is_cross, exe_wrap):
+class ObjCCompiler(CLikeCompiler, Compiler):
+    def __init__(self, exelist, version, for_machine: MachineChoice, is_cross: bool, exe_wrap: typing.Optional[str], **kwargs):
         self.language = 'objc'
-        CCompiler.__init__(self, exelist, version, is_cross, exe_wrap)
+        Compiler.__init__(self, exelist, version, for_machine, **kwargs)
+        CLikeCompiler.__init__(self, is_cross, exe_wrap)
 
     def get_display_language(self):
         return 'Objective-C'
@@ -31,12 +35,14 @@
         # TODO try to use sanity_check_impl instead of duplicated code
         source_name = os.path.join(work_dir, 'sanitycheckobjc.m')
         binary_name = os.path.join(work_dir, 'sanitycheckobjc')
-        extra_flags = self.get_cross_extra_flags(environment, link=False)
+        extra_flags = environment.coredata.get_external_args(self.for_machine, self.language)
         if self.is_cross:
             extra_flags += self.get_compile_only_args()
+        else:
+            extra_flags += environment.coredata.get_external_link_args(self.for_machine, self.language)
         with open(source_name, 'w') as ofile:
-            ofile.write('#import\n'
-                        'int main(int argc, char **argv) { return 0; }\n')
+            ofile.write('#import\n'
+                        'int main() { return 0; }\n')
         pc = subprocess.Popen(self.exelist + extra_flags + [source_name, '-o', binary_name])
         pc.wait()
         if pc.returncode != 0:
@@ -51,21 +57,22 @@
 
 
 class GnuObjCCompiler(GnuCompiler, ObjCCompiler):
-    def __init__(self, exelist, version, compiler_type, is_cross, exe_wrapper=None, defines=None):
-        ObjCCompiler.__init__(self, exelist, version, is_cross, exe_wrapper)
+    def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, defines=None, **kwargs):
+        ObjCCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwargs)
         GnuCompiler.__init__(self, compiler_type, defines)
         default_warn_args = ['-Wall', '-Winvalid-pch']
-        self.warn_args = {'1': default_warn_args,
+        self.warn_args = {'0': [],
+                          '1': default_warn_args,
                           '2': default_warn_args + ['-Wextra'],
                           '3': default_warn_args + ['-Wextra', '-Wpedantic']}
 
 
 class ClangObjCCompiler(ClangCompiler, ObjCCompiler):
-    def __init__(self, exelist, version, compiler_type, is_cross, exe_wrapper=None):
-        ObjCCompiler.__init__(self, exelist, version, is_cross, exe_wrapper)
+    def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwargs):
+        ObjCCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwargs)
         ClangCompiler.__init__(self, compiler_type)
         default_warn_args = ['-Wall', '-Winvalid-pch']
-        self.warn_args = {'1': default_warn_args,
+        self.warn_args = {'0': [],
+                          '1': default_warn_args,
                           '2': default_warn_args + ['-Wextra'],
                           '3': default_warn_args + ['-Wextra', '-Wpedantic']}
-        self.base_options = ['b_pch', 'b_lto', 'b_pgo', 'b_sanitize', 'b_coverage']
diff -Nru meson-0.49.0/mesonbuild/compilers/rust.py meson-0.52.1/mesonbuild/compilers/rust.py
--- meson-0.49.0/mesonbuild/compilers/rust.py	2018-10-31 09:31:20.000000000 +0000
+++ meson-0.52.1/mesonbuild/compilers/rust.py	2019-11-28 17:37:44.000000000 +0000
@@ -13,26 +13,29 @@
 # limitations under the License.
 
 import subprocess, os.path
+import typing
 
-from ..mesonlib import EnvironmentException, Popen_safe
-
+from ..mesonlib import EnvironmentException, MachineChoice, Popen_safe
 from .compilers import Compiler, rust_buildtype_args, clike_debug_args
 
+if typing.TYPE_CHECKING:
+    from ..environment import Environment  # noqa: F401
+
 rust_optimization_args = {'0': [],
-                          'g': ['-C', '--opt-level=0'],
-                          '1': ['-C', '--opt-level=1'],
-                          '2': ['-C', '--opt-level=2'],
-                          '3': ['-C', '--opt-level=3'],
-                          's': ['-C', '--opt-level=s'],
+                          'g': ['-C', 'opt-level=0'],
+                          '1': ['-C', 'opt-level=1'],
+                          '2': ['-C', 'opt-level=2'],
+                          '3': ['-C', 'opt-level=3'],
+                          's': ['-C', 'opt-level=s'],
                           }
 
 class RustCompiler(Compiler):
-    def __init__(self, exelist, version, is_cross, exe_wrapper=None):
+    def __init__(self, exelist, version, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwargs):
         self.language = 'rust'
-        super().__init__(exelist, version)
-        self.is_cross = is_cross
+        super().__init__(exelist, version, for_machine, **kwargs)
         self.exe_wrapper = exe_wrapper
         self.id = 'rustc'
+        self.is_cross = is_cross
 
     def needs_static_linker(self):
         return False
@@ -47,10 +50,18 @@
             ofile.write('''fn main() {
 }
 ''')
-        pc = subprocess.Popen(self.exelist + ['-o', output_name, source_name], cwd=work_dir)
-        pc.wait()
+        pc = subprocess.Popen(self.exelist + ['-o', output_name, source_name],
+                              stdout=subprocess.PIPE,
+                              stderr=subprocess.PIPE,
+                              cwd=work_dir)
+        stdo, stde = pc.communicate()
+        stdo = stdo.decode('utf-8', errors='replace')
+        stde = stde.decode('utf-8', errors='replace')
         if pc.returncode != 0:
-            raise EnvironmentException('Rust compiler %s can not compile programs.' % self.name_string())
+            raise EnvironmentException('Rust compiler %s can not compile programs.\n%s\n%s' % (
+                self.name_string(),
+                stdo,
+                stde))
         if self.is_cross:
             if self.exe_wrapper is None:
                 # Can't check if the binaries run so we have to assume they do
@@ -69,9 +80,6 @@
     def get_buildtype_args(self, buildtype):
         return rust_buildtype_args[buildtype]
 
-    def build_rpath_args(self, build_dir, from_dir, rpath_paths, build_rpath, install_rpath):
-        return self.build_unix_rpath_args(build_dir, from_dir, rpath_paths, build_rpath, install_rpath)
-
     def get_sysroot(self):
         cmd = self.exelist + ['--print', 'sysroot']
         p, stdo, stde = Popen_safe(cmd)
@@ -82,3 +90,17 @@
 
     def get_optimization_args(self, optimization_level):
         return rust_optimization_args[optimization_level]
+
+    def compute_parameters_with_absolute_paths(self, parameter_list, build_dir):
+        for idx, i in enumerate(parameter_list):
+            if i[:2] == '-L':
+                for j in ['dependency', 'crate', 'native', 'framework', 'all']:
+                    combined_len = len(j) + 3
+                    if i[:combined_len] == '-L{}='.format(j):
+                        parameter_list[idx] = i[:combined_len] + os.path.normpath(os.path.join(build_dir, i[combined_len:]))
+                        break
+
+        return parameter_list
+
+    def get_std_exe_link_args(self):
+        return []
diff -Nru meson-0.49.0/mesonbuild/compilers/swift.py meson-0.52.1/mesonbuild/compilers/swift.py
--- meson-0.49.0/mesonbuild/compilers/swift.py	2018-10-31 09:31:20.000000000 +0000
+++ meson-0.52.1/mesonbuild/compilers/swift.py	2019-11-28 17:37:44.000000000 +0000
@@ -14,7 +14,7 @@
 
 import subprocess, os.path
 
-from ..mesonlib import EnvironmentException
+from ..mesonlib import EnvironmentException, MachineChoice
 
 from .compilers import Compiler, swift_buildtype_args, clike_debug_args
 
@@ -27,15 +27,15 @@
                            }
 
 class SwiftCompiler(Compiler):
-    def __init__(self, exelist, version):
+
+    LINKER_PREFIX = ['-Xlinker']
+
+    def __init__(self, exelist, version, for_machine: MachineChoice, is_cross, **kwargs):
         self.language = 'swift'
-        super().__init__(exelist, version)
+        super().__init__(exelist, version, for_machine, **kwargs)
         self.version = version
         self.id = 'llvm'
-        self.is_cross = False
-
-    def get_linker_exelist(self):
-        return self.exelist[:]
+        self.is_cross = is_cross
 
     def name_string(self):
         return ' '.join(self.exelist)
@@ -58,9 +58,6 @@
     def get_output_args(self, target):
         return ['-o', target]
 
-    def get_linker_output_args(self, target):
-        return ['-o', target]
-
     def get_header_import_args(self, headername):
         return ['-import-objc-header', headername]
 
@@ -70,9 +67,6 @@
     def get_buildtype_args(self, buildtype):
         return swift_buildtype_args[buildtype]
 
-    def get_buildtype_linker_args(self, buildtype):
-        return []
-
     def get_std_exe_link_args(self):
         return ['-emit-executable']
 
@@ -82,27 +76,38 @@
     def get_mod_gen_args(self):
         return ['-emit-module']
 
-    def build_rpath_args(self, *args):
-        return [] # FIXME
-
     def get_include_args(self, dirname):
         return ['-I' + dirname]
 
     def get_compile_only_args(self):
         return ['-c']
 
+    def compute_parameters_with_absolute_paths(self, parameter_list, build_dir):
+        for idx, i in enumerate(parameter_list):
+            if i[:2] == '-I' or i[:2] == '-L':
+                parameter_list[idx] = i[:2] + os.path.normpath(os.path.join(build_dir, i[2:]))
+
+        return parameter_list
+
     def sanity_check(self, work_dir, environment):
         src = 'swifttest.swift'
         source_name = os.path.join(work_dir, src)
         output_name = os.path.join(work_dir, 'swifttest')
+        extra_flags = environment.coredata.get_external_args(self.for_machine, self.language)
+        if self.is_cross:
+            extra_flags += self.get_compile_only_args()
+        else:
+            extra_flags += environment.coredata.get_external_link_args(self.for_machine, self.language)
         with open(source_name, 'w') as ofile:
             ofile.write('''print("Swift compilation is working.")
 ''')
-        extra_flags = self.get_cross_extra_flags(environment, link=True)
         pc = subprocess.Popen(self.exelist + extra_flags + ['-emit-executable', '-o', output_name, src], cwd=work_dir)
         pc.wait()
         if pc.returncode != 0:
             raise EnvironmentException('Swift compiler %s can not compile programs.' % self.name_string())
+        if self.is_cross:
+            # Can't check if the binaries run so we have to assume they do
+            return
         if subprocess.call(output_name) != 0:
             raise EnvironmentException('Executables created by Swift compiler %s are not runnable.' % self.name_string())
 
diff -Nru meson-0.49.0/mesonbuild/compilers/vala.py meson-0.52.1/mesonbuild/compilers/vala.py
--- meson-0.49.0/mesonbuild/compilers/vala.py	2018-10-31 09:31:20.000000000 +0000
+++ meson-0.52.1/mesonbuild/compilers/vala.py	2019-11-28 17:37:44.000000000 +0000
@@ -15,17 +15,17 @@
 import os.path
 
 from .. import mlog
-from ..mesonlib import EnvironmentException, version_compare
+from ..mesonlib import EnvironmentException, MachineChoice, version_compare
 
 from .compilers import Compiler
 
 class ValaCompiler(Compiler):
-    def __init__(self, exelist, version):
+    def __init__(self, exelist, version, for_machine: MachineChoice, is_cross):
         self.language = 'vala'
-        super().__init__(exelist, version)
+        super().__init__(exelist, version, for_machine)
         self.version = version
+        self.is_cross = is_cross
         self.id = 'valac'
-        self.is_cross = False
         self.base_options = ['b_colorout']
 
     def name_string(self):
@@ -38,7 +38,7 @@
         return []
 
     def get_debug_args(self, is_debug):
-        return ['--debug']
+        return ['--debug'] if is_debug else []
 
     def get_output_args(self, target):
         return [] # Because compiles into C.
@@ -49,6 +49,12 @@
     def get_pic_args(self):
         return []
 
+    def get_pie_args(self):
+        return []
+
+    def get_pie_link_args(self):
+        return []
+
     def get_always_args(self):
         return ['-C']
 
@@ -66,10 +72,27 @@
             return ['--color=' + colortype]
         return []
 
+    def compute_parameters_with_absolute_paths(self, parameter_list, build_dir):
+        for idx, i in enumerate(parameter_list):
+            if i[:9] == '--girdir=':
+                parameter_list[idx] = i[:9] + os.path.normpath(os.path.join(build_dir, i[9:]))
+            if i[:10] == '--vapidir=':
+                parameter_list[idx] = i[:10] + os.path.normpath(os.path.join(build_dir, i[10:]))
+            if i[:13] == '--includedir=':
+                parameter_list[idx] = i[:13] + os.path.normpath(os.path.join(build_dir, i[13:]))
+            if i[:14] == '--metadatadir=':
+                parameter_list[idx] = i[:14] + os.path.normpath(os.path.join(build_dir, i[14:]))
+
+        return parameter_list
+
     def sanity_check(self, work_dir, environment):
         code = 'class MesonSanityCheck : Object { }'
-        args = self.get_cross_extra_flags(environment, link=False)
-        with self.compile(code, args, 'compile') as p:
+        extra_flags = environment.coredata.get_external_args(self.for_machine, self.language)
+        if self.is_cross:
+            extra_flags += self.get_compile_only_args()
+        else:
+            extra_flags += environment.coredata.get_external_link_args(self.for_machine, self.language)
+        with self.cached_compile(code, environment.coredata, extra_args=extra_flags, mode='compile') as p:
             if p.returncode != 0:
                 msg = 'Vala compiler {!r} can not compile programs' \
                       ''.format(self.name_string())
@@ -80,17 +103,17 @@
             return ['--debug']
         return []
 
-    def find_library(self, libname, env, extra_dirs):
+    def find_library(self, libname, env, extra_dirs, *args):
         if extra_dirs and isinstance(extra_dirs, str):
             extra_dirs = [extra_dirs]
         # Valac always looks in the default vapi dir, so only search there if
         # no extra dirs are specified.
         if not extra_dirs:
             code = 'class MesonFindLibrary : Object { }'
+            args = env.coredata.get_external_args(self.for_machine, self.language)
             vapi_args = ['--pkg', libname]
-            args = self.get_cross_extra_flags(env, link=False)
             args += vapi_args
-            with self.compile(code, args, 'compile') as p:
+            with self.cached_compile(code, env.coredata, extra_args=args, mode='compile') as p:
                 if p.returncode == 0:
                     return vapi_args
         # Not found? Try to find the vapi file itself.
diff -Nru meson-0.49.0/mesonbuild/coredata.py meson-0.52.1/mesonbuild/coredata.py
--- meson-0.49.0/mesonbuild/coredata.py	2018-12-09 19:42:19.000000000 +0000
+++ meson-0.52.1/mesonbuild/coredata.py	2019-11-28 17:37:44.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright 2012-2018 The Meson development team
+# Copyright 2012-2019 The Meson development team
 
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -13,27 +13,42 @@
 # limitations under the License.
 
 from . import mlog
-import pickle, os, uuid, shlex
+import pickle, os, uuid
 import sys
+from itertools import chain
 from pathlib import PurePath
 from collections import OrderedDict
 from .mesonlib import (
-    MesonException, default_libdir, default_libexecdir, default_prefix
+    MesonException, MachineChoice, PerMachine,
+    default_libdir, default_libexecdir, default_prefix, split_args
 )
 from .wrap import WrapMode
 import ast
 import argparse
 import configparser
+from typing import (
+    Any, Dict, Generic, Iterable, List, Optional, Type, TypeVar, Union
+)
+import typing
+import enum
+import shlex
+
+if typing.TYPE_CHECKING:
+    from . import dependencies
+
+    OptionDictType = typing.Dict[str, 'UserOption[Any]']
 
-version = '0.49.0'
-backendlist = ['ninja', 'vs', 'vs2010', 'vs2015', 'vs2017', 'xcode']
+version = '0.52.1'
+backendlist = ['ninja', 'vs', 'vs2010', 'vs2015', 'vs2017', 'vs2019', 'xcode']
 
 default_yielding = False
 
-class UserOption:
-    def __init__(self, name, description, choices, yielding):
+# Can't bind this near the class method it seems, sadly.
+_T = TypeVar('_T')
+
+class UserOption(Generic[_T]):
+    def __init__(self, description, choices, yielding):
         super().__init__()
-        self.name = name
         self.choices = choices
         self.description = description
         if yielding is None:
@@ -42,34 +57,37 @@
             raise MesonException('Value of "yielding" must be a boolean.')
         self.yielding = yielding
 
+    def printable_value(self):
+        return self.value
+
     # Check that the input is a valid value and return the
     # "cleaned" or "native" version. For example the Boolean
     # option could take the string "true" and return True.
-    def validate_value(self, value):
+    def validate_value(self, value: Any) -> _T:
         raise RuntimeError('Derived option class did not override validate_value.')
 
     def set_value(self, newvalue):
         self.value = self.validate_value(newvalue)
 
-class UserStringOption(UserOption):
-    def __init__(self, name, description, value, choices=None, yielding=None):
-        super().__init__(name, description, choices, yielding)
+class UserStringOption(UserOption[str]):
+    def __init__(self, description, value, choices=None, yielding=None):
+        super().__init__(description, choices, yielding)
         self.set_value(value)
 
     def validate_value(self, value):
         if not isinstance(value, str):
-            raise MesonException('Value "%s" for string option "%s" is not a string.' % (str(value), self.name))
+            raise MesonException('Value "%s" for string option is not a string.' % str(value))
         return value
 
-class UserBooleanOption(UserOption):
-    def __init__(self, name, description, value, yielding=None):
-        super().__init__(name, description, [True, False], yielding)
+class UserBooleanOption(UserOption[bool]):
+    def __init__(self, description, value, yielding=None):
+        super().__init__(description, [True, False], yielding)
         self.set_value(value)
 
-    def __bool__(self):
+    def __bool__(self) -> bool:
         return self.value
 
-    def validate_value(self, value):
+    def validate_value(self, value) -> bool:
         if isinstance(value, bool):
             return value
         if value.lower() == 'true':
@@ -78,9 +96,9 @@
             return False
         raise MesonException('Value %s is not boolean (true or false).' % value)
 
-class UserIntegerOption(UserOption):
-    def __init__(self, name, description, min_value, max_value, value, yielding=None):
-        super().__init__(name, description, [True, False], yielding)
+class UserIntegerOption(UserOption[int]):
+    def __init__(self, description, min_value, max_value, value, yielding=None):
+        super().__init__(description, [True, False], yielding)
         self.min_value = min_value
         self.max_value = max_value
         self.set_value(value)
@@ -91,7 +109,7 @@
             c.append('<=' + str(max_value))
         self.choices = ', '.join(c)
 
-    def validate_value(self, value):
+    def validate_value(self, value) -> int:
         if isinstance(value, str):
             value = self.toint(value)
         if not isinstance(value, int):
@@ -102,20 +120,25 @@
             raise MesonException('New value %d is more than maximum value %d.' % (value, self.max_value))
         return value
 
-    def toint(self, valuestring):
+    def toint(self, valuestring) -> int:
         try:
             return int(valuestring)
         except ValueError:
             raise MesonException('Value string "%s" is not convertable to an integer.' % valuestring)
 
-class UserUmaskOption(UserIntegerOption):
-    def __init__(self, name, description, value, yielding=None):
-        super().__init__(name, description, 0, 0o777, value, yielding)
+class UserUmaskOption(UserIntegerOption, UserOption[Union[str, int]]):
+    def __init__(self, description, value, yielding=None):
+        super().__init__(description, 0, 0o777, value, yielding)
         self.choices = ['preserve', '0000-0777']
 
+    def printable_value(self):
+        if self.value == 'preserve':
+            return self.value
+        return format(self.value, '04o')
+
     def validate_value(self, value):
         if value is None or value == 'preserve':
-            return None
+            return 'preserve'
         return super().validate_value(value)
 
     def toint(self, valuestring):
@@ -124,9 +147,9 @@
         except ValueError as e:
             raise MesonException('Invalid mode: {}'.format(e))
 
-class UserComboOption(UserOption):
-    def __init__(self, name, description, choices, value, yielding=None):
-        super().__init__(name, description, choices, yielding)
+class UserComboOption(UserOption[str]):
+    def __init__(self, description, choices: List[str], value, yielding=None):
+        super().__init__(description, choices, yielding)
         if not isinstance(self.choices, list):
             raise MesonException('Combo choices must be an array.')
         for i in self.choices:
@@ -137,17 +160,17 @@
     def validate_value(self, value):
         if value not in self.choices:
             optionsstring = ', '.join(['"%s"' % (item,) for item in self.choices])
-            raise MesonException('Value "%s" for combo option "%s" is not one of the choices. Possible choices are: %s.' % (value, self.name, optionsstring))
+            raise MesonException('Value "%s" for combo option is not one of the choices. Possible choices are: %s.' % (value, optionsstring))
         return value
 
-class UserArrayOption(UserOption):
-    def __init__(self, name, description, value, shlex_split=False, user_input=False, allow_dups=False, **kwargs):
-        super().__init__(name, description, kwargs.get('choices', []), yielding=kwargs.get('yielding', None))
-        self.shlex_split = shlex_split
+class UserArrayOption(UserOption[List[str]]):
+    def __init__(self, description, value, split_args=False, user_input=False, allow_dups=False, **kwargs):
+        super().__init__(description, kwargs.get('choices', []), yielding=kwargs.get('yielding', None))
+        self.split_args = split_args
         self.allow_dups = allow_dups
         self.value = self.validate_value(value, user_input=user_input)
 
-    def validate_value(self, value, user_input=True):
+    def validate_value(self, value, user_input=True) -> List[str]:
         # User input is for options defined on the command line (via -D
         # options). Users can put their input in as a comma separated
         # string, but for defining options in meson_options.txt the format
@@ -161,8 +184,8 @@
             elif value == '':
                 newvalue = []
             else:
-                if self.shlex_split:
-                    newvalue = shlex.split(value)
+                if self.split_args:
+                    newvalue = split_args(value)
                 else:
                     newvalue = [v.strip() for v in value.split(',')]
         elif isinstance(value, list):
@@ -171,8 +194,8 @@
             raise MesonException('"{0}" should be a string array, but it is not'.format(str(newvalue)))
 
         if not self.allow_dups and len(set(newvalue)) != len(newvalue):
-            msg = 'Duplicated values in array option "%s" is deprecated. ' \
-                  'This will become a hard error in the future.' % (self.name)
+            msg = 'Duplicated values in array option is deprecated. ' \
+                  'This will become a hard error in the future.'
             mlog.deprecation(msg)
         for i in newvalue:
             if not isinstance(i, str):
@@ -188,8 +211,8 @@
 class UserFeatureOption(UserComboOption):
     static_choices = ['enabled', 'disabled', 'auto']
 
-    def __init__(self, name, description, value, yielding=None):
-        super().__init__(name, description, self.static_choices, value, yielding)
+    def __init__(self, description, value, yielding=None):
+        super().__init__(description, self.static_choices, value, yielding)
 
     def is_enabled(self):
         return self.value == 'enabled'
@@ -201,70 +224,124 @@
         return self.value == 'auto'
 
 
-def load_configs(filenames):
-    """Load native files."""
-    def gen():
-        for f in filenames:
-            f = os.path.expanduser(os.path.expandvars(f))
-            if os.path.exists(f):
-                yield f
-                continue
-            elif sys.platform != 'win32':
-                f = os.path.basename(f)
-                paths = [
-                    os.environ.get('XDG_DATA_HOME', os.path.expanduser('~/.local/share')),
-                ] + os.environ.get('XDG_DATA_DIRS', '/usr/local/share:/usr/share').split(':')
-                for path in paths:
-                    path_to_try = os.path.join(path, 'meson', 'native', f)
-                    if os.path.isfile(path_to_try):
-                        yield path_to_try
-                        break
-                else:
-                    raise MesonException('Cannot find specified native file: ' + f)
-                continue
+def load_configs(filenames: List[str]) -> configparser.ConfigParser:
+    """Load configuration files from a named subdirectory."""
+    config = configparser.ConfigParser()
+    config.read(filenames)
+    return config
 
-            raise MesonException('Cannot find specified native file: ' + f)
 
-    config = configparser.SafeConfigParser()
-    config.read(gen())
-    return config
+if typing.TYPE_CHECKING:
+    CacheKeyType = typing.Tuple[typing.Tuple[typing.Any, ...], ...]
+    SubCacheKeyType = typing.Tuple[typing.Any, ...]
+
+
+class DependencyCacheType(enum.Enum):
+
+    OTHER = 0
+    PKG_CONFIG = 1
+    CMAKE = 2
+
+    @classmethod
+    def from_type(cls, dep: 'dependencies.Dependency') -> 'DependencyCacheType':
+        from . import dependencies
+        # As more types gain search overrides they'll need to be added here
+        if isinstance(dep, dependencies.PkgConfigDependency):
+            return cls.PKG_CONFIG
+        if isinstance(dep, dependencies.CMakeDependency):
+            return cls.CMAKE
+        return cls.OTHER
+
+
+class DependencySubCache:
+
+    def __init__(self, type_: DependencyCacheType):
+        self.types = [type_]
+        self.__cache = {}  # type: typing.Dict[SubCacheKeyType, dependencies.Dependency]
+
+    def __getitem__(self, key: 'SubCacheKeyType') -> 'dependencies.Dependency':
+        return self.__cache[key]
+
+    def __setitem__(self, key: 'SubCacheKeyType', value: 'dependencies.Dependency') -> None:
+        self.__cache[key] = value
 
+    def __contains__(self, key: 'SubCacheKeyType') -> bool:
+        return key in self.__cache
 
-def _get_section(config, section):
-    if config.has_section(section):
-        final = {}
-        for k, v in config.items(section):
-            # Windows paths...
-            v = v.replace('\\', '\\\\')
+    def values(self) -> typing.Iterable['dependencies.Dependency']:
+        return self.__cache.values()
+
+
+class DependencyCache:
+
+    """Class that stores a cache of dependencies.
+
+    This class is meant to encapsulate the fact that we need multiple keys to
+    successfully lookup by providing a simple get/put interface.
+    """
+
+    def __init__(self, builtins_per_machine: PerMachine[typing.Dict[str, UserOption[typing.Any]]], for_machine: MachineChoice):
+        self.__cache = OrderedDict()  # type: typing.MutableMapping[CacheKeyType, DependencySubCache]
+        self.__builtins_per_machine = builtins_per_machine
+        self.__for_machine = for_machine
+
+    def __calculate_subkey(self, type_: DependencyCacheType) -> typing.Tuple[typing.Any, ...]:
+        if type_ is DependencyCacheType.PKG_CONFIG:
+            return tuple(self.__builtins_per_machine[self.__for_machine]['pkg_config_path'].value)
+        elif type_ is DependencyCacheType.CMAKE:
+            return tuple(self.__builtins_per_machine[self.__for_machine]['cmake_prefix_path'].value)
+        assert type_ is DependencyCacheType.OTHER, 'Someone forgot to update subkey calculations for a new type'
+        return tuple()
+
+    def __iter__(self) -> typing.Iterator['CacheKeyType']:
+        return self.keys()
+
+    def put(self, key: 'CacheKeyType', dep: 'dependencies.Dependency') -> None:
+        t = DependencyCacheType.from_type(dep)
+        if key not in self.__cache:
+            self.__cache[key] = DependencySubCache(t)
+        subkey = self.__calculate_subkey(t)
+        self.__cache[key][subkey] = dep
+
+    def get(self, key: 'CacheKeyType') -> typing.Optional['dependencies.Dependency']:
+        """Get a value from the cache.
+
+        If there is no cache entry then None will be returned.
+        """
+        try:
+            val = self.__cache[key]
+        except KeyError:
+            return None
+
+        for t in val.types:
+            subkey = self.__calculate_subkey(t)
             try:
-                final[k] = ast.literal_eval(v)
-            except SyntaxError:
-                raise MesonException(
-                    'Malformed value in native file variable: {}'.format(v))
-        return final
-    return {}
-
-
-class ConfigData:
-
-    """Contains configuration information provided by the user for the build."""
-
-    def __init__(self, config=None):
-        if config:
-            self.binaries = _get_section(config, 'binaries')
-            # global is a keyword and globals is a builtin, rather than mangle it,
-            # use a similar word
-            self.universal = _get_section(config, 'globals')
-            self.subprojects = {s: _get_section(config, s) for s in config.sections()
-                                if s not in {'binaries', 'globals'}}
-        else:
-            self.binaries = {}
-            self.universal = {}
-            self.subprojects = {}
+                return val[subkey]
+            except KeyError:
+                pass
+        return None
+
+    def values(self) -> typing.Iterator['dependencies.Dependency']:
+        for c in self.__cache.values():
+            yield from c.values()
+
+    def keys(self) -> typing.Iterator['CacheKeyType']:
+        return iter(self.__cache.keys())
+
+    def items(self) -> typing.Iterator[typing.Tuple['CacheKeyType', typing.List['dependencies.Dependency']]]:
+        for k, v in self.__cache.items():
+            vs = []
+            for t in v.types:
+                subkey = self.__calculate_subkey(t)
+                if subkey in v:
+                    vs.append(v[subkey])
+            yield k, vs
 
-    def get_binaries(self, name):
-        return self.binaries.get(name, None)
+    def clear(self) -> None:
+        self.__cache.clear()
 
+# Can't bind this near the class method it seems, sadly.
+_V = TypeVar('_V')
 
 # This class contains all data that must persist over multiple
 # invocations of Meson. It is roughly the same thing as
@@ -272,7 +349,7 @@
 
 class CoreData:
 
-    def __init__(self, options):
+    def __init__(self, options: argparse.Namespace, scratch_dir: str):
         self.lang_guids = {
             'default': '8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942',
             'c': '8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942',
@@ -286,68 +363,88 @@
         self.target_guids = {}
         self.version = version
         self.init_builtins()
-        self.backend_options = {}
-        self.user_options = {}
-        self.compiler_options = {}
-        self.base_options = {}
-        self.external_preprocess_args = {} # CPPFLAGS only
-        self.cross_file = self.__load_cross_file(options.cross_file)
-        self.compilers = OrderedDict()
-        self.cross_compilers = OrderedDict()
-        self.deps = OrderedDict()
+        self.backend_options = {} # : Dict[str, UserOption]
+        self.user_options = {} # : Dict[str, UserOption]
+        self.compiler_options = PerMachine({}, {})
+        self.base_options = {} # : Dict[str, UserOption]
+        self.cross_files = self.__load_config_files(options, scratch_dir, 'cross')
+        self.compilers = PerMachine(OrderedDict(), OrderedDict())
+
+        build_cache = DependencyCache(self.builtins_per_machine, MachineChoice.BUILD)
+        host_cache = DependencyCache(self.builtins_per_machine, MachineChoice.BUILD)
+        self.deps = PerMachine(build_cache, host_cache)  # type: PerMachine[DependencyCache]
+        self.compiler_check_cache = OrderedDict()
         # Only to print a warning if it changes between Meson invocations.
-        self.pkgconf_envvar = os.environ.get('PKG_CONFIG_PATH', '')
-        self.config_files = self.__load_config_files(options.native_file)
+        self.config_files = self.__load_config_files(options, scratch_dir, 'native')
+        self.libdir_cross_fixup()
 
     @staticmethod
-    def __load_config_files(filenames):
+    def __load_config_files(options: argparse.Namespace, scratch_dir: str, ftype: str) -> List[str]:
+        # Need to try and make the passed filenames absolute because when the
+        # files are parsed later we'll have chdir()d.
+        if ftype == 'cross':
+            filenames = options.cross_file
+        else:
+            filenames = options.native_file
+
         if not filenames:
             return []
-        filenames = [os.path.abspath(os.path.expanduser(os.path.expanduser(f)))
-                     for f in filenames]
-        return filenames
 
-    @staticmethod
-    def __load_cross_file(filename):
-        """Try to load the cross file.
-
-        If the filename is None return None. If the filename is an absolute
-        (after resolving variables and ~), return that absolute path. Next,
-        check if the file is relative to the current source dir. If the path
-        still isn't resolved do the following:
-            Windows:
-                - Error
-            *:
-                - $XDG_DATA_HOME/meson/cross (or ~/.local/share/meson/cross if
-                  undefined)
-                - $XDG_DATA_DIRS/meson/cross (or
-                  /usr/local/share/meson/cross:/usr/share/meson/cross if undefined)
-                - Error
-
-        Non-Windows follows the Linux path and will honor XDG_* if set. This
-        simplifies the implementation somewhat.
-        """
-        if filename is None:
-            return None
-        filename = os.path.expanduser(os.path.expandvars(filename))
-        if os.path.isabs(filename):
-            return filename
-        path_to_try = os.path.abspath(filename)
-        if os.path.isfile(path_to_try):
-            return path_to_try
-        if sys.platform != 'win32':
-            paths = [
-                os.environ.get('XDG_DATA_HOME', os.path.expanduser('~/.local/share')),
-            ] + os.environ.get('XDG_DATA_DIRS', '/usr/local/share:/usr/share').split(':')
-            for path in paths:
-                path_to_try = os.path.join(path, 'meson', 'cross', filename)
-                if os.path.isfile(path_to_try):
-                    return path_to_try
-            raise MesonException('Cannot find specified cross file: ' + filename)
+        found_invalid = []  # type: typing.List[str]
+        missing = []        # type: typing.List[str]
+        real = []           # type: typing.List[str]
+        for i, f in enumerate(filenames):
+            f = os.path.expanduser(os.path.expandvars(f))
+            if os.path.exists(f):
+                if os.path.isfile(f):
+                    real.append(os.path.abspath(f))
+                    continue
+                elif os.path.isdir(f):
+                    found_invalid.append(os.path.abspath(f))
+                else:
+                    # in this case we've been passed some kind of pipe, copy
+                    # the contents of that file into the meson private (scratch)
+                    # directory so that it can be re-read when wiping/reconfiguring
+                    copy = os.path.join(scratch_dir, '{}.{}.ini'.format(uuid.uuid4(), ftype))
+                    with open(f, 'r') as rf:
+                        with open(copy, 'w') as wf:
+                            wf.write(rf.read())
+                    real.append(copy)
+
+                    # Also replace the command line argument, as the pipe
+                    # probably wont exist on reconfigure
+                    filenames[i] = copy
+                    continue
+            if sys.platform != 'win32':
+                paths = [
+                    os.environ.get('XDG_DATA_HOME', os.path.expanduser('~/.local/share')),
+                ] + os.environ.get('XDG_DATA_DIRS', '/usr/local/share:/usr/share').split(':')
+                for path in paths:
+                    path_to_try = os.path.join(path, 'meson', ftype, f)
+                    if os.path.isfile(path_to_try):
+                        real.append(path_to_try)
+                        break
+                else:
+                    missing.append(f)
+            else:
+                missing.append(f)
 
-        raise MesonException('Cannot find specified cross file: ' + filename)
+        if missing:
+            if found_invalid:
+                mlog.log('Found invalid candidates for', ftype, 'file:', *found_invalid)
+            mlog.log('Could not find any valid candidate for', ftype, 'files:', *missing)
+            raise MesonException('Cannot find specified {} file: {}'.format(ftype, f))
+        return real
+
+    def libdir_cross_fixup(self):
+        # By default set libdir to "lib" when cross compiling since
+        # getting the "system default" is always wrong on multiarch
+        # platforms as it gets a value like lib/x86_64-linux-gnu.
+        if self.cross_files:
+            self.builtins['libdir'].value = 'lib'
 
     def sanitize_prefix(self, prefix):
+        prefix = os.path.expanduser(prefix)
         if not os.path.isabs(prefix):
             raise MesonException('prefix value {!r} must be an absolute path'
                                  ''.format(prefix))
@@ -392,50 +489,61 @@
     def init_builtins(self):
         # Create builtin options with default values
         self.builtins = {}
-        prefix = get_builtin_option_default('prefix')
-        for key in get_builtin_options():
-            value = get_builtin_option_default(key, prefix)
-            args = [key] + builtin_options[key][1:-1] + [value]
-            self.builtins[key] = builtin_options[key][0](*args)
+        for key, opt in builtin_options.items():
+            self.builtins[key] = opt.init_option()
+        self.builtins_per_machine = PerMachine({}, {})
+        for for_machine in iter(MachineChoice):
+            for key, opt in builtin_options_per_machine.items():
+                self.builtins_per_machine[for_machine][key] = opt.init_option()
 
     def init_backend_options(self, backend_name):
         if backend_name == 'ninja':
             self.backend_options['backend_max_links'] = \
                 UserIntegerOption(
-                    'backend_max_links',
                     'Maximum number of linker processes to run or 0 for no '
                     'limit',
                     0, None, 0)
         elif backend_name.startswith('vs'):
             self.backend_options['backend_startup_project'] = \
                 UserStringOption(
-                    'backend_startup_project',
                     'Default project to execute in Visual Studio',
                     '')
 
     def get_builtin_option(self, optname):
-        if optname in self.builtins:
-            v = self.builtins[optname]
+        for opts in self._get_all_builtin_options():
+            v = opts.get(optname)
+            if v is None:
+                continue
             if optname == 'wrap_mode':
                 return WrapMode.from_string(v.value)
             return v.value
         raise RuntimeError('Tried to get unknown builtin option %s.' % optname)
 
-    def set_builtin_option(self, optname, value):
-        if optname == 'prefix':
-            value = self.sanitize_prefix(value)
-        elif optname in self.builtins:
-            prefix = self.builtins['prefix'].value
-            value = self.sanitize_dir_option_value(prefix, optname, value)
+    def _try_set_builtin_option(self, optname, value):
+        for opts in self._get_all_builtin_options():
+            opt = opts.get(optname)
+            if opt is None:
+                continue
+            if optname == 'prefix':
+                value = self.sanitize_prefix(value)
+            else:
+                prefix = self.builtins['prefix'].value
+                value = self.sanitize_dir_option_value(prefix, optname, value)
+            break
         else:
-            raise RuntimeError('Tried to set unknown builtin option %s.' % optname)
-        self.builtins[optname].set_value(value)
-
+            return False
+        opt.set_value(value)
         # Make sure that buildtype matches other settings.
         if optname == 'buildtype':
             self.set_others_from_buildtype(value)
         else:
             self.set_buildtype_from_others()
+        return True
+
+    def set_builtin_option(self, optname, value):
+        res = self._try_set_builtin_option(optname, value)
+        if not res:
+            raise RuntimeError('Tried to set unknown builtin option %s.' % optname)
 
     def set_others_from_buildtype(self, value):
         if value == 'plain':
@@ -476,21 +584,48 @@
             mode = 'custom'
         self.builtins['buildtype'].set_value(mode)
 
-    def validate_option_value(self, option_name, override_value):
-        for opts in (self.builtins, self.base_options, self.compiler_options, self.user_options):
-            if option_name in opts:
-                opt = opts[option_name]
-                return opt.validate_value(override_value)
-        raise MesonException('Tried to validate unknown option %s.' % option_name)
+    @staticmethod
+    def get_prefixed_options_per_machine(
+        options_per_machine # : PerMachine[Dict[str, _V]]]
+    ) -> Iterable[Dict[str, _V]]:
+        for for_machine in iter(MachineChoice):
+            prefix = for_machine.get_prefix()
+            yield {
+                prefix + k: v
+                for k, v in options_per_machine[for_machine].items()
+            }
+
+    def _get_all_nonbuiltin_options(self) -> Iterable[Dict[str, UserOption]]:
+        yield self.backend_options
+        yield self.user_options
+        yield from self.get_prefixed_options_per_machine(self.compiler_options)
+        yield self.base_options
+
+    def _get_all_builtin_options(self) -> Dict[str, UserOption]:
+        yield from self.get_prefixed_options_per_machine(self.builtins_per_machine)
+        yield self.builtins
+
+    def get_all_options(self) -> Dict[str, UserOption]:
+        yield from self._get_all_nonbuiltin_options()
+        yield from self._get_all_builtin_options()
 
-    def get_external_args(self, lang):
-        return self.compiler_options[lang + '_args'].value
+    def validate_option_value(self, option_name, override_value):
+        for opts in self.get_all_options():
+            opt = opts.get(option_name)
+            if opt is not None:
+                try:
+                    return opt.validate_value(override_value)
+                except MesonException as e:
+                    raise type(e)(('Validation failed for option %s: ' % option_name) + str(e)) \
+                        .with_traceback(sys.exc_info()[2])
+        else:
+            raise MesonException('Tried to validate unknown option %s.' % option_name)
 
-    def get_external_link_args(self, lang):
-        return self.compiler_options[lang + '_link_args'].value
+    def get_external_args(self, for_machine: MachineChoice, lang):
+        return self.compiler_options[for_machine][lang + '_args'].value
 
-    def get_external_preprocess_args(self, lang):
-        return self.external_preprocess_args[lang]
+    def get_external_link_args(self, for_machine: MachineChoice, lang):
+        return self.compiler_options[for_machine][lang + '_link_args'].value
 
     def merge_user_options(self, options):
         for (name, value) in options.items():
@@ -501,7 +636,28 @@
                 if type(oldval) != type(value):
                     self.user_options[name] = value
 
-    def set_options(self, options, subproject=''):
+    def is_cross_build(self) -> bool:
+        return len(self.cross_files) > 0
+
+    def strip_build_option_names(self, options):
+        res = {}
+        for k, v in options.items():
+            if k.startswith('build.'):
+                k = k.split('.', 1)[1]
+            res[k] = v
+        return res
+
+    def copy_build_options_from_regular_ones(self):
+        assert(not self.is_cross_build())
+        for k, o in self.builtins_per_machine.host.items():
+            self.builtins_per_machine.build[k].set_value(o.value)
+        for k, o in self.compiler_options.host.items():
+            if k in self.compiler_options.build:
+                self.compiler_options.build[k].set_value(o.value)
+
+    def set_options(self, options, *, subproject='', warn_unknown=True):
+        if not self.is_cross_build():
+            options = self.strip_build_option_names(options)
         # Set prefix first because it's needed to sanitize other options
         prefix = self.builtins['prefix'].value
         if 'prefix' in options:
@@ -509,33 +665,112 @@
             self.builtins['prefix'].set_value(prefix)
             for key in builtin_dir_noprefix_options:
                 if key not in options:
-                    self.builtins[key].set_value(get_builtin_option_default(key, prefix))
+                    self.builtins[key].set_value(builtin_options[key].prefixed_default(key, prefix))
 
         unknown_options = []
         for k, v in options.items():
             if k == 'prefix':
-                pass
-            elif k in self.builtins:
-                self.set_builtin_option(k, v)
-            elif k in self.backend_options:
-                tgt = self.backend_options[k]
-                tgt.set_value(v)
-            elif k in self.user_options:
-                tgt = self.user_options[k]
-                tgt.set_value(v)
-            elif k in self.compiler_options:
-                tgt = self.compiler_options[k]
-                tgt.set_value(v)
-            elif k in self.base_options:
-                tgt = self.base_options[k]
+                continue
+            if self._try_set_builtin_option(k, v):
+                continue
+            for opts in self._get_all_nonbuiltin_options():
+                tgt = opts.get(k)
+                if tgt is None:
+                    continue
                 tgt.set_value(v)
+                break
             else:
                 unknown_options.append(k)
-
-        if unknown_options:
+        if unknown_options and warn_unknown:
             unknown_options = ', '.join(sorted(unknown_options))
             sub = 'In subproject {}: '.format(subproject) if subproject else ''
             mlog.warning('{}Unknown options: "{}"'.format(sub, unknown_options))
+        if not self.is_cross_build():
+            self.copy_build_options_from_regular_ones()
+
+    def set_default_options(self, default_options, subproject, env):
+        # Set defaults first from conf files (cross or native), then
+        # override them as nec as necessary.
+        for k, v in env.paths.host:
+            if v is not None:
+                env.cmd_line_options.setdefault(k, v)
+
+        # Set default options as if they were passed to the command line.
+        # Subprojects can only define default for user options.
+        from . import optinterpreter
+        for k, v in default_options.items():
+            if subproject:
+                if optinterpreter.is_invalid_name(k, log=False):
+                    continue
+                k = subproject + ':' + k
+            env.cmd_line_options.setdefault(k, v)
+
+        # Create a subset of cmd_line_options, keeping only options for this
+        # subproject. Also take builtin options if it's the main project.
+        # Language and backend specific options will be set later when adding
+        # languages and setting the backend (builtin options must be set first
+        # to know which backend we'll use).
+        options = {}
+
+        # Some options default to environment variables if they are
+        # unset, set those now. These will either be overwritten
+        # below, or they won't. These should only be set on the first run.
+        if env.first_invocation:
+            p_env = os.environ.get('PKG_CONFIG_PATH')
+            if p_env:
+                # PKG_CONFIG_PATH may contain duplicates, which must be
+                # removed, else a duplicates-in-array-option warning arises.
+                pkg_config_paths = []
+                for k in p_env.split(':'):
+                    if k not in pkg_config_paths:
+                        pkg_config_paths.append(k)
+                options['pkg_config_path'] = pkg_config_paths
+
+        for k, v in env.cmd_line_options.items():
+            if subproject:
+                if not k.startswith(subproject + ':'):
+                    continue
+            elif k not in builtin_options.keys() \
+                    and 'build.' + k not in builtin_options_per_machine.keys() \
+                    and k not in builtin_options_per_machine.keys():
+                if ':' in k:
+                    continue
+                if optinterpreter.is_invalid_name(k, log=False):
+                    continue
+            options[k] = v
+
+        self.set_options(options, subproject=subproject)
+
+    def process_new_compiler(self, lang: str, comp, env):
+        from . import compilers
+
+        self.compilers[comp.for_machine][lang] = comp
+
+        optprefix = lang + '_'
+        for k, o in comp.get_and_default_options(env.properties[comp.for_machine]).items():
+            if not k.startswith(optprefix):
+                raise MesonException('Internal error, %s has incorrect prefix.' % k)
+            # prefixed compiler options affect just this machine
+            opt_prefix = comp.for_machine.get_prefix()
+            if opt_prefix + k in env.cmd_line_options:
+                o.set_value(env.cmd_line_options[opt_prefix + k])
+            self.compiler_options[comp.for_machine].setdefault(k, o)
+
+        enabled_opts = []
+        for optname in comp.base_options:
+            if optname in self.base_options:
+                continue
+            oobj = compilers.base_options[optname]
+            if optname in env.cmd_line_options:
+                oobj.set_value(env.cmd_line_options[optname])
+                enabled_opts.append(optname)
+            self.base_options[optname] = oobj
+        self.emit_base_options_warnings(enabled_opts)
+
+    def emit_base_options_warnings(self, enabled_opts: list):
+        if 'b_bitcode' in enabled_opts:
+            mlog.warning('Base option \'b_bitcode\' is enabled, which is incompatible with many linker options. Incompatible options such as such as \'b_asneeded\' have been disabled.')
+            mlog.warning('Please see https://mesonbuild.com/Builtin-options.html#Notes_about_Apple_Bitcode_support for more details.')
 
 class CmdLineFileParser(configparser.ConfigParser):
     def __init__(self):
@@ -548,6 +783,9 @@
 
 def read_cmd_line_file(build_dir, options):
     filename = get_cmd_line_file(build_dir)
+    if not os.path.isfile(filename):
+        return
+
     config = CmdLineFileParser()
     config.read(filename)
 
@@ -558,16 +796,22 @@
     options.cmd_line_options = d
 
     properties = config['properties']
-    if options.cross_file is None:
-        options.cross_file = properties.get('cross_file', None)
+    if not options.cross_file:
+        options.cross_file = ast.literal_eval(properties.get('cross_file', '[]'))
+    if not options.native_file:
+        # This will be a string in the form: "['first', 'second', ...]", use
+        # literal_eval to get it into the list of strings.
+        options.native_file = ast.literal_eval(properties.get('native_file', '[]'))
 
 def write_cmd_line_file(build_dir, options):
     filename = get_cmd_line_file(build_dir)
     config = CmdLineFileParser()
 
     properties = {}
-    if options.cross_file is not None:
+    if options.cross_file:
         properties['cross_file'] = options.cross_file
+    if options.native_file:
+        properties['native_file'] = options.native_file
 
     config['options'] = options.cmd_line_options
     config['properties'] = properties
@@ -582,17 +826,35 @@
     with open(filename, 'w') as f:
         config.write(f)
 
+def get_cmd_line_options(build_dir, options):
+    copy = argparse.Namespace(**vars(options))
+    read_cmd_line_file(build_dir, copy)
+    cmdline = ['-D{}={}'.format(k, v) for k, v in copy.cmd_line_options.items()]
+    if options.cross_file:
+        cmdline += ['--cross-file {}'.format(f) for f in options.cross_file]
+    if options.native_file:
+        cmdline += ['--native-file {}'.format(f) for f in options.native_file]
+    return ' '.join([shlex.quote(x) for x in cmdline])
+
+def major_versions_differ(v1, v2):
+    return v1.split('.')[0:2] != v2.split('.')[0:2]
+
 def load(build_dir):
     filename = os.path.join(build_dir, 'meson-private', 'coredata.dat')
     load_fail_msg = 'Coredata file {!r} is corrupted. Try with a fresh build tree.'.format(filename)
     try:
         with open(filename, 'rb') as f:
             obj = pickle.load(f)
-    except pickle.UnpicklingError:
+    except (pickle.UnpicklingError, EOFError):
         raise MesonException(load_fail_msg)
+    except AttributeError:
+        raise MesonException(
+            "Coredata file {!r} references functions or classes that don't "
+            "exist. This probably means that it was generated with an old "
+            "version of meson.".format(filename))
     if not isinstance(obj, CoreData):
         raise MesonException(load_fail_msg)
-    if obj.version != version:
+    if major_versions_differ(obj.version, version):
         raise MesonException('Build directory has been generated with Meson version %s, '
                              'which is incompatible with current version %s.\n' %
                              (obj.version, version))
@@ -602,7 +864,7 @@
     filename = os.path.join(build_dir, 'meson-private', 'coredata.dat')
     prev_filename = filename + '.prev'
     tempfilename = filename + '~'
-    if obj.version != version:
+    if major_versions_differ(obj.version, version):
         raise MesonException('Fatal version mismatch corruption.')
     if os.path.exists(filename):
         import shutil
@@ -614,80 +876,13 @@
     os.replace(tempfilename, filename)
     return filename
 
-def get_builtin_options():
-    return list(builtin_options.keys())
-
-def is_builtin_option(optname):
-    return optname in get_builtin_options()
-
-def get_builtin_option_choices(optname):
-    if is_builtin_option(optname):
-        if builtin_options[optname][0] == UserComboOption:
-            return builtin_options[optname][2]
-        elif builtin_options[optname][0] == UserBooleanOption:
-            return [True, False]
-        elif builtin_options[optname][0] == UserFeatureOption:
-            return UserFeatureOption.static_choices
-        else:
-            return None
-    else:
-        raise RuntimeError('Tried to get the supported values for an unknown builtin option \'%s\'.' % optname)
-
-def get_builtin_option_description(optname):
-    if is_builtin_option(optname):
-        return builtin_options[optname][1]
-    else:
-        raise RuntimeError('Tried to get the description for an unknown builtin option \'%s\'.' % optname)
-
-def get_builtin_option_action(optname):
-    default = builtin_options[optname][2]
-    if default is True:
-        return 'store_false'
-    elif default is False:
-        return 'store_true'
-    return None
-
-def get_builtin_option_default(optname, prefix=''):
-    if is_builtin_option(optname):
-        o = builtin_options[optname]
-        if o[0] == UserComboOption:
-            return o[3]
-        if o[0] == UserIntegerOption:
-            return o[4]
-        try:
-            return builtin_dir_noprefix_options[optname][prefix]
-        except KeyError:
-            pass
-        return o[2]
-    else:
-        raise RuntimeError('Tried to get the default value for an unknown builtin option \'%s\'.' % optname)
-
-def get_builtin_option_cmdline_name(name):
-    if name == 'warning_level':
-        return '--warnlevel'
-    else:
-        return '--' + name.replace('_', '-')
-
-def add_builtin_argument(p, name):
-    kwargs = {}
-    c = get_builtin_option_choices(name)
-    b = get_builtin_option_action(name)
-    h = get_builtin_option_description(name)
-    if not b:
-        h = h.rstrip('.') + ' (default: %s).' % get_builtin_option_default(name)
-    else:
-        kwargs['action'] = b
-    if c and not b:
-        kwargs['choices'] = c
-    kwargs['default'] = argparse.SUPPRESS
-    kwargs['dest'] = name
-
-    cmdline_name = get_builtin_option_cmdline_name(name)
-    p.add_argument(cmdline_name, help=h, **kwargs)
 
 def register_builtin_arguments(parser):
-    for n in builtin_options:
-        add_builtin_argument(parser, n)
+    for n, b in builtin_options.items():
+        b.add_to_argparse(n, parser, '', '')
+    for n, b in builtin_options_per_machine.items():
+        b.add_to_argparse(n, parser, '', ' (just for host machine)')
+        b.add_to_argparse(n, parser, 'build.', ' (just for build machine)')
     parser.add_argument('-D', action='append', dest='projectoptions', default=[], metavar="option",
                         help='Set the value of an option, can be used several times to set multiple options.')
 
@@ -705,49 +900,132 @@
     args.cmd_line_options = create_options_dict(args.projectoptions)
 
     # Merge builtin options set with --option into the dict.
-    for name in builtin_options:
+    for name in chain(
+            builtin_options.keys(),
+            ('build.' + k for k in builtin_options_per_machine.keys()),
+            builtin_options_per_machine.keys(),
+    ):
         value = getattr(args, name, None)
         if value is not None:
             if name in args.cmd_line_options:
-                cmdline_name = get_builtin_option_cmdline_name(name)
+                cmdline_name = BuiltinOption.argparse_name_to_arg(name)
                 raise MesonException(
                     'Got argument {0} as both -D{0} and {1}. Pick one.'.format(name, cmdline_name))
             args.cmd_line_options[name] = value
             delattr(args, name)
 
-builtin_options = {
-    'buildtype':  [UserComboOption, 'Build type to use', ['plain', 'debug', 'debugoptimized', 'release', 'minsize', 'custom'], 'debug'],
-    'strip':      [UserBooleanOption, 'Strip targets on install', False],
-    'unity':      [UserComboOption, 'Unity build', ['on', 'off', 'subprojects'], 'off'],
-    'prefix':     [UserStringOption, 'Installation prefix', default_prefix()],
-    'libdir':     [UserStringOption, 'Library directory', default_libdir()],
-    'libexecdir': [UserStringOption, 'Library executable directory', default_libexecdir()],
-    'bindir':     [UserStringOption, 'Executable directory', 'bin'],
-    'sbindir':    [UserStringOption, 'System executable directory', 'sbin'],
-    'includedir': [UserStringOption, 'Header file directory', 'include'],
-    'datadir':    [UserStringOption, 'Data file directory', 'share'],
-    'mandir':     [UserStringOption, 'Manual page directory', 'share/man'],
-    'infodir':    [UserStringOption, 'Info page directory', 'share/info'],
-    'localedir':  [UserStringOption, 'Locale data directory', 'share/locale'],
-    'sysconfdir':      [UserStringOption, 'Sysconf data directory', 'etc'],
-    'localstatedir':   [UserStringOption, 'Localstate data directory', 'var'],
-    'sharedstatedir':  [UserStringOption, 'Architecture-independent data directory', 'com'],
-    'werror':          [UserBooleanOption, 'Treat warnings as errors', False],
-    'warning_level':   [UserComboOption, 'Compiler warning level to use', ['1', '2', '3'], '1'],
-    'layout':          [UserComboOption, 'Build directory layout', ['mirror', 'flat'], 'mirror'],
-    'default_library': [UserComboOption, 'Default library type', ['shared', 'static', 'both'], 'shared'],
-    'backend':         [UserComboOption, 'Backend to use', backendlist, 'ninja'],
-    'stdsplit':        [UserBooleanOption, 'Split stdout and stderr in test logs', True],
-    'errorlogs':       [UserBooleanOption, "Whether to print the logs from failing tests", True],
-    'install_umask':   [UserUmaskOption, 'Default umask to apply on permissions of installed files', '022'],
-    'auto_features':   [UserFeatureOption, "Override value of all 'auto' features", 'auto'],
-    'optimization':    [UserComboOption, 'Optimization level', ['0', 'g', '1', '2', '3', 's'], '0'],
-    'debug':           [UserBooleanOption, 'Debug', True],
-    'wrap_mode':       [UserComboOption, 'Wrap mode', ['default',
-                                                       'nofallback',
-                                                       'nodownload',
-                                                       'forcefallback'], 'default'],
-}
+
+_U = TypeVar('_U', bound=UserOption[_T])
+
+class BuiltinOption(Generic[_T, _U]):
+
+    """Class for a builtin option type.
+
+    Currently doesn't support UserIntegerOption, or a few other cases.
+    """
+
+    def __init__(self, opt_type: Type[_U], description: str, default: Any, yielding: Optional[bool] = None, *,
+                 choices: Any = None):
+        self.opt_type = opt_type
+        self.description = description
+        self.default = default
+        self.choices = choices
+        self.yielding = yielding
+
+    def init_option(self) -> _U:
+        """Create an instance of opt_type and return it."""
+        keywords = {'yielding': self.yielding, 'value': self.default}
+        if self.choices:
+            keywords['choices'] = self.choices
+        return self.opt_type(self.description, **keywords)
+
+    def _argparse_action(self) -> Optional[str]:
+        if self.default is True:
+            return 'store_false'
+        elif self.default is False:
+            return 'store_true'
+        return None
+
+    def _argparse_choices(self) -> Any:
+        if self.opt_type is UserBooleanOption:
+            return [True, False]
+        elif self.opt_type is UserFeatureOption:
+            return UserFeatureOption.static_choices
+        return self.choices
+
+    @staticmethod
+    def argparse_name_to_arg(name: str) -> str:
+        if name == 'warning_level':
+            return '--warnlevel'
+        else:
+            return '--' + name.replace('_', '-')
+
+    def prefixed_default(self, name: str, prefix: str = '') -> Any:
+        if self.opt_type in [UserComboOption, UserIntegerOption]:
+            return self.default
+        try:
+            return builtin_dir_noprefix_options[name][prefix]
+        except KeyError:
+            pass
+        return self.default
+
+    def add_to_argparse(self, name: str, parser: argparse.ArgumentParser, prefix: str, help_suffix: str) -> None:
+        kwargs = {}
+
+        c = self._argparse_choices()
+        b = self._argparse_action()
+        h = self.description
+        if not b:
+            h = '{} (default: {}).'.format(h.rstrip('.'), self.prefixed_default(name))
+        else:
+            kwargs['action'] = b
+        if c and not b:
+            kwargs['choices'] = c
+        kwargs['default'] = argparse.SUPPRESS
+        kwargs['dest'] = prefix + name
+
+        cmdline_name = self.argparse_name_to_arg(prefix + name)
+        parser.add_argument(cmdline_name, help=h + help_suffix, **kwargs)
+
+# Update `docs/markdown/Builtin-options.md` after changing the options below
+builtin_options = OrderedDict([
+    # Directories
+    ('prefix',     BuiltinOption(UserStringOption, 'Installation prefix', default_prefix())),
+    ('bindir',     BuiltinOption(UserStringOption, 'Executable directory', 'bin')),
+    ('datadir',    BuiltinOption(UserStringOption, 'Data file directory', 'share')),
+    ('includedir', BuiltinOption(UserStringOption, 'Header file directory', 'include')),
+    ('infodir',    BuiltinOption(UserStringOption, 'Info page directory', 'share/info')),
+    ('libdir',     BuiltinOption(UserStringOption, 'Library directory', default_libdir())),
+    ('libexecdir', BuiltinOption(UserStringOption, 'Library executable directory', default_libexecdir())),
+    ('localedir',  BuiltinOption(UserStringOption, 'Locale data directory', 'share/locale')),
+    ('localstatedir',   BuiltinOption(UserStringOption, 'Localstate data directory', 'var')),
+    ('mandir',          BuiltinOption(UserStringOption, 'Manual page directory', 'share/man')),
+    ('sbindir',         BuiltinOption(UserStringOption, 'System executable directory', 'sbin')),
+    ('sharedstatedir',  BuiltinOption(UserStringOption, 'Architecture-independent data directory', 'com')),
+    ('sysconfdir',      BuiltinOption(UserStringOption, 'Sysconf data directory', 'etc')),
+    # Core options
+    ('auto_features',   BuiltinOption(UserFeatureOption, "Override value of all 'auto' features", 'auto')),
+    ('backend',         BuiltinOption(UserComboOption, 'Backend to use', 'ninja', choices=backendlist)),
+    ('buildtype',       BuiltinOption(UserComboOption, 'Build type to use', 'debug',
+                                      choices=['plain', 'debug', 'debugoptimized', 'release', 'minsize', 'custom'])),
+    ('debug',           BuiltinOption(UserBooleanOption, 'Debug', True)),
+    ('default_library', BuiltinOption(UserComboOption, 'Default library type', 'shared', choices=['shared', 'static', 'both'])),
+    ('errorlogs',       BuiltinOption(UserBooleanOption, "Whether to print the logs from failing tests", True)),
+    ('install_umask',   BuiltinOption(UserUmaskOption, 'Default umask to apply on permissions of installed files', '022')),
+    ('layout',          BuiltinOption(UserComboOption, 'Build directory layout', 'mirror', choices=['mirror', 'flat'])),
+    ('optimization',    BuiltinOption(UserComboOption, 'Optimization level', '0', choices=['0', 'g', '1', '2', '3', 's'])),
+    ('stdsplit',        BuiltinOption(UserBooleanOption, 'Split stdout and stderr in test logs', True)),
+    ('strip',           BuiltinOption(UserBooleanOption, 'Strip targets on install', False)),
+    ('unity',           BuiltinOption(UserComboOption, 'Unity build', 'off', choices=['on', 'off', 'subprojects'])),
+    ('warning_level',   BuiltinOption(UserComboOption, 'Compiler warning level to use', '1', choices=['0', '1', '2', '3'])),
+    ('werror',          BuiltinOption(UserBooleanOption, 'Treat warnings as errors', False)),
+    ('wrap_mode',       BuiltinOption(UserComboOption, 'Wrap mode', 'default', choices=['default', 'nofallback', 'nodownload', 'forcefallback'])),
+])
+
+builtin_options_per_machine = OrderedDict([
+    ('pkg_config_path', BuiltinOption(UserArrayOption, 'List of additional paths for pkg-config to search', [])),
+    ('cmake_prefix_path', BuiltinOption(UserArrayOption, 'List of additional prefixes for cmake to search', [])),
+])
 
 # Special prefix-dependent defaults for installation directories that reside in
 # a path outside of the prefix in FHS and common usage.
diff -Nru meson-0.49.0/mesonbuild/dependencies/base.py meson-0.52.1/mesonbuild/dependencies/base.py
--- meson-0.49.0/mesonbuild/dependencies/base.py	2018-12-09 14:27:23.000000000 +0000
+++ meson-0.52.1/mesonbuild/dependencies/base.py	2019-11-28 17:37:44.000000000 +0000
@@ -14,27 +14,28 @@
 
 # This file contains the detection logic for external dependencies.
 # Custom logic for several other packages are in separate files.
-
 import copy
 import functools
 import os
 import re
-import stat
 import json
 import shlex
 import shutil
 import textwrap
 import platform
-import itertools
-import ctypes
+import typing
+from typing import Any, Dict, List, Tuple
 from enum import Enum
-from pathlib import PurePath
+from pathlib import Path, PurePath
 
 from .. import mlog
 from .. import mesonlib
 from ..compilers import clib_langs
-from ..mesonlib import MesonException, OrderedSet
-from ..mesonlib import Popen_safe, version_compare_many, version_compare, listify
+from ..environment import BinaryTable, Environment, MachineInfo
+from ..cmake import CMakeExecutor, CMakeTraceParser, CMakeException
+from ..mesonlib import MachineChoice, MesonException, OrderedSet, PerMachine
+from ..mesonlib import Popen_safe, version_compare_many, version_compare, listify, stringlistify, extract_as_list, split_args
+from ..mesonlib import Version, LibType
 
 # These must be defined in this file to avoid cyclical references.
 packages = {}
@@ -72,6 +73,8 @@
     @classmethod
     def _process_method_kw(cls, kwargs):
         method = kwargs.get('method', 'auto')
+        if isinstance(method, DependencyMethods):
+            return method
         if method not in [e.value for e in DependencyMethods]:
             raise DependencyException('method {!r} is invalid'.format(method))
         method = DependencyMethods(method)
@@ -100,6 +103,16 @@
 
         return methods
 
+    @classmethod
+    def _process_include_type_kw(cls, kwargs) -> str:
+        if 'include_type' not in kwargs:
+            return 'preserve'
+        if not isinstance(kwargs['include_type'], str):
+            raise DependencyException('The include_type kwarg must be a string type')
+        if kwargs['include_type'] not in ['preserve', 'system', 'non-system']:
+            raise DependencyException("include_type may only be one of ['preserve', 'system', 'non-system']")
+        return kwargs['include_type']
+
     def __init__(self, type_name, kwargs):
         self.name = "null"
         self.version = None
@@ -113,12 +126,30 @@
         self.raw_link_args = None
         self.sources = []
         self.methods = self._process_method_kw(kwargs)
+        self.include_type = self._process_include_type_kw(kwargs)
+        self.ext_deps = []  # type: List[Dependency]
 
     def __repr__(self):
         s = '<{0} {1}: {2}>'
         return s.format(self.__class__.__name__, self.name, self.is_found)
 
     def get_compile_args(self):
+        if self.include_type == 'system':
+            converted = []
+            for i in self.compile_args:
+                if i.startswith('-I') or i.startswith('/I'):
+                    converted += ['-isystem' + i[2:]]
+                else:
+                    converted += [i]
+            return converted
+        if self.include_type == 'non-system':
+            converted = []
+            for i in self.compile_args:
+                if i.startswith('-isystem'):
+                    converted += ['-I' + i[8:]]
+                else:
+                    converted += [i]
+            return converted
         return self.compile_args
 
     def get_link_args(self, raw=False):
@@ -147,23 +178,21 @@
         else:
             return 'unknown'
 
+    def get_include_type(self) -> str:
+        return self.include_type
+
     def get_exe_args(self, compiler):
         return []
 
-    def need_openmp(self):
-        return False
-
-    def need_threads(self):
-        return False
-
     def get_pkgconfig_variable(self, variable_name, kwargs):
         raise DependencyException('{!r} is not a pkgconfig dependency'.format(self.name))
 
     def get_configtool_variable(self, variable_name):
         raise DependencyException('{!r} is not a config-tool dependency'.format(self.name))
 
-    def get_partial_dependency(self, *, compile_args=False, link_args=False,
-                               links=False, includes=False, sources=False):
+    def get_partial_dependency(self, *, compile_args: bool = False,
+                               link_args: bool = False, links: bool = False,
+                               includes: bool = False, sources: bool = False):
         """Create a new dependency that contains part of the parent dependency.
 
         The following options can be inherited:
@@ -179,6 +208,31 @@
         """
         raise RuntimeError('Unreachable code in partial_dependency called')
 
+    def _add_sub_dependency(self, dep_type: typing.Type['Dependency'], env: Environment,
+                            kwargs: typing.Dict[str, typing.Any], *,
+                            method: DependencyMethods = DependencyMethods.AUTO) -> None:
+        """Add an internal dependency of of the given type.
+
+        This method is intended to simplify cases of adding a dependency on
+        another dependency type (such as threads). This will by default set
+        the method back to auto, but the 'method' keyword argument can be
+        used to overwrite this behavior.
+        """
+        kwargs = kwargs.copy()
+        kwargs['method'] = method
+        self.ext_deps.append(dep_type(env, kwargs))
+
+    def get_variable(self, *, cmake: typing.Optional[str] = None, pkgconfig: typing.Optional[str] = None,
+                     configtool: typing.Optional[str] = None, default_value: typing.Optional[str] = None,
+                     pkgconfig_define: typing.Optional[typing.List[str]] = None) -> typing.Union[str, typing.List[str]]:
+        if default_value is not None:
+            return default_value
+        raise DependencyException('No default provided for dependency {!r}, which is not pkg-config, cmake, or config-tool based.'.format(self))
+
+    def generate_system_dependency(self, include_type: str) -> typing.Type['Dependency']:
+        new_dep = copy.deepcopy(self)
+        new_dep.include_type = self._process_include_type_kw({'include_type': include_type})
+        return new_dep
 
 class InternalDependency(Dependency):
     def __init__(self, version, incdirs, compile_args, link_args, libraries, whole_libraries, sources, ext_deps):
@@ -201,25 +255,30 @@
         raise DependencyException('Method "get_configtool_variable()" is '
                                   'invalid for an internal dependency')
 
-    def get_partial_dependency(self, *, compile_args=False, link_args=False,
-                               links=False, includes=False, sources=False):
-        compile_args = self.compile_args.copy() if compile_args else []
-        link_args = self.link_args.copy() if link_args else []
-        libraries = self.libraries.copy() if links else []
-        whole_libraries = self.whole_libraries.copy() if links else []
-        sources = self.sources.copy() if sources else []
-        includes = self.include_directories.copy() if includes else []
-        deps = [d.get_partial_dependency(
+    def get_partial_dependency(self, *, compile_args: bool = False,
+                               link_args: bool = False, links: bool = False,
+                               includes: bool = False, sources: bool = False):
+        final_compile_args = self.compile_args.copy() if compile_args else []
+        final_link_args = self.link_args.copy() if link_args else []
+        final_libraries = self.libraries.copy() if links else []
+        final_whole_libraries = self.whole_libraries.copy() if links else []
+        final_sources = self.sources.copy() if sources else []
+        final_includes = self.include_directories.copy() if includes else []
+        final_deps = [d.get_partial_dependency(
             compile_args=compile_args, link_args=link_args, links=links,
             includes=includes, sources=sources) for d in self.ext_deps]
         return InternalDependency(
-            self.version, includes, compile_args, link_args, libraries,
-            whole_libraries, sources, deps)
-
+            self.version, final_includes, final_compile_args,
+            final_link_args, final_libraries, final_whole_libraries,
+            final_sources, final_deps)
+
+class HasNativeKwarg:
+    def __init__(self, kwargs):
+        self.for_machine = MachineChoice.BUILD if kwargs.get('native', False) else MachineChoice.HOST
 
-class ExternalDependency(Dependency):
+class ExternalDependency(Dependency, HasNativeKwarg):
     def __init__(self, type_name, environment, language, kwargs):
-        super().__init__(type_name, kwargs)
+        Dependency.__init__(self, type_name, kwargs)
         self.env = environment
         self.name = type_name # default
         self.is_found = False
@@ -232,18 +291,12 @@
         self.static = kwargs.get('static', False)
         if not isinstance(self.static, bool):
             raise DependencyException('Static keyword must be boolean')
-        # Is this dependency for cross-compilation?
-        if 'native' in kwargs and self.env.is_cross_build():
-            self.want_cross = not kwargs['native']
-        else:
-            self.want_cross = self.env.is_cross_build()
+        # Is this dependency to be run on the build platform?
+        HasNativeKwarg.__init__(self, kwargs)
         self.clib_compiler = None
         # Set the compiler that will be used by this dependency
         # This is only used for configuration checks
-        if self.want_cross:
-            compilers = self.env.coredata.cross_compilers
-        else:
-            compilers = self.env.coredata.compilers
+        compilers = self.env.coredata.compilers[self.for_machine]
         # Set the compiler for this dependency if a language is specified,
         # else try to pick something that looks usable.
         if self.language:
@@ -263,8 +316,9 @@
     def get_compiler(self):
         return self.clib_compiler
 
-    def get_partial_dependency(self, *, compile_args=False, link_args=False,
-                               links=False, includes=False, sources=False):
+    def get_partial_dependency(self, *, compile_args: bool = False,
+                               link_args: bool = False, links: bool = False,
+                               includes: bool = False, sources: bool = False):
         new = copy.copy(self)
         if not compile_args:
             new.compile_args = []
@@ -272,6 +326,10 @@
             new.link_args = []
         if not sources:
             new.sources = []
+        if not includes:
+            new.include_directories = []
+        if not sources:
+            new.sources = []
 
         return new
 
@@ -327,6 +385,11 @@
         self.name = 'not-found'
         self.is_found = False
 
+    def get_partial_dependency(self, *, compile_args: bool = False,
+                               link_args: bool = False, links: bool = False,
+                               includes: bool = False, sources: bool = False):
+        return copy.copy(self)
+
 
 class ConfigToolDependency(ExternalDependency):
 
@@ -339,7 +402,6 @@
     def __init__(self, name, environment, language, kwargs):
         super().__init__('config-tool', environment, language, kwargs)
         self.name = name
-        self.native = kwargs.get('native', False)
         self.tools = listify(kwargs.get('tools', self.tools))
 
         req_version = kwargs.get('version', None)
@@ -393,24 +455,29 @@
         if not isinstance(versions, list) and versions is not None:
             versions = listify(versions)
 
-        if self.env.is_cross_build() and not self.native:
-            cross_file = self.env.cross_info.config['binaries']
-            try:
-                tools = [cross_file[self.tool_name]]
-            except KeyError:
-                mlog.warning('No entry for {0} specified in your cross file. '
-                             'Falling back to searching PATH. This may find a '
-                             'native version of {0}!'.format(self.tool_name))
-                tools = self.tools
-        elif self.tool_name in self.env.config_info.binaries:
-            tools = [self.env.config_info.binaries[self.tool_name]]
-        else:
-            tools = self.tools
+        tool = self.env.binaries[self.for_machine].lookup_entry(self.tool_name)
+        if tool is not None:
+            tools = [tool]
+        else:
+            if not self.env.machines.matches_build_machine(self.for_machine):
+                mlog.deprecation('No entry for {0} specified in your cross file. '
+                                 'Falling back to searching PATH. This may find a '
+                                 'native version of {0}! This will become a hard '
+                                 'error in a future version of meson'.format(self.tool_name))
+            tools = [[t] for t in self.tools]
 
         best_match = (None, None)
         for tool in tools:
+            if len(tool) == 1:
+                # In some situations the command can't be directly executed.
+                # For example Shell scripts need to be called through sh on
+                # Windows (see issue #1423).
+                potential_bin = ExternalProgram(tool[0], silent=True)
+                if not potential_bin.found():
+                    continue
+                tool = potential_bin.get_command()
             try:
-                p, out = Popen_safe([tool, '--version'])[:2]
+                p, out = Popen_safe(tool + ['--version'])[:2]
             except (FileNotFoundError, PermissionError):
                 continue
             if p.returncode != 0:
@@ -439,37 +506,38 @@
 
     def report_config(self, version, req_version):
         """Helper method to print messages about the tool."""
+
+        found_msg = [mlog.bold(self.tool_name), 'found:']
+
         if self.config is None:
-            if version is not None:
-                mlog.log('Found', mlog.bold(self.tool_name), repr(version),
-                         mlog.red('NO'), '(needed', req_version, ')')
-            else:
-                mlog.log('Found', mlog.bold(self.tool_name), repr(req_version),
-                         mlog.red('NO'))
-            return False
-        mlog.log('Found {}:'.format(self.tool_name), mlog.bold(shutil.which(self.config)),
-                 '({})'.format(version))
-        return True
+            found_msg.append(mlog.red('NO'))
+            if version is not None and req_version is not None:
+                found_msg.append('found {!r} but need {!r}'.format(version, req_version))
+            elif req_version:
+                found_msg.append('need {!r}'.format(req_version))
+        else:
+            found_msg += [mlog.green('YES'), '({})'.format(' '.join(self.config)), version]
+
+        mlog.log(*found_msg)
+
+        return self.config is not None
 
     def get_config_value(self, args, stage):
-        p, out, err = Popen_safe([self.config] + args)
-        # This is required to keep shlex from stripping path separators on
-        # Windows. Also, don't put escape sequences in config values, okay?
-        out = out.replace('\\', '\\\\')
+        p, out, err = Popen_safe(self.config + args)
         if p.returncode != 0:
             if self.required:
                 raise DependencyException(
                     'Could not generate {} for {}.\n{}'.format(
                         stage, self.name, err))
             return []
-        return shlex.split(out)
+        return split_args(out)
 
     @staticmethod
     def get_methods():
         return [DependencyMethods.AUTO, DependencyMethods.CONFIG_TOOL]
 
     def get_configtool_variable(self, variable_name):
-        p, out, _ = Popen_safe([self.config, '--{}'.format(variable_name)])
+        p, out, _ = Popen_safe(self.config + ['--{}'.format(variable_name)])
         if p.returncode != 0:
             if self.required:
                 raise DependencyException(
@@ -482,11 +550,31 @@
     def log_tried(self):
         return self.type_name
 
+    def get_variable(self, *, cmake: typing.Optional[str] = None, pkgconfig: typing.Optional[str] = None,
+                     configtool: typing.Optional[str] = None, default_value: typing.Optional[str] = None,
+                     pkgconfig_define: typing.Optional[typing.List[str]] = None) -> typing.Union[str, typing.List[str]]:
+        if configtool:
+            # In the not required case '' (empty string) will be returned if the
+            # variable is not found. Since '' is a valid value to return we
+            # set required to True here to force and error, and use the
+            # finally clause to ensure it's restored.
+            restore = self.required
+            self.required = True
+            try:
+                return self.get_configtool_variable(configtool)
+            except DependencyException:
+                pass
+            finally:
+                self.required = restore
+        if default_value is not None:
+            return default_value
+        raise DependencyException('Could not get config-tool variable and no default provided for {!r}'.format(self))
+
 
 class PkgConfigDependency(ExternalDependency):
     # The class's copy of the pkg-config path. Avoids having to search for it
     # multiple times in the same Meson invocation.
-    class_pkgbin = None
+    class_pkgbin = PerMachine(None, None)
     # We cache all pkg-config subprocess invocations to avoid redundant calls
     pkgbin_cache = {}
 
@@ -498,44 +586,77 @@
         # stored in the pickled coredata and recovered.
         self.pkgbin = None
 
-        # When finding dependencies for cross-compiling, we don't care about
-        # the 'native' pkg-config
-        if self.want_cross:
-            if 'pkgconfig' not in environment.cross_info.config['binaries']:
-                if self.required:
-                    raise DependencyException('Pkg-config binary missing from cross file')
+        # Create an iterator of options
+        def search():
+            # Lookup in cross or machine file.
+            potential_pkgpath = environment.binaries[self.for_machine].lookup_entry('pkgconfig')
+            if potential_pkgpath is not None:
+                mlog.debug('Pkg-config binary for {} specified from cross file, native file, '
+                           'or env var as {}'.format(self.for_machine, potential_pkgpath))
+                yield ExternalProgram.from_entry('pkgconfig', potential_pkgpath)
+                # We never fallback if the user-specified option is no good, so
+                # stop returning options.
+                return
+            mlog.debug('Pkg-config binary missing from cross or native file, or env var undefined.')
+            # Fallback on hard-coded defaults.
+            # TODO prefix this for the cross case instead of ignoring thing.
+            if environment.machines.matches_build_machine(self.for_machine):
+                for potential_pkgpath in environment.default_pkgconfig:
+                    mlog.debug('Trying a default pkg-config fallback at', potential_pkgpath)
+                    yield ExternalProgram(potential_pkgpath, silent=True)
+
+        # Only search for pkg-config for each machine the first time and store
+        # the result in the class definition
+        if PkgConfigDependency.class_pkgbin[self.for_machine] is False:
+            mlog.debug('Pkg-config binary for %s is cached as not found.' % self.for_machine)
+        elif PkgConfigDependency.class_pkgbin[self.for_machine] is not None:
+            mlog.debug('Pkg-config binary for %s is cached.' % self.for_machine)
+        else:
+            assert PkgConfigDependency.class_pkgbin[self.for_machine] is None
+            mlog.debug('Pkg-config binary for %s is not cached.' % self.for_machine)
+            for potential_pkgbin in search():
+                mlog.debug('Trying pkg-config binary {} for machine {} at {}'
+                           .format(potential_pkgbin.name, self.for_machine, potential_pkgbin.command))
+                version_if_ok = self.check_pkgconfig(potential_pkgbin)
+                if not version_if_ok:
+                    continue
+                if not self.silent:
+                    mlog.log('Found pkg-config:', mlog.bold(potential_pkgbin.get_path()),
+                             '(%s)' % version_if_ok)
+                PkgConfigDependency.class_pkgbin[self.for_machine] = potential_pkgbin
+                break
             else:
-                potential_pkgbin = ExternalProgram.from_bin_list(
-                    environment.cross_info.config['binaries'], 'pkgconfig')
-                if potential_pkgbin.found():
-                    self.pkgbin = potential_pkgbin
-                else:
-                    mlog.debug('Cross pkg-config %s not found.' % potential_pkgbin.name)
-        # Only search for the native pkg-config the first time and
-        # store the result in the class definition
-        elif PkgConfigDependency.class_pkgbin is None:
-            self.pkgbin = self.check_pkgconfig()
-            PkgConfigDependency.class_pkgbin = self.pkgbin
-        else:
-            self.pkgbin = PkgConfigDependency.class_pkgbin
-
-        if not self.pkgbin:
+                if not self.silent:
+                    mlog.log('Found Pkg-config:', mlog.red('NO'))
+                # Set to False instead of None to signify that we've already
+                # searched for it and not found it
+                PkgConfigDependency.class_pkgbin[self.for_machine] = False
+
+        self.pkgbin = PkgConfigDependency.class_pkgbin[self.for_machine]
+        if self.pkgbin is False:
+            self.pkgbin = None
+            msg = 'Pkg-config binary for machine %s not found. Giving up.' % self.for_machine
             if self.required:
-                raise DependencyException('Pkg-config not found.')
-            return
+                raise DependencyException(msg)
+            else:
+                mlog.debug(msg)
+                return
 
         mlog.debug('Determining dependency {!r} with pkg-config executable '
                    '{!r}'.format(name, self.pkgbin.get_path()))
-        ret, self.version = self._call_pkgbin(['--modversion', name])
+        ret, self.version, _ = self._call_pkgbin(['--modversion', name])
         if ret != 0:
             return
 
+        self.is_found = True
+
         try:
             # Fetch cargs to be used while using this dependency
             self._set_cargs()
             # Fetch the libraries and library paths needed for using this
             self._set_libs()
         except DependencyException as e:
+            mlog.debug("pkg-config error with '%s': %s" % (name, e))
             if self.required:
                 raise
             else:
@@ -544,8 +665,6 @@
                 self.is_found = False
                 self.reason = e
 
-        self.is_found = True
-
     def __repr__(self):
         s = '<{0} {1}: {2} {3}>'
         return s.format(self.__class__.__name__, self.name, self.is_found,
@@ -553,18 +672,29 @@
 
     def _call_pkgbin_real(self, args, env):
         cmd = self.pkgbin.get_command() + args
-        p, out = Popen_safe(cmd, env=env)[0:2]
-        rc, out = p.returncode, out.strip()
+        p, out, err = Popen_safe(cmd, env=env)
+        rc, out, err = p.returncode, out.strip(), err.strip()
         call = ' '.join(cmd)
         mlog.debug("Called `{}` -> {}\n{}".format(call, rc, out))
-        return rc, out
+        return rc, out, err
 
     def _call_pkgbin(self, args, env=None):
+        # Always copy the environment since we're going to modify it
+        # with pkg-config variables
         if env is None:
-            fenv = env
-            env = os.environ
+            env = os.environ.copy()
         else:
-            fenv = frozenset(env.items())
+            env = env.copy()
+
+        extra_paths = self.env.coredata.builtins_per_machine[self.for_machine]['pkg_config_path'].value
+        sysroot = self.env.properties[self.for_machine].get_sys_root()
+        if sysroot:
+            env['PKG_CONFIG_SYSROOT_DIR'] = sysroot
+        new_pkg_config_path = ':'.join([p for p in extra_paths])
+        mlog.debug('PKG_CONFIG_PATH: ' + new_pkg_config_path)
+        env['PKG_CONFIG_PATH'] = new_pkg_config_path
+
+        fenv = frozenset(env.items())
         targs = tuple(args)
         cache = PkgConfigDependency.pkgbin_cache
         if (self.pkgbin, targs, fenv) not in cache:
@@ -599,6 +729,11 @@
             converted.append(arg)
         return converted
 
+    def _split_args(self, cmd):
+        # pkg-config paths follow Unix conventions, even on Windows; split the
+        # output using shlex.split rather than mesonlib.split_args
+        return shlex.split(cmd)
+
     def _set_cargs(self):
         env = None
         if self.language == 'fortran':
@@ -606,11 +741,11 @@
             # so don't allow pkg-config to suppress -I flags for system paths
             env = os.environ.copy()
             env['PKG_CONFIG_ALLOW_SYSTEM_CFLAGS'] = '1'
-        ret, out = self._call_pkgbin(['--cflags', self.name], env=env)
+        ret, out, err = self._call_pkgbin(['--cflags', self.name], env=env)
         if ret != 0:
-            raise DependencyException('Could not generate cargs for %s:\n\n%s' %
-                                      (self.name, out))
-        self.compile_args = self._convert_mingw_paths(shlex.split(out))
+            raise DependencyException('Could not generate cargs for %s:\n%s\n' %
+                                      (self.name, err))
+        self.compile_args = self._convert_mingw_paths(self._split_args(out))
 
     def _search_libs(self, out, out_raw):
         '''
@@ -639,12 +774,16 @@
         # always searched first.
         prefix_libpaths = OrderedSet()
         # We also store this raw_link_args on the object later
-        raw_link_args = self._convert_mingw_paths(shlex.split(out_raw))
+        raw_link_args = self._convert_mingw_paths(self._split_args(out_raw))
         for arg in raw_link_args:
             if arg.startswith('-L') and not arg.startswith(('-L-l', '-L-L')):
-                prefix_libpaths.add(arg[2:])
+                path = arg[2:]
+                if not os.path.isabs(path):
+                    # Resolve the path as a compiler in the build directory would
+                    path = os.path.join(self.env.get_build_dir(), path)
+                prefix_libpaths.add(path)
         system_libpaths = OrderedSet()
-        full_args = self._convert_mingw_paths(shlex.split(out))
+        full_args = self._convert_mingw_paths(self._split_args(out))
         for arg in full_args:
             if arg.startswith(('-L-l', '-L-L')):
                 # These are D language arguments, not library paths
@@ -657,7 +796,7 @@
         libs_found = OrderedSet()
         # Track not-found libraries to know whether to add library paths
         libs_notfound = []
-        libtype = 'static' if self.static else 'default'
+        libtype = LibType.STATIC if self.static else LibType.PREFER_SHARED
         # Generate link arguments for this library
         link_args = []
         for lib in full_args:
@@ -733,14 +872,14 @@
         # paths so we can do manual searching with cc.find_library() later.
         env = os.environ.copy()
         env['PKG_CONFIG_ALLOW_SYSTEM_LIBS'] = '1'
-        ret, out = self._call_pkgbin(libcmd, env=env)
+        ret, out, err = self._call_pkgbin(libcmd, env=env)
         if ret != 0:
-            raise DependencyException('Could not generate libs for %s:\n\n%s' %
-                                      (self.name, out))
+            raise DependencyException('Could not generate libs for %s:\n%s\n' %
+                                      (self.name, err))
         # Also get the 'raw' output without -Lfoo system paths for adding -L
         # args with -lfoo when a library can't be found, and also in
         # gnome.generate_gir + gnome.gtkdoc which need -L -l arguments.
-        ret, out_raw = self._call_pkgbin(libcmd)
+        ret, out_raw, err_raw = self._call_pkgbin(libcmd)
         if ret != 0:
             raise DependencyException('Could not generate libs for %s:\n\n%s' %
                                       (self.name, out_raw))
@@ -752,26 +891,26 @@
         if 'define_variable' in kwargs:
             definition = kwargs.get('define_variable', [])
             if not isinstance(definition, list):
-                raise MesonException('define_variable takes a list')
+                raise DependencyException('define_variable takes a list')
 
             if len(definition) != 2 or not all(isinstance(i, str) for i in definition):
-                raise MesonException('define_variable must be made up of 2 strings for VARIABLENAME and VARIABLEVALUE')
+                raise DependencyException('define_variable must be made up of 2 strings for VARIABLENAME and VARIABLEVALUE')
 
             options = ['--define-variable=' + '='.join(definition)] + options
 
-        ret, out = self._call_pkgbin(options)
+        ret, out, err = self._call_pkgbin(options)
         variable = ''
         if ret != 0:
             if self.required:
-                raise DependencyException('dependency %s not found.' %
-                                          (self.name))
+                raise DependencyException('dependency %s not found:\n%s\n' %
+                                          (self.name, err))
         else:
             variable = out.strip()
 
             # pkg-config doesn't distinguish between empty and non-existent variables
             # use the variable list to check for variable existence
             if not variable:
-                ret, out = self._call_pkgbin(['--print-variables', self.name])
+                ret, out, _ = self._call_pkgbin(['--print-variables', self.name])
                 if not re.search(r'^' + variable_name + r'$', out, re.MULTILINE):
                     if 'default' in kwargs:
                         variable = kwargs['default']
@@ -785,33 +924,27 @@
     def get_methods():
         return [DependencyMethods.PKGCONFIG]
 
-    def check_pkgconfig(self):
-        evar = 'PKG_CONFIG'
-        if evar in os.environ:
-            pkgbin = os.environ[evar].strip()
-        else:
-            pkgbin = 'pkg-config'
-        pkgbin = ExternalProgram(pkgbin, silent=True)
-        if pkgbin.found():
-            try:
-                p, out = Popen_safe(pkgbin.get_command() + ['--version'])[0:2]
-                if p.returncode != 0:
-                    mlog.warning('Found pkg-config {!r} but couldn\'t run it'
-                                 ''.format(' '.join(pkgbin.get_command())))
-                    # Set to False instead of None to signify that we've already
-                    # searched for it and not found it
-                    pkgbin = False
-            except (FileNotFoundError, PermissionError):
-                pkgbin = False
-        else:
-            pkgbin = False
-        if not self.silent:
-            if pkgbin:
-                mlog.log('Found pkg-config:', mlog.bold(pkgbin.get_path()),
-                         '(%s)' % out.strip())
-            else:
-                mlog.log('Found Pkg-config:', mlog.red('NO'))
-        return pkgbin
+    def check_pkgconfig(self, pkgbin):
+        if not pkgbin.found():
+            mlog.log('Did not find pkg-config by name {!r}'.format(pkgbin.name))
+            return None
+        try:
+            p, out = Popen_safe(pkgbin.get_command() + ['--version'])[0:2]
+            if p.returncode != 0:
+                mlog.warning('Found pkg-config {!r} but it failed when run'
+                             ''.format(' '.join(pkgbin.get_command())))
+                return None
+        except FileNotFoundError:
+            mlog.warning('We thought we found pkg-config {!r} but now it\'s not there. How odd!'
+                         ''.format(' '.join(pkgbin.get_command())))
+            return None
+        except PermissionError:
+            msg = 'Found pkg-config {!r} but didn\'t have permissions to run it.'.format(' '.join(pkgbin.get_command()))
+            if not mesonlib.is_windows():
+                msg += '\n\nOn Unix-like systems this is often caused by scripts that are not executable.'
+            mlog.warning(msg)
+            return None
+        return out.strip()
 
     def extract_field(self, la_file, fieldname):
         with open(la_file) as f:
@@ -851,103 +984,280 @@
     def log_tried(self):
         return self.type_name
 
-class CMakeTraceLine:
-    def __init__(self, file, line, func, args):
-        self.file = file
-        self.line = line
-        self.func = func.lower()
-        self.args = args
-
-    def __repr__(self):
-        s = 'CMake TRACE: {0}:{1} {2}({3})'
-        return s.format(self.file, self.line, self.func, self.args)
-
-class CMakeTarget:
-    def __init__(self, name, type, properies = {}):
-        self.name = name
-        self.type = type
-        self.properies = properies
-
-    def __repr__(self):
-        s = 'CMake TARGET:\n  -- name:      {}\n  -- type:      {}\n  -- properies: {{\n{}     }}'
-        propSTR = ''
-        for i in self.properies:
-            propSTR += "      '{}': {}\n".format(i, self.properies[i])
-        return s.format(self.name, self.type, propSTR)
+    def get_variable(self, *, cmake: typing.Optional[str] = None, pkgconfig: typing.Optional[str] = None,
+                     configtool: typing.Optional[str] = None, default_value: typing.Optional[str] = None,
+                     pkgconfig_define: typing.Optional[typing.List[str]] = None) -> typing.Union[str, typing.List[str]]:
+        if pkgconfig:
+            kwargs = {}
+            if default_value is not None:
+                kwargs['default'] = default_value
+            if pkgconfig_define is not None:
+                kwargs['define_variable'] = pkgconfig_define
+            try:
+                return self.get_pkgconfig_variable(pkgconfig, kwargs)
+            except DependencyException:
+                pass
+        if default_value is not None:
+            return default_value
+        raise DependencyException('Could not get pkg-config variable and no default provided for {!r}'.format(self))
 
 class CMakeDependency(ExternalDependency):
     # The class's copy of the CMake path. Avoids having to search for it
     # multiple times in the same Meson invocation.
-    class_cmakebin = None
-    class_cmakevers = None
-    # We cache all pkg-config subprocess invocations to avoid redundant calls
-    cmake_cache = {}
+    class_cmakeinfo = PerMachine(None, None)
     # Version string for the minimum CMake version
     class_cmake_version = '>=3.4'
     # CMake generators to try (empty for no generator)
     class_cmake_generators = ['', 'Ninja', 'Unix Makefiles', 'Visual Studio 10 2010']
+    class_working_generator = None
 
     def _gen_exception(self, msg):
         return DependencyException('Dependency {} not found: {}'.format(self.name, msg))
 
-    def __init__(self, name, environment, kwargs, language=None):
+    def _main_cmake_file(self) -> str:
+        return 'CMakeLists.txt'
+
+    def _extra_cmake_opts(self) -> List[str]:
+        return []
+
+    def _map_module_list(self, modules: List[Tuple[str, bool]]) -> List[Tuple[str, bool]]:
+        # Map the input module list to something else
+        # This function will only be executed AFTER the initial CMake
+        # interpreter pass has completed. Thus variables defined in the
+        # CMakeLists.txt can be accessed here.
+        return modules
+
+    def _original_module_name(self, module: str) -> str:
+        # Reverse the module mapping done by _map_module_list for
+        # one module
+        return module
+
+    def __init__(self, name: str, environment: Environment, kwargs, language=None):
         super().__init__('cmake', environment, language, kwargs)
         self.name = name
         self.is_libtool = False
         # Store a copy of the CMake path on the object itself so it is
         # stored in the pickled coredata and recovered.
         self.cmakebin = None
-        self.cmakevers = None
-
-        # Dict of CMake variables: '': ['list', 'of', 'values']
-        self.vars = {}
-
-        # Dict of CMakeTarget
-        self.targets = {}
+        self.cmakeinfo = None
+        self.traceparser = CMakeTraceParser()
 
         # Where all CMake "build dirs" are located
         self.cmake_root_dir = environment.scratch_dir
 
-        # When finding dependencies for cross-compiling, we don't care about
-        # the 'native' CMake binary
-        # TODO: Test if this works as expected
-        if self.want_cross:
-            if 'cmake' not in environment.cross_info.config['binaries']:
-                if self.required:
-                    raise self._gen_exception('CMake binary missing from cross file')
-            else:
-                potential_cmake = ExternalProgram.from_cross_info(environment.cross_info, 'cmake')
-                if potential_cmake.found():
-                    self.cmakebin = potential_cmake
-                    CMakeDependency.class_cmakebin = self.cmakebin
-                else:
-                    mlog.debug('Cross CMake %s not found.' % potential_cmake.name)
-        # Only search for the native CMake the first time and
-        # store the result in the class definition
-        elif CMakeDependency.class_cmakebin is None:
-            self.cmakebin, self.cmakevers = self.check_cmake()
-            CMakeDependency.class_cmakebin = self.cmakebin
-            CMakeDependency.class_cmakevers = self.cmakevers
-        else:
-            self.cmakebin = CMakeDependency.class_cmakebin
-            self.cmakevers = CMakeDependency.class_cmakevers
+        # List of successfully found modules
+        self.found_modules = []
 
-        if not self.cmakebin:
+        self.cmakebin = CMakeExecutor(environment, CMakeDependency.class_cmake_version, self.for_machine, silent=self.silent)
+        if not self.cmakebin.found():
+            self.cmakebin = None
+            msg = 'No CMake binary for machine %s not found. Giving up.' % self.for_machine
             if self.required:
-                raise self._gen_exception('CMake not found.')
+                raise DependencyException(msg)
+            mlog.debug(msg)
             return
 
-        modules = kwargs.get('modules', [])
-        if not isinstance(modules, list):
-            modules = [modules]
-        self._detect_dep(name, modules)
+        if CMakeDependency.class_cmakeinfo[self.for_machine] is None:
+            CMakeDependency.class_cmakeinfo[self.for_machine] = self._get_cmake_info()
+        self.cmakeinfo = CMakeDependency.class_cmakeinfo[self.for_machine]
+        if self.cmakeinfo is None:
+            raise self._gen_exception('Unable to obtain CMake system information')
+
+        modules = [(x, True) for x in stringlistify(extract_as_list(kwargs, 'modules'))]
+        modules += [(x, False) for x in stringlistify(extract_as_list(kwargs, 'optional_modules'))]
+        cm_path = stringlistify(extract_as_list(kwargs, 'cmake_module_path'))
+        cm_path = [x if os.path.isabs(x) else os.path.join(environment.get_source_dir(), x) for x in cm_path]
+        cm_args = stringlistify(extract_as_list(kwargs, 'cmake_args'))
+        if cm_path:
+            cm_args.append('-DCMAKE_MODULE_PATH=' + ';'.join(cm_path))
+
+        pref_path = self.env.coredata.builtins_per_machine[self.for_machine]['cmake_prefix_path'].value
+        if 'CMAKE_PREFIX_PATH' in os.environ:
+            env_pref_path = os.environ['CMAKE_PREFIX_PATH'].split(os.pathsep)
+            env_pref_path = [x for x in env_pref_path if x]  # Filter out empty strings
+            if not pref_path:
+                pref_path = []
+            pref_path += env_pref_path
+        if pref_path:
+            cm_args.append('-DCMAKE_PREFIX_PATH={}'.format(';'.join(pref_path)))
+
+        if not self._preliminary_find_check(name, cm_path, pref_path, environment.machines[self.for_machine]):
+            return
+        self._detect_dep(name, modules, cm_args)
 
     def __repr__(self):
         s = '<{0} {1}: {2} {3}>'
         return s.format(self.__class__.__name__, self.name, self.is_found,
                         self.version_reqs)
 
-    def _detect_dep(self, name, modules):
+    def _get_cmake_info(self):
+        mlog.debug("Extracting basic cmake information")
+        res = {}
+
+        # Try different CMake generators since specifying no generator may fail
+        # in cygwin for some reason
+        gen_list = []
+        # First try the last working generator
+        if CMakeDependency.class_working_generator is not None:
+            gen_list += [CMakeDependency.class_working_generator]
+        gen_list += CMakeDependency.class_cmake_generators
+
+        for i in gen_list:
+            mlog.debug('Try CMake generator: {}'.format(i if len(i) > 0 else 'auto'))
+
+            # Prepare options
+            cmake_opts = ['--trace-expand', '.']
+            if len(i) > 0:
+                cmake_opts = ['-G', i] + cmake_opts
+
+            # Run CMake
+            ret1, out1, err1 = self._call_cmake(cmake_opts, 'CMakePathInfo.txt')
+
+            # Current generator was successful
+            if ret1 == 0:
+                CMakeDependency.class_working_generator = i
+                break
+
+            mlog.debug('CMake failed to gather system information for generator {} with error code {}'.format(i, ret1))
+            mlog.debug('OUT:\n{}\n\n\nERR:\n{}\n\n'.format(out1, err1))
+
+        # Check if any generator succeeded
+        if ret1 != 0:
+            return None
+
+        try:
+            temp_parser = CMakeTraceParser()
+            temp_parser.parse(err1)
+        except MesonException:
+            return None
+
+        # Extract the variables and sanity check them
+        root_paths = set(temp_parser.get_cmake_var('MESON_FIND_ROOT_PATH'))
+        root_paths.update(set(temp_parser.get_cmake_var('MESON_CMAKE_SYSROOT')))
+        root_paths = sorted(root_paths)
+        root_paths = list(filter(lambda x: os.path.isdir(x), root_paths))
+        module_paths = set(temp_parser.get_cmake_var('MESON_PATHS_LIST'))
+        rooted_paths = []
+        for j in [Path(x) for x in root_paths]:
+            for i in [Path(x) for x in module_paths]:
+                rooted_paths.append(str(j / i.relative_to(i.anchor)))
+        module_paths = sorted(module_paths.union(rooted_paths))
+        module_paths = list(filter(lambda x: os.path.isdir(x), module_paths))
+        archs = temp_parser.get_cmake_var('MESON_ARCH_LIST')
+
+        common_paths = ['lib', 'lib32', 'lib64', 'libx32', 'share']
+        for i in archs:
+            common_paths += [os.path.join('lib', i)]
+
+        res = {
+            'module_paths': module_paths,
+            'cmake_root': temp_parser.get_cmake_var('MESON_CMAKE_ROOT')[0],
+            'archs': archs,
+            'common_paths': common_paths
+        }
+
+        mlog.debug('  -- Module search paths:    {}'.format(res['module_paths']))
+        mlog.debug('  -- CMake root:             {}'.format(res['cmake_root']))
+        mlog.debug('  -- CMake architectures:    {}'.format(res['archs']))
+        mlog.debug('  -- CMake lib search paths: {}'.format(res['common_paths']))
+
+        return res
+
+    @staticmethod
+    @functools.lru_cache(maxsize=None)
+    def _cached_listdir(path: str) -> Tuple[Tuple[str, str]]:
+        try:
+            return tuple((x, str(x).lower()) for x in os.listdir(path))
+        except OSError:
+            return ()
+
+    @staticmethod
+    @functools.lru_cache(maxsize=None)
+    def _cached_isdir(path: str) -> bool:
+        try:
+            return os.path.isdir(path)
+        except OSError:
+            return False
+
+    def _preliminary_find_check(self, name: str, module_path: List[str], prefix_path: List[str], machine: MachineInfo) -> bool:
+        lname = str(name).lower()
+
+        # Checks , /cmake, /CMake
+        def find_module(path: str) -> bool:
+            for i in [path, os.path.join(path, 'cmake'), os.path.join(path, 'CMake')]:
+                if not self._cached_isdir(i):
+                    continue
+
+                for j in ['Find{}.cmake', '{}Config.cmake', '{}-config.cmake']:
+                    if os.path.isfile(os.path.join(i, j.format(name))):
+                        return True
+            return False
+
+        # Search in /(lib/|lib*|share) for cmake files
+        def search_lib_dirs(path: str) -> bool:
+            for i in [os.path.join(path, x) for x in self.cmakeinfo['common_paths']]:
+                if not self._cached_isdir(i):
+                    continue
+
+                # Check /(lib/|lib*|share)/cmake/*/
+                cm_dir = os.path.join(i, 'cmake')
+                if self._cached_isdir(cm_dir):
+                    content = self._cached_listdir(cm_dir)
+                    content = list(filter(lambda x: x[1].startswith(lname), content))
+                    for k in content:
+                        if find_module(os.path.join(cm_dir, k[0])):
+                            return True
+
+                # /(lib/|lib*|share)/*/
+                # /(lib/|lib*|share)/*/(cmake|CMake)/
+                content = self._cached_listdir(i)
+                content = list(filter(lambda x: x[1].startswith(lname), content))
+                for k in content:
+                    if find_module(os.path.join(i, k[0])):
+                        return True
+
+            return False
+
+        # Check the user provided and system module paths
+        for i in module_path + [os.path.join(self.cmakeinfo['cmake_root'], 'Modules')]:
+            if find_module(i):
+                return True
+
+        # Check the user provided prefix paths
+        for i in prefix_path:
+            if search_lib_dirs(i):
+                return True
+
+        # Check the system paths
+        for i in self.cmakeinfo['module_paths']:
+            if find_module(i):
+                return True
+
+            if search_lib_dirs(i):
+                return True
+
+            content = self._cached_listdir(i)
+            content = list(filter(lambda x: x[1].startswith(lname), content))
+            for k in content:
+                if search_lib_dirs(os.path.join(i, k[0])):
+                    return True
+
+            # Mac framework support
+            if machine.is_darwin():
+                for j in ['{}.framework', '{}.app']:
+                    j = j.format(lname)
+                    if j in content:
+                        if find_module(os.path.join(i, j[0], 'Resources')) or find_module(os.path.join(i, j[0], 'Version')):
+                            return True
+
+        # Check the environment path
+        env_path = os.environ.get('{}_DIR'.format(name))
+        if env_path and find_module(env_path):
+            return True
+
+        return False
+
+    def _detect_dep(self, name: str, modules: List[Tuple[str, bool]], args: List[str]):
         # Detect a dependency with CMake using the '--find-package' mode
         # and the trace output (stderr)
         #
@@ -955,23 +1265,31 @@
         # parameters to stderr as they are executed. Since CMake 3.4.0
         # variables ("${VAR}") are also replaced in the trace output.
         mlog.debug('\nDetermining dependency {!r} with CMake executable '
-                   '{!r}'.format(name, self.cmakebin.get_path()))
+                   '{!r}'.format(name, self.cmakebin.executable_path()))
 
         # Try different CMake generators since specifying no generator may fail
         # in cygwin for some reason
-        for i in CMakeDependency.class_cmake_generators:
+        gen_list = []
+        # First try the last working generator
+        if CMakeDependency.class_working_generator is not None:
+            gen_list += [CMakeDependency.class_working_generator]
+        gen_list += CMakeDependency.class_cmake_generators
+
+        for i in gen_list:
             mlog.debug('Try CMake generator: {}'.format(i if len(i) > 0 else 'auto'))
 
             # Prepare options
-            cmake_opts = ['--trace-expand', '-DNAME={}'.format(name), '.']
+            cmake_opts = ['--trace-expand', '-DNAME={}'.format(name), '-DARCHS={}'.format(';'.join(self.cmakeinfo['archs']))] + args + ['.']
+            cmake_opts += self._extra_cmake_opts()
             if len(i) > 0:
                 cmake_opts = ['-G', i] + cmake_opts
 
             # Run CMake
-            ret1, out1, err1 = self._call_cmake(cmake_opts)
+            ret1, out1, err1 = self._call_cmake(cmake_opts, self._main_cmake_file())
 
             # Current generator was successful
             if ret1 == 0:
+                CMakeDependency.class_working_generator = i
                 break
 
             mlog.debug('CMake failed for generator {} and package {} with error code {}'.format(i, name, ret1))
@@ -982,28 +1300,9 @@
             return
 
         try:
-            # First parse the trace
-            lexer1 = self._lex_trace(err1)
-
-            # All supported functions
-            functions = {
-                'set': self._cmake_set,
-                'unset': self._cmake_unset,
-                'add_executable': self._cmake_add_executable,
-                'add_library': self._cmake_add_library,
-                'add_custom_target': self._cmake_add_custom_target,
-                'set_property': self._cmake_set_property,
-                'set_target_properties': self._cmake_set_target_properties
-            }
-
-            # Primary pass -- parse everything
-            for l in lexer1:
-                # "Execute" the CMake function if supported
-                fn = functions.get(l.func, None)
-                if(fn):
-                    fn(l)
-
-        except DependencyException as e:
+            self.traceparser.parse(err1)
+        except CMakeException as e:
+            e = self._gen_exception(str(e))
             if self.required:
                 raise
             else:
@@ -1014,58 +1313,75 @@
                 return
 
         # Whether the package is found or not is always stored in PACKAGE_FOUND
-        self.is_found = self._var_to_bool('PACKAGE_FOUND')
+        self.is_found = self.traceparser.var_to_bool('PACKAGE_FOUND')
         if not self.is_found:
             return
 
         # Try to detect the version
-        vers_raw = self.get_first_cmake_var_of(['PACKAGE_VERSION'])
+        vers_raw = self.traceparser.get_cmake_var('PACKAGE_VERSION')
 
         if len(vers_raw) > 0:
             self.version = vers_raw[0]
             self.version.strip('"\' ')
 
+        # Post-process module list. Used in derived classes to modify the
+        # module list (append prepend a string, etc.).
+        modules = self._map_module_list(modules)
+        autodetected_module_list = False
+
         # Try guessing a CMake target if none is provided
         if len(modules) == 0:
-            for i in self.targets:
+            for i in self.traceparser.targets:
                 tg = i.lower()
                 lname = name.lower()
                 if '{}::{}'.format(lname, lname) == tg or lname == tg.replace('::', ''):
                     mlog.debug('Guessed CMake target \'{}\''.format(i))
-                    modules = [i]
+                    modules = [(i, True)]
+                    autodetected_module_list = True
                     break
 
         # Failed to guess a target --> try the old-style method
         if len(modules) == 0:
-            incDirs = self.get_first_cmake_var_of(['PACKAGE_INCLUDE_DIRS'])
-            libs = self.get_first_cmake_var_of(['PACKAGE_LIBRARIES'])
+            incDirs = [x for x in self.traceparser.get_cmake_var('PACKAGE_INCLUDE_DIRS') if x]
+            defs = [x for x in self.traceparser.get_cmake_var('PACKAGE_DEFINITIONS') if x]
+            libs = [x for x in self.traceparser.get_cmake_var('PACKAGE_LIBRARIES') if x]
 
             # Try to use old style variables if no module is specified
             if len(libs) > 0:
-                self.compile_args = list(map(lambda x: '-I{}'.format(x), incDirs))
+                self.compile_args = list(map(lambda x: '-I{}'.format(x), incDirs)) + defs
                 self.link_args = libs
                 mlog.debug('using old-style CMake variables for dependency {}'.format(name))
+                mlog.debug('Include Dirs:         {}'.format(incDirs))
+                mlog.debug('Compiler Definitions: {}'.format(defs))
+                mlog.debug('Libraries:            {}'.format(libs))
                 return
 
             # Even the old-style approach failed. Nothing else we can do here
             self.is_found = False
             raise self._gen_exception('CMake: failed to guess a CMake target for {}.\n'
                                       'Try to explicitly specify one or more targets with the "modules" property.\n'
-                                      'Valid targets are:\n{}'.format(name, list(self.targets.keys())))
+                                      'Valid targets are:\n{}'.format(name, list(self.traceparser.targets.keys())))
 
         # Set dependencies with CMake targets
+        reg_is_lib = re.compile(r'^(-l[a-zA-Z0-9_]+|-pthread)$')
         processed_targets = []
         incDirs = []
         compileDefinitions = []
         compileOptions = []
         libraries = []
-        for i in modules:
-            if i not in self.targets:
-                raise self._gen_exception('CMake: invalid CMake target {} for {}.\n'
+        for i, required in modules:
+            if i not in self.traceparser.targets:
+                if not required:
+                    mlog.warning('CMake: Optional module', mlog.bold(self._original_module_name(i)), 'for', mlog.bold(name), 'was not found')
+                    continue
+                raise self._gen_exception('CMake: invalid module {} for {}.\n'
                                           'Try to explicitly specify one or more targets with the "modules" property.\n'
-                                          'Valid targets are:\n{}'.format(i, name, list(self.targets.keys())))
+                                          'Valid targets are:\n{}'.format(self._original_module_name(i), name, list(self.traceparser.targets.keys())))
 
             targets = [i]
+            if not autodetected_module_list:
+                self.found_modules += [i]
+
             while len(targets) > 0:
                 curr = targets.pop(0)
 
@@ -1073,391 +1389,113 @@
                 if curr in processed_targets:
                     continue
 
-                tgt = self.targets[curr]
+                tgt = self.traceparser.targets[curr]
                 cfgs = []
                 cfg = ''
                 otherDeps = []
                 mlog.debug(tgt)
 
-                if 'INTERFACE_INCLUDE_DIRECTORIES' in tgt.properies:
-                    incDirs += tgt.properies['INTERFACE_INCLUDE_DIRECTORIES']
+                if 'INTERFACE_INCLUDE_DIRECTORIES' in tgt.properties:
+                    incDirs += [x for x in tgt.properties['INTERFACE_INCLUDE_DIRECTORIES'] if x]
 
-                if 'INTERFACE_COMPILE_DEFINITIONS' in tgt.properies:
-                    tempDefs = list(tgt.properies['INTERFACE_COMPILE_DEFINITIONS'])
-                    tempDefs = list(map(lambda x: '-D{}'.format(re.sub('^-D', '', x)), tempDefs))
-                    compileDefinitions += tempDefs
+                if 'INTERFACE_COMPILE_DEFINITIONS' in tgt.properties:
+                    compileDefinitions += ['-D' + re.sub('^-D', '', x) for x in tgt.properties['INTERFACE_COMPILE_DEFINITIONS'] if x]
 
-                if 'INTERFACE_COMPILE_OPTIONS' in tgt.properies:
-                    compileOptions += tgt.properies['INTERFACE_COMPILE_OPTIONS']
+                if 'INTERFACE_COMPILE_OPTIONS' in tgt.properties:
+                    compileOptions += [x for x in tgt.properties['INTERFACE_COMPILE_OPTIONS'] if x]
 
-                if 'IMPORTED_CONFIGURATIONS' in tgt.properies:
-                    cfgs = tgt.properies['IMPORTED_CONFIGURATIONS']
+                if 'IMPORTED_CONFIGURATIONS' in tgt.properties:
+                    cfgs = [x for x in tgt.properties['IMPORTED_CONFIGURATIONS'] if x]
                     cfg = cfgs[0]
 
                 if 'RELEASE' in cfgs:
                     cfg = 'RELEASE'
 
-                if 'IMPORTED_LOCATION_{}'.format(cfg) in tgt.properies:
-                    libraries += tgt.properies['IMPORTED_LOCATION_{}'.format(cfg)]
-                elif 'IMPORTED_LOCATION' in tgt.properies:
-                    libraries += tgt.properies['IMPORTED_LOCATION']
-
-                if 'INTERFACE_LINK_LIBRARIES' in tgt.properies:
-                    otherDeps += tgt.properies['INTERFACE_LINK_LIBRARIES']
-
-                if 'IMPORTED_LINK_DEPENDENT_LIBRARIES_{}'.format(cfg) in tgt.properies:
-                    otherDeps += tgt.properies['IMPORTED_LINK_DEPENDENT_LIBRARIES_{}'.format(cfg)]
-                elif 'IMPORTED_LINK_DEPENDENT_LIBRARIES' in tgt.properies:
-                    otherDeps += tgt.properies['IMPORTED_LINK_DEPENDENT_LIBRARIES']
+                if 'IMPORTED_IMPLIB_{}'.format(cfg) in tgt.properties:
+                    libraries += [x for x in tgt.properties['IMPORTED_IMPLIB_{}'.format(cfg)] if x]
+                elif 'IMPORTED_IMPLIB' in tgt.properties:
+                    libraries += [x for x in tgt.properties['IMPORTED_IMPLIB'] if x]
+                elif 'IMPORTED_LOCATION_{}'.format(cfg) in tgt.properties:
+                    libraries += [x for x in tgt.properties['IMPORTED_LOCATION_{}'.format(cfg)] if x]
+                elif 'IMPORTED_LOCATION' in tgt.properties:
+                    libraries += [x for x in tgt.properties['IMPORTED_LOCATION'] if x]
+
+                if 'INTERFACE_LINK_LIBRARIES' in tgt.properties:
+                    otherDeps += [x for x in tgt.properties['INTERFACE_LINK_LIBRARIES'] if x]
+
+                if 'IMPORTED_LINK_DEPENDENT_LIBRARIES_{}'.format(cfg) in tgt.properties:
+                    otherDeps += [x for x in tgt.properties['IMPORTED_LINK_DEPENDENT_LIBRARIES_{}'.format(cfg)] if x]
+                elif 'IMPORTED_LINK_DEPENDENT_LIBRARIES' in tgt.properties:
+                    otherDeps += [x for x in tgt.properties['IMPORTED_LINK_DEPENDENT_LIBRARIES'] if x]
 
                 for j in otherDeps:
-                    if j in self.targets:
+                    if j in self.traceparser.targets:
                         targets += [j]
+                    elif reg_is_lib.match(j) or os.path.exists(j):
+                        libraries += [j]
 
                 processed_targets += [curr]
 
         # Make sure all elements in the lists are unique and sorted
-        incDirs = list(sorted(list(set(incDirs))))
-        compileDefinitions = list(sorted(list(set(compileDefinitions))))
-        compileOptions = list(sorted(list(set(compileOptions))))
-        libraries = list(sorted(list(set(libraries))))
+        incDirs = sorted(set(incDirs))
+        compileDefinitions = sorted(set(compileDefinitions))
+        compileOptions = sorted(set(compileOptions))
+        libraries = sorted(set(libraries))
 
         mlog.debug('Include Dirs:         {}'.format(incDirs))
         mlog.debug('Compiler Definitions: {}'.format(compileDefinitions))
         mlog.debug('Compiler Options:     {}'.format(compileOptions))
         mlog.debug('Libraries:            {}'.format(libraries))
 
-        self.compile_args = compileOptions + compileDefinitions + list(map(lambda x: '-I{}'.format(x), incDirs))
+        self.compile_args = compileOptions + compileDefinitions + ['-I{}'.format(x) for x in incDirs]
         self.link_args = libraries
 
-    def get_first_cmake_var_of(self, var_list):
-        # Return the first found CMake variable in list var_list
-        for i in var_list:
-            if i in self.vars:
-                return self.vars[i]
-
-        return []
-
-    def get_cmake_var(self, var):
-        # Return the value of the CMake variable var or an empty list if var does not exist
-        for var in self.vars:
-            return self.vars[var]
-
-        return []
-
-    def _var_to_bool(self, var):
-        if var not in self.vars:
-            return False
-
-        if len(self.vars[var]) < 1:
-            return False
-
-        if self.vars[var][0].upper() in ['1', 'ON', 'TRUE']:
-            return True
-        return False
-
-    def _cmake_set(self, tline: CMakeTraceLine):
-        # DOC: https://cmake.org/cmake/help/latest/command/set.html
-
-        # 1st remove PARENT_SCOPE and CACHE from args
-        args = []
-        for i in tline.args:
-            if i == 'PARENT_SCOPE' or len(i) == 0:
-                continue
-
-            # Discard everything after the CACHE keyword
-            if i == 'CACHE':
-                break
-
-            args.append(i)
-
-        if len(args) < 1:
-            raise self._gen_exception('CMake: set() requires at least one argument\n{}'.format(tline))
-
-        if len(args) == 1:
-            # Same as unset
-            if args[0] in self.vars:
-                del self.vars[args[0]]
-        else:
-            values = list(itertools.chain(*map(lambda x: x.split(';'), args[1:])))
-            self.vars[args[0]] = values
-
-    def _cmake_unset(self, tline: CMakeTraceLine):
-        # DOC: https://cmake.org/cmake/help/latest/command/unset.html
-        if len(tline.args) < 1:
-            raise self._gen_exception('CMake: unset() requires at least one argument\n{}'.format(tline))
-
-        if tline.args[0] in self.vars:
-            del self.vars[tline.args[0]]
-
-    def _cmake_add_executable(self, tline: CMakeTraceLine):
-        # DOC: https://cmake.org/cmake/help/latest/command/add_executable.html
-        args = list(tline.args) # Make a working copy
-
-        # Make sure the exe is imported
-        if 'IMPORTED' not in args:
-            raise self._gen_exception('CMake: add_executable() non imported executables are not supported\n{}'.format(tline))
-
-        args.remove('IMPORTED')
-
-        if len(args) < 1:
-            raise self._gen_exception('CMake: add_executable() requires at least 1 argument\n{}'.format(tline))
-
-        self.targets[args[0]] = CMakeTarget(args[0], 'EXECUTABLE', {})
-
-    def _cmake_add_library(self, tline: CMakeTraceLine):
-        # DOC: https://cmake.org/cmake/help/latest/command/add_library.html
-        args = list(tline.args) # Make a working copy
-
-        # Make sure the lib is imported
-        if 'IMPORTED' not in args:
-            raise self._gen_exception('CMake: add_library() non imported libraries are not supported\n{}'.format(tline))
-
-        args.remove('IMPORTED')
-
-        # No only look at the first two arguments (target_name and target_type) and ignore the rest
-        if len(args) < 2:
-            raise self._gen_exception('CMake: add_library() requires at least 2 arguments\n{}'.format(tline))
-
-        self.targets[args[0]] = CMakeTarget(args[0], args[1], {})
-
-    def _cmake_add_custom_target(self, tline: CMakeTraceLine):
-        # DOC: https://cmake.org/cmake/help/latest/command/add_custom_target.html
-        # We only the first parameter (the target name) is interesting
-        if len(tline.args) < 1:
-            raise self._gen_exception('CMake: add_custom_target() requires at least one argument\n{}'.format(tline))
-
-        self.targets[tline.args[0]] = CMakeTarget(tline.args[0], 'CUSTOM', {})
-
-    def _cmake_set_property(self, tline: CMakeTraceLine):
-        # DOC: https://cmake.org/cmake/help/latest/command/set_property.html
-        args = list(tline.args)
-
-        # We only care for TARGET properties
-        if args.pop(0) != 'TARGET':
-            return
-
-        append = False
-        targets = []
-        while len(args) > 0:
-            curr = args.pop(0)
-            if curr == 'APPEND' or curr == 'APPEND_STRING':
-                append = True
-                continue
-
-            if curr == 'PROPERTY':
-                break
-
-            targets.append(curr)
-
-        if len(args) == 1:
-            # Tries to set property to nothing so nothing has to be done
-            return
-
-        if len(args) < 2:
-            raise self._gen_exception('CMake: set_property() faild to parse argument list\n{}'.format(tline))
-
-        propName = args[0]
-        propVal = list(itertools.chain(*map(lambda x: x.split(';'), args[1:])))
-        propVal = list(filter(lambda x: len(x) > 0, propVal))
-
-        if len(propVal) == 0:
-            return
-
-        for i in targets:
-            if i not in self.targets:
-                raise self._gen_exception('CMake: set_property() TARGET {} not found\n{}'.format(i, tline))
-
-            if propName not in self.targets[i].properies:
-                self.targets[i].properies[propName] = []
-
-            if append:
-                self.targets[i].properies[propName] += propVal
-            else:
-                self.targets[i].properies[propName] = propVal
-
-    def _cmake_set_target_properties(self, tline: CMakeTraceLine):
-        # DOC: https://cmake.org/cmake/help/latest/command/set_target_properties.html
-        args = list(tline.args)
-
-        targets = []
-        while len(args) > 0:
-            curr = args.pop(0)
-            if curr == 'PROPERTIES':
-                break
-
-            targets.append(curr)
-
-        if (len(args) % 2) != 0:
-            raise self._gen_exception('CMake: set_target_properties() uneven number of property arguments\n{}'.format(tline))
-
-        while len(args) > 0:
-            propName = args.pop(0)
-            propVal = args.pop(0).split(';')
-            propVal = list(filter(lambda x: len(x) > 0, propVal))
-
-            if len(propVal) == 0:
-                continue
-
-            for i in targets:
-                if i not in self.targets:
-                    raise self._gen_exception('CMake: set_target_properties() TARGET {} not found\n{}'.format(i, tline))
-
-                self.targets[i].properies[propName] = propVal
-
-    def _lex_trace(self, trace):
-        # The trace format is: '():  ( )\n'
-        reg_tline = re.compile(r'\s*(.*\.(cmake|txt))\(([0-9]+)\):\s*(\w+)\(([\s\S]*?) ?\)\s*\n', re.MULTILINE)
-        reg_other = re.compile(r'[^\n]*\n')
-        reg_genexp = re.compile(r'\$<.*>')
-        loc = 0
-        while loc < len(trace):
-            mo_file_line = reg_tline.match(trace, loc)
-            if not mo_file_line:
-                skip_match = reg_other.match(trace, loc)
-                if not skip_match:
-                    print(trace[loc:])
-                    raise self._gen_exception('Failed to parse CMake trace')
-
-                loc = skip_match.end()
-                continue
-
-            loc = mo_file_line.end()
-
-            file = mo_file_line.group(1)
-            line = mo_file_line.group(3)
-            func = mo_file_line.group(4)
-            args = mo_file_line.group(5).split(' ')
-            args = list(map(lambda x: x.strip(), args))
-            args = list(map(lambda x: reg_genexp.sub('', x), args)) # Remove generator expressions
-
-            yield CMakeTraceLine(file, line, func, args)
-
-    def _reset_cmake_cache(self, build_dir):
-        with open('{}/CMakeCache.txt'.format(build_dir), 'w') as fp:
-            fp.write('CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1\n')
-
-    def _setup_compiler(self, build_dir):
-        comp_dir = '{}/CMakeFiles/{}'.format(build_dir, self.cmakevers)
-        os.makedirs(comp_dir, exist_ok=True)
-
-        c_comp = '{}/CMakeCCompiler.cmake'.format(comp_dir)
-        cxx_comp = '{}/CMakeCXXCompiler.cmake'.format(comp_dir)
-
-        if not os.path.exists(c_comp):
-            with open(c_comp, 'w') as fp:
-                fp.write('''# Fake CMake file to skip the boring and slow stuff
-set(CMAKE_C_COMPILER "{}") # Just give CMake a valid full path to any file
-set(CMAKE_C_COMPILER_ID "GNU") # Pretend we have found GCC
-set(CMAKE_COMPILER_IS_GNUCC 1)
-set(CMAKE_C_COMPILER_LOADED 1)
-set(CMAKE_C_COMPILER_WORKS TRUE)
-set(CMAKE_C_ABI_COMPILED TRUE)
-set(CMAKE_SIZEOF_VOID_P "{}")
-'''.format(os.path.realpath(__file__), ctypes.sizeof(ctypes.c_voidp)))
-
-        if not os.path.exists(cxx_comp):
-            with open(cxx_comp, 'w') as fp:
-                fp.write('''# Fake CMake file to skip the boring and slow stuff
-set(CMAKE_CXX_COMPILER "{}") # Just give CMake a valid full path to any file
-set(CMAKE_CXX_COMPILER_ID "GNU") # Pretend we have found GCC
-set(CMAKE_COMPILER_IS_GNUCXX 1)
-set(CMAKE_CXX_COMPILER_LOADED 1)
-set(CMAKE_CXX_COMPILER_WORKS TRUE)
-set(CMAKE_CXX_ABI_COMPILED TRUE)
-set(CMAKE_SIZEOF_VOID_P "{}")
-'''.format(os.path.realpath(__file__), ctypes.sizeof(ctypes.c_voidp)))
-
-    def _setup_cmake_dir(self):
+    def _setup_cmake_dir(self, cmake_file: str) -> str:
         # Setup the CMake build environment and return the "build" directory
-        build_dir = '{}/cmake_{}'.format(self.cmake_root_dir, self.name)
-        os.makedirs(build_dir, exist_ok=True)
+        build_dir = Path(self.cmake_root_dir) / 'cmake_{}'.format(self.name)
+        build_dir.mkdir(parents=True, exist_ok=True)
 
         # Copy the CMakeLists.txt
-        cmake_lists = '{}/CMakeLists.txt'.format(build_dir)
-        if not os.path.exists(cmake_lists):
-            dir_path = os.path.dirname(os.path.realpath(__file__))
-            src_cmake = '{}/data/CMakeLists.txt'.format(dir_path)
-            shutil.copyfile(src_cmake, cmake_lists)
-
-        self._setup_compiler(build_dir)
-        self._reset_cmake_cache(build_dir)
-        return build_dir
-
-    def _call_cmake_real(self, args, env):
-        build_dir = self._setup_cmake_dir()
-        cmd = self.cmakebin.get_command() + args
-        p, out, err = Popen_safe(cmd, env=env, cwd=build_dir)
-        rc = p.returncode
-        call = ' '.join(cmd)
-        mlog.debug("Called `{}` in {} -> {}".format(call, build_dir, rc))
+        src_cmake = Path(__file__).parent / 'data' / cmake_file
+        shutil.copyfile(str(src_cmake), str(build_dir / 'CMakeLists.txt'))  # str() is for Python 3.5
 
-        return rc, out, err
-
-    def _call_cmake(self, args, env=None):
-        if env is None:
-            fenv = env
-            env = os.environ
-        else:
-            fenv = frozenset(env.items())
-        targs = tuple(args)
+        return str(build_dir)
 
-        # First check if cached, if not call the real cmake function
-        cache = CMakeDependency.cmake_cache
-        if (self.cmakebin, targs, fenv) not in cache:
-            cache[(self.cmakebin, targs, fenv)] = self._call_cmake_real(args, env)
-        return cache[(self.cmakebin, targs, fenv)]
+    def _call_cmake(self, args, cmake_file: str, env=None):
+        build_dir = self._setup_cmake_dir(cmake_file)
+        return self.cmakebin.call_with_fake_build(args, build_dir, env=env)
 
     @staticmethod
     def get_methods():
         return [DependencyMethods.CMAKE]
 
-    def check_cmake(self):
-        evar = 'CMAKE'
-        if evar in os.environ:
-            cmakebin = os.environ[evar].strip()
-        else:
-            cmakebin = 'cmake'
-        cmakebin = ExternalProgram(cmakebin, silent=True)
-        cmvers = None
-        invalid_version = False
-        if cmakebin.found():
-            try:
-                p, out = Popen_safe(cmakebin.get_command() + ['--version'])[0:2]
-                if p.returncode != 0:
-                    mlog.warning('Found CMake {!r} but couldn\'t run it'
-                                 ''.format(' '.join(cmakebin.get_command())))
-                    # Set to False instead of None to signify that we've already
-                    # searched for it and not found it
-                    cmakebin = False
-            except (FileNotFoundError, PermissionError):
-                cmakebin = False
-
-            cmvers = re.sub(r'\s*cmake version\s*', '', out.split('\n')[0]).strip()
-            if not version_compare(cmvers, CMakeDependency.class_cmake_version):
-                invalid_version = True
-        else:
-            cmakebin = False
-        if not self.silent:
-            if cmakebin and invalid_version:
-                mlog.log('Found CMake:', mlog.red('NO'), '(version of', mlog.bold(cmakebin.get_path()),
-                         'is', mlog.bold(cmvers), 'but version', mlog.bold(CMakeDependency.class_cmake_version),
-                         'is required)')
-            elif cmakebin:
-                mlog.log('Found CMake:', mlog.bold(cmakebin.get_path()),
-                         '(%s)' % cmvers)
-            else:
-                mlog.log('Found CMake:', mlog.red('NO'))
-
-        if invalid_version:
-            cmakebin = False
-            cmvers = None
-
-        return cmakebin, cmvers
-
     def log_tried(self):
         return self.type_name
 
+    def log_details(self) -> str:
+        modules = [self._original_module_name(x) for x in self.found_modules]
+        modules = sorted(set(modules))
+        if modules:
+            return 'modules: ' + ', '.join(modules)
+        return ''
+
+    def get_variable(self, *, cmake: typing.Optional[str] = None, pkgconfig: typing.Optional[str] = None,
+                     configtool: typing.Optional[str] = None, default_value: typing.Optional[str] = None,
+                     pkgconfig_define: typing.Optional[typing.List[str]] = None) -> typing.Union[str, typing.List[str]]:
+        if cmake:
+            try:
+                v = self.traceparser.vars[cmake]
+            except KeyError:
+                pass
+            else:
+                if len(v) == 1:
+                    return v[0]
+                elif v:
+                    return v
+        if default_value is not None:
+            return default_value
+        raise DependencyException('Could not get cmake variable and no default provided for {!r}'.format(self))
+
 class DubDependency(ExternalDependency):
     class_dubbin = None
 
@@ -1505,7 +1543,7 @@
 
                 not_lib = True
                 if 'targetType' in package:
-                    if package['targetType'] == 'library':
+                    if package['targetType'] in ['library', 'sourceLibrary', 'staticLibrary', 'dynamicLibrary']:
                         not_lib = False
 
                 if not_lib:
@@ -1556,7 +1594,7 @@
                 for lib in target['buildSettings'][field_name]:
                     if lib not in libs:
                         libs.append(lib)
-                        if os.name is not 'nt':
+                        if os.name != 'nt':
                             pkgdep = PkgConfigDependency(lib, environment, {'required': 'true', 'silent': 'true'})
                             for arg in pkgdep.get_compile_args():
                                 self.compile_args.append(arg)
@@ -1607,9 +1645,9 @@
             return ''
 
         # Ex.: library-debug-linux.posix-x86_64-ldc_2081-EF934983A3319F8F8FF2F0E107A363BA
-        build_name = 'library-{}-{}-{}-{}_{}'.format(description['buildType'], '.'.join(description['platform']), '.'.join(description['architecture']), comp, d_ver)
+        build_name = '-{}-{}-{}-{}_{}'.format(description['buildType'], '.'.join(description['platform']), '.'.join(description['architecture']), comp, d_ver)
         for entry in os.listdir(module_build_path):
-            if entry.startswith(build_name):
+            if build_name in entry:
                 for file in os.listdir(os.path.join(module_build_path, entry)):
                     if file == lib_file_name:
                         if folder_only:
@@ -1655,8 +1693,11 @@
 
 class ExternalProgram:
     windows_exts = ('exe', 'msc', 'com', 'bat', 'cmd')
+    # An 'ExternalProgram' always runs on the build machine
+    for_machine = MachineChoice.BUILD
 
-    def __init__(self, name, command=None, silent=False, search_dir=None):
+    def __init__(self, name: str, command: typing.Optional[typing.List[str]] = None,
+                 silent: bool = False, search_dir: typing.Optional[str] = None):
         self.name = name
         if command is not None:
             self.command = listify(command)
@@ -1680,22 +1721,23 @@
             else:
                 mlog.log('Program', mlog.bold(name), 'found:', mlog.red('NO'))
 
-    def __repr__(self):
+    def __repr__(self) -> str:
         r = '<{} {!r} -> {!r}>'
         return r.format(self.__class__.__name__, self.name, self.command)
 
-    def description(self):
+    def description(self) -> str:
         '''Human friendly description of the command'''
         return ' '.join(self.command)
 
-    @staticmethod
-    def from_bin_list(bins, name):
-        if name not in bins:
+    @classmethod
+    def from_bin_list(cls, bt: BinaryTable, name):
+        command = bt.lookup_entry(name)
+        if command is None:
             return NonExistingExternalProgram()
-        command = bins[name]
-        if not isinstance(command, (list, str)):
-            raise MesonException('Invalid type {!r} for binary {!r} in cross file'
-                                 ''.format(command, name))
+        return cls.from_entry(name, command)
+
+    @staticmethod
+    def from_entry(name, command):
         if isinstance(command, list):
             if len(command) == 1:
                 command = command[0]
@@ -1703,6 +1745,7 @@
         # need to search if the path is an absolute path.
         if isinstance(command, list) or os.path.isabs(command):
             return ExternalProgram(name, command=command, silent=True)
+        assert isinstance(command, str)
         # Search for the command using the specified string!
         return ExternalProgram(command, silent=True)
 
@@ -1741,6 +1784,12 @@
                     # We know what python3 is, we're running on it
                     if len(commands) > 0 and commands[0] == 'python3':
                         commands = mesonlib.python_command + commands[1:]
+                else:
+                    # Replace python3 with the actual python3 that we are using
+                    if commands[0] == '/usr/bin/env' and commands[1] == 'python3':
+                        commands = mesonlib.python_command + commands[2:]
+                    elif commands[0].split('/')[-1] == 'python3':
+                        commands = mesonlib.python_command + commands[1:]
                 return commands + [script]
         except Exception as e:
             mlog.debug(e)
@@ -1835,7 +1884,7 @@
         # all executables whether in PATH or with an absolute path
         return [command]
 
-    def found(self):
+    def found(self) -> bool:
         return self.command[0] is not None
 
     def get_command(self):
@@ -1913,8 +1962,9 @@
             return []
         return super().get_link_args(**kwargs)
 
-    def get_partial_dependency(self, *, compile_args=False, link_args=False,
-                               links=False, includes=False, sources=False):
+    def get_partial_dependency(self, *, compile_args: bool = False,
+                               link_args: bool = False, links: bool = False,
+                               includes: bool = False, sources: bool = False):
         # External library only has link_args, so ignore the rest of the
         # interface.
         new = copy.copy(self)
@@ -1924,57 +1974,116 @@
 
 
 class ExtraFrameworkDependency(ExternalDependency):
-    def __init__(self, name, required, path, env, lang, kwargs):
+    system_framework_paths = None
+
+    def __init__(self, name, required, paths, env, lang, kwargs):
         super().__init__('extraframeworks', env, lang, kwargs)
         self.name = name
         self.required = required
-        self.detect(name, path)
-        if self.found():
-            self.compile_args = ['-I' + os.path.join(self.path, self.name, 'Headers')]
-            self.link_args = ['-F' + self.path, '-framework', self.name.split('.')[0]]
-
-    def detect(self, name, path):
-        # should use the compiler to look for frameworks, rather than peering at
-        # the filesystem, so we can also find them when cross-compiling
-        if self.want_cross:
+        # Full path to framework directory
+        self.framework_path = None
+        if not self.clib_compiler:
+            raise DependencyException('No C-like compilers are available')
+        if self.system_framework_paths is None:
+            try:
+                self.system_framework_paths = self.clib_compiler.find_framework_paths(self.env)
+            except MesonException as e:
+                if 'non-clang' in str(e):
+                    # Apple frameworks can only be found (and used) with the
+                    # system compiler. It is not available so bail immediately.
+                    self.is_found = False
+                    return
+                raise
+        self.detect(name, paths)
+
+    def detect(self, name, paths):
+        if not paths:
+            paths = self.system_framework_paths
+        for p in paths:
+            mlog.debug('Looking for framework {} in {}'.format(name, p))
+            # We need to know the exact framework path because it's used by the
+            # Qt5 dependency class, and for setting the include path. We also
+            # want to avoid searching in an invalid framework path which wastes
+            # time and can cause a false positive.
+            framework_path = self._get_framework_path(p, name)
+            if framework_path is None:
+                continue
+            # We want to prefer the specified paths (in order) over the system
+            # paths since these are "extra" frameworks.
+            # For example, Python2's framework is in /System/Library/Frameworks and
+            # Python3's framework is in /Library/Frameworks, but both are called
+            # Python.framework. We need to know for sure that the framework was
+            # found in the path we expect.
+            allow_system = p in self.system_framework_paths
+            args = self.clib_compiler.find_framework(name, self.env, [p], allow_system)
+            if args is None:
+                continue
+            self.link_args = args
+            self.framework_path = framework_path.as_posix()
+            self.compile_args = ['-F' + self.framework_path]
+            # We need to also add -I includes to the framework because all
+            # cross-platform projects such as OpenGL, Python, Qt, GStreamer,
+            # etc do not use "framework includes":
+            # https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPFrameworks/Tasks/IncludingFrameworks.html
+            incdir = self._get_framework_include_path(framework_path)
+            if incdir:
+                self.compile_args += ['-I' + incdir]
+            self.is_found = True
             return
 
+    def _get_framework_path(self, path, name):
+        p = Path(path)
         lname = name.lower()
-        if path is None:
-            paths = ['/System/Library/Frameworks', '/Library/Frameworks']
-        else:
-            paths = [path]
-        for p in paths:
-            for d in os.listdir(p):
-                fullpath = os.path.join(p, d)
-                if lname != d.rsplit('.', 1)[0].lower():
-                    continue
-                if not stat.S_ISDIR(os.stat(fullpath).st_mode):
-                    continue
-                self.path = p
-                self.name = d
-                self.is_found = True
-                return
+        for d in p.glob('*.framework/'):
+            if lname == d.name.rsplit('.', 1)[0].lower():
+                return d
+        return None
+
+    def _get_framework_latest_version(self, path):
+        versions = []
+        for each in path.glob('Versions/*'):
+            # macOS filesystems are usually case-insensitive
+            if each.name.lower() == 'current':
+                continue
+            versions.append(Version(each.name))
+        if len(versions) == 0:
+            # most system frameworks do not have a 'Versions' directory
+            return 'Headers'
+        return 'Versions/{}/Headers'.format(sorted(versions)[-1]._s)
+
+    def _get_framework_include_path(self, path):
+        # According to the spec, 'Headers' must always be a symlink to the
+        # Headers directory inside the currently-selected version of the
+        # framework, but sometimes frameworks are broken. Look in 'Versions'
+        # for the currently-selected version or pick the latest one.
+        trials = ('Headers', 'Versions/Current/Headers',
+                  self._get_framework_latest_version(path))
+        for each in trials:
+            trial = path / each
+            if trial.is_dir():
+                return trial.as_posix()
+        return None
+
+    @staticmethod
+    def get_methods():
+        return [DependencyMethods.EXTRAFRAMEWORK]
 
     def log_info(self):
-        return os.path.join(self.path, self.name)
+        return self.framework_path
 
     def log_tried(self):
         return 'framework'
 
 
-def get_dep_identifier(name, kwargs, want_cross):
-    # Need immutable objects since the identifier will be used as a dict key
-    version_reqs = listify(kwargs.get('version', []))
-    if isinstance(version_reqs, list):
-        version_reqs = frozenset(version_reqs)
-    identifier = (name, version_reqs, want_cross)
+def get_dep_identifier(name, kwargs) -> Tuple:
+    identifier = (name, )
     for key, value in kwargs.items():
-        # 'version' is embedded above as the second element for easy access
-        # 'native' is handled above with `want_cross`
+        # 'version' is irrelevant for caching; the caller must check version matches
+        # 'native' is handled above with `for_machine`
         # 'required' is irrelevant for caching; the caller handles it separately
         # 'fallback' subprojects cannot be cached -- they must be initialized
-        if key in ('version', 'native', 'required', 'fallback',):
+        # 'default_options' is only used in fallback case
+        if key in ('version', 'native', 'required', 'fallback', 'default_options'):
             continue
         # All keyword arguments are strings, ints, or lists (or lists of lists)
         if isinstance(value, list):
@@ -1987,8 +2096,10 @@
     'dub': 'DUB',
     'gmock': 'GMock',
     'gtest': 'GTest',
+    'hdf5': 'HDF5',
     'llvm': 'LLVM',
     'mpi': 'MPI',
+    'netcdf': 'NetCDF',
     'openmp': 'OpenMP',
     'wxwidgets': 'WxWidgets',
 }
@@ -2009,12 +2120,9 @@
     # display the dependency name with correct casing
     display_name = display_name_map.get(lname, lname)
 
-    # if this isn't a cross-build, it's uninteresting if native: is used or not
-    if not env.is_cross_build():
-        type_text = 'Dependency'
-    else:
-        type_text = 'Native' if kwargs.get('native', False) else 'Cross'
-        type_text += ' dependency'
+    for_machine = MachineChoice.BUILD if kwargs.get('native', False) else MachineChoice.HOST
+
+    type_text = PerMachine('Build-time', 'Run-time')[for_machine] + ' dependency'
 
     # build a list of dependency methods to try
     candidates = _build_external_dependency_list(name, env, kwargs)
@@ -2029,7 +2137,7 @@
             d = c()
             d._check_version()
             pkgdep.append(d)
-        except Exception as e:
+        except DependencyException as e:
             pkg_exc.append(e)
             mlog.debug(str(e))
         else:
@@ -2071,7 +2179,7 @@
         # if an exception occurred with the first detection method, re-raise it
         # (on the grounds that it came from the preferred dependency detection
         # method)
-        if pkg_exc[0]:
+        if pkg_exc and pkg_exc[0]:
             raise pkg_exc[0]
 
         # we have a list of failed ExternalDependency objects, so we can report
@@ -2079,15 +2187,10 @@
         raise DependencyException('Dependency "%s" not found' % (name) +
                                   (', tried %s' % (tried) if tried else ''))
 
-    # return the last failed dependency object
-    if pkgdep:
-        return pkgdep[-1]
-
-    # this should never happen
-    raise DependencyException('Dependency "%s" not found, but no dependency object to return' % (name))
+    return NotFoundDependency(env)
 
 
-def _build_external_dependency_list(name, env, kwargs):
+def _build_external_dependency_list(name, env: Environment, kwargs: Dict[str, Any]) -> list:
     # First check if the method is valid
     if 'method' in kwargs and kwargs['method'] not in [e.value for e in DependencyMethods]:
         raise DependencyException('method {!r} is invalid'.format(kwargs['method']))
@@ -2121,6 +2224,14 @@
         candidates.append(functools.partial(CMakeDependency, name, env, kwargs))
         return candidates
 
+    # If it's explicitly requested, use the Extraframework detection method (only)
+    if 'extraframework' == kwargs.get('method', ''):
+        # On OSX, also try framework dependency detector
+        if mesonlib.is_osx():
+            candidates.append(functools.partial(ExtraFrameworkDependency, name,
+                                                False, None, env, None, kwargs))
+        return candidates
+
     # Otherwise, just use the pkgconfig and cmake dependency detector
     if 'auto' == kwargs.get('method', 'auto'):
         candidates.append(functools.partial(PkgConfigDependency, name, env, kwargs))
@@ -2134,12 +2245,12 @@
     return candidates
 
 
-def strip_system_libdirs(environment, link_args):
+def strip_system_libdirs(environment, for_machine: MachineChoice, link_args):
     """Remove -L arguments.
 
     leaving these in will break builds where a user has a version of a library
     in the system path, and a different version not in the system path if they
     want to link against the non-system path version.
     """
-    exclude = {'-L{}'.format(p) for p in environment.get_compiler_system_dirs()}
+    exclude = {'-L{}'.format(p) for p in environment.get_compiler_system_dirs(for_machine)}
     return [l for l in link_args if l not in exclude]
diff -Nru meson-0.49.0/mesonbuild/dependencies/boost.py meson-0.52.1/mesonbuild/dependencies/boost.py
--- meson-0.49.0/mesonbuild/dependencies/boost.py	2018-12-09 14:27:16.000000000 +0000
+++ meson-0.52.1/mesonbuild/dependencies/boost.py	2019-08-28 17:15:39.000000000 +0000
@@ -22,6 +22,7 @@
 from ..environment import detect_cpu_family
 
 from .base import (DependencyException, ExternalDependency)
+from .misc import ThreadDependency
 
 # On windows 3 directory layouts are supported:
 # * The default layout (versioned) installed:
@@ -103,6 +104,8 @@
         self.is_multithreading = threading == "multi"
 
         self.requested_modules = self.get_requested(kwargs)
+        if 'thread' in self.requested_modules:
+            self._add_sub_dependency(ThreadDependency, environment, kwargs)
 
         self.boost_root = None
         self.boost_roots = []
@@ -120,33 +123,42 @@
             self.libdir = os.environ['BOOST_LIBRARYDIR']
 
         if self.boost_root is None:
-            if mesonlib.for_windows(self.want_cross, self.env):
+            if self.env.machines[self.for_machine].is_windows():
                 self.boost_roots = self.detect_win_roots()
             else:
                 self.boost_roots = self.detect_nix_roots()
 
         if self.incdir is None:
-            if mesonlib.for_windows(self.want_cross, self.env):
+            if self.env.machines[self.for_machine].is_windows():
                 self.incdir = self.detect_win_incdir()
             else:
                 self.incdir = self.detect_nix_incdir()
 
-        if self.check_invalid_modules():
-            return
-
         mlog.debug('Boost library root dir is', mlog.bold(self.boost_root))
         mlog.debug('Boost include directory is', mlog.bold(self.incdir))
 
         # 1. check if we can find BOOST headers.
         self.detect_headers_and_version()
 
+        if not self.is_found:
+            return # if we can not find 'boost/version.hpp'
+
         # 2. check if we can find BOOST libraries.
-        if self.is_found:
-            self.detect_lib_modules()
-            mlog.debug('Boost library directory is', mlog.bold(self.libdir))
+        self.detect_lib_modules()
+        mlog.debug('Boost library directory is', mlog.bold(self.libdir))
+
+        mlog.debug('Installed Boost libraries: ')
+        for key in sorted(self.lib_modules.keys()):
+            mlog.debug(key, self.lib_modules[key])
+
+        # 3. check if requested modules are valid, that is, either found or in the list of known boost libraries
+        self.check_invalid_modules()
+
+        # 4. final check whether or not we find all requested and valid modules
+        self.check_find_requested_modules()
 
     def check_invalid_modules(self):
-        invalid_modules = [c for c in self.requested_modules if 'boost_' + c not in BOOST_LIBS]
+        invalid_modules = [c for c in self.requested_modules if 'boost_' + c not in self.lib_modules and 'boost_' + c not in BOOST_LIBS]
 
         # previous versions of meson allowed include dirs as modules
         remove = []
@@ -206,7 +218,7 @@
         for root in self.boost_roots:
             globtext = os.path.join(root, 'include', 'boost-*')
             incdirs = glob.glob(globtext)
-            if len(incdirs) > 0:
+            if incdirs:
                 return incdirs[0]
             incboostdir = os.path.join(root, 'include', 'boost')
             if os.path.isdir(incboostdir):
@@ -247,7 +259,7 @@
 
     def detect_headers_and_version(self):
         try:
-            version = self.clib_compiler.get_define('BOOST_LIB_VERSION', '#include ', self.env, self.get_compile_args(), [])
+            version = self.clib_compiler.get_define('BOOST_LIB_VERSION', '#include ', self.env, self.get_compile_args(), [], disable_cache=True)[0]
         except mesonlib.EnvironmentException:
             return
         except TypeError:
@@ -265,11 +277,12 @@
             pass
         # 2. Fall back to the old method
         else:
-            if mesonlib.for_windows(self.want_cross, self.env):
+            if self.env.machines[self.for_machine].is_windows():
                 self.detect_lib_modules_win()
             else:
                 self.detect_lib_modules_nix()
 
+    def check_find_requested_modules(self):
         # 3. Check if we can find the modules
         for m in self.requested_modules:
             if 'boost_' + m not in self.lib_modules:
@@ -286,8 +299,8 @@
 
     def compiler_tag(self):
         tag = None
-        compiler = self.env.detect_cpp_compiler(self.want_cross)
-        if mesonlib.for_windows(self.want_cross, self.env):
+        compiler = self.env.detect_cpp_compiler(self.for_machine)
+        if self.env.machines[self.for_machine].is_windows():
             if compiler.get_id() in ['msvc', 'clang-cl']:
                 comp_ts_version = compiler.get_toolset_version()
                 compiler_ts = comp_ts_version.split('.')
@@ -301,10 +314,10 @@
         if not self.is_multithreading:
             return ''
 
-        if mesonlib.for_darwin(self.want_cross, self.env):
+        if self.env.machines[self.for_machine].is_darwin():
             # - Mac:      requires -mt for multithreading, so should not fall back to non-mt libraries.
             return '-mt'
-        elif mesonlib.for_windows(self.want_cross, self.env):
+        elif self.env.machines[self.for_machine].is_windows():
             # - Windows:  requires -mt for multithreading, so should not fall back to non-mt libraries.
             return '-mt'
         else:
@@ -320,12 +333,12 @@
 
     def arch_tag(self):
         # currently only applies to windows msvc installed binaries
-        if self.env.detect_cpp_compiler(self.want_cross).get_id() not in ['msvc', 'clang-cl']:
+        if self.env.detect_cpp_compiler(self.for_machine).get_id() not in ['msvc', 'clang-cl']:
             return ''
         # pre-compiled binaries only added arch tag for versions > 1.64
         if float(self.version) < 1.65:
             return ''
-        arch = detect_cpu_family(self.env.coredata.compilers)
+        arch = detect_cpu_family(self.env.coredata.compilers.host)
         if arch == 'x86':
             return '-x32'
         elif arch == 'x86_64':
@@ -337,16 +350,16 @@
 
     # FIXME - how to handle different distributions, e.g. for Mac? Currently we handle homebrew and macports, but not fink.
     def abi_tags(self):
-        if mesonlib.for_windows(self.want_cross, self.env):
+        if self.env.machines[self.for_machine].is_windows():
             return [self.versioned_abi_tag(), self.threading_tag()]
         else:
             return [self.threading_tag()]
 
     def sourceforge_dir(self):
-        if self.env.detect_cpp_compiler(self.want_cross).get_id() != 'msvc':
+        if self.env.detect_cpp_compiler(self.for_machine).get_id() != 'msvc':
             return None
-        comp_ts_version = self.env.detect_cpp_compiler(self.want_cross).get_toolset_version()
-        arch = detect_cpu_family(self.env.coredata.compilers)
+        comp_ts_version = self.env.detect_cpp_compiler(self.for_machine).get_toolset_version()
+        arch = detect_cpu_family(self.env.coredata.compilers.host)
         if arch == 'x86':
             return 'lib32-msvc-{}'.format(comp_ts_version)
         elif arch == 'x86_64':
@@ -424,7 +437,7 @@
         for entry in globber2_matches:
             fname = os.path.basename(entry)
             self.lib_modules[self.modname_from_filename(fname)] = [fname]
-        if len(globber2_matches) == 0:
+        if not globber2_matches:
             # FIXME - why are we only looking for *.lib? Mingw provides *.dll.a and *.a
             for entry in glob.glob(os.path.join(self.libdir, globber1 + '.lib')):
                 if self.static:
@@ -434,7 +447,7 @@
     def detect_lib_modules_nix(self):
         if self.static:
             libsuffix = 'a'
-        elif mesonlib.for_darwin(self.want_cross, self.env):
+        elif self.env.machines[self.for_machine].is_darwin():
             libsuffix = 'dylib'
         else:
             libsuffix = 'so'
@@ -488,10 +501,6 @@
     def get_sources(self):
         return []
 
-    def need_threads(self):
-        return 'thread' in self.requested_modules
-
-
 # Generated with boost_names.py
 BOOST_LIBS = [
     'boost_atomic',
@@ -547,10 +556,6 @@
     'boost_math_c99l',
     'boost_mpi',
     'boost_program_options',
-    'boost_python',
-    'boost_python3',
-    'boost_numpy',
-    'boost_numpy3',
     'boost_random',
     'boost_regex',
     'boost_serialization',
diff -Nru meson-0.49.0/mesonbuild/dependencies/data/CMakeListsLLVM.txt meson-0.52.1/mesonbuild/dependencies/data/CMakeListsLLVM.txt
--- meson-0.49.0/mesonbuild/dependencies/data/CMakeListsLLVM.txt	1970-01-01 00:00:00.000000000 +0000
+++ meson-0.52.1/mesonbuild/dependencies/data/CMakeListsLLVM.txt	2019-05-05 19:11:16.000000000 +0000
@@ -0,0 +1,95 @@
+cmake_minimum_required(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} )
+
+set(PACKAGE_FOUND FALSE)
+
+while(TRUE)
+  find_package(LLVM REQUIRED CONFIG QUIET)
+
+  # ARCHS has to be set via the CMD interface
+  if(LLVM_FOUND OR "${ARCHS}" STREQUAL "")
+    break()
+  endif()
+
+  list(GET       ARCHS 0 CMAKE_LIBRARY_ARCHITECTURE)
+  list(REMOVE_AT ARCHS 0)
+endwhile()
+
+if(LLVM_FOUND)
+  set(PACKAGE_FOUND TRUE)
+
+  foreach(mod IN LISTS LLVM_MESON_MODULES)
+    # Reset variables
+    set(out_mods)
+    set(real_mods)
+
+    # Generate a lower and upper case version
+    string(TOLOWER "${mod}" mod_L)
+    string(TOUPPER "${mod}" mod_U)
+
+    # Get the mapped components
+    llvm_map_components_to_libnames(out_mods ${mod} ${mod_L} ${mod_U})
+    list(SORT              out_mods)
+    list(REMOVE_DUPLICATES out_mods)
+
+    # Make sure that the modules exist
+    foreach(i IN LISTS out_mods)
+      if(TARGET ${i})
+        list(APPEND real_mods ${i})
+      endif()
+    endforeach()
+
+    # Set the output variables
+    set(MESON_LLVM_TARGETS_${mod} ${real_mods})
+    foreach(i IN LISTS real_mods)
+      set(MESON_TARGET_TO_LLVM_${i} ${mod})
+    endforeach()
+  endforeach()
+
+  # Check the following variables:
+  # LLVM_PACKAGE_VERSION
+  # LLVM_VERSION
+  # LLVM_VERSION_STRING
+  if(NOT DEFINED PACKAGE_VERSION)
+    if(DEFINED LLVM_PACKAGE_VERSION)
+      set(PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}")
+    elseif(DEFINED LLVM_VERSION)
+      set(PACKAGE_VERSION "${LLVM_VERSION}")
+    elseif(DEFINED LLVM_VERSION_STRING)
+      set(PACKAGE_VERSION "${LLVM_VERSION_STRING}")
+    endif()
+  endif()
+
+  # Check the following variables:
+  # LLVM_LIBRARIES
+  # LLVM_LIBS
+  set(libs)
+  if(DEFINED LLVM_LIBRARIES)
+    set(libs LLVM_LIBRARIES)
+  elseif(DEFINED LLVM_LIBS)
+    set(libs LLVM_LIBS)
+  endif()
+
+  # Check the following variables:
+  # LLVM_INCLUDE_DIRS
+  # LLVM_INCLUDES
+  # LLVM_INCLUDE_DIR
+  set(includes)
+  if(DEFINED LLVM_INCLUDE_DIRS)
+    set(includes LLVM_INCLUDE_DIRS)
+  elseif(DEFINED LLVM_INCLUDES)
+    set(includes LLVM_INCLUDES)
+  elseif(DEFINED LLVM_INCLUDE_DIR)
+    set(includes LLVM_INCLUDE_DIR)
+  endif()
+
+  # Check the following variables:
+  # LLVM_DEFINITIONS
+  set(definitions)
+  if(DEFINED LLVM_DEFINITIONS)
+    set(definitions LLVM_DEFINITIONS)
+  endif()
+
+  set(PACKAGE_INCLUDE_DIRS "${${includes}}")
+  set(PACKAGE_DEFINITIONS  "${${definitions}}")
+  set(PACKAGE_LIBRARIES    "${${libs}}")
+endif()
diff -Nru meson-0.49.0/mesonbuild/dependencies/data/CMakeLists.txt meson-0.52.1/mesonbuild/dependencies/data/CMakeLists.txt
--- meson-0.49.0/mesonbuild/dependencies/data/CMakeLists.txt	2018-12-09 14:27:23.000000000 +0000
+++ meson-0.52.1/mesonbuild/dependencies/data/CMakeLists.txt	2019-02-28 20:43:18.000000000 +0000
@@ -1,24 +1,21 @@
 cmake_minimum_required(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} )
 
-# Inspired by CMakeDetermineCompilerABI.cmake to set CMAKE_LIBRARY_ARCHITECTURE
-if(CMAKE_LIBRARY_ARCHITECTURE_REGEX)
-  if(NOT DEFINED CMAKE_LIBRARY_ARCHITECTURE)
-    file(GLOB implicit_dirs RELATIVE /lib /lib/*-linux-gnu* )
-    foreach(dir ${implicit_dirs})
-      if("${dir}" MATCHES "${CMAKE_LIBRARY_ARCHITECTURE_REGEX}")
-        set(CMAKE_LIBRARY_ARCHITECTURE "${dir}")
-        break()
-      endif()
-    endforeach()
-  endif()
-endif()
-
-find_package("${NAME}" QUIET)
-
 set(PACKAGE_FOUND FALSE)
 set(_packageName "${NAME}")
 string(TOUPPER "${_packageName}" PACKAGE_NAME)
 
+while(TRUE)
+  find_package("${NAME}" QUIET)
+
+  # ARCHS has to be set via the CMD interface
+  if(${_packageName}_FOUND OR ${PACKAGE_NAME}_FOUND OR "${ARCHS}" STREQUAL "")
+    break()
+  endif()
+
+  list(GET       ARCHS 0 CMAKE_LIBRARY_ARCHITECTURE)
+  list(REMOVE_AT ARCHS 0)
+endwhile()
+
 if(${_packageName}_FOUND  OR  ${PACKAGE_NAME}_FOUND)
   set(PACKAGE_FOUND TRUE)
 
diff -Nru meson-0.49.0/mesonbuild/dependencies/data/CMakePathInfo.txt meson-0.52.1/mesonbuild/dependencies/data/CMakePathInfo.txt
--- meson-0.49.0/mesonbuild/dependencies/data/CMakePathInfo.txt	1970-01-01 00:00:00.000000000 +0000
+++ meson-0.52.1/mesonbuild/dependencies/data/CMakePathInfo.txt	2019-08-28 17:15:39.000000000 +0000
@@ -0,0 +1,31 @@
+cmake_minimum_required(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION})
+
+set(TMP_PATHS_LIST)
+list(APPEND TMP_PATHS_LIST ${CMAKE_PREFIX_PATH})
+list(APPEND TMP_PATHS_LIST ${CMAKE_FRAMEWORK_PATH})
+list(APPEND TMP_PATHS_LIST ${CMAKE_APPBUNDLE_PATH})
+list(APPEND TMP_PATHS_LIST $ENV{CMAKE_PREFIX_PATH})
+list(APPEND TMP_PATHS_LIST $ENV{CMAKE_FRAMEWORK_PATH})
+list(APPEND TMP_PATHS_LIST $ENV{CMAKE_APPBUNDLE_PATH})
+list(APPEND TMP_PATHS_LIST ${CMAKE_SYSTEM_PREFIX_PATH})
+list(APPEND TMP_PATHS_LIST ${CMAKE_SYSTEM_FRAMEWORK_PATH})
+list(APPEND TMP_PATHS_LIST ${CMAKE_SYSTEM_APPBUNDLE_PATH})
+
+set(LIB_ARCH_LIST)
+if(CMAKE_LIBRARY_ARCHITECTURE_REGEX)
+  file(GLOB implicit_dirs RELATIVE /lib /lib/*-linux-gnu* )
+  foreach(dir ${implicit_dirs})
+    if("${dir}" MATCHES "${CMAKE_LIBRARY_ARCHITECTURE_REGEX}")
+      list(APPEND LIB_ARCH_LIST "${dir}")
+    endif()
+  endforeach()
+endif()
+
+# "Export" these variables:
+set(MESON_ARCH_LIST ${LIB_ARCH_LIST})
+set(MESON_PATHS_LIST ${TMP_PATHS_LIST})
+set(MESON_CMAKE_ROOT ${CMAKE_ROOT})
+set(MESON_CMAKE_SYSROOT ${CMAKE_SYSROOT})
+set(MESON_FIND_ROOT_PATH ${CMAKE_FIND_ROOT_PATH})
+
+message(STATUS ${TMP_PATHS_LIST})
diff -Nru meson-0.49.0/mesonbuild/dependencies/dev.py meson-0.52.1/mesonbuild/dependencies/dev.py
--- meson-0.49.0/mesonbuild/dependencies/dev.py	2018-10-31 20:53:35.000000000 +0000
+++ meson-0.52.1/mesonbuild/dependencies/dev.py	2019-11-28 17:37:44.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright 2013-2017 The Meson development team
+# Copyright 2013-2019 The Meson development team
 
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -20,21 +20,26 @@
 import os
 import re
 
-from .. import mesonlib
-from ..mesonlib import version_compare, stringlistify, extract_as_list
+from .. import mesonlib, mlog
+from ..mesonlib import version_compare, stringlistify, extract_as_list, MachineChoice
+from ..environment import get_llvm_tool_names
 from .base import (
     DependencyException, DependencyMethods, ExternalDependency, PkgConfigDependency,
-    strip_system_libdirs, ConfigToolDependency,
+    strip_system_libdirs, ConfigToolDependency, CMakeDependency, HasNativeKwarg
 )
+from .misc import ThreadDependency
 
+from typing import List, Tuple
 
-def get_shared_library_suffix(environment, native):
+
+def get_shared_library_suffix(environment, for_machine: MachineChoice):
     """This is only gauranteed to work for languages that compile to machine
     code, not for languages like C# that use a bytecode and always end in .dll
     """
-    if mesonlib.for_windows(native, environment):
+    m = environment.machines[for_machine]
+    if m.is_windows():
         return '.dll'
-    elif mesonlib.for_darwin(native, environment):
+    elif m.is_darwin():
         return '.dylib'
     return '.so'
 
@@ -45,6 +50,7 @@
         self.main = kwargs.get('main', False)
         self.src_dirs = ['/usr/src/gtest/src', '/usr/src/googletest/googletest/src']
         self.detect()
+        self._add_sub_dependency(ThreadDependency, environment, kwargs)
 
     def detect(self):
         gtest_detect = self.clib_compiler.find_library("gtest", self.env, [])
@@ -83,9 +89,6 @@
                 return True
         return False
 
-    def need_threads(self):
-        return True
-
     def log_info(self):
         if self.prebuilt:
             return 'prebuilt'
@@ -118,6 +121,7 @@
     def __init__(self, environment, kwargs):
         super().__init__('gmock', environment, 'cpp', kwargs)
         self.main = kwargs.get('main', False)
+        self._add_sub_dependency(ThreadDependency, environment, kwargs)
 
         # If we are getting main() from GMock, we definitely
         # want to avoid linking in main() from GTest
@@ -132,10 +136,7 @@
         if not gtest_dep.is_found:
             self.is_found = False
             return
-
-        self.compile_args = gtest_dep.compile_args
-        self.link_args = gtest_dep.link_args
-        self.sources = gtest_dep.sources
+        self.ext_deps.append(gtest_dep)
 
         # GMock may be a library or just source.
         # Work with both.
@@ -167,9 +168,6 @@
 
         self.is_found = False
 
-    def need_threads(self):
-        return True
-
     def log_info(self):
         if self.prebuilt:
             return 'prebuilt'
@@ -198,35 +196,30 @@
         return [DependencyMethods.PKGCONFIG, DependencyMethods.SYSTEM]
 
 
-class LLVMDependency(ConfigToolDependency):
+class LLVMDependencyConfigTool(ConfigToolDependency):
     """
     LLVM uses a special tool, llvm-config, which has arguments for getting
     c args, cxx args, and ldargs as well as version.
     """
-
-    # Ordered list of llvm-config binaries to try. Start with base, then try
-    # newest back to oldest (3.5 is arbitrary), and finally the devel version.
-    # Please note that llvm-config-6.0 is a development snapshot and it should
-    # not be moved to the beginning of the list. The only difference between
-    # llvm-config-8 and llvm-config-devel is that the former is used by
-    # Debian and the latter is used by FreeBSD.
-    tools = [
-        'llvm-config', # base
-        'llvm-config-7',   'llvm-config70',
-        'llvm-config-6.0', 'llvm-config60',
-        'llvm-config-5.0', 'llvm-config50',
-        'llvm-config-4.0', 'llvm-config40',
-        'llvm-config-3.9', 'llvm-config39',
-        'llvm-config-3.8', 'llvm-config38',
-        'llvm-config-3.7', 'llvm-config37',
-        'llvm-config-3.6', 'llvm-config36',
-        'llvm-config-3.5', 'llvm-config35',
-        'llvm-config-8',   'llvm-config-devel', # development snapshot
-    ]
     tool_name = 'llvm-config'
     __cpp_blacklist = {'-DNDEBUG'}
 
     def __init__(self, environment, kwargs):
+        # Already called by `super().__init__`, but need `self.for_machine`
+        # before `super().__init__` is called.
+        HasNativeKwarg.__init__(self, kwargs)
+
+        self.tools = get_llvm_tool_names('llvm-config')
+
+        # Fedora starting with Fedora 30 adds a suffix of the number
+        # of bits in the isa that llvm targets, for example, on x86_64
+        # and aarch64 the name will be llvm-config-64, on x86 and arm
+        # it will be llvm-config-32.
+        if environment.machines[self.for_machine].is_64_bit:
+            self.tools.append('llvm-config-64')
+        else:
+            self.tools.append('llvm-config-32')
+
         # It's necessary for LLVM <= 3.8 to use the C++ linker. For 3.9 and 4.0
         # the C linker works fine if only using the C API.
         super().__init__('LLVM', environment, 'cpp', kwargs)
@@ -250,22 +243,29 @@
             self._set_new_link_args(environment)
         else:
             self._set_old_link_args()
-        self.link_args = strip_system_libdirs(environment, self.link_args)
+        self.link_args = strip_system_libdirs(environment, self.for_machine, self.link_args)
         self.link_args = self.__fix_bogus_link_args(self.link_args)
+        self._add_sub_dependency(ThreadDependency, environment, kwargs)
 
-    @staticmethod
-    def __fix_bogus_link_args(args):
+    def __fix_bogus_link_args(self, args):
         """This function attempts to fix bogus link arguments that llvm-config
         generates.
 
         Currently it works around the following:
             - FreeBSD: when statically linking -l/usr/lib/libexecinfo.so will
               be generated, strip the -l in cases like this.
+            - Windows: We may get -LIBPATH:... which is later interpreted as
+              "-L IBPATH:...", if we're using an msvc like compilers convert
+              that to "/LIBPATH", otherwise to "-L ..."
         """
+        cpp = self.env.coredata.compilers[self.for_machine]['cpp']
+
         new_args = []
         for arg in args:
             if arg.startswith('-l') and arg.endswith('.so'):
                 new_args.append(arg.lstrip('-l'))
+            elif arg.startswith('-LIBPATH:'):
+                new_args.extend(cpp.get_linker_search_args(arg.lstrip('-LIBPATH:')))
             else:
                 new_args.append(arg)
         return new_args
@@ -303,7 +303,7 @@
             try:
                 self.__check_libfiles(True)
             except DependencyException:
-                lib_ext = get_shared_library_suffix(environment, self.native)
+                lib_ext = get_shared_library_suffix(environment, self.for_machine)
                 libdir = self.get_config_value(['--libdir'], 'link_args')[0]
                 # Sort for reproducability
                 matches = sorted(glob.iglob(os.path.join(libdir, 'libLLVM*{}'.format(lib_ext))))
@@ -389,14 +389,71 @@
 
             self.module_details.append(mod + status)
 
-    def need_threads(self):
-        return True
-
     def log_details(self):
         if self.module_details:
             return 'modules: ' + ', '.join(self.module_details)
         return ''
 
+class LLVMDependencyCMake(CMakeDependency):
+    def __init__(self, env, kwargs):
+        self.llvm_modules = stringlistify(extract_as_list(kwargs, 'modules'))
+        self.llvm_opt_modules = stringlistify(extract_as_list(kwargs, 'optional_modules'))
+        super().__init__(name='LLVM', environment=env, language='cpp', kwargs=kwargs)
+
+        # Extract extra include directories and definitions
+        inc_dirs = self.traceparser.get_cmake_var('PACKAGE_INCLUDE_DIRS')
+        defs = self.traceparser.get_cmake_var('PACKAGE_DEFINITIONS')
+        temp = ['-I' + x for x in inc_dirs] + defs
+        self.compile_args += [x for x in temp if x not in self.compile_args]
+        self._add_sub_dependency(ThreadDependency, env, kwargs)
+
+    def _main_cmake_file(self) -> str:
+        # Use a custom CMakeLists.txt for LLVM
+        return 'CMakeListsLLVM.txt'
+
+    def _extra_cmake_opts(self) -> List[str]:
+        return ['-DLLVM_MESON_MODULES={}'.format(';'.join(self.llvm_modules + self.llvm_opt_modules))]
+
+    def _map_module_list(self, modules: List[Tuple[str, bool]]) -> List[Tuple[str, bool]]:
+        res = []
+        for mod, required in modules:
+            cm_targets = self.traceparser.get_cmake_var('MESON_LLVM_TARGETS_{}'.format(mod))
+            if not cm_targets:
+                if required:
+                    raise self._gen_exception('LLVM module {} was not found'.format(mod))
+                else:
+                    mlog.warning('Optional LLVM module', mlog.bold(mod), 'was not found')
+                    continue
+            for i in cm_targets:
+                res += [(i, required)]
+        return res
+
+    def _original_module_name(self, module: str) -> str:
+        orig_name = self.traceparser.get_cmake_var('MESON_TARGET_TO_LLVM_{}'.format(module))
+        if orig_name:
+            return orig_name[0]
+        return module
+
+class LLVMDependency(ExternalDependency):
+    def __init__(self, env, kwargs):
+        super().__init__('LLVM', env, 'cpp', kwargs)
+
+    @classmethod
+    def _factory(cls, env, kwargs):
+        methods = cls._process_method_kw(kwargs)
+        candidates = []
+
+        if DependencyMethods.CONFIG_TOOL in methods:
+            candidates.append(functools.partial(LLVMDependencyConfigTool, env, kwargs))
+
+        if DependencyMethods.CMAKE in methods:
+            candidates.append(functools.partial(LLVMDependencyCMake, env, kwargs))
+
+        return candidates
+
+    @staticmethod
+    def get_methods():
+        return [DependencyMethods.CMAKE, DependencyMethods.CONFIG_TOOL]
 
 class ValgrindDependency(PkgConfigDependency):
     '''
diff -Nru meson-0.49.0/mesonbuild/dependencies/__init__.py meson-0.52.1/mesonbuild/dependencies/__init__.py
--- meson-0.49.0/mesonbuild/dependencies/__init__.py	2018-12-09 14:27:23.000000000 +0000
+++ meson-0.52.1/mesonbuild/dependencies/__init__.py	2019-11-28 17:37:44.000000000 +0000
@@ -18,7 +18,7 @@
     ExternalDependency, NotFoundDependency, ExternalLibrary, ExtraFrameworkDependency, InternalDependency,
     PkgConfigDependency, CMakeDependency, find_external_dependency, get_dep_identifier, packages, _packages_accept_language)
 from .dev import GMockDependency, GTestDependency, LLVMDependency, ValgrindDependency
-from .misc import (MPIDependency, OpenMPDependency, Python3Dependency, ThreadDependency, PcapDependency, CupsDependency, LibWmfDependency, LibGCryptDependency)
+from .misc import (BlocksDependency, CoarrayDependency, HDF5Dependency, MPIDependency, NetCDFDependency, OpenMPDependency, Python3Dependency, ThreadDependency, PcapDependency, CupsDependency, LibWmfDependency, LibGCryptDependency, GpgmeDependency, ShadercDependency)
 from .platform import AppleFrameworks
 from .ui import GLDependency, GnuStepDependency, Qt4Dependency, Qt5Dependency, SDL2Dependency, WxDependency, VulkanDependency
 
@@ -31,8 +31,12 @@
     'valgrind': ValgrindDependency,
 
     # From misc:
+    'blocks': BlocksDependency,
     'boost': BoostDependency,
+    'coarray': CoarrayDependency,
     'mpi': MPIDependency,
+    'hdf5': HDF5Dependency,
+    'netcdf': NetCDFDependency,
     'openmp': OpenMPDependency,
     'python3': Python3Dependency,
     'threads': ThreadDependency,
@@ -40,6 +44,8 @@
     'cups': CupsDependency,
     'libwmf': LibWmfDependency,
     'libgcrypt': LibGCryptDependency,
+    'gpgme': GpgmeDependency,
+    'shaderc': ShadercDependency,
 
     # From platform:
     'appleframeworks': AppleFrameworks,
@@ -54,6 +60,8 @@
     'vulkan': VulkanDependency,
 })
 _packages_accept_language.update({
+    'hdf5',
     'mpi',
+    'netcdf',
     'openmp',
 })
diff -Nru meson-0.49.0/mesonbuild/dependencies/misc.py meson-0.52.1/mesonbuild/dependencies/misc.py
--- meson-0.49.0/mesonbuild/dependencies/misc.py	2018-12-09 14:27:23.000000000 +0000
+++ meson-0.52.1/mesonbuild/dependencies/misc.py	2019-11-28 17:37:44.000000000 +0000
@@ -14,16 +14,15 @@
 
 # This file contains the detection logic for miscellaneous external dependencies.
 
+from pathlib import Path
 import functools
 import os
 import re
-import shlex
 import sysconfig
 
-from pathlib import Path
-
 from .. import mlog
 from .. import mesonlib
+from ..mesonlib import split_args
 from ..environment import detect_cpu_family
 
 from .base import (
@@ -33,6 +32,125 @@
 )
 
 
+class CoarrayDependency(ExternalDependency):
+    """
+    Coarrays are a Fortran 2008 feature.
+
+    Coarrays are sometimes implemented via external library (GCC+OpenCoarrays),
+    while other compilers just build in support (Cray, IBM, Intel, NAG).
+    Coarrays may be thought of as a high-level language abstraction of
+    low-level MPI calls.
+    """
+    def __init__(self, environment, kwargs):
+        super().__init__('coarray', environment, 'fortran', kwargs)
+        kwargs['required'] = False
+        kwargs['silent'] = True
+        self.is_found = False
+
+        cid = self.get_compiler().get_id()
+        if cid == 'gcc':
+            """ OpenCoarrays is the most commonly used method for Fortran Coarray with GCC """
+            self.is_found = True
+            kwargs['modules'] = 'OpenCoarrays::caf_mpi'
+            cmakedep = CMakeDependency('OpenCoarrays', environment, kwargs)
+            if not cmakedep.found():
+                self.compile_args = ['-fcoarray=single']
+                self.version = 'single image'
+                return
+
+            self.compile_args = cmakedep.get_compile_args()
+            self.link_args = cmakedep.get_link_args()
+            self.version = cmakedep.get_version()
+        elif cid == 'intel':
+            """ Coarrays are built into Intel compilers, no external library needed """
+            self.is_found = True
+            self.link_args = ['-coarray=shared']
+            self.compile_args = self.link_args
+        elif cid == 'intel-cl':
+            """ Coarrays are built into Intel compilers, no external library needed """
+            self.is_found = True
+            self.compile_args = ['/Qcoarray:shared']
+        elif cid == 'nagfor':
+            """ NAG doesn't require any special arguments for Coarray """
+            self.is_found = True
+
+
+class HDF5Dependency(ExternalDependency):
+
+    def __init__(self, environment, kwargs):
+        language = kwargs.get('language', 'c')
+        super().__init__('hdf5', environment, language, kwargs)
+        kwargs['required'] = False
+        kwargs['silent'] = True
+        self.is_found = False
+
+        pkgconfig_files = ['hdf5']
+
+        if language not in ('c', 'cpp', 'fortran'):
+            raise DependencyException('Language {} is not supported with HDF5.'.format(language))
+
+        for pkg in pkgconfig_files:
+            try:
+                pkgdep = PkgConfigDependency(pkg, environment, kwargs, language=self.language)
+                if pkgdep.found():
+                    self.compile_args = pkgdep.get_compile_args()
+                    # derive needed libraries by language
+                    pd_link_args = pkgdep.get_link_args()
+                    link_args = []
+                    for larg in pd_link_args:
+                        lpath = Path(larg)
+                        if lpath.is_file():
+                            if language == 'cpp':
+                                link_args.append(str(lpath.parent / (lpath.stem + '_hl_cpp' + lpath.suffix)))
+                                link_args.append(str(lpath.parent / (lpath.stem + '_cpp' + lpath.suffix)))
+                            elif language == 'fortran':
+                                link_args.append(str(lpath.parent / (lpath.stem + 'hl_fortran' + lpath.suffix)))
+                                link_args.append(str(lpath.parent / (lpath.stem + '_fortran' + lpath.suffix)))
+
+                            # HDF5 C libs are required by other HDF5 languages
+                            link_args.append(str(lpath.parent / (lpath.stem + '_hl' + lpath.suffix)))
+                            link_args.append(larg)
+                        else:
+                            link_args.append(larg)
+
+                    self.link_args = link_args
+                    self.version = pkgdep.get_version()
+                    self.is_found = True
+                    self.pcdep = pkgdep
+                    break
+            except Exception:
+                pass
+
+
+class NetCDFDependency(ExternalDependency):
+
+    def __init__(self, environment, kwargs):
+        language = kwargs.get('language', 'c')
+        super().__init__('netcdf', environment, language, kwargs)
+        kwargs['required'] = False
+        kwargs['silent'] = True
+        self.is_found = False
+
+        pkgconfig_files = ['netcdf']
+
+        if language not in ('c', 'cpp', 'fortran'):
+            raise DependencyException('Language {} is not supported with NetCDF.'.format(language))
+
+        if language == 'fortran':
+            pkgconfig_files.append('netcdf-fortran')
+
+        self.compile_args = []
+        self.link_args = []
+        self.pcdep = []
+        for pkg in pkgconfig_files:
+            pkgdep = PkgConfigDependency(pkg, environment, kwargs, language=self.language)
+            if pkgdep.found():
+                self.compile_args.extend(pkgdep.get_compile_args())
+                self.link_args.extend(pkgdep.get_link_args())
+                self.version = pkgdep.get_version()
+                self.is_found = True
+                self.pcdep.append(pkgdep)
+
 class MPIDependency(ExternalDependency):
 
     def __init__(self, environment, kwargs):
@@ -98,6 +216,9 @@
                     break
 
         if not self.is_found and mesonlib.is_windows():
+            # only Intel Fortran compiler is compatible with Microsoft MPI at this time.
+            if language == 'fortran' and environment.detect_fortran_compiler(self.for_machine).name_string() != 'intel-cl':
+                return
             result = self._try_msmpi()
             if result is not None:
                 self.is_found = True
@@ -111,7 +232,7 @@
         result = []
         multi_args = ('-I', )
         if self.language == 'fortran':
-            fc = self.env.coredata.compilers['fortran']
+            fc = self.env.coredata.compilers[self.for_machine]['fortran']
             multi_args += fc.get_module_incdir_args()
 
         include_next = False
@@ -156,7 +277,7 @@
                 mlog.debug(mlog.bold('Standard output\n'), o)
                 mlog.debug(mlog.bold('Standard error\n'), e)
                 return
-            cargs = shlex.split(o)
+            cargs = split_args(o)
 
             cmd = prog.get_command() + ['--showme:link']
             p, o, e = mesonlib.Popen_safe(cmd)
@@ -166,7 +287,7 @@
                 mlog.debug(mlog.bold('Standard output\n'), o)
                 mlog.debug(mlog.bold('Standard error\n'), e)
                 return
-            libs = shlex.split(o)
+            libs = split_args(o)
 
             cmd = prog.get_command() + ['--showme:version']
             p, o, e = mesonlib.Popen_safe(cmd)
@@ -176,7 +297,7 @@
                 mlog.debug(mlog.bold('Standard output\n'), o)
                 mlog.debug(mlog.bold('Standard error\n'), e)
                 return
-            version = re.search('\d+.\d+.\d+', o)
+            version = re.search(r'\d+.\d+.\d+', o)
             if version:
                 version = version.group(0)
             else:
@@ -195,7 +316,7 @@
                 mlog.debug(mlog.bold('Standard output\n'), o)
                 mlog.debug(mlog.bold('Standard error\n'), e)
                 return
-            args = shlex.split(o)
+            args = split_args(o)
 
             version = None
 
@@ -208,7 +329,7 @@
         if 'MSMPI_INC' not in os.environ:
             return
         incdir = os.environ['MSMPI_INC']
-        arch = detect_cpu_family(self.env.coredata.compilers)
+        arch = detect_cpu_family(self.env.coredata.compilers.host)
         if arch == 'x86':
             if 'MSMPI_LIB32' not in os.environ:
                 return
@@ -249,39 +370,86 @@
         language = kwargs.get('language')
         super().__init__('openmp', environment, language, kwargs)
         self.is_found = False
+        if self.clib_compiler.get_id() == 'pgi':
+            # through at least PGI 19.4, there is no macro defined for OpenMP, but OpenMP 3.1 is supported.
+            self.version = '3.1'
+            self.is_found = True
+            self.compile_args = self.link_args = self.clib_compiler.openmp_flags()
+            return
         try:
-            openmp_date = self.clib_compiler.get_define('_OPENMP', '', self.env, [], [self])
+            openmp_date = self.clib_compiler.get_define(
+                '_OPENMP', '', self.env, self.clib_compiler.openmp_flags(), [self], disable_cache=True)[0]
         except mesonlib.EnvironmentException as e:
             mlog.debug('OpenMP support not available in the compiler')
             mlog.debug(e)
-            openmp_date = False
+            openmp_date = None
 
         if openmp_date:
             self.version = self.VERSIONS[openmp_date]
-            if self.clib_compiler.has_header('omp.h', '', self.env, dependencies=[self]):
-                self.is_found = True
-            else:
+            # Flang has omp_lib.h
+            header_names = ('omp.h', 'omp_lib.h')
+            for name in header_names:
+                if self.clib_compiler.has_header(name, '', self.env, dependencies=[self], disable_cache=True)[0]:
+                    self.is_found = True
+                    self.compile_args = self.link_args = self.clib_compiler.openmp_flags()
+                    break
+            if not self.is_found:
                 mlog.log(mlog.yellow('WARNING:'), 'OpenMP found but omp.h missing.')
 
-    def need_openmp(self):
-        return True
-
 
 class ThreadDependency(ExternalDependency):
     def __init__(self, environment, kwargs):
         super().__init__('threads', environment, None, kwargs)
         self.name = 'threads'
         self.is_found = True
+        # Happens if you are using a language with threads
+        # concept without C, such as plain Cuda.
+        if self.clib_compiler is None:
+            self.compile_args = []
+            self.link_args = []
+        else:
+            self.compile_args = self.clib_compiler.thread_flags(environment)
+            self.link_args = self.clib_compiler.thread_link_flags(environment)
+
+
+class BlocksDependency(ExternalDependency):
+    def __init__(self, environment, kwargs):
+        super().__init__('blocks', environment, None, kwargs)
+        self.name = 'blocks'
+        self.is_found = False
 
-    def need_threads(self):
-        return True
+        if self.env.machines[self.for_machine].is_darwin():
+            self.compile_args = []
+            self.link_args = []
+        else:
+            self.compile_args = ['-fblocks']
+            self.link_args = ['-lBlocksRuntime']
+
+            if not self.clib_compiler.has_header('Block.h', '', environment, disable_cache=True) or \
+               not self.clib_compiler.find_library('BlocksRuntime', environment, []):
+                mlog.log(mlog.red('ERROR:'), 'BlocksRuntime not found.')
+                return
+
+        source = '''
+            int main(int argc, char **argv)
+            {
+                int (^callback)(void) = ^ int (void) { return 0; };
+                return callback();
+            }'''
+
+        with self.clib_compiler.compile(source, extra_args=self.compile_args + self.link_args) as p:
+            if p.returncode != 0:
+                mlog.log(mlog.red('ERROR:'), 'Compiler does not support blocks extension.')
+                return
+
+            self.is_found = True
 
 
 class Python3Dependency(ExternalDependency):
     def __init__(self, environment, kwargs):
         super().__init__('python3', environment, None, kwargs)
 
-        if self.want_cross:
+        if not environment.machines.matches_build_machine(self.for_machine):
             return
 
         self.name = 'python3'
@@ -307,7 +475,7 @@
             # There is a python in /System/Library/Frameworks, but that's
             # python 2, Python 3 will always be in /Library
             candidates.append(functools.partial(
-                ExtraFrameworkDependency, 'python', False, '/Library/Frameworks',
+                ExtraFrameworkDependency, 'Python', False, ['/Library/Frameworks'],
                 environment, kwargs.get('language', None), kwargs))
 
         return candidates
@@ -337,10 +505,14 @@
         if pyplat.startswith('win'):
             vernum = sysconfig.get_config_var('py_version_nodot')
             if self.static:
-                libname = 'libpython{}.a'.format(vernum)
+                libpath = Path('libs') / 'libpython{}.a'.format(vernum)
             else:
-                libname = 'python{}.lib'.format(vernum)
-            lib = Path(sysconfig.get_config_var('base')) / 'libs' / libname
+                comp = self.get_compiler()
+                if comp.id == "gcc":
+                    libpath = 'python{}.dll'.format(vernum)
+                else:
+                    libpath = Path('libs') / 'python{}.lib'.format(vernum)
+            lib = Path(sysconfig.get_config_var('base')) / libpath
         elif pyplat == 'mingw':
             if self.static:
                 libname = sysconfig.get_config_var('LIBRARY')
@@ -361,7 +533,7 @@
         if pyarch is None:
             self.is_found = False
             return
-        arch = detect_cpu_family(env.coredata.compilers)
+        arch = detect_cpu_family(env.coredata.compilers.host)
         if arch == 'x86':
             arch = '32'
         elif arch == 'x86_64':
@@ -441,7 +613,7 @@
     def get_pcap_lib_version(ctdep):
         # Since we seem to need to run a program to discover the pcap version,
         # we can't do that when cross-compiling
-        if ctdep.want_cross:
+        if not ctdep.env.machines.matches_build_machine(ctdep.for_machine):
             return None
 
         v = ctdep.clib_compiler.get_return_value('pcap_lib_version', 'string',
@@ -550,3 +722,93 @@
     @staticmethod
     def get_methods():
         return [DependencyMethods.PKGCONFIG, DependencyMethods.CONFIG_TOOL]
+
+
+class GpgmeDependency(ExternalDependency):
+    def __init__(self, environment, kwargs):
+        super().__init__('gpgme', environment, None, kwargs)
+
+    @classmethod
+    def _factory(cls, environment, kwargs):
+        methods = cls._process_method_kw(kwargs)
+        candidates = []
+
+        if DependencyMethods.PKGCONFIG in methods:
+            candidates.append(functools.partial(PkgConfigDependency, 'gpgme', environment, kwargs))
+
+        if DependencyMethods.CONFIG_TOOL in methods:
+            candidates.append(functools.partial(ConfigToolDependency.factory,
+                                                'gpgme', environment, None, kwargs, ['gpgme-config'],
+                                                'gpgme-config',
+                                                GpgmeDependency.tool_finish_init))
+
+        return candidates
+
+    @staticmethod
+    def tool_finish_init(ctdep):
+        ctdep.compile_args = ctdep.get_config_value(['--cflags'], 'compile_args')
+        ctdep.link_args = ctdep.get_config_value(['--libs'], 'link_args')
+        ctdep.version = ctdep.get_config_value(['--version'], 'version')[0]
+
+    @staticmethod
+    def get_methods():
+        return [DependencyMethods.PKGCONFIG, DependencyMethods.CONFIG_TOOL]
+
+
+class ShadercDependency(ExternalDependency):
+
+    def __init__(self, environment, kwargs):
+        super().__init__('shaderc', environment, None, kwargs)
+
+        static_lib = 'shaderc_combined'
+        shared_lib = 'shaderc_shared'
+
+        libs = [shared_lib, static_lib]
+        if self.static:
+            libs.reverse()
+
+        cc = self.get_compiler()
+
+        for lib in libs:
+            self.link_args = cc.find_library(lib, environment, [])
+            if self.link_args is not None:
+                self.is_found = True
+
+                if self.static and lib != static_lib:
+                    mlog.warning('Static library {!r} not found for dependency {!r}, may '
+                                 'not be statically linked'.format(static_lib, self.name))
+
+                break
+
+    def log_tried(self):
+        return 'system'
+
+    @classmethod
+    def _factory(cls, environment, kwargs):
+        methods = cls._process_method_kw(kwargs)
+        candidates = []
+
+        if DependencyMethods.PKGCONFIG in methods:
+            # ShaderC packages their shared and static libs together
+            # and provides different pkg-config files for each one. We
+            # smooth over this difference by handling the static
+            # keyword before handing off to the pkg-config handler.
+            shared_libs = ['shaderc']
+            static_libs = ['shaderc_combined', 'shaderc_static']
+
+            if kwargs.get('static', False):
+                c = [functools.partial(PkgConfigDependency, name, environment, kwargs)
+                     for name in static_libs + shared_libs]
+            else:
+                c = [functools.partial(PkgConfigDependency, name, environment, kwargs)
+                     for name in shared_libs + static_libs]
+            candidates.extend(c)
+
+        if DependencyMethods.SYSTEM in methods:
+            candidates.append(functools.partial(ShadercDependency, environment, kwargs))
+
+        return candidates
+
+    @staticmethod
+    def get_methods():
+        return [DependencyMethods.SYSTEM, DependencyMethods.PKGCONFIG]
diff -Nru meson-0.49.0/mesonbuild/dependencies/platform.py meson-0.52.1/mesonbuild/dependencies/platform.py
--- meson-0.49.0/mesonbuild/dependencies/platform.py	2018-12-09 14:27:16.000000000 +0000
+++ meson-0.52.1/mesonbuild/dependencies/platform.py	2019-05-02 18:59:50.000000000 +0000
@@ -15,10 +15,8 @@
 # This file contains the detection logic for external dependencies that are
 # platform-specific (generally speaking).
 
-from .. import mesonlib
-
 from .base import ExternalDependency, DependencyException
-
+from ..mesonlib import MesonException
 
 class AppleFrameworks(ExternalDependency):
     def __init__(self, env, kwargs):
@@ -29,11 +27,28 @@
         if not modules:
             raise DependencyException("AppleFrameworks dependency requires at least one module.")
         self.frameworks = modules
-        # FIXME: Use self.clib_compiler to check if the frameworks are available
+        if not self.clib_compiler:
+            raise DependencyException('No C-like compilers are available, cannot find the framework')
+        self.is_found = True
         for f in self.frameworks:
-            self.link_args += ['-framework', f]
+            try:
+                args = self.clib_compiler.find_framework(f, env, [])
+            except MesonException as e:
+                if 'non-clang' in str(e):
+                    self.is_found = False
+                    self.link_args = []
+                    self.compile_args = []
+                    return
+                raise
+
+            if args is not None:
+                # No compile args are needed for system frameworks
+                self.link_args += args
+            else:
+                self.is_found = False
 
-        self.is_found = mesonlib.for_darwin(self.want_cross, self.env)
+    def log_info(self):
+        return ', '.join(self.frameworks)
 
     def log_tried(self):
         return 'framework'
diff -Nru meson-0.49.0/mesonbuild/dependencies/ui.py meson-0.52.1/mesonbuild/dependencies/ui.py
--- meson-0.49.0/mesonbuild/dependencies/ui.py	2018-12-09 14:27:23.000000000 +0000
+++ meson-0.52.1/mesonbuild/dependencies/ui.py	2019-11-28 17:37:44.000000000 +0000
@@ -14,7 +14,6 @@
 
 # This file contains the detection logic for external dependencies that
 # are UI-related.
-
 import functools
 import os
 import re
@@ -24,8 +23,7 @@
 from .. import mlog
 from .. import mesonlib
 from ..mesonlib import (
-    MesonException, Popen_safe, extract_as_list, for_windows,
-    version_compare_many
+    MesonException, Popen_safe, extract_as_list, version_compare_many
 )
 from ..environment import detect_cpu
 
@@ -39,13 +37,13 @@
     def __init__(self, environment, kwargs):
         super().__init__('gl', environment, None, kwargs)
 
-        if mesonlib.for_darwin(self.want_cross, self.env):
+        if self.env.machines[self.for_machine].is_darwin():
             self.is_found = True
             # FIXME: Use AppleFrameworks dependency
             self.link_args = ['-framework', 'OpenGL']
             # FIXME: Detect version using self.clib_compiler
             return
-        if mesonlib.for_windows(self.want_cross, self.env):
+        if self.env.machines[self.for_machine].is_windows():
             self.is_found = True
             # FIXME: Use self.clib_compiler.find_library()
             self.link_args = ['-lopengl32']
@@ -92,9 +90,9 @@
             'link_args'))
 
     def find_config(self, versions=None):
-        tool = self.tools[0]
+        tool = [self.tools[0]]
         try:
-            p, out = Popen_safe([tool, '--help'])[:2]
+            p, out = Popen_safe(tool + ['--help'])[:2]
         except (FileNotFoundError, PermissionError):
             return (None, None)
         if p.returncode != 0:
@@ -178,13 +176,13 @@
             os.path.join(private_dir, 'Qt' + module))
 
 class QtExtraFrameworkDependency(ExtraFrameworkDependency):
-    def __init__(self, name, required, path, env, lang, kwargs):
-        super().__init__(name, required, path, env, lang, kwargs)
+    def __init__(self, name, required, paths, env, lang, kwargs):
+        super().__init__(name, required, paths, env, lang, kwargs)
         self.mod_name = name[2:]
 
     def get_compile_args(self, with_private_headers=False, qt_version="0"):
         if self.found():
-            mod_inc_dir = os.path.join(self.path, self.name, 'Headers')
+            mod_inc_dir = os.path.join(self.framework_path, 'Headers')
             args = ['-I' + mod_inc_dir]
             if with_private_headers:
                 args += ['-I' + dirname for dirname in _qt_get_private_includes(mod_inc_dir, self.mod_name, qt_version)]
@@ -217,9 +215,11 @@
         methods = []
         # Prefer pkg-config, then fallback to `qmake -query`
         if DependencyMethods.PKGCONFIG in self.methods:
+            mlog.debug('Trying to find qt with pkg-config')
             self._pkgconfig_detect(mods, kwargs)
             methods.append('pkgconfig')
         if not self.is_found and DependencyMethods.QMAKE in self.methods:
+            mlog.debug('Trying to find qt with qmake')
             self.from_text = self._qmake_detect(mods, kwargs)
             methods.append('qmake-' + self.name)
             methods.append('qmake')
@@ -243,7 +243,7 @@
                 if self.bindir:
                     yield os.path.join(self.bindir, b), b, False
                 yield '{}-{}'.format(b, self.name), b, False
-                yield b, b, self.required
+                yield b, b, self.required if b != 'lrelease' else False
 
         for b, name, required in gen_bins():
             if found[name].found():
@@ -288,9 +288,17 @@
             self.compile_args += m.get_compile_args()
             if self.private_headers:
                 qt_inc_dir = m.get_pkgconfig_variable('includedir', dict())
-                mod_private_inc = _qt_get_private_includes(os.path.join(qt_inc_dir, 'Qt' + m_name), m_name, m.version)
-                for dir in mod_private_inc:
-                    self.compile_args.append('-I' + dir)
+                mod_private_dir = os.path.join(qt_inc_dir, 'Qt' + m_name)
+                if not os.path.isdir(mod_private_dir):
+                    # At least some versions of homebrew don't seem to set this
+                    # up correctly. /usr/local/opt/qt/include/Qt + m_name is a
+                    # symlink to /usr/local/opt/qt/include, but the pkg-config
+                    # file points to /usr/local/Cellar/qt/x.y.z/Headers/, and
+                    # the Qt + m_name there is not a symlink, it's a file
+                    mod_private_dir = qt_inc_dir
+                mod_private_inc = _qt_get_private_includes(mod_private_dir, m_name, m.version)
+                for directory in mod_private_inc:
+                    self.compile_args.append('-I' + directory)
             self.link_args += m.get_link_args()
 
         if 'Core' in modules:
@@ -301,7 +309,7 @@
                                        language=self.language)
             modules['Core'] = core
 
-        if for_windows(self.env.is_cross_build(), self.env) and self.qtmain:
+        if self.env.machines[self.for_machine].is_windows() and self.qtmain:
             # Check if we link with debug binaries
             debug_lib_name = self.qtpkgname + 'Core' + self._get_modules_lib_suffix(True)
             is_debug = False
@@ -326,23 +334,18 @@
             if prefix:
                 self.bindir = os.path.join(prefix, 'bin')
 
-    def _find_qmake(self, qmake):
-        # Even when cross-compiling, if a cross-info qmake is not specified, we
-        # fallback to using the qmake in PATH because that's what we used to do
-        if self.env.is_cross_build():
-            if 'qmake' in self.env.cross_info.config['binaries']:
-                return ExternalProgram.from_bin_list(self.env.cross_info.config['binaries'], 'qmake')
-        elif self.env.config_info:
-            # Prefer suffixed to unsuffixed version
-            p = ExternalProgram.from_bin_list(self.env.config_info.binaries, 'qmake-' + self.name)
-            if p.found():
-                return p
-            return ExternalProgram.from_bin_list(self.env.config_info.binaries, 'qmake')
-        return ExternalProgram(qmake, silent=True)
-
     def _qmake_detect(self, mods, kwargs):
         for qmake in ('qmake-' + self.name, 'qmake'):
-            self.qmake = self._find_qmake(qmake)
+            self.qmake = ExternalProgram.from_bin_list(
+                self.env.binaries.host, qmake)
+            if not self.qmake.found():
+                # Even when cross-compiling, if a cross-info qmake is not
+                # specified, we fallback to using the qmake in PATH because
+                # that's what we used to do
+                self.qmake = ExternalProgram.from_bin_list(
+                    self.env.binaries.build, qmake)
+            if not self.qmake.found():
+                self.qmake = ExternalProgram(qmake, silent=True)
             if not self.qmake.found():
                 continue
             # Check that the qmake is for qt5
@@ -358,9 +361,9 @@
             # Didn't find qmake :(
             self.is_found = False
             return
-        self.version = re.search(self.qtver + '(\.\d+)+', stdo).group(0)
+        self.version = re.search(self.qtver + r'(\.\d+)+', stdo).group(0)
         # Query library path, header path, and binary path
-        mlog.log("Found qmake:", mlog.bold(self.qmake.get_name()), '(%s)' % self.version)
+        mlog.log("Found qmake:", mlog.bold(self.qmake.get_path()), '(%s)' % self.version)
         stdo = Popen_safe(self.qmake.get_command() + ['-query'])[1]
         qvars = {}
         for line in stdo.split('\n'):
@@ -369,7 +372,9 @@
                 continue
             (k, v) = tuple(line.split(':', 1))
             qvars[k] = v
-        if mesonlib.is_osx():
+        # Qt on macOS uses a framework, but Qt for iOS/tvOS does not
+        if self.env.machines.host.is_darwin() and 'ios' not in qvars['QMAKE_XSPEC'] and 'tvos' not in qvars['QMAKE_XSPEC']:
+            mlog.debug("Building for macOS, looking for framework")
             self._framework_detect(qvars, mods, kwargs)
             return qmake
         incdir = qvars['QT_INSTALL_HEADERS']
@@ -396,8 +401,8 @@
 
             if self.private_headers:
                 priv_inc = self.get_private_includes(mincdir, module)
-                for dir in priv_inc:
-                    self.compile_args.append('-I' + dir)
+                for directory in priv_inc:
+                    self.compile_args.append('-I' + directory)
             libfile = self.clib_compiler.find_library(self.qtpkgname + module + modules_lib_suffix,
                                                       self.env,
                                                       libdir)
@@ -408,7 +413,7 @@
                 break
             self.link_args.append(libfile)
 
-        if for_windows(self.env.is_cross_build(), self.env) and self.qtmain:
+        if self.env.machines[self.for_machine].is_windows() and self.qtmain:
             if not self._link_with_qtmain(is_debug, libdir):
                 self.is_found = False
 
@@ -416,7 +421,7 @@
 
     def _get_modules_lib_suffix(self, is_debug):
         suffix = ''
-        if for_windows(self.env.is_cross_build(), self.env):
+        if self.env.machines[self.for_machine].is_windows():
             if is_debug:
                 suffix += 'd'
             if self.qtver == '4':
@@ -440,7 +445,8 @@
 
         for m in modules:
             fname = 'Qt' + m
-            fwdep = QtExtraFrameworkDependency(fname, False, libdir, self.env,
+            mlog.debug('Looking for qt framework ' + fname)
+            fwdep = QtExtraFrameworkDependency(fname, False, [libdir], self.env,
                                                self.language, fw_kwargs)
             self.compile_args.append('-F' + libdir)
             if fwdep.found():
@@ -634,7 +640,7 @@
         else:
             # simply try to guess it, usually works on linux
             libs = self.clib_compiler.find_library('vulkan', environment, [])
-            if libs is not None and self.clib_compiler.has_header('vulkan/vulkan.h', '', environment):
+            if libs is not None and self.clib_compiler.has_header('vulkan/vulkan.h', '', environment, disable_cache=True)[0]:
                 self.type_name = 'system'
                 self.is_found = True
                 for lib in libs:
diff -Nru meson-0.49.0/mesonbuild/depfile.py meson-0.52.1/mesonbuild/depfile.py
--- meson-0.49.0/mesonbuild/depfile.py	1970-01-01 00:00:00.000000000 +0000
+++ meson-0.52.1/mesonbuild/depfile.py	2019-10-06 17:01:35.000000000 +0000
@@ -0,0 +1,85 @@
+# Copyright 2019 Red Hat, Inc.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+
+#     http://www.apache.org/licenses/LICENSE-2.0
+
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import collections
+
+def parse(lines):
+    rules = []
+    targets = []
+    deps = []
+    in_deps = False
+    out = ''
+    for line in lines:
+        if not line.endswith('\n'):
+            line += '\n'
+        escape = None
+        for c in line:
+            if escape:
+                if escape == '$' and c != '$':
+                    out += '$'
+                if escape == '\\' and c == '\n':
+                    continue
+                out += c
+                escape = None
+                continue
+            if c == '\\' or c == '$':
+                escape = c
+                continue
+            elif c in (' ', '\n'):
+                if out != '':
+                    if in_deps:
+                        deps.append(out)
+                    else:
+                        targets.append(out)
+                out = ''
+                if c == '\n':
+                    rules.append((targets, deps))
+                    targets = []
+                    deps = []
+                    in_deps = False
+                continue
+            elif c == ':':
+                targets.append(out)
+                out = ''
+                in_deps = True
+                continue
+            out += c
+    return rules
+
+Target = collections.namedtuple('Target', ['deps'])
+
+class DepFile:
+    def __init__(self, lines):
+        rules = parse(lines)
+        depfile = {}
+        for (targets, deps) in rules:
+            for target in targets:
+                t = depfile.setdefault(target, Target(deps=set()))
+                for dep in deps:
+                    t.deps.add(dep)
+        self.depfile = depfile
+
+    def get_all_dependencies(self, target, visited=None):
+        deps = set()
+        if not visited:
+            visited = set()
+        if target in visited:
+            return set()
+        visited.add(target)
+        target = self.depfile.get(target)
+        if not target:
+            return set()
+        deps.update(target.deps)
+        for dep in target.deps:
+            deps.update(self.get_all_dependencies(dep, visited))
+        return deps
diff -Nru meson-0.49.0/mesonbuild/envconfig.py meson-0.52.1/mesonbuild/envconfig.py
--- meson-0.49.0/mesonbuild/envconfig.py	1970-01-01 00:00:00.000000000 +0000
+++ meson-0.52.1/mesonbuild/envconfig.py	2019-11-28 17:37:44.000000000 +0000
@@ -0,0 +1,410 @@
+# Copyright 2012-2016 The Meson development team
+
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+
+#     http://www.apache.org/licenses/LICENSE-2.0
+
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import configparser, os, subprocess
+import typing
+
+from . import mesonlib
+from .mesonlib import EnvironmentException, split_args
+from . import mlog
+
+_T = typing.TypeVar('_T')
+
+
+# These classes contains all the data pulled from configuration files (native
+# and cross file currently), and also assists with the reading environment
+# variables.
+#
+# At this time there isn't an ironclad difference between this an other sources
+# of state like `coredata`. But one rough guide is much what is in `coredata` is
+# the *output* of the configuration process: the final decisions after tests.
+# This, on the other hand has *inputs*. The config files are parsed, but
+# otherwise minimally transformed. When more complex fallbacks (environment
+# detection) exist, they are defined elsewhere as functions that construct
+# instances of these classes.
+
+
+known_cpu_families = (
+    'aarch64',
+    'arc',
+    'arm',
+    'e2k',
+    'ia64',
+    'microblaze',
+    'mips',
+    'mips64',
+    'parisc',
+    'ppc',
+    'ppc64',
+    'riscv32',
+    'riscv64',
+    'rl78',
+    'rx',
+    's390x',
+    'sparc',
+    'sparc64',
+    'wasm32',
+    'wasm64',
+    'x86',
+    'x86_64'
+)
+
+# It would feel more natural to call this "64_BIT_CPU_FAMILES", but
+# python identifiers cannot start with numbers
+CPU_FAMILES_64_BIT = [
+    'aarch64',
+    'ia64',
+    'mips64',
+    'ppc64',
+    'riscv64',
+    'sparc64',
+    'wasm64',
+    'x86_64',
+]
+
+class MesonConfigFile:
+    @classmethod
+    def from_config_parser(cls, parser: configparser.ConfigParser) -> typing.Dict[str, typing.Dict[str, typing.Dict[str, str]]]:
+        out = {}
+        # This is a bit hackish at the moment.
+        for s in parser.sections():
+            section = {}
+            for entry in parser[s]:
+                value = parser[s][entry]
+                # Windows paths...
+                value = value.replace('\\', '\\\\')
+                if ' ' in entry or '\t' in entry or "'" in entry or '"' in entry:
+                    raise EnvironmentException('Malformed variable name %s in cross file..' % entry)
+                try:
+                    res = eval(value, {'__builtins__': None}, {'true': True, 'false': False})
+                except Exception:
+                    raise EnvironmentException('Malformed value in cross file variable %s.' % entry)
+
+                for i in (res if isinstance(res, list) else [res]):
+                    if not isinstance(i, (str, int, bool)):
+                        raise EnvironmentException('Malformed value in cross file variable %s.' % entry)
+
+                section[entry] = res
+
+            out[s] = section
+        return out
+
+class HasEnvVarFallback:
+    """
+    A tiny class to indicate that this class contains data that can be
+    initialized from either a config file or environment file. The `fallback`
+    field says whether env vars should be used. Downstream logic (e.g. subclass
+    methods) can check it to decide what to do, since env vars are currently
+    lazily decoded.
+
+    Frankly, this is a pretty silly class at the moment. The hope is the way
+    that we deal with environment variables will become more structured, and
+    this can be starting point.
+    """
+    def __init__(self, fallback: bool = True):
+        self.fallback = fallback
+
+class Properties(HasEnvVarFallback):
+    def __init__(
+            self,
+            properties: typing.Optional[typing.Dict[str, typing.Union[str, typing.List[str]]]] = None,
+            fallback: bool = True):
+        super().__init__(fallback)
+        self.properties = properties or {}  # type: typing.Dict[str, typing.Union[str, typing.List[str]]]
+
+    def has_stdlib(self, language: str) -> bool:
+        return language + '_stdlib' in self.properties
+
+    # Some of get_stdlib, get_root, get_sys_root are wider than is actually
+    # true, but without heterogenious dict annotations it's not practical to
+    # narrow them
+    def get_stdlib(self, language: str) -> typing.Union[str, typing.List[str]]:
+        return self.properties[language + '_stdlib']
+
+    def get_root(self) -> typing.Optional[typing.Union[str, typing.List[str]]]:
+        return self.properties.get('root', None)
+
+    def get_sys_root(self) -> typing.Optional[typing.Union[str, typing.List[str]]]:
+        return self.properties.get('sys_root', None)
+
+    def __eq__(self, other: typing.Any) -> 'typing.Union[bool, NotImplemented]':
+        if isinstance(other, type(self)):
+            return self.properties == other.properties
+        return NotImplemented
+
+    # TODO consider removing so Properties is less freeform
+    def __getitem__(self, key: str) -> typing.Any:
+        return self.properties[key]
+
+    # TODO consider removing so Properties is less freeform
+    def __contains__(self, item: typing.Any) -> bool:
+        return item in self.properties
+
+    # TODO consider removing, for same reasons as above
+    def get(self, key: str, default: typing.Any = None) -> typing.Any:
+        return self.properties.get(key, default)
+
+class MachineInfo:
+    def __init__(self, system: str, cpu_family: str, cpu: str, endian: str):
+        self.system = system
+        self.cpu_family = cpu_family
+        self.cpu = cpu
+        self.endian = endian
+        self.is_64_bit = cpu_family in CPU_FAMILES_64_BIT  # type: bool
+
+    def __eq__(self, other: typing.Any) -> 'typing.Union[bool, NotImplemented]':
+        if self.__class__ is not other.__class__:
+            return NotImplemented
+        return \
+            self.system == other.system and \
+            self.cpu_family == other.cpu_family and \
+            self.cpu == other.cpu and \
+            self.endian == other.endian
+
+    def __ne__(self, other: typing.Any) -> 'typing.Union[bool, NotImplemented]':
+        if self.__class__ is not other.__class__:
+            return NotImplemented
+        return not self.__eq__(other)
+
+    def __repr__(self) -> str:
+        return ''.format(self.system, self.cpu_family, self.cpu)
+
+    @classmethod
+    def from_literal(cls, literal: typing.Dict[str, str]) -> 'MachineInfo':
+        minimum_literal = {'cpu', 'cpu_family', 'endian', 'system'}
+        if set(literal) < minimum_literal:
+            raise EnvironmentException(
+                'Machine info is currently {}\n'.format(literal) +
+                'but is missing {}.'.format(minimum_literal - set(literal)))
+
+        cpu_family = literal['cpu_family']
+        if cpu_family not in known_cpu_families:
+            mlog.warning('Unknown CPU family %s, please report this at https://github.com/mesonbuild/meson/issues/new' % cpu_family)
+
+        endian = literal['endian']
+        if endian not in ('little', 'big'):
+            mlog.warning('Unknown endian %s' % endian)
+
+        return cls(literal['system'], cpu_family, literal['cpu'], endian)
+
+    def is_windows(self) -> bool:
+        """
+        Machine is windows?
+        """
+        return self.system == 'windows' or 'mingw' in self.system
+
+    def is_cygwin(self) -> bool:
+        """
+        Machine is cygwin?
+        """
+        return self.system.startswith('cygwin')
+
+    def is_linux(self) -> bool:
+        """
+        Machine is linux?
+        """
+        return self.system == 'linux'
+
+    def is_darwin(self) -> bool:
+        """
+        Machine is Darwin (iOS/tvOS/OS X)?
+        """
+        return self.system in {'darwin', 'ios', 'tvos'}
+
+    def is_android(self) -> bool:
+        """
+        Machine is Android?
+        """
+        return self.system == 'android'
+
+    def is_haiku(self) -> bool:
+        """
+        Machine is Haiku?
+        """
+        return self.system == 'haiku'
+
+    def is_netbsd(self) -> bool:
+        """
+        Machine is NetBSD?
+        """
+        return self.system == 'netbsd'
+
+    def is_openbsd(self) -> bool:
+        """
+        Machine is OpenBSD?
+        """
+        return self.system == 'openbsd'
+
+    def is_dragonflybsd(self) -> bool:
+        """Machine is DragonflyBSD?"""
+        return self.system == 'dragonfly'
+
+    def is_freebsd(self) -> bool:
+        """Machine is FreeBSD?"""
+        return self.system == 'freebsd'
+
+    def is_sunos(self) -> bool:
+        """Machine is illumos or Solaris?"""
+        return self.system == 'sunos'
+
+
+    # Various prefixes and suffixes for import libraries, shared libraries,
+    # static libraries, and executables.
+    # Versioning is added to these names in the backends as-needed.
+
+    def get_exe_suffix(self) -> str:
+        if self.is_windows() or self.is_cygwin():
+            return 'exe'
+        else:
+            return ''
+
+    def get_object_suffix(self) -> str:
+        if self.is_windows():
+            return 'obj'
+        else:
+            return 'o'
+
+    def libdir_layout_is_win(self) -> bool:
+        return self.is_windows() or self.is_cygwin()
+
+class BinaryTable(HasEnvVarFallback):
+    def __init__(
+            self,
+            binaries: typing.Optional[typing.Dict[str, typing.Union[str, typing.List[str]]]] = None,
+            fallback: bool = True):
+        super().__init__(fallback)
+        self.binaries = binaries or {}  # type: typing.Dict[str, typing.Union[str, typing.List[str]]]
+        for name, command in self.binaries.items():
+            if not isinstance(command, (list, str)):
+                # TODO generalize message
+                raise mesonlib.MesonException(
+                    'Invalid type {!r} for binary {!r} in cross file'
+                    ''.format(command, name))
+
+    # Map from language identifiers to environment variables.
+    evarMap = {
+        # Compilers
+        'c': 'CC',
+        'cpp': 'CXX',
+        'cs': 'CSC',
+        'd': 'DC',
+        'fortran': 'FC',
+        'objc': 'OBJC',
+        'objcpp': 'OBJCXX',
+        'rust': 'RUSTC',
+        'vala': 'VALAC',
+
+        # Binutils
+        'strip': 'STRIP',
+        'ar': 'AR',
+        'windres': 'WINDRES',
+
+        'cmake': 'CMAKE',
+        'qmake': 'QMAKE',
+        'pkgconfig': 'PKG_CONFIG',
+    }  # type: typing.Dict[str, str]
+
+    @staticmethod
+    def detect_ccache() -> typing.List[str]:
+        try:
+            subprocess.check_call(['ccache', '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+        except (OSError, subprocess.CalledProcessError):
+            return []
+        return ['ccache']
+
+    @classmethod
+    def _warn_about_lang_pointing_to_cross(cls, compiler_exe: str, evar: str) -> None:
+        evar_str = os.environ.get(evar, 'WHO_WOULD_CALL_THEIR_COMPILER_WITH_THIS_NAME')
+        if evar_str == compiler_exe:
+            mlog.warning('''Env var %s seems to point to the cross compiler.
+This is probably wrong, it should always point to the native compiler.''' % evar)
+
+    @classmethod
+    def parse_entry(cls, entry: typing.Union[str, typing.List[str]]) -> typing.Tuple[typing.List[str], typing.List[str]]:
+        compiler = mesonlib.stringlistify(entry)
+        # Ensure ccache exists and remove it if it doesn't
+        if compiler[0] == 'ccache':
+            compiler = compiler[1:]
+            ccache = cls.detect_ccache()
+        else:
+            ccache = []
+        # Return value has to be a list of compiler 'choices'
+        return compiler, ccache
+
+    def lookup_entry(self, name: str) -> typing.Optional[typing.List[str]]:
+        """Lookup binaryk
+
+        Returns command with args as list if found, Returns `None` if nothing is
+        found.
+
+        First tries looking in explicit map, then tries environment variable.
+        """
+        # Try explict map, don't fall back on env var
+        command = self.binaries.get(name)
+        if command is not None:
+            command = mesonlib.stringlistify(command)
+            # Relies on there being no "" env var
+            evar = self.evarMap.get(name, "")
+            self._warn_about_lang_pointing_to_cross(command[0], evar)
+        elif self.fallback:
+            # Relies on there being no "" env var
+            evar = self.evarMap.get(name, "")
+            command = os.environ.get(evar)
+            if command is not None:
+                command = split_args(command)
+
+        # Do not return empty or blank string entries
+        if command is not None and (len(command) == 0 or len(command[0].strip()) == 0):
+            return None
+        return command
+
+class Directories:
+
+    """Data class that holds information about directories for native and cross
+    builds.
+    """
+
+    def __init__(self, bindir: typing.Optional[str] = None, datadir: typing.Optional[str] = None,
+                 includedir: typing.Optional[str] = None, infodir: typing.Optional[str] = None,
+                 libdir: typing.Optional[str] = None, libexecdir: typing.Optional[str] = None,
+                 localedir: typing.Optional[str] = None, localstatedir: typing.Optional[str] = None,
+                 mandir: typing.Optional[str] = None, prefix: typing.Optional[str] = None,
+                 sbindir: typing.Optional[str] = None, sharedstatedir: typing.Optional[str] = None,
+                 sysconfdir: typing.Optional[str] = None):
+        self.bindir = bindir
+        self.datadir = datadir
+        self.includedir = includedir
+        self.infodir = infodir
+        self.libdir = libdir
+        self.libexecdir = libexecdir
+        self.localedir = localedir
+        self.localstatedir = localstatedir
+        self.mandir = mandir
+        self.prefix = prefix
+        self.sbindir = sbindir
+        self.sharedstatedir = sharedstatedir
+        self.sysconfdir = sysconfdir
+
+    def __contains__(self, key: str) -> bool:
+        return hasattr(self, key)
+
+    def __getitem__(self, key: str) -> typing.Optional[str]:
+        # Mypy can't figure out what to do with getattr here, so we'll case for it
+        return typing.cast(typing.Optional[str], getattr(self, key))
+
+    def __setitem__(self, key: str, value: typing.Optional[str]) -> None:
+        setattr(self, key, value)
+
+    def __iter__(self) -> typing.Iterator[typing.Tuple[str, str]]:
+        return iter(self.__dict__.items())
diff -Nru meson-0.49.0/mesonbuild/environment.py meson-0.52.1/mesonbuild/environment.py
--- meson-0.49.0/mesonbuild/environment.py	2018-12-09 16:37:53.000000000 +0000
+++ meson-0.52.1/mesonbuild/environment.py	2019-11-28 17:37:44.000000000 +0000
@@ -12,16 +12,26 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import configparser, os, platform, re, sys, shlex, shutil, subprocess
+import os, platform, re, sys, shutil, subprocess, typing
+import tempfile
+import shlex
 
 from . import coredata
-from .linkers import ArLinker, ArmarLinker, VisualStudioLinker, DLinker, CcrxLinker
+from .linkers import ArLinker, ArmarLinker, VisualStudioLinker, DLinker, CcrxLinker, IntelVisualStudioLinker
 from . import mesonlib
-from .mesonlib import MesonException, EnvironmentException, PerMachine, Popen_safe
+from .mesonlib import (
+    MesonException, EnvironmentException, MachineChoice, Popen_safe,
+    PerMachineDefaultable, PerThreeMachineDefaultable, split_args, quote_arg
+)
 from . import mlog
 
+from .envconfig import (
+    BinaryTable, Directories, MachineInfo, MesonConfigFile,
+    Properties, known_cpu_families,
+)
 from . import compilers
 from .compilers import (
+    Compiler,
     CompilerType,
     is_assembly,
     is_header,
@@ -30,6 +40,26 @@
     is_object,
     is_source,
 )
+from .linkers import (
+    AppleDynamicLinker,
+    ArmClangDynamicLinker,
+    ArmDynamicLinker,
+    CcrxDynamicLinker,
+    ClangClDynamicLinker,
+    DynamicLinker,
+    GnuDynamicLinker,
+    LLVMDynamicLinker,
+    MSVCDynamicLinker,
+    OptlinkDynamicLinker,
+    PGIDynamicLinker,
+    PGIStaticLinker,
+    SolarisDynamicLinker,
+    XildAppleDynamicLinker,
+    XildLinuxDynamicLinker,
+    XilinkDynamicLinker,
+    CudaLinker,
+)
+from functools import lru_cache
 from .compilers import (
     ArmCCompiler,
     ArmCPPCompiler,
@@ -41,6 +71,7 @@
     ClangObjCPPCompiler,
     ClangClCCompiler,
     ClangClCPPCompiler,
+    FlangFortranCompiler,
     G95FortranCompiler,
     GnuCCompiler,
     GnuCPPCompiler,
@@ -50,15 +81,23 @@
     ElbrusCCompiler,
     ElbrusCPPCompiler,
     ElbrusFortranCompiler,
+    EmscriptenCCompiler,
+    EmscriptenCPPCompiler,
     IntelCCompiler,
+    IntelClCCompiler,
     IntelCPPCompiler,
+    IntelClCPPCompiler,
     IntelFortranCompiler,
+    IntelClFortranCompiler,
     JavaCompiler,
     MonoCompiler,
+    CudaCompiler,
     VisualStudioCsCompiler,
     NAGFortranCompiler,
     Open64FortranCompiler,
     PathScaleFortranCompiler,
+    PGICCompiler,
+    PGICPPCompiler,
     PGIFortranCompiler,
     RustCompiler,
     CcrxCCompiler,
@@ -71,28 +110,9 @@
 
 build_filename = 'meson.build'
 
-known_cpu_families = (
-    'aarch64',
-    'arc',
-    'arm',
-    'e2k',
-    'ia64',
-    'mips',
-    'mips64',
-    'parisc',
-    'ppc',
-    'ppc64',
-    'riscv32',
-    'riscv64',
-    'rx',
-    's390x',
-    'sparc',
-    'sparc64',
-    'x86',
-    'x86_64'
-)
+CompilersDict = typing.Dict[str, Compiler]
 
-def detect_gcovr(version='3.1', log=False):
+def detect_gcovr(min_version='3.3', new_rootdir_version='4.2', log=False):
     gcovr_exe = 'gcovr'
     try:
         p, found = Popen_safe([gcovr_exe, '--version'])[0:2]
@@ -100,10 +120,10 @@
         # Doesn't exist in PATH or isn't executable
         return None, None
     found = search_version(found)
-    if p.returncode == 0:
+    if p.returncode == 0 and mesonlib.version_compare(found, '>=' + min_version):
         if log:
-            mlog.log('Found gcovr-{} at {}'.format(found, shlex.quote(shutil.which(gcovr_exe))))
-        return gcovr_exe, mesonlib.version_compare(found, '>=' + version)
+            mlog.log('Found gcovr-{} at {}'.format(found, quote_arg(shutil.which(gcovr_exe))))
+        return gcovr_exe, mesonlib.version_compare(found, '>=' + new_rootdir_version)
     return None, None
 
 def find_coverage_tools():
@@ -119,8 +139,9 @@
 
     return gcovr_exe, gcovr_new_rootdir, lcov_exe, genhtml_exe
 
-def detect_ninja(version='1.5', log=False):
-    for n in ['ninja', 'ninja-build', 'samu']:
+def detect_ninja(version: str = '1.5', log: bool = False) -> str:
+    env_ninja = os.environ.get('NINJA', None)
+    for n in [env_ninja] if env_ninja else ['ninja', 'ninja-build', 'samu']:
         try:
             p, found = Popen_safe([n, '--version'])[0:2]
         except (FileNotFoundError, PermissionError):
@@ -130,13 +151,95 @@
         # Perhaps we should add a way for the caller to know the failure mode
         # (not found or too old)
         if p.returncode == 0 and mesonlib.version_compare(found, '>=' + version):
+            n = shutil.which(n)
             if log:
-                mlog.log('Found ninja-{} at {}'.format(found, shlex.quote(shutil.which(n))))
+                name = os.path.basename(n)
+                if name.endswith('-' + found):
+                    name = name[0:-1 - len(found)]
+                if name == 'ninja-build':
+                    name = 'ninja'
+                if name == 'samu':
+                    name = 'samurai'
+                mlog.log('Found {}-{} at {}'.format(name, found, quote_arg(n)))
             return n
 
+def get_llvm_tool_names(tool: str) -> typing.List[str]:
+    # Ordered list of possible suffixes of LLVM executables to try. Start with
+    # base, then try newest back to oldest (3.5 is arbitrary), and finally the
+    # devel version. Please note that the development snapshot in Debian does
+    # not have a distinct name. Do not move it to the beginning of the list
+    # unless it becomes a stable release.
+    suffixes = [
+        '', # base (no suffix)
+        '-9',   '90',
+        '-8',   '80',
+        '-7',   '70',
+        '-6.0', '60',
+        '-5.0', '50',
+        '-4.0', '40',
+        '-3.9', '39',
+        '-3.8', '38',
+        '-3.7', '37',
+        '-3.6', '36',
+        '-3.5', '35',
+        '-10',    # Debian development snapshot
+        '-devel', # FreeBSD development snapshot
+    ]
+    names = []
+    for suffix in suffixes:
+        names.append(tool + suffix)
+    return names
+
+def detect_scanbuild() -> typing.List[str]:
+    """ Look for scan-build binary on build platform
+
+    First, if a SCANBUILD env variable has been provided, give it precedence
+    on all platforms.
+
+    For most platforms, scan-build is found is the PATH contains a binary
+    named "scan-build". However, some distribution's package manager (FreeBSD)
+    don't. For those, loop through a list of candidates to see if one is
+    available.
+
+    Return: a single-element list of the found scan-build binary ready to be
+        passed to Popen()
+    """
+    exelist = []
+    if 'SCANBUILD' in os.environ:
+        exelist = split_args(os.environ['SCANBUILD'])
+
+    else:
+        tools = get_llvm_tool_names('scan-build')
+        for tool in tools:
+            if shutil.which(tool) is not None:
+                exelist = [shutil.which(tool)]
+                break
+
+    if exelist:
+        tool = exelist[0]
+        if os.path.isfile(tool) and os.access(tool, os.X_OK):
+            return [tool]
+    return []
+
+def detect_clangformat() -> typing.List[str]:
+    """ Look for clang-format binary on build platform
+
+    Do the same thing as detect_scanbuild to find clang-format except it
+    currently does not check the environment variable.
+
+    Return: a single-element list of the found clang-format binary ready to be
+        passed to Popen()
+    """
+    tools = get_llvm_tool_names('clang-format')
+    for tool in tools:
+        path = shutil.which(tool)
+        if path is not None:
+            return [path]
+    return []
+
 def detect_native_windows_arch():
     """
-    The architecture of Windows itself: x86 or amd64
+    The architecture of Windows itself: x86, amd64 or arm64
     """
     # These env variables are always available. See:
     # https://msdn.microsoft.com/en-us/library/aa384274(VS.85).aspx
@@ -150,7 +253,7 @@
             raise EnvironmentException('Unable to detect native OS architecture')
     return arch
 
-def detect_windows_arch(compilers):
+def detect_windows_arch(compilers: CompilersDict) -> str:
     """
     Detecting the 'native' architecture of Windows is not a trivial task. We
     cannot trust that the architecture that Python is built for is the 'native'
@@ -166,51 +269,31 @@
     easily detected.
 
     In the end, the sanest method is as follows:
-    1. Check if we're in an MSVC toolchain environment, and if so, return the
-       MSVC toolchain architecture as our 'native' architecture.
-    2. If not, check environment variables that are set by Windows and WOW64 to
-       find out the architecture that Windows is built for, and use that as our
-       'native' architecture.
+    1. Check environment variables that are set by Windows and WOW64 to find out
+       if this is x86 (possibly in WOW64), if so use that as our 'native'
+       architecture.
+    2. If the compiler toolchain target architecture is x86, use that as our
+      'native' architecture.
+    3. Otherwise, use the actual Windows architecture
+
     """
     os_arch = detect_native_windows_arch()
-    if os_arch != 'amd64':
+    if os_arch == 'x86':
         return os_arch
     # If we're on 64-bit Windows, 32-bit apps can be compiled without
     # cross-compilation. So if we're doing that, just set the native arch as
     # 32-bit and pretend like we're running under WOW64. Else, return the
     # actual Windows architecture that we deduced above.
     for compiler in compilers.values():
-        # Check if we're using and inside an MSVC toolchain environment
-        if compiler.id == 'msvc' and 'VCINSTALLDIR' in os.environ:
-            if float(compiler.get_toolset_version()) < 10.0:
-                # On MSVC 2008 and earlier, check 'BUILD_PLAT', where
-                # 'Win32' means 'x86'
-                platform = os.environ.get('BUILD_PLAT', os_arch)
-                if platform == 'Win32':
-                    return 'x86'
-            elif 'VSCMD_ARG_TGT_ARCH' in os.environ:
-                # On MSVC 2017 'Platform' is not set in VsDevCmd.bat
-                return os.environ['VSCMD_ARG_TGT_ARCH']
-            else:
-                # Starting with VS 2017, `Platform` is not always set (f.ex.,
-                # if you use VsDevCmd.bat directly instead of vcvars*.bat), but
-                # `VSCMD_ARG_HOST_ARCH` is always set, so try that first.
-                if 'VSCMD_ARG_HOST_ARCH' in os.environ:
-                    platform = os.environ['VSCMD_ARG_HOST_ARCH'].lower()
-                # On VS 2010-2015, 'Platform' is only set when the
-                # target arch is not 'x86'.  It's 'x64' when targeting
-                # x86_64 and 'arm' when targeting ARM.
-                else:
-                    platform = os.environ.get('Platform', 'x86').lower()
-            if platform == 'x86':
-                return platform
-        if compiler.id == 'clang-cl' and not compiler.is_64:
+        if compiler.id == 'msvc' and (compiler.target == 'x86' or compiler.target == '80x86'):
+            return 'x86'
+        if compiler.id == 'clang-cl' and compiler.target == 'x86':
             return 'x86'
         if compiler.id == 'gcc' and compiler.has_builtin_define('__i386__'):
             return 'x86'
     return os_arch
 
-def any_compiler_has_define(compilers, define):
+def any_compiler_has_define(compilers: CompilersDict, define):
     for c in compilers.values():
         try:
             if c.has_builtin_define(define):
@@ -220,7 +303,7 @@
             pass
     return False
 
-def detect_cpu_family(compilers):
+def detect_cpu_family(compilers: CompilersDict) -> str:
     """
     Python is inconsistent in its platform module.
     It returns different values for the same cpu.
@@ -229,27 +312,23 @@
     """
     if mesonlib.is_windows():
         trial = detect_windows_arch(compilers)
+    elif mesonlib.is_freebsd() or mesonlib.is_netbsd() or mesonlib.is_openbsd():
+        trial = platform.processor().lower()
     else:
         trial = platform.machine().lower()
     if trial.startswith('i') and trial.endswith('86'):
         trial = 'x86'
-    elif trial.startswith('arm'):
+    elif trial == 'bepc':
+        trial = 'x86'
+    elif trial.startswith('arm') or trial.startswith('earm'):
         trial = 'arm'
-    elif trial.startswith('ppc64'):
+    elif trial.startswith(('powerpc64', 'ppc64')):
         trial = 'ppc64'
-    elif trial == 'powerpc':
+    elif trial.startswith(('powerpc', 'ppc')):
         trial = 'ppc'
-        # FreeBSD calls both ppc and ppc64 "powerpc".
-        # https://github.com/mesonbuild/meson/issues/4397
-        try:
-            p, stdo, _ = Popen_safe(['uname', '-p'])
-        except (FileNotFoundError, PermissionError):
-            # Not much to go on here.
-            if sys.maxsize > 2**32:
-                trial = 'ppc64'
-        if 'powerpc64' in stdo:
-            trial = 'ppc64'
-    elif trial in ('amd64', 'x64'):
+    elif trial == 'macppc':
+        trial = 'ppc'
+    elif trial in ('amd64', 'x64', 'i86pc'):
         trial = 'x86_64'
 
     # On Linux (and maybe others) there can be any mixture of 32/64 bit code in
@@ -263,6 +342,10 @@
             trial = 'arm'
     # Add more quirks here as bugs are reported. Keep in sync with detect_cpu()
     # below.
+    elif trial == 'parisc64':
+        # ATM there is no 64 bit userland for PA-RISC. Thus always
+        # report it as 32 bit for simplicity.
+        trial = 'parisc'
 
     if trial not in known_cpu_families:
         mlog.warning('Unknown CPU family {!r}, please report this at '
@@ -271,12 +354,14 @@
 
     return trial
 
-def detect_cpu(compilers):
+def detect_cpu(compilers: CompilersDict):
     if mesonlib.is_windows():
         trial = detect_windows_arch(compilers)
+    elif mesonlib.is_freebsd() or mesonlib.is_netbsd() or mesonlib.is_openbsd():
+        trial = platform.processor().lower()
     else:
         trial = platform.machine().lower()
-    if trial in ('amd64', 'x64'):
+    if trial in ('amd64', 'x64', 'i86pc'):
         trial = 'x86_64'
     if trial == 'x86_64':
         # Same check as above for cpu_family
@@ -286,6 +371,8 @@
         # Same check as above for cpu_family
         if any_compiler_has_define(compilers, '__arm__'):
             trial = 'arm'
+    elif trial.startswith('earm'):
+        trial = 'arm'
     elif trial == 'e2k':
         # Make more precise CPU detection for Elbrus platform.
         trial = platform.processor().lower()
@@ -304,6 +391,37 @@
         return os.environ['MSYSTEM_CARCH']
     return None
 
+def detect_machine_info(compilers: typing.Optional[CompilersDict] = None) -> MachineInfo:
+    """Detect the machine we're running on
+
+    If compilers are not provided, we cannot know as much. None out those
+    fields to avoid accidentally depending on partial knowledge. The
+    underlying ''detect_*'' method can be called to explicitly use the
+    partial information.
+    """
+    return MachineInfo(
+        detect_system(),
+        detect_cpu_family(compilers) if compilers is not None else None,
+        detect_cpu(compilers) if compilers is not None else None,
+        sys.byteorder)
+
+# TODO make this compare two `MachineInfo`s purely. How important is the
+# `detect_cpu_family({})` distinction? It is the one impediment to that.
+def machine_info_can_run(machine_info: MachineInfo):
+    """Whether we can run binaries for this machine on the current machine.
+
+    Can almost always run 32-bit binaries on 64-bit natively if the host
+    and build systems are the same. We don't pass any compilers to
+    detect_cpu_family() here because we always want to know the OS
+    architecture, not what the compiler environment tells us.
+    """
+    if machine_info.system != detect_system():
+        return False
+    true_build_cpu_family = detect_cpu_family({})
+    return \
+        (machine_info.cpu_family == true_build_cpu_family) or \
+        ((true_build_cpu_family == 'x86_64') and (machine_info.cpu_family == 'x86'))
+
 def search_version(text):
     # Usually of the type 4.1.4 but compiler output may contain
     # stuff like this:
@@ -316,8 +434,26 @@
     # This regex is reaching magic levels. If it ever needs
     # to be updated, do not complexify but convert to something
     # saner instead.
-    version_regex = '(? bool:
+        return self.coredata.is_cross_build()
 
     def dump_coredata(self):
         return coredata.save(self.coredata, self.get_build_dir())
@@ -470,6 +647,7 @@
     def is_object(self, fname):
         return is_object(fname)
 
+    @lru_cache(maxsize=None)
     def is_library(self, fname):
         return is_library(fname)
 
@@ -528,38 +706,28 @@
             return CompilerType.GCC_CYGWIN
         return CompilerType.GCC_STANDARD
 
-    def _get_compilers(self, lang, want_cross):
+    def _get_compilers(self, lang, for_machine):
         '''
         The list of compilers is detected in the exact same way for
         C, C++, ObjC, ObjC++, Fortran, CS so consolidate it here.
         '''
-        is_cross = False
-        exe_wrap = None
-        evar = BinaryTable.evarMap[lang]
-
-        if self.is_cross_build() and want_cross:
-            if lang not in self.cross_info.config['binaries']:
-                raise EnvironmentException('{!r} compiler binary not defined in cross file'.format(lang))
-            compilers, ccache = BinaryTable.parse_entry(
-                mesonlib.stringlistify(self.cross_info.config['binaries'][lang]))
-            BinaryTable.warn_about_lang_pointing_to_cross(compilers[0], evar)
-            # Return value has to be a list of compiler 'choices'
-            compilers = [compilers]
-            is_cross = True
-            exe_wrap = self.get_exe_wrapper()
-        elif evar in os.environ:
-            compilers, ccache = BinaryTable.parse_entry(
-                shlex.split(os.environ[evar]))
+        value = self.binaries[for_machine].lookup_entry(lang)
+        if value is not None:
+            compilers, ccache = BinaryTable.parse_entry(value)
             # Return value has to be a list of compiler 'choices'
             compilers = [compilers]
-        elif lang in self.config_info.binaries:
-            compilers, ccache = BinaryTable.parse_entry(
-                mesonlib.stringlistify(self.config_info.binaries[lang]))
-            compilers = [compilers]
         else:
+            if not self.machines.matches_build_machine(for_machine):
+                raise EnvironmentException('{!r} compiler binary not defined in cross or native file'.format(lang))
             compilers = getattr(self, 'default_' + lang)
             ccache = BinaryTable.detect_ccache()
-        return compilers, ccache, is_cross, exe_wrap
+
+        if self.machines.matches_build_machine(for_machine):
+            exe_wrap = None
+        else:
+            exe_wrap = self.get_exe_wrapper()
+
+        return compilers, ccache, exe_wrap
 
     def _handle_exceptions(self, exceptions, binaries, bintype='compiler'):
         errmsg = 'Unknown {}(s): {}'.format(bintype, binaries)
@@ -569,9 +737,104 @@
                 errmsg += '\nRunning "{0}" gave "{1}"'.format(c, e)
         raise EnvironmentException(errmsg)
 
-    def _detect_c_or_cpp_compiler(self, lang, want_cross):
+    @staticmethod
+    def _guess_win_linker(compiler: typing.List[str], for_machine: MachineChoice,
+                          prefix: typing.Union[str, typing.List[str]]) -> 'DynamicLinker':
+        # Explicitly pass logo here so that we can get the version of link.exe
+        if isinstance(prefix, str):
+            check_args = [prefix + '/logo', prefix + '--version']
+        else:
+            check_args = prefix + ['/logo'] + prefix + ['--version']
+        p, o, _ = Popen_safe(compiler + check_args)
+        if o.startswith('LLD'):
+            if '(compatible with GNU linkers)' in o:
+                return LLVMDynamicLinker(compiler, for_machine, 'lld', prefix, version=search_version(o))
+            else:
+                return ClangClDynamicLinker(for_machine, exelist=compiler, prefix=prefix, version=search_version(o))
+        elif o.startswith('Microsoft'):
+            match = re.search(r'.*(X86|X64|ARM|ARM64).*', o)
+            if match:
+                target = str(match.group(1))
+            else:
+                target = 'x86'
+            return MSVCDynamicLinker(
+                for_machine, machine=target, exelist=compiler, prefix=prefix,
+                version=search_version(o))
+        raise MesonException('Cannot guess dynamic linker')
+
+    @staticmethod
+    def _guess_nix_linker(compiler: typing.List[str], for_machine: MachineChoice,
+                          prefix: typing.Union[str, typing.List[str]], *,
+                          extra_args: typing.Optional[typing.List[str]] = None) -> 'DynamicLinker':
+        """Helper for guessing what linker to use on Unix-Like OSes.
+
+        :prefix: The prefix that the compiler uses to proxy arguments to the
+            linker, if required. This can be passed as a string or a list of
+            strings. If it is passed as a string then the arguments to be
+            proxied to the linker will be concatenated, if it is a list they
+            will be appended. This means that if a space is required (such as
+            with swift which wants `-Xlinker --version` and *not*
+            `-Xlinker=--version`) you must pass as a list.
+        :extra_args: Any addtional arguments rquired (such as a source file)
+        """
+        extra_args = typing.cast(typing.List[str], extra_args or [])
+        if isinstance(prefix, str):
+            check_args = [prefix + '--version'] + extra_args
+        else:
+            check_args = prefix + ['--version'] + extra_args
+        _, o, e = Popen_safe(compiler + check_args)
+        v = search_version(o)
+        if o.startswith('LLD'):
+            linker = LLVMDynamicLinker(compiler, for_machine, 'lld', prefix, version=v)  # type: DynamicLinker
+        elif e.startswith('lld-link: '):
+            # Toolchain wrapper got in the way; this happens with e.g. https://github.com/mstorsjo/llvm-mingw
+            # Let's try to extract the linker invocation command to grab the version.
+
+            _, o, e = Popen_safe(compiler + check_args + ['-v'])
+
+            try:
+                linker_cmd = re.match(r'.*\n(.*?)\nlld-link: ', e, re.DOTALL).group(1)
+                linker_cmd = shlex.split(linker_cmd)[0]
+            except (AttributeError, IndexError, ValueError):
+                pass
+            else:
+                _, o, e = Popen_safe([linker_cmd, '--version'])
+                v = search_version(o)
+
+            linker = LLVMDynamicLinker(compiler, for_machine, 'lld', prefix, version=v)
+        # first is for apple clang, second is for real gcc
+        elif e.endswith('(use -v to see invocation)\n') or 'macosx_version' in e:
+            if isinstance(prefix, str):
+                _, _, e = Popen_safe(compiler + [prefix + '-v'] + extra_args)
+            else:
+                _, _, e = Popen_safe(compiler + prefix + ['-v'] + extra_args)
+            i = 'APPLE ld'
+            for line in e.split('\n'):
+                if 'PROJECT:ld' in line:
+                    v = line.split('-')[1]
+                    break
+            else:
+                v = 'unknown version'
+            linker = AppleDynamicLinker(compiler, for_machine, i, prefix, version=v)
+        elif 'GNU' in o:
+            if 'gold' in o:
+                i = 'GNU ld.gold'
+            else:
+                i = 'GNU ld.bfd'
+            linker = GnuDynamicLinker(compiler, for_machine, i, prefix, version=v)
+        elif 'Solaris' in e or 'Solaris' in o:
+            linker = SolarisDynamicLinker(
+                compiler, for_machine, 'solaris', prefix,
+                version=search_version(e))
+        else:
+            raise MesonException('Unable to determine dynamic linker.')
+        return linker
+
+    def _detect_c_or_cpp_compiler(self, lang: str, for_machine: MachineChoice) -> Compiler:
         popen_exceptions = {}
-        compilers, ccache, is_cross, exe_wrap = self._get_compilers(lang, want_cross)
+        compilers, ccache, exe_wrap = self._get_compilers(lang, for_machine)
+        is_cross = not self.machines.matches_build_machine(for_machine)
+
         for compiler in compilers:
             if isinstance(compiler, str):
                 compiler = [compiler]
@@ -599,8 +862,12 @@
                 arg = '--vsn'
             elif 'ccrx' in compiler[0]:
                 arg = '-v'
+            elif 'icl' in compiler[0]:
+                # if you pass anything to icl you get stuck in a pager
+                arg = ''
             else:
                 arg = '--version'
+
             try:
                 p, out, err = Popen_safe(compiler + [arg])
             except OSError as e:
@@ -614,7 +881,7 @@
             version = search_version(out)
 
             guess_gcc_or_lcc = False
-            if 'Free Software Foundation' in out:
+            if 'Free Software Foundation' in out or 'xt-' in out:
                 guess_gcc_or_lcc = 'gcc'
             if 'e2k' in out and 'lcc' in out:
                 guess_gcc_or_lcc = 'lcc'
@@ -625,13 +892,23 @@
                     popen_exceptions[' '.join(compiler)] = 'no pre-processor defines'
                     continue
                 compiler_type = self.get_gnu_compiler_type(defines)
+
                 if guess_gcc_or_lcc == 'lcc':
                     version = self.get_lcc_version_from_defines(defines)
                     cls = ElbrusCCompiler if lang == 'c' else ElbrusCPPCompiler
                 else:
                     version = self.get_gnu_version_from_defines(defines)
                     cls = GnuCCompiler if lang == 'c' else GnuCPPCompiler
-                return cls(ccache + compiler, version, compiler_type, is_cross, exe_wrap, defines, full_version=full_version)
+
+                linker = self._guess_nix_linker(compiler, for_machine, cls.LINKER_PREFIX)
+                return cls(ccache + compiler, version, compiler_type,
+                           for_machine, is_cross, exe_wrap, defines,
+                           full_version=full_version, linker=linker)
+
+            if 'Emscripten' in out:
+                cls = EmscriptenCCompiler if lang == 'c' else EmscriptenCPPCompiler
+                compiler_type = CompilerType.CLANG_EMSCRIPTEN
+                return cls(ccache + compiler, version, compiler_type, for_machine, is_cross, exe_wrap, full_version=full_version)
 
             if 'armclang' in out:
                 # The compiler version is not present in the first line of output,
@@ -649,7 +926,8 @@
                 full_version = arm_ver_str
                 compiler_type = CompilerType.ARM_WIN
                 cls = ArmclangCCompiler if lang == 'c' else ArmclangCPPCompiler
-                return cls(ccache + compiler, version, compiler_type, is_cross, exe_wrap, full_version=full_version)
+                linker = ArmClangDynamicLinker(for_machine, version=version)
+                return cls(ccache + compiler, version, compiler_type, for_machine, is_cross, exe_wrap, full_version=full_version, linker=linker)
             if 'CL.EXE COMPATIBILITY' in out:
                 # if this is clang-cl masquerading as cl, detect it as cl, not
                 # clang
@@ -659,62 +937,135 @@
                 except OSError as e:
                     popen_exceptions[' '.join(compiler + [arg])] = e
                 version = search_version(out)
-                is_64 = 'Target: x86_64' in out
+                match = re.search('^Target: (.*?)-', out, re.MULTILINE)
+                if match:
+                    target = match.group(1)
+                else:
+                    target = 'unknown target'
                 cls = ClangClCCompiler if lang == 'c' else ClangClCPPCompiler
-                return cls(compiler, version, is_cross, exe_wrap, is_64)
+                linker = ClangClDynamicLinker(for_machine, version=version)
+                return cls(compiler, version, for_machine, is_cross, exe_wrap, target, linker=linker)
             if 'clang' in out:
-                if 'Apple' in out or mesonlib.for_darwin(want_cross, self):
+                linker = None
+                cls = ClangCCompiler if lang == 'c' else ClangCPPCompiler
+                if 'Apple' in out or self.machines[for_machine].is_darwin():
                     compiler_type = CompilerType.CLANG_OSX
-                elif 'windows' in out or mesonlib.for_windows(want_cross, self):
+                elif 'windows' in out or self.machines[for_machine].is_windows():
                     compiler_type = CompilerType.CLANG_MINGW
+                    # If we're in a MINGW context this actually will use a gnu style ld
+                    try:
+                        linker = self._guess_win_linker(compiler, for_machine, cls.LINKER_PREFIX)
+                    except MesonException:
+                        pass
                 else:
                     compiler_type = CompilerType.CLANG_STANDARD
-                cls = ClangCCompiler if lang == 'c' else ClangCPPCompiler
-                return cls(ccache + compiler, version, compiler_type, is_cross, exe_wrap, full_version=full_version)
+                if linker is None:
+                    linker = self._guess_nix_linker(compiler, for_machine, cls.LINKER_PREFIX)
+                return cls(ccache + compiler, version, compiler_type, for_machine, is_cross, exe_wrap, full_version=full_version, linker=linker)
+            if 'Intel(R) C++ Intel(R)' in err:
+                version = search_version(err)
+                target = 'x86' if 'IA-32' in err else 'x86_64'
+                cls = IntelClCCompiler if lang == 'c' else IntelClCPPCompiler
+                linker = XilinkDynamicLinker(for_machine, version=version)
+                return cls(compiler, version, for_machine, is_cross, exe_wrap, target, linker=linker)
             if 'Microsoft' in out or 'Microsoft' in err:
                 # Latest versions of Visual Studio print version
                 # number to stderr but earlier ones print version
                 # on stdout.  Why? Lord only knows.
                 # Check both outputs to figure out version.
-                version = search_version(err)
-                if version == 'unknown version':
-                    version = search_version(out)
-                if version == 'unknown version':
-                    m = 'Failed to detect MSVC compiler arch: stderr was\n{!r}'
+                for lookat in [err, out]:
+                    version = search_version(lookat)
+                    if version != 'unknown version':
+                        break
+                else:
+                    m = 'Failed to detect MSVC compiler version: stderr was\n{!r}'
                     raise EnvironmentException(m.format(err))
-                is_64 = err.split('\n')[0].endswith(' x64')
+                match = re.search(' for .*(x86|x64|ARM|ARM64)$', lookat.split('\n')[0])
+                if match:
+                    target = match.group(1)
+                else:
+                    target = 'x86'
+                linker = MSVCDynamicLinker(for_machine, version=version)
                 cls = VisualStudioCCompiler if lang == 'c' else VisualStudioCPPCompiler
-                return cls(compiler, version, is_cross, exe_wrap, is_64)
+                return cls(compiler, version, for_machine, is_cross, exe_wrap, target, linker=linker)
+            if 'PGI Compilers' in out:
+                if self.machines[for_machine].is_darwin():
+                    compiler_type = CompilerType.PGI_OSX
+                elif self.machines[for_machine].is_windows():
+                    compiler_type = CompilerType.PGI_WIN
+                else:
+                    compiler_type = CompilerType.PGI_STANDARD
+                cls = PGICCompiler if lang == 'c' else PGICPPCompiler
+                linker = PGIDynamicLinker(compiler, for_machine, 'pgi', cls.LINKER_PREFIX, version=version)
+                return cls(ccache + compiler, version, compiler_type, for_machine, is_cross, exe_wrap, linker=linker)
             if '(ICC)' in out:
-                if mesonlib.for_darwin(want_cross, self):
+                cls = IntelCCompiler if lang == 'c' else IntelCPPCompiler
+                if self.machines[for_machine].is_darwin():
                     compiler_type = CompilerType.ICC_OSX
-                elif mesonlib.for_windows(want_cross, self):
-                    # TODO: fix ICC on Windows
-                    compiler_type = CompilerType.ICC_WIN
+                    l = XildAppleDynamicLinker(compiler, for_machine, 'xild', '-Wl,', version=version)
                 else:
                     compiler_type = CompilerType.ICC_STANDARD
-                cls = IntelCCompiler if lang == 'c' else IntelCPPCompiler
-                return cls(ccache + compiler, version, compiler_type, is_cross, exe_wrap, full_version=full_version)
+                    l = XildLinuxDynamicLinker(compiler, for_machine, 'xild', '-Wl,', version=version)
+                return cls(ccache + compiler, version, compiler_type, for_machine, is_cross, exe_wrap, full_version=full_version, linker=l)
             if 'ARM' in out:
                 compiler_type = CompilerType.ARM_WIN
                 cls = ArmCCompiler if lang == 'c' else ArmCPPCompiler
-                return cls(ccache + compiler, version, compiler_type, is_cross, exe_wrap, full_version=full_version)
+                linker = ArmDynamicLinker(for_machine, version=version)
+                return cls(ccache + compiler, version, compiler_type, for_machine, is_cross, exe_wrap, full_version=full_version, linker=linker)
             if 'RX Family' in out:
                 compiler_type = CompilerType.CCRX_WIN
                 cls = CcrxCCompiler if lang == 'c' else CcrxCPPCompiler
-                return cls(ccache + compiler, version, compiler_type, is_cross, exe_wrap, full_version=full_version)
+                linker = CcrxDynamicLinker(for_machine, version=version)
+                return cls(ccache + compiler, version, compiler_type, for_machine, is_cross, exe_wrap, full_version=full_version, linker=linker)
 
         self._handle_exceptions(popen_exceptions, compilers)
 
-    def detect_c_compiler(self, want_cross):
-        return self._detect_c_or_cpp_compiler('c', want_cross)
+    def detect_c_compiler(self, for_machine):
+        return self._detect_c_or_cpp_compiler('c', for_machine)
 
-    def detect_cpp_compiler(self, want_cross):
-        return self._detect_c_or_cpp_compiler('cpp', want_cross)
+    def detect_cpp_compiler(self, for_machine):
+        return self._detect_c_or_cpp_compiler('cpp', for_machine)
 
-    def detect_fortran_compiler(self, want_cross):
+    def detect_cuda_compiler(self, for_machine):
         popen_exceptions = {}
-        compilers, ccache, is_cross, exe_wrap = self._get_compilers('fortran', want_cross)
+        is_cross = not self.machines.matches_build_machine(for_machine)
+        compilers, ccache, exe_wrap = self._get_compilers('cuda', for_machine)
+        for compiler in compilers:
+            if isinstance(compiler, str):
+                compiler = [compiler]
+            else:
+                raise EnvironmentException()
+            arg = '--version'
+            try:
+                p, out, err = Popen_safe(compiler + [arg])
+            except OSError as e:
+                popen_exceptions[' '.join(compiler + [arg])] = e
+                continue
+            # Example nvcc printout:
+            #
+            #     nvcc: NVIDIA (R) Cuda compiler driver
+            #     Copyright (c) 2005-2018 NVIDIA Corporation
+            #     Built on Sat_Aug_25_21:08:01_CDT_2018
+            #     Cuda compilation tools, release 10.0, V10.0.130
+            #
+            # search_version() first finds the "10.0" after "release",
+            # rather than the more precise "10.0.130" after "V".
+            # The patch version number is occasionally important; For
+            # instance, on Linux,
+            #    - CUDA Toolkit 8.0.44 requires NVIDIA Driver 367.48
+            #    - CUDA Toolkit 8.0.61 requires NVIDIA Driver 375.26
+            # Luckily, the "V" also makes it very simple to extract
+            # the full version:
+            version = out.strip().split('V')[-1]
+            cpp_compiler = self.detect_cpp_compiler(for_machine)
+            linker = CudaLinker(compiler, for_machine, 'nvlink', CudaCompiler.LINKER_PREFIX, version=CudaLinker.parse_version())
+            return CudaCompiler(ccache + compiler, version, for_machine, is_cross, exe_wrap, host_compiler=cpp_compiler, linker=linker)
+        raise EnvironmentException('Could not find suitable CUDA compiler: "' + ' '.join(compilers) + '"')
+
+    def detect_fortran_compiler(self, for_machine: MachineChoice):
+        popen_exceptions = {}
+        compilers, ccache, exe_wrap = self._get_compilers('fortran', for_machine)
+        is_cross = not self.machines.matches_build_machine(for_machine)
         for compiler in compilers:
             if isinstance(compiler, str):
                 compiler = [compiler]
@@ -746,64 +1097,67 @@
                     else:
                         version = self.get_gnu_version_from_defines(defines)
                         cls = GnuFortranCompiler
-                    return cls(compiler, version, compiler_type, is_cross, exe_wrap, defines, full_version=full_version)
+                    linker = self._guess_nix_linker(compiler, for_machine, cls.LINKER_PREFIX)
+                    return cls(compiler, version, compiler_type, for_machine, is_cross, exe_wrap, defines, full_version=full_version, linker=linker)
 
                 if 'G95' in out:
-                    return G95FortranCompiler(compiler, version, is_cross, exe_wrap, full_version=full_version)
+                    linker = self._guess_nix_linker(compiler, for_machine, G95FortranCompiler.LINKER_PREFIX)
+                    return G95FortranCompiler(compiler, version, for_machine, is_cross, exe_wrap, full_version=full_version, linker=linker)
 
                 if 'Sun Fortran' in err:
                     version = search_version(err)
-                    return SunFortranCompiler(compiler, version, is_cross, exe_wrap, full_version=full_version)
+                    linker = self._guess_nix_linker(compiler, for_machine, SunFortranCompiler.LINKER_PREFIX)
+                    return SunFortranCompiler(compiler, version, for_machine, is_cross, exe_wrap, full_version=full_version, linker=linker)
+
+                if 'Intel(R) Visual Fortran' in err:
+                    version = search_version(err)
+                    target = 'x86' if 'IA-32' in err else 'x86_64'
+                    linker = XilinkDynamicLinker(for_machine, version=version)
+                    return IntelClFortranCompiler(compiler, version, for_machine, is_cross, target, exe_wrap, linker=linker)
 
                 if 'ifort (IFORT)' in out:
-                    return IntelFortranCompiler(compiler, version, is_cross, exe_wrap, full_version=full_version)
+                    linker = XildLinuxDynamicLinker(compiler, for_machine, 'xild', '-Wl,', version=version)
+                    return IntelFortranCompiler(compiler, version, for_machine, is_cross, exe_wrap, full_version=full_version, linker=linker)
 
                 if 'PathScale EKOPath(tm)' in err:
-                    return PathScaleFortranCompiler(compiler, version, is_cross, exe_wrap, full_version=full_version)
+                    return PathScaleFortranCompiler(compiler, version, for_machine, is_cross, exe_wrap, full_version=full_version)
 
                 if 'PGI Compilers' in out:
-                    return PGIFortranCompiler(compiler, version, is_cross, exe_wrap, full_version=full_version)
+                    if self.machines[for_machine].is_darwin():
+                        compiler_type = CompilerType.PGI_OSX
+                    elif self.machines[for_machine].is_windows():
+                        compiler_type = CompilerType.PGI_WIN
+                    else:
+                        compiler_type = CompilerType.PGI_STANDARD
+                    linker = PGIDynamicLinker(compiler, for_machine, 'pgi', PGIFortranCompiler.LINKER_PREFIX, version=version)
+                    return PGIFortranCompiler(compiler, version, compiler_type, for_machine, is_cross, exe_wrap, full_version=full_version, linker=linker)
+
+                if 'flang' in out or 'clang' in out:
+                    linker = self._guess_nix_linker(compiler, for_machine, FlangFortranCompiler.LINKER_PREFIX)
+                    return FlangFortranCompiler(compiler, version, for_machine, is_cross, exe_wrap, full_version=full_version, linker=linker)
 
                 if 'Open64 Compiler Suite' in err:
-                    return Open64FortranCompiler(compiler, version, is_cross, exe_wrap, full_version=full_version)
+                    linker = self._guess_nix_linker(compiler, for_machine, Open64FortranCompiler.LINKER_PREFIX)
+                    return Open64FortranCompiler(compiler, version, for_machine, is_cross, exe_wrap, full_version=full_version, linker=linker)
 
                 if 'NAG Fortran' in err:
-                    return NAGFortranCompiler(compiler, version, is_cross, exe_wrap, full_version=full_version)
+                    linker = self._guess_nix_linker(compiler, for_machine, NAGFortranCompiler.LINKER_PREFIX)
+                    return NAGFortranCompiler(compiler, version, for_machine, is_cross, exe_wrap, full_version=full_version, linker=linker)
         self._handle_exceptions(popen_exceptions, compilers)
 
     def get_scratch_dir(self):
         return self.scratch_dir
 
-    def detect_objc_compiler(self, want_cross):
-        popen_exceptions = {}
-        compilers, ccache, is_cross, exe_wrap = self._get_compilers('objc', want_cross)
-        for compiler in compilers:
-            if isinstance(compiler, str):
-                compiler = [compiler]
-            arg = ['--version']
-            try:
-                p, out, err = Popen_safe(compiler + arg)
-            except OSError as e:
-                popen_exceptions[' '.join(compiler + arg)] = e
-                continue
-            version = search_version(out)
-            if 'Free Software Foundation' in out or ('e2k' in out and 'lcc' in out):
-                defines = self.get_gnu_compiler_defines(compiler)
-                if not defines:
-                    popen_exceptions[' '.join(compiler)] = 'no pre-processor defines'
-                    continue
-                compiler_type = self.get_gnu_compiler_type(defines)
-                version = self.get_gnu_version_from_defines(defines)
-                return GnuObjCCompiler(ccache + compiler, version, compiler_type, is_cross, exe_wrap, defines)
-            if out.startswith('Apple LLVM'):
-                return ClangObjCCompiler(ccache + compiler, version, CompilerType.CLANG_OSX, is_cross, exe_wrap)
-            if out.startswith('clang'):
-                return ClangObjCCompiler(ccache + compiler, version, CompilerType.CLANG_STANDARD, is_cross, exe_wrap)
-        self._handle_exceptions(popen_exceptions, compilers)
+    def detect_objc_compiler(self, for_machine: MachineInfo) -> 'Compiler':
+        return self._detect_objc_or_objcpp_compiler(for_machine, True)
+
+    def detect_objcpp_compiler(self, for_machine: MachineInfo) -> 'Compiler':
+        return self._detect_objc_or_objcpp_compiler(for_machine, False)
 
-    def detect_objcpp_compiler(self, want_cross):
+    def _detect_objc_or_objcpp_compiler(self, for_machine: MachineInfo, objc: bool) -> 'Compiler':
         popen_exceptions = {}
-        compilers, ccache, is_cross, exe_wrap = self._get_compilers('objcpp', want_cross)
+        compilers, ccache, exe_wrap = self._get_compilers('objc' if objc else 'objcpp', for_machine)
+        is_cross = not self.machines.matches_build_machine(for_machine)
         for compiler in compilers:
             if isinstance(compiler, str):
                 compiler = [compiler]
@@ -821,17 +1175,31 @@
                     continue
                 compiler_type = self.get_gnu_compiler_type(defines)
                 version = self.get_gnu_version_from_defines(defines)
-                return GnuObjCPPCompiler(ccache + compiler, version, compiler_type, is_cross, exe_wrap, defines)
-            if out.startswith('Apple LLVM'):
-                return ClangObjCPPCompiler(ccache + compiler, version, CompilerType.CLANG_OSX, is_cross, exe_wrap)
-            if out.startswith('clang'):
-                return ClangObjCPPCompiler(ccache + compiler, version, CompilerType.CLANG_STANDARD, is_cross, exe_wrap)
+                comp = GnuObjCCompiler if objc else GnuObjCPPCompiler
+                linker = self._guess_nix_linker(compiler, for_machine, comp.LINKER_PREFIX)
+                return comp(ccache + compiler, version, compiler_type, for_machine, is_cross, exe_wrap, defines, linker=linker)
+            if 'clang' in out:
+                linker = None
+                comp = ClangObjCCompiler if objc else ClangObjCPPCompiler
+                if 'Apple' in out or self.machines[for_machine].is_darwin():
+                    compiler_type = CompilerType.CLANG_OSX
+                elif 'windows' in out or self.machines[for_machine].is_windows():
+                    compiler_type = CompilerType.CLANG_MINGW
+                    # If we're in a MINGW context this actually will use a gnu style ld
+                    try:
+                        linker = self._guess_win_linker(compiler, for_machine, comp.LINKER_PREFIX)
+                    except MesonException:
+                        pass
+                else:
+                    compiler_type = CompilerType.CLANG_STANDARD
+                if not linker:
+                    linker = self._guess_nix_linker(compiler, for_machine, comp.LINKER_PREFIX)
+                return comp(ccache + compiler, version, compiler_type, for_machine, is_cross, exe_wrap, linker=linker)
         self._handle_exceptions(popen_exceptions, compilers)
 
-    def detect_java_compiler(self):
-        if 'java' in self.config_info.binaries:
-            exelist = mesonlib.stringlistify(self.config_info.binaries['java'])
-        else:
+    def detect_java_compiler(self, for_machine):
+        exelist = self.binaries.host.lookup_entry('java')
+        if exelist is None:
             # TODO support fallback
             exelist = [self.default_java[0]]
 
@@ -841,11 +1209,15 @@
             raise EnvironmentException('Could not execute Java compiler "%s"' % ' '.join(exelist))
         if 'javac' in out or 'javac' in err:
             version = search_version(err if 'javac' in err else out)
-            return JavaCompiler(exelist, version)
+            if not version or version == 'unknown version':
+                parts = (err if 'javac' in err else out).split()
+                if len(parts) > 1:
+                    version = parts[1]
+            return JavaCompiler(exelist, version, for_machine)
         raise EnvironmentException('Unknown compiler "' + ' '.join(exelist) + '"')
 
-    def detect_cs_compiler(self):
-        compilers, ccache, is_cross, exe_wrap = self._get_compilers('cs', False)
+    def detect_cs_compiler(self, for_machine):
+        compilers, ccache, exe_wrap = self._get_compilers('cs', for_machine)
         popen_exceptions = {}
         for comp in compilers:
             if not isinstance(comp, list):
@@ -858,32 +1230,32 @@
 
             version = search_version(out)
             if 'Mono' in out:
-                return MonoCompiler(comp, version)
+                return MonoCompiler(comp, version, for_machine)
             elif "Visual C#" in out:
-                return VisualStudioCsCompiler(comp, version)
+                return VisualStudioCsCompiler(comp, version, for_machine)
 
         self._handle_exceptions(popen_exceptions, compilers)
 
-    def detect_vala_compiler(self):
-        if 'VALAC' in os.environ:
-            exelist = shlex.split(os.environ['VALAC'])
-        elif 'vala' in self.config_info.binaries:
-            exelist = mesonlib.stringlistify(self.config_info.binaries['vala'])
-        else:
+    def detect_vala_compiler(self, for_machine):
+        exelist = self.binaries.host.lookup_entry('vala')
+        is_cross = not self.machines.matches_build_machine(for_machine)
+        if exelist is None:
             # TODO support fallback
             exelist = [self.default_vala[0]]
+
         try:
             p, out = Popen_safe(exelist + ['--version'])[0:2]
         except OSError:
             raise EnvironmentException('Could not execute Vala compiler "%s"' % ' '.join(exelist))
         version = search_version(out)
         if 'Vala' in out:
-            return ValaCompiler(exelist, version)
+            return ValaCompiler(exelist, version, for_machine, is_cross)
         raise EnvironmentException('Unknown compiler "' + ' '.join(exelist) + '"')
 
-    def detect_rust_compiler(self, want_cross):
+    def detect_rust_compiler(self, for_machine):
         popen_exceptions = {}
-        compilers, ccache, is_cross, exe_wrap = self._get_compilers('rust', want_cross)
+        compilers, ccache, exe_wrap = self._get_compilers('rust', for_machine)
+        is_cross = not self.machines.matches_build_machine(for_machine)
         for compiler in compilers:
             if isinstance(compiler, str):
                 compiler = [compiler]
@@ -897,25 +1269,32 @@
             version = search_version(out)
 
             if 'rustc' in out:
-                return RustCompiler(compiler, version, is_cross, exe_wrap)
+                # Chalk up another quirk for rust. There is no way (AFAICT) to
+                # figure out what linker rustc is using for a non-nightly compiler
+                # (On nightly you can pass -Z print-link-args). So we're going to
+                # hard code the linker based on the platform.
+                # Currenty gnu ld is used for everything except apple by
+                # default, and apple ld is used on mac.
+                # TODO: find some better way to figure this out.
+                if self.machines[for_machine].is_darwin():
+                    linker = AppleDynamicLinker([], for_machine, 'Apple ld', '-Wl,')
+                else:
+                    linker = GnuDynamicLinker([], for_machine, 'GNU ld', '-Wl,')
+                return RustCompiler(compiler, version, for_machine, is_cross, exe_wrap, linker=linker)
 
         self._handle_exceptions(popen_exceptions, compilers)
 
-    def detect_d_compiler(self, want_cross):
-        is_cross = False
+    def detect_d_compiler(self, for_machine: MachineChoice):
+        exelist = self.binaries[for_machine].lookup_entry('d')
         # Search for a D compiler.
         # We prefer LDC over GDC unless overridden with the DC
         # environment variable because LDC has a much more
         # up to date language version at time (2016).
-        if 'DC' in os.environ:
-            exelist = shlex.split(os.environ['DC'])
+        if exelist is not None:
             if os.path.basename(exelist[-1]).startswith(('ldmd', 'gdmd')):
-                    raise EnvironmentException('Meson doesn\'t support %s as it\'s only a DMD frontend for another compiler. Please provide a valid value for DC or unset it so that Meson can resolve the compiler by itself.' % exelist[-1])
-        elif self.is_cross_build() and want_cross:
-            exelist = mesonlib.stringlistify(self.cross_info.config['binaries']['d'])
-            is_cross = True
-        elif 'd' in self.config_info.binaries:
-            exelist = mesonlib.stringlistify(self.config_info.binaries['d'])
+                raise EnvironmentException(
+                    'Meson does not support {} as it is only a DMD frontend for another compiler.'
+                    'Please provide a valid value for DC or unset it so that Meson can resolve the compiler by itself.'.format(exelist[-1]))
         else:
             for d in self.default_d:
                 if shutil.which(d):
@@ -935,64 +1314,148 @@
         c_compiler = {}
         is_msvc = mesonlib.is_windows() and 'VCINSTALLDIR' in os.environ
         if is_msvc:
-            c_compiler = {'c': self.detect_c_compiler(want_cross)} # MSVC compiler is required for correct platform detection.
+            c_compiler = {'c': self.detect_c_compiler(for_machine)} # MSVC compiler is required for correct platform detection.
 
         arch = detect_cpu_family(c_compiler)
         if is_msvc and arch == 'x86':
             arch = 'x86_mscoff'
 
         if 'LLVM D compiler' in out:
-            return compilers.LLVMDCompiler(exelist, version, is_cross, arch, full_version=full_version)
+            # LDC seems to require a file
+            m = self.machines[for_machine]
+            if m.is_windows() or m.is_cygwin():
+                if is_msvc:
+                    linker = MSVCDynamicLinker(for_machine, version=version)
+                else:
+                    # Getting LDC on windows to give useful linker output when not
+                    # doing real work is painfully hard. It ships with a verison of
+                    # lld-link, so just assume that we're going to use lld-link
+                    # with it.
+                    _, o, _ = Popen_safe(['lld-link.exe', '--version'])
+                    linker = ClangClDynamicLinker(for_machine, version=search_version(o))
+            else:
+                with tempfile.NamedTemporaryFile(suffix='.d') as f:
+                    linker = self._guess_nix_linker(
+                        exelist, for_machine,
+                        compilers.LLVMDCompiler.LINKER_PREFIX,
+                        extra_args=[f.name])
+            return compilers.LLVMDCompiler(exelist, version, for_machine, arch, full_version=full_version, linker=linker)
         elif 'gdc' in out:
-            return compilers.GnuDCompiler(exelist, version, is_cross, arch, full_version=full_version)
+            linker = self._guess_nix_linker(exelist, for_machine, compilers.GnuDCompiler.LINKER_PREFIX)
+            return compilers.GnuDCompiler(exelist, version, for_machine, arch, full_version=full_version, linker=linker)
         elif 'The D Language Foundation' in out or 'Digital Mars' in out:
-            return compilers.DmdDCompiler(exelist, version, is_cross, arch, full_version=full_version)
+            # DMD seems to require a file
+            m = self.machines[for_machine]
+            if m.is_windows() or m.is_cygwin():
+                if is_msvc:
+                    linker = MSVCDynamicLinker(for_machine, version=version)
+                elif arch == 'x86':
+                    linker = OptlinkDynamicLinker(for_machine, version=full_version)
+                else:
+                    # DMD ships with lld-link
+                    _, o, _ = Popen_safe(['lld-link.exe', '--version'])
+                    linker = ClangClDynamicLinker(for_machine, version=search_version(o))
+            else:
+                with tempfile.NamedTemporaryFile(suffix='.d') as f:
+                    linker = self._guess_nix_linker(
+                        exelist, for_machine,
+                        compilers.LLVMDCompiler.LINKER_PREFIX,
+                        extra_args=[f.name])
+            return compilers.DmdDCompiler(exelist, version, for_machine, arch, full_version=full_version, linker=linker)
         raise EnvironmentException('Unknown compiler "' + ' '.join(exelist) + '"')
 
-    def detect_swift_compiler(self):
-        if 'swift' in self.config_info.binaries:
-            exelist = mesonlib.stringlistify(self.config_info.binaries['swift'])
-        else:
+    def detect_swift_compiler(self, for_machine):
+        exelist = self.binaries.host.lookup_entry('swift')
+        is_cross = not self.machines.matches_build_machine(for_machine)
+        if exelist is None:
             # TODO support fallback
             exelist = [self.default_swift[0]]
+
         try:
             p, _, err = Popen_safe(exelist + ['-v'])
         except OSError:
             raise EnvironmentException('Could not execute Swift compiler "%s"' % ' '.join(exelist))
         version = search_version(err)
         if 'Swift' in err:
-            return compilers.SwiftCompiler(exelist, version)
+            # As for 5.0.1 swiftc *requires* a file to check the linker:
+            with tempfile.NamedTemporaryFile(suffix='.swift') as f:
+                linker = self._guess_nix_linker(
+                    exelist, for_machine, compilers.SwiftCompiler.LINKER_PREFIX, extra_args=[f.name])
+            return compilers.SwiftCompiler(exelist, version, for_machine, is_cross, linker=linker)
+
         raise EnvironmentException('Unknown compiler "' + ' '.join(exelist) + '"')
 
+    def compiler_from_language(self, lang: str, for_machine: MachineChoice):
+        if lang == 'c':
+            comp = self.detect_c_compiler(for_machine)
+        elif lang == 'cpp':
+            comp = self.detect_cpp_compiler(for_machine)
+        elif lang == 'objc':
+            comp = self.detect_objc_compiler(for_machine)
+        elif lang == 'cuda':
+            comp = self.detect_cuda_compiler(for_machine)
+        elif lang == 'objcpp':
+            comp = self.detect_objcpp_compiler(for_machine)
+        elif lang == 'java':
+            comp = self.detect_java_compiler(for_machine)
+        elif lang == 'cs':
+            comp = self.detect_cs_compiler(for_machine)
+        elif lang == 'vala':
+            comp = self.detect_vala_compiler(for_machine)
+        elif lang == 'd':
+            comp = self.detect_d_compiler(for_machine)
+        elif lang == 'rust':
+            comp = self.detect_rust_compiler(for_machine)
+        elif lang == 'fortran':
+            comp = self.detect_fortran_compiler(for_machine)
+        elif lang == 'swift':
+            comp = self.detect_swift_compiler(for_machine)
+        else:
+            comp = None
+        return comp
+
+    def detect_compiler_for(self, lang: str, for_machine: MachineChoice):
+        comp = self.compiler_from_language(lang, for_machine)
+        if comp is not None:
+            assert comp.for_machine == for_machine
+            self.coredata.process_new_compiler(lang, comp, self)
+        return comp
+
     def detect_static_linker(self, compiler):
-        if compiler.is_cross:
-            linker = self.cross_info.config['binaries']['ar']
-            if isinstance(linker, str):
-                linker = [linker]
+        linker = self.binaries[compiler.for_machine].lookup_entry('ar')
+        if linker is not None:
             linkers = [linker]
         else:
-            evar = BinaryTable.evarMap['ar']
-            if evar in os.environ:
-                linkers = [shlex.split(os.environ[evar])]
-            elif isinstance(compiler, compilers.VisualStudioCCompiler):
+            evar = 'AR'
+            defaults = [[l] for l in self.default_static_linker]
+            if isinstance(compiler, compilers.CudaCompiler):
+                linkers = [self.cuda_static_linker] + defaults
+            elif evar in os.environ:
+                linkers = [split_args(os.environ[evar])]
+            elif isinstance(compiler, compilers.VisualStudioLikeCompiler):
                 linkers = [self.vs_static_linker, self.clang_cl_static_linker]
             elif isinstance(compiler, compilers.GnuCompiler):
                 # Use gcc-ar if available; needed for LTO
-                linkers = [self.gcc_static_linker, self.default_static_linker]
+                linkers = [self.gcc_static_linker] + defaults
             elif isinstance(compiler, compilers.ClangCompiler):
                 # Use llvm-ar if available; needed for LTO
-                linkers = [self.clang_static_linker, self.default_static_linker]
+                linkers = [self.clang_static_linker] + defaults
             elif isinstance(compiler, compilers.DCompiler):
                 # Prefer static linkers over linkers used by D compilers
                 if mesonlib.is_windows():
                     linkers = [self.vs_static_linker, self.clang_cl_static_linker, compiler.get_linker_exelist()]
                 else:
-                    linkers = [self.default_static_linker, compiler.get_linker_exelist()]
+                    linkers = defaults
+            elif isinstance(compiler, IntelClCCompiler):
+                # Intel has it's own linker that acts like microsoft's lib
+                linkers = ['xilib']
+            elif isinstance(compiler, (PGICCompiler, PGIFortranCompiler)) and mesonlib.is_windows():
+                linkers = [self.default_static_linker]  # this is just a wrapper calling link/lib on Windows, keeping things simple.
             else:
-                linkers = [self.default_static_linker]
+                linkers = defaults
         popen_exceptions = {}
         for linker in linkers:
-            if not set(['lib', 'lib.exe', 'llvm-lib', 'llvm-lib.exe']).isdisjoint(linker):
+            if not {'lib', 'lib.exe', 'llvm-lib', 'llvm-lib.exe', 'xilib', 'xilib.exe'}.isdisjoint(linker):
                 arg = '/?'
             else:
                 arg = '--version'
@@ -1001,8 +1464,12 @@
             except OSError as e:
                 popen_exceptions[' '.join(linker + [arg])] = e
                 continue
+            if "xilib: executing 'lib'" in err:
+                return IntelVisualStudioLinker(linker, getattr(compiler, 'machine', None))
             if '/OUT:' in out.upper() or '/OUT:' in err.upper():
-                return VisualStudioLinker(linker)
+                return VisualStudioLinker(linker, getattr(compiler, 'machine', None))
+            if 'ar-Error-Unknown switch: --version' in err:
+                return PGIStaticLinker(linker)
             if p.returncode == 0 and ('armar' in linker or 'armar.exe' in linker):
                 return ArmarLinker(linker)
             if 'DMD32 D Compiler' in out or 'DMD64 D Compiler' in out:
@@ -1019,6 +1486,8 @@
                 return ArLinker(linker)
             if p.returncode == 1 and err.startswith('Usage'): # AIX
                 return ArLinker(linker)
+            if p.returncode == 1 and err.startswith('ar: bad option: --'): # Solaris
+                return ArLinker(linker)
         self._handle_exceptions(popen_exceptions, linkers, 'linker')
         raise EnvironmentException('Unknown static linker "%s"' % ' '.join(linkers))
 
@@ -1028,53 +1497,49 @@
     def get_build_dir(self):
         return self.build_dir
 
-    def get_exe_suffix(self):
-        return self.exe_suffix
-
-    def get_import_lib_dir(self):
+    def get_import_lib_dir(self) -> str:
         "Install dir for the import library (library used for linking)"
         return self.get_libdir()
 
-    def get_shared_module_dir(self):
+    def get_shared_module_dir(self) -> str:
         "Install dir for shared modules that are loaded at runtime"
         return self.get_libdir()
 
-    def get_shared_lib_dir(self):
+    def get_shared_lib_dir(self) -> str:
         "Install dir for the shared library"
-        if self.win_libdir_layout:
+        m = self.machines.host
+        # Windows has no RPATH or similar, so DLLs must be next to EXEs.
+        if m.is_windows() or m.is_cygwin():
             return self.get_bindir()
         return self.get_libdir()
 
-    def get_static_lib_dir(self):
+    def get_static_lib_dir(self) -> str:
         "Install dir for the static library"
         return self.get_libdir()
 
-    def get_object_suffix(self):
-        return self.object_suffix
-
-    def get_prefix(self):
+    def get_prefix(self) -> str:
         return self.coredata.get_builtin_option('prefix')
 
-    def get_libdir(self):
+    def get_libdir(self) -> str:
         return self.coredata.get_builtin_option('libdir')
 
-    def get_libexecdir(self):
+    def get_libexecdir(self) -> str:
         return self.coredata.get_builtin_option('libexecdir')
 
-    def get_bindir(self):
+    def get_bindir(self) -> str:
         return self.coredata.get_builtin_option('bindir')
 
-    def get_includedir(self):
+    def get_includedir(self) -> str:
         return self.coredata.get_builtin_option('includedir')
 
-    def get_mandir(self):
+    def get_mandir(self) -> str:
         return self.coredata.get_builtin_option('mandir')
 
-    def get_datadir(self):
+    def get_datadir(self) -> str:
         return self.coredata.get_builtin_option('datadir')
 
-    def get_compiler_system_dirs(self):
-        for comp in self.coredata.compilers.values():
+    def get_compiler_system_dirs(self, for_machine: MachineChoice):
+        for comp in self.coredata.compilers[for_machine].values():
             if isinstance(comp, compilers.ClangCompiler):
                 index = 1
                 break
@@ -1092,297 +1557,14 @@
         out = out.split('\n')[index].lstrip('libraries: =').split(':')
         return [os.path.normpath(p) for p in out]
 
+    def need_exe_wrapper(self, for_machine: MachineChoice = MachineChoice.HOST):
+        value = self.properties[for_machine].get('needs_exe_wrapper', None)
+        if value is not None:
+            return value
+        return not machine_info_can_run(self.machines[for_machine])
+
     def get_exe_wrapper(self):
-        if not self.cross_info.need_exe_wrapper():
+        if not self.need_exe_wrapper():
             from .dependencies import EmptyExternalProgram
             return EmptyExternalProgram()
         return self.exe_wrapper
-
-
-class CrossBuildInfo:
-    def __init__(self, filename):
-        self.config = {'properties': {}}
-        self.parse_datafile(filename)
-        if 'host_machine' not in self.config and 'target_machine' not in self.config:
-            raise mesonlib.MesonException('Cross info file must have either host or a target machine.')
-        if 'host_machine' in self.config and 'binaries' not in self.config:
-            raise mesonlib.MesonException('Cross file with "host_machine" is missing "binaries".')
-
-    def ok_type(self, i):
-        return isinstance(i, (str, int, bool))
-
-    def parse_datafile(self, filename):
-        config = configparser.ConfigParser()
-        try:
-            with open(filename, 'r') as f:
-                config.read_file(f, filename)
-        except FileNotFoundError:
-            raise EnvironmentException('File not found: %s.' % filename)
-        # This is a bit hackish at the moment.
-        for s in config.sections():
-            self.config[s] = {}
-            for entry in config[s]:
-                value = config[s][entry]
-                if ' ' in entry or '\t' in entry or "'" in entry or '"' in entry:
-                    raise EnvironmentException('Malformed variable name %s in cross file..' % entry)
-                try:
-                    res = eval(value, {'__builtins__': None}, {'true': True, 'false': False})
-                except Exception:
-                    raise EnvironmentException('Malformed value in cross file variable %s.' % entry)
-
-                if self.ok_type(res):
-                    self.config[s][entry] = res
-                elif isinstance(res, list):
-                    for i in res:
-                        if not self.ok_type(i):
-                            raise EnvironmentException('Malformed value in cross file variable %s.' % entry)
-                    self.config[s][entry] = res
-                else:
-                    raise EnvironmentException('Malformed value in cross file variable %s.' % entry)
-
-    def has_host(self):
-        return 'host_machine' in self.config
-
-    def has_target(self):
-        return 'target_machine' in self.config
-
-    def has_stdlib(self, language):
-        return language + '_stdlib' in self.config['properties']
-
-    def get_stdlib(self, language):
-        return self.config['properties'][language + '_stdlib']
-
-    def get_host_system(self):
-        "Name of host system like 'linux', or None"
-        if self.has_host():
-            return self.config['host_machine']['system']
-        return None
-
-    def get_properties(self):
-        return self.config['properties']
-
-    def get_root(self):
-        return self.get_properties().get('root', None)
-
-    def get_sys_root(self):
-        return self.get_properties().get('sys_root', None)
-
-    # When compiling a cross compiler we use the native compiler for everything.
-    # But not when cross compiling a cross compiler.
-    def need_cross_compiler(self):
-        return 'host_machine' in self.config
-
-    def need_exe_wrapper(self):
-        value = self.config['properties'].get('needs_exe_wrapper', None)
-        if value is not None:
-            return value
-        # Can almost always run 32-bit binaries on 64-bit natively if the host
-        # and build systems are the same. We don't pass any compilers to
-        # detect_cpu_family() here because we always want to know the OS
-        # architecture, not what the compiler environment tells us.
-        if self.has_host() and detect_cpu_family({}) == 'x86_64' and \
-           self.config['host_machine']['cpu_family'] == 'x86' and \
-           self.config['host_machine']['system'] == detect_system():
-            return False
-        return True
-
-class MachineInfo:
-    def __init__(self, system, cpu_family, cpu, endian):
-        self.system = system
-        self.cpu_family = cpu_family
-        self.cpu = cpu
-        self.endian = endian
-
-    def __eq__(self, other):
-        if self.__class__ is not other.__class__:
-            return NotImplemented
-        return \
-            self.system == other.system and \
-            self.cpu_family == other.cpu_family and \
-            self.cpu == other.cpu and \
-            self.endian == other.endian
-
-    def __ne__(self, other):
-        if self.__class__ is not other.__class__:
-            return NotImplemented
-        return not self.__eq__(other)
-
-    @staticmethod
-    def detect(compilers = None):
-        """Detect the machine we're running on
-
-        If compilers are not provided, we cannot know as much. None out those
-        fields to avoid accidentally depending on partial knowledge. The
-        underlying ''detect_*'' method can be called to explicitly use the
-        partial information.
-        """
-        return MachineInfo(
-            detect_system(),
-            detect_cpu_family(compilers) if compilers is not None else None,
-            detect_cpu(compilers) if compilers is not None else None,
-            sys.byteorder)
-
-    @staticmethod
-    def from_literal(literal):
-        minimum_literal = {'cpu', 'cpu_family', 'endian', 'system'}
-        if set(literal) < minimum_literal:
-            raise EnvironmentException(
-                'Machine info is currently {}\n'.format(literal) +
-                'but is missing {}.'.format(minimum_literal - set(literal)))
-
-        cpu_family = literal['cpu_family']
-        if cpu_family not in known_cpu_families:
-            mlog.warning('Unknown CPU family %s, please report this at https://github.com/mesonbuild/meson/issues/new' % cpu_family)
-
-        endian = literal['endian']
-        if endian not in ('little', 'big'):
-            mlog.warning('Unknown endian %s' % endian)
-
-        return MachineInfo(
-            literal['system'],
-            cpu_family,
-            literal['cpu'],
-            endian)
-
-    def is_windows(self):
-        """
-        Machine is windows?
-        """
-        return self.system == 'windows'
-
-    def is_cygwin(self):
-        """
-        Machine is cygwin?
-        """
-        return self.system == 'cygwin'
-
-    def is_linux(self):
-        """
-        Machine is linux?
-        """
-        return self.system == 'linux'
-
-    def is_darwin(self):
-        """
-        Machine is Darwin (iOS/OS X)?
-        """
-        return self.system in ('darwin', 'ios')
-
-    def is_android(self):
-        """
-        Machine is Android?
-        """
-        return self.system == 'android'
-
-    def is_haiku(self):
-        """
-        Machine is Haiku?
-        """
-        return self.system == 'haiku'
-
-    def is_openbsd(self):
-        """
-        Machine is OpenBSD?
-        """
-        return self.system == 'openbsd'
-
-    # Various prefixes and suffixes for import libraries, shared libraries,
-    # static libraries, and executables.
-    # Versioning is added to these names in the backends as-needed.
-
-    def get_exe_suffix(self):
-        if self.is_windows() or self.is_cygwin():
-            return 'exe'
-        else:
-            return ''
-
-    def get_object_suffix(self):
-        if self.is_windows():
-            return 'obj'
-        else:
-            return 'o'
-
-    def libdir_layout_is_win(self):
-        return self.is_windows() \
-            or self.is_cygwin()
-
-class MachineInfos(PerMachine):
-    def __init__(self):
-        super().__init__(None, None, None)
-
-    def default_missing(self):
-        """Default host to buid and target to host.
-
-        This allows just specifying nothing in the native case, just host in the
-        cross non-compiler case, and just target in the native-built
-        cross-compiler case.
-        """
-        if self.host is None:
-            self.host = self.build
-        if self.target is None:
-            self.target = self.host
-
-    def miss_defaulting(self):
-        """Unset definition duplicated from their previous to None
-
-        This is the inverse of ''default_missing''. By removing defaulted
-        machines, we can elaborate the original and then redefault them and thus
-        avoid repeating the elaboration explicitly.
-        """
-        if self.target == self.host:
-            self.target = None
-        if self.host == self.build:
-            self.host = None
-
-    def detect_build(self, compilers = None):
-        self.build = MachineInfo.detect(compilers)
-
-class BinaryTable:
-    # Map from language identifiers to environment variables.
-    evarMap = {
-        # Compilers
-        'c': 'CC',
-        'cpp': 'CXX',
-        'cs': 'CSC',
-        'd': 'DC',
-        'fortran': 'FC',
-        'objc': 'OBJC',
-        'objcpp': 'OBJCXX',
-        'rust': 'RUSTC',
-        'vala': 'VALAC',
-
-        # Binutils
-        'strip': 'STRIP',
-        'ar': 'AR',
-    }
-
-    @classmethod
-    def detect_ccache(cls):
-        try:
-            has_ccache = subprocess.call(['ccache', '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
-        except OSError:
-            has_ccache = 1
-        if has_ccache == 0:
-            cmdlist = ['ccache']
-        else:
-            cmdlist = []
-        return cmdlist
-
-    @classmethod
-    def warn_about_lang_pointing_to_cross(cls, compiler_exe, evar):
-        evar_str = os.environ.get(evar, 'WHO_WOULD_CALL_THEIR_COMPILER_WITH_THIS_NAME')
-        if evar_str == compiler_exe:
-            mlog.warning('''Env var %s seems to point to the cross compiler.
-This is probably wrong, it should always point to the native compiler.''' % evar)
-
-    @classmethod
-    def parse_entry(cls, entry):
-        compiler = mesonlib.stringlistify(entry)
-        # Ensure ccache exists and remove it if it doesn't
-        if compiler[0] == 'ccache':
-            compiler = compiler[1:]
-            ccache = cls.detect_ccache()
-        else:
-            ccache = []
-        # Return value has to be a list of compiler 'choices'
-        return compiler, ccache
diff -Nru meson-0.49.0/mesonbuild/interpreterbase.py meson-0.52.1/mesonbuild/interpreterbase.py
--- meson-0.49.0/mesonbuild/interpreterbase.py	2018-12-09 14:27:23.000000000 +0000
+++ meson-0.52.1/mesonbuild/interpreterbase.py	2019-11-28 17:37:44.000000000 +0000
@@ -18,7 +18,7 @@
 from . import mparser, mesonlib, mlog
 from . import environment, dependencies
 
-import os, copy, re, types
+import os, copy, re
 from functools import wraps
 
 class ObjectHolder:
@@ -47,14 +47,14 @@
     if want_subproject and n == 2:
         if hasattr(s, 'subproject'):
             # Interpreter base types have 2 args: self, node
-            node_or_state = wrapped_args[1]
+            node = wrapped_args[1]
             # args and kwargs are inside the node
             args = None
             kwargs = None
             subproject = s.subproject
         elif hasattr(wrapped_args[1], 'subproject'):
             # Module objects have 2 args: self, interpreter
-            node_or_state = wrapped_args[1]
+            node = wrapped_args[1].current_node
             # args and kwargs are inside the node
             args = None
             kwargs = None
@@ -63,7 +63,7 @@
             raise AssertionError('Unknown args: {!r}'.format(wrapped_args))
     elif n == 3:
         # Methods on objects (*Holder, MesonMain, etc) have 3 args: self, args, kwargs
-        node_or_state = None # FIXME
+        node = s.current_node
         args = wrapped_args[1]
         kwargs = wrapped_args[2]
         if want_subproject:
@@ -73,30 +73,32 @@
                 subproject = s.interpreter.subproject
     elif n == 4:
         # Meson functions have 4 args: self, node, args, kwargs
-        # Module functions have 4 args: self, state, args, kwargs; except,
-        # PythonInstallation methods have self, interpreter, args, kwargs
-        node_or_state = wrapped_args[1]
+        # Module functions have 4 args: self, state, args, kwargs
+        if isinstance(s, InterpreterBase):
+            node = wrapped_args[1]
+        else:
+            node = wrapped_args[1].current_node
         args = wrapped_args[2]
         kwargs = wrapped_args[3]
         if want_subproject:
             if isinstance(s, InterpreterBase):
                 subproject = s.subproject
             else:
-                subproject = node_or_state.subproject
+                subproject = wrapped_args[1].subproject
     elif n == 5:
         # Module snippets have 5 args: self, interpreter, state, args, kwargs
-        node_or_state = wrapped_args[2]
+        node = wrapped_args[2].current_node
         args = wrapped_args[3]
         kwargs = wrapped_args[4]
         if want_subproject:
-            subproject = node_or_state.subproject
+            subproject = wrapped_args[2].subproject
     else:
         raise AssertionError('Unknown args: {!r}'.format(wrapped_args))
     # Sometimes interpreter methods are called internally with None instead of
     # empty list/dict
     args = args if args is not None else []
     kwargs = kwargs if kwargs is not None else {}
-    return s, node_or_state, args, kwargs, subproject
+    return s, node, args, kwargs, subproject
 
 def flatten(args):
     if isinstance(args, mparser.StringNode):
@@ -142,7 +144,7 @@
     return wrapped
 
 def noArgsFlattening(f):
-    setattr(f, 'no-args-flattening', True)
+    setattr(f, 'no-args-flattening', True)  # noqa: B010
     return f
 
 def disablerIfNotFound(f):
@@ -164,19 +166,10 @@
     def __call__(self, f):
         @wraps(f)
         def wrapped(*wrapped_args, **wrapped_kwargs):
-            s, node_or_state, args, kwargs, _ = _get_callee_args(wrapped_args)
-            loc = types.SimpleNamespace()
-            if hasattr(s, 'subdir'):
-                loc.subdir = s.subdir
-                loc.lineno = s.current_lineno
-            elif node_or_state and hasattr(node_or_state, 'subdir'):
-                loc.subdir = node_or_state.subdir
-                loc.lineno = node_or_state.current_lineno
-            else:
-                loc = None
+            s, node, args, kwargs, _ = _get_callee_args(wrapped_args)
             for k in kwargs:
                 if k not in self.permitted:
-                    mlog.warning('''Passed invalid keyword argument "{}".'''.format(k), location=loc)
+                    mlog.warning('''Passed invalid keyword argument "{}".'''.format(k), location=node)
                     mlog.warning('This will become a hard error in the future.')
             return f(*wrapped_args, **wrapped_kwargs)
         return wrapped
@@ -320,6 +313,9 @@
 class InterpreterObject:
     def __init__(self):
         self.methods = {}
+        # Current node set during a method call. This can be used as location
+        # when printing a warning message during a method call.
+        self.current_node = None
 
     def method_call(self, method_name, args, kwargs):
         if method_name in self.methods:
@@ -341,20 +337,25 @@
     def found_method(self, args, kwargs):
         return False
 
-def is_disabler(i):
+def is_disabler(i) -> bool:
     return isinstance(i, Disabler)
 
-def is_disabled(args, kwargs):
+def is_arg_disabled(arg) -> bool:
+    if is_disabler(arg):
+        return True
+    if isinstance(arg, list):
+        for i in arg:
+            if is_arg_disabled(i):
+                return True
+    return False
+
+def is_disabled(args, kwargs) -> bool:
     for i in args:
-        if isinstance(i, Disabler):
+        if is_arg_disabled(i):
             return True
     for i in kwargs.values():
-        if isinstance(i, Disabler):
+        if is_arg_disabled(i):
             return True
-        if isinstance(i, list):
-            for j in i:
-                if isinstance(j, Disabler):
-                    return True
     return False
 
 class InterpreterBase:
@@ -366,6 +367,9 @@
         self.variables = {}
         self.argument_depth = 0
         self.current_lineno = -1
+        # Current node set during a function call. This can be used as location
+        # when printing a warning message during a method call.
+        self.current_node = None
 
     def load_root_meson_file(self):
         mesonfile = os.path.join(self.source_root, self.subdir, environment.build_filename)
@@ -496,6 +500,8 @@
 
     def evaluate_notstatement(self, cur):
         v = self.evaluate_statement(cur.value)
+        if is_disabler(v):
+            return v
         if not isinstance(v, bool):
             raise InterpreterException('Argument to "not" is not a boolean.')
         return not v
@@ -607,6 +613,23 @@
             raise InterpreterException('Argument to negation is not an integer.')
         return -v
 
+    @FeatureNew('/ with string arguments', '0.49.0')
+    def evaluate_path_join(self, l, r):
+        if not isinstance(l, str):
+            raise InvalidCode('The division operator can only append to a string.')
+        if not isinstance(r, str):
+            raise InvalidCode('The division operator can only append a string.')
+        return self.join_path_strings((l, r))
+
+    def evaluate_division(self, l, r):
+        if isinstance(l, str) or isinstance(r, str):
+            return self.evaluate_path_join(l, r)
+        if isinstance(l, int) and isinstance(r, int):
+            if r == 0:
+                raise InvalidCode('Division by zero.')
+            return l // r
+        raise InvalidCode('Division works only with strings or integers.')
+
     def evaluate_arithmeticstatement(self, cur):
         l = self.evaluate_statement(cur.left)
         if is_disabler(l):
@@ -631,13 +654,7 @@
                 raise InvalidCode('Multiplication works only with integers.')
             return l * r
         elif cur.operation == 'div':
-            if isinstance(l, str) and isinstance(r, str):
-                return self.join_path_strings((l, r))
-            if isinstance(l, int) and isinstance(r, int):
-                if r == 0:
-                    raise InvalidCode('Division by zero.')
-                return l // r
-            raise InvalidCode('Division works only with strings or integers.')
+            return self.evaluate_division(l, r)
         elif cur.operation == 'mod':
             if not isinstance(l, int) or not isinstance(r, int):
                 raise InvalidCode('Modulo works only with integers.')
@@ -665,8 +682,6 @@
             if len(node.varnames) != 1:
                 raise InvalidArguments('Foreach on array does not unpack')
             varname = node.varnames[0].value
-            if is_disabler(items):
-                return items
             for item in items:
                 self.set_variable(varname, item)
                 try:
@@ -678,8 +693,6 @@
         elif isinstance(items, dict):
             if len(node.varnames) != 2:
                 raise InvalidArguments('Foreach on dict unpacks key and value')
-            if is_disabler(items):
-                return items
             for key, value in items.items():
                 self.set_variable(node.varnames[0].value, key)
                 self.set_variable(node.varnames[1].value, value)
@@ -749,17 +762,17 @@
             except IndexError:
                 raise InterpreterException('Index %d out of bounds of array of size %d.' % (index, len(iobject)))
 
-
     def function_call(self, node):
         func_name = node.func_name
         (posargs, kwargs) = self.reduce_arguments(node.args)
-        if is_disabled(posargs, kwargs):
+        if is_disabled(posargs, kwargs) and func_name != 'set_variable' and func_name != 'is_disabler':
             return Disabler()
         if func_name in self.funcs:
             func = self.funcs[func_name]
             if not getattr(func, 'no-args-flattening', False):
                 posargs = flatten(posargs)
 
+            self.current_node = node
             return func(node, posargs, kwargs)
         else:
             self.unknown_function_called(func_name)
@@ -790,12 +803,16 @@
         (args, kwargs) = self.reduce_arguments(args)
         # Special case. This is the only thing you can do with a disabler
         # object. Every other use immediately returns the disabler object.
-        if isinstance(obj, Disabler) and method_name == 'found':
-            return False
+        if isinstance(obj, Disabler):
+            if method_name == 'found':
+                return False
+            else:
+                return Disabler()
         if is_disabled(args, kwargs):
             return Disabler()
         if method_name == 'extract_objects':
             self.validate_extraction(obj.held_object)
+        obj.current_node = node
         return obj.method_call(method_name, args, kwargs)
 
     def bool_method_call(self, obj, method_name, args):
@@ -909,6 +926,24 @@
             return mesonlib.version_compare(obj, cmpr)
         raise InterpreterException('Unknown method "%s" for a string.' % method_name)
 
+    def format_string(self, templ, args):
+        if isinstance(args, mparser.ArgumentNode):
+            args = args.arguments
+        arg_strings = []
+        for arg in args:
+            arg = self.evaluate_statement(arg)
+            if isinstance(arg, bool): # Python boolean is upper case.
+                arg = str(arg).lower()
+            arg_strings.append(str(arg))
+
+        def arg_replace(match):
+            idx = int(match.group(1))
+            if idx >= len(arg_strings):
+                raise InterpreterException('Format placeholder @{}@ out of range.'.format(idx))
+            return arg_strings[idx]
+
+        return re.sub(r'@(\d+)@', arg_replace, templ)
+
     def unknown_function_called(self, func_name):
         raise InvalidCode('Unknown function "%s".' % func_name)
 
diff -Nru meson-0.49.0/mesonbuild/interpreter.py meson-0.52.1/mesonbuild/interpreter.py
--- meson-0.49.0/mesonbuild/interpreter.py	2018-12-09 14:27:23.000000000 +0000
+++ meson-0.52.1/mesonbuild/interpreter.py	2019-11-28 17:37:44.000000000 +0000
@@ -21,9 +21,10 @@
 from . import compilers
 from .wrap import wrap, WrapMode
 from . import mesonlib
-from .mesonlib import FileMode, Popen_safe, listify, extract_as_list, has_path_sep
+from .mesonlib import FileMode, MachineChoice, Popen_safe, listify, extract_as_list, has_path_sep
 from .dependencies import ExternalProgram
 from .dependencies import InternalDependency, Dependency, NotFoundDependency, DependencyException
+from .depfile import DepFile
 from .interpreterbase import InterpreterBase
 from .interpreterbase import check_stringlist, flatten, noPosargs, noKwargs, stringArgs, permittedKwargs, noArgsFlattening
 from .interpreterbase import InterpreterException, InvalidArguments, InvalidCode, SubdirDoneRequest
@@ -31,14 +32,16 @@
 from .interpreterbase import FeatureNew, FeatureDeprecated, FeatureNewKwargs
 from .interpreterbase import ObjectHolder
 from .modules import ModuleReturnValue
+from .cmake import CMakeInterpreter
 
+from pathlib import Path, PurePath
 import os, shutil, uuid
 import re, shlex
 import subprocess
 from collections import namedtuple
-from pathlib import PurePath
-import traceback
+from itertools import chain
 import functools
+from typing import Sequence, List, Union, Optional, Dict, Any
 
 import importlib
 
@@ -59,13 +62,17 @@
     raise InvalidArguments('Function accepts only strings, integers, lists and lists thereof.')
 
 
+class OverrideProgram(dependencies.ExternalProgram):
+    pass
+
+
 class FeatureOptionHolder(InterpreterObject, ObjectHolder):
-    def __init__(self, env, option):
+    def __init__(self, env, name, option):
         InterpreterObject.__init__(self)
         ObjectHolder.__init__(self, option)
         if option.is_auto():
             self.held_object = env.coredata.builtins['auto_features']
-        self.name = option.name
+        self.name = name
         self.methods.update({'enabled': self.enabled_method,
                              'disabled': self.disabled_method,
                              'auto': self.auto_method,
@@ -86,8 +93,8 @@
     def auto_method(self, args, kwargs):
         return self.held_object.is_auto()
 
-def extract_required_kwarg(kwargs, subproject, feature_check=None):
-    val = kwargs.get('required', True)
+def extract_required_kwarg(kwargs, subproject, feature_check=None, default=True):
+    val = kwargs.get('required', default)
     disabled = False
     required = False
     feature = None
@@ -101,7 +108,7 @@
             disabled = True
         elif option.is_enabled():
             required = True
-    elif isinstance(required, bool):
+    elif isinstance(val, bool):
         required = val
     else:
         raise InterpreterException('required keyword argument must be boolean or a feature option')
@@ -144,31 +151,32 @@
 
 class RunProcess(InterpreterObject):
 
-    def __init__(self, cmd, args, source_dir, build_dir, subdir, mesonintrospect, in_builddir=False, check=False, capture=True):
+    def __init__(self, cmd, args, env, source_dir, build_dir, subdir, mesonintrospect, in_builddir=False, check=False, capture=True):
         super().__init__()
         if not isinstance(cmd, ExternalProgram):
             raise AssertionError('BUG: RunProcess must be passed an ExternalProgram')
         self.capture = capture
-        pc, self.stdout, self.stderr = self.run_command(cmd, args, source_dir, build_dir, subdir, mesonintrospect, in_builddir, check)
+        pc, self.stdout, self.stderr = self.run_command(cmd, args, env, source_dir, build_dir, subdir, mesonintrospect, in_builddir, check)
         self.returncode = pc.returncode
         self.methods.update({'returncode': self.returncode_method,
                              'stdout': self.stdout_method,
                              'stderr': self.stderr_method,
                              })
 
-    def run_command(self, cmd, args, source_dir, build_dir, subdir, mesonintrospect, in_builddir, check=False):
+    def run_command(self, cmd, args, env, source_dir, build_dir, subdir, mesonintrospect, in_builddir, check=False):
         command_array = cmd.get_command() + args
-        env = {'MESON_SOURCE_ROOT': source_dir,
-               'MESON_BUILD_ROOT': build_dir,
-               'MESON_SUBDIR': subdir,
-               'MESONINTROSPECT': ' '.join([shlex.quote(x) for x in mesonintrospect]),
-               }
+        menv = {'MESON_SOURCE_ROOT': source_dir,
+                'MESON_BUILD_ROOT': build_dir,
+                'MESON_SUBDIR': subdir,
+                'MESONINTROSPECT': ' '.join([shlex.quote(x) for x in mesonintrospect]),
+                }
         if in_builddir:
             cwd = os.path.join(build_dir, subdir)
         else:
             cwd = os.path.join(source_dir, subdir)
         child_env = os.environ.copy()
-        child_env.update(env)
+        child_env.update(menv)
+        child_env = env.get_env(child_env)
         stdout = subprocess.PIPE if self.capture else subprocess.DEVNULL
         mlog.debug('Running command:', ' '.join(command_array))
         try:
@@ -214,13 +222,28 @@
 
 
 class EnvironmentVariablesHolder(MutableInterpreterObject, ObjectHolder):
-    def __init__(self):
+    def __init__(self, initial_values=None):
         MutableInterpreterObject.__init__(self)
         ObjectHolder.__init__(self, build.EnvironmentVariables())
         self.methods.update({'set': self.set_method,
                              'append': self.append_method,
                              'prepend': self.prepend_method,
                              })
+        if isinstance(initial_values, dict):
+            for k, v in initial_values.items():
+                self.set_method([k, v], {})
+        elif isinstance(initial_values, list):
+            for e in initial_values:
+                if '=' not in e:
+                    raise InterpreterException('Env var definition must be of type key=val.')
+                (k, val) = e.split('=', 1)
+                k = k.strip()
+                val = val.strip()
+                if ' ' in k:
+                    raise InterpreterException('Env var key must not have spaces in it.')
+                self.set_method([k, val], {})
+        elif initial_values:
+            raise AssertionError('Unsupported EnvironmentVariablesHolder initial_values')
 
     def __repr__(self):
         repr_str = "<{0}: {1}>"
@@ -234,7 +257,13 @@
             raise InterpreterException("EnvironmentVariablesHolder methods require at least"
                                        "2 arguments, first is the name of the variable and"
                                        " following one are values")
-        self.held_object.envvars.append((method, args[0], args[1:], kwargs))
+        # Warn when someone tries to use append() or prepend() on an env var
+        # which already has an operation set on it. People seem to think that
+        # multiple append/prepend operations stack, but they don't.
+        if method != self.held_object.set and self.held_object.has_name(args[0]):
+            mlog.warning('Overriding previous value of environment variable {!r} with a new one'
+                         .format(args[0]), location=self.current_node)
+        self.held_object.add_var(method, args[0], args[1:], kwargs)
 
     @stringArgs
     @permittedKwargs({'separator'})
@@ -253,7 +282,7 @@
 
 
 class ConfigurationDataHolder(MutableInterpreterObject, ObjectHolder):
-    def __init__(self, pv):
+    def __init__(self, pv, initial_values=None):
         MutableInterpreterObject.__init__(self)
         self.used = False # These objects become immutable after use in configure_file.
         ObjectHolder.__init__(self, build.ConfigurationData(), pv)
@@ -265,6 +294,11 @@
                              'get_unquoted': self.get_unquoted_method,
                              'merge_from': self.merge_from_method,
                              })
+        if isinstance(initial_values, dict):
+            for k, v in initial_values.items():
+                self.set_method([k, v], {})
+        elif initial_values:
+            raise AssertionError('Unsupported ConfigurationDataHolder initial_values')
 
     def is_used(self):
         return self.used
@@ -276,20 +310,20 @@
         if len(args) == 1 and isinstance(args[0], list) and len(args[0]) == 2:
             mlog.deprecation('Passing a list as the single argument to '
                              'configuration_data.set is deprecated. This will '
-                             'become a hard error in the future.')
+                             'become a hard error in the future.',
+                             location=self.current_node)
             args = args[0]
 
         if len(args) != 2:
             raise InterpreterException("Configuration set requires 2 arguments.")
         if self.used:
             raise InterpreterException("Can not set values on configuration object that has been used.")
-        name = args[0]
-        val = args[1]
+        name, val = args
         if not isinstance(val, (int, str)):
             msg = 'Setting a configuration data value to {!r} is invalid, ' \
                   'and will fail at configure_file(). If you are using it ' \
                   'just to store some values, please use a dict instead.'
-            mlog.deprecation(msg.format(val))
+            mlog.deprecation(msg.format(val), location=self.current_node)
         desc = kwargs.get('description', None)
         if not isinstance(name, str):
             raise InterpreterException("First argument to set must be a string.")
@@ -376,7 +410,10 @@
                              'name': self.name_method,
                              'get_pkgconfig_variable': self.pkgconfig_method,
                              'get_configtool_variable': self.configtool_method,
+                             'get_variable': self.variable_method,
                              'partial_dependency': self.partial_dependency_method,
+                             'include_type': self.include_type_method,
+                             'as_system': self.as_system_method,
                              })
 
     def found(self):
@@ -432,31 +469,29 @@
         pdep = self.held_object.get_partial_dependency(**kwargs)
         return DependencyHolder(pdep, self.subproject)
 
-class InternalDependencyHolder(InterpreterObject, ObjectHolder):
-    def __init__(self, dep, pv):
-        InterpreterObject.__init__(self)
-        ObjectHolder.__init__(self, dep, pv)
-        self.methods.update({'found': self.found_method,
-                             'version': self.version_method,
-                             'partial_dependency': self.partial_dependency_method,
-                             })
-
+    @FeatureNew('dep.get_variable', '0.51.0')
     @noPosargs
-    @permittedKwargs({})
-    def found_method(self, args, kwargs):
-        return True
+    @permittedKwargs({'cmake', 'pkgconfig', 'configtool', 'default_value', 'pkgconfig_define'})
+    def variable_method(self, args, kwargs):
+        return self.held_object.get_variable(**kwargs)
 
+    @FeatureNew('dep.include_type', '0.52.0')
     @noPosargs
     @permittedKwargs({})
-    def version_method(self, args, kwargs):
-        return self.held_object.get_version()
+    def include_type_method(self, args, kwargs):
+        return self.held_object.get_include_type()
 
-    @FeatureNew('dep.partial_dependency', '0.46.0')
-    @noPosargs
-    @permittedKwargs(permitted_method_kwargs['partial_dependency'])
-    def partial_dependency_method(self, args, kwargs):
-        pdep = self.held_object.get_partial_dependency(**kwargs)
-        return DependencyHolder(pdep, self.subproject)
+    @FeatureNew('dep.as_system', '0.52.0')
+    @permittedKwargs({})
+    def as_system_method(self, args, kwargs):
+        args = listify(args)
+        new_is_system = 'system'
+        if len(args) > 1:
+            raise InterpreterException('as_system takes only one optional value')
+        if len(args) == 1:
+            new_is_system = args[0]
+        new_dep = self.held_object.generate_system_dependency(new_is_system)
+        return DependencyHolder(new_dep, self.subproject)
 
 class ExternalProgramHolder(InterpreterObject, ObjectHolder):
     def __init__(self, ep):
@@ -464,6 +499,7 @@
         ObjectHolder.__init__(self, ep)
         self.methods.update({'found': self.found_method,
                              'path': self.path_method})
+        self.cached_version = None
 
     @noPosargs
     @permittedKwargs({})
@@ -484,6 +520,24 @@
     def get_name(self):
         return self.held_object.get_name()
 
+    def get_version(self, interpreter):
+        if not self.cached_version:
+            raw_cmd = self.get_command() + ['--version']
+            cmd = [self, '--version']
+            res = interpreter.run_command_impl(interpreter.current_node, cmd, {}, True)
+            if res.returncode != 0:
+                m = 'Running {!r} failed'
+                raise InterpreterException(m.format(raw_cmd))
+            output = res.stdout.strip()
+            if not output:
+                output = res.stderr.strip()
+            match = re.search(r'([0-9\.]+)', output)
+            if not match:
+                m = 'Could not find a version number in output of {!r}'
+                raise InterpreterException(m.format(raw_cmd))
+            self.cached_version = match.group(1)
+        return self.cached_version
+
 class ExternalLibraryHolder(InterpreterObject, ObjectHolder):
     def __init__(self, el, pv):
         InterpreterObject.__init__(self)
@@ -553,10 +607,10 @@
 
 
 class GeneratedListHolder(InterpreterObject, ObjectHolder):
-    def __init__(self, arg1, extra_args=[]):
+    def __init__(self, arg1, extra_args=None):
         InterpreterObject.__init__(self)
         if isinstance(arg1, GeneratorHolder):
-            ObjectHolder.__init__(self, build.GeneratedList(arg1.held_object, extra_args))
+            ObjectHolder.__init__(self, build.GeneratedList(arg1.held_object, extra_args if extra_args is not None else []))
         else:
             ObjectHolder.__init__(self, arg1)
 
@@ -609,6 +663,8 @@
         InterpreterObject.__init__(self)
         self.sources = sources
         self.install_subdir = kwargs.get('subdir', '')
+        if os.path.isabs(self.install_subdir):
+            mlog.deprecation('Subdir keyword must not be an absolute path. This will be a hard error in the next release.')
         self.custom_install_dir = kwargs.get('install_dir', None)
         self.custom_install_mode = kwargs.get('install_mode', None)
         if self.custom_install_dir is not None:
@@ -711,7 +767,7 @@
         return r.format(self.__class__.__name__, h.get_id(), h.filename)
 
     def is_cross(self):
-        return self.held_object.is_cross()
+        return not self.held_object.environment.machines.matches_build_machine(self.held_object.for_machine)
 
     @noPosargs
     @permittedKwargs({})
@@ -744,7 +800,8 @@
             mlog.warning('extract_all_objects called without setting recursive '
                          'keyword argument. Meson currently defaults to '
                          'non-recursive to maintain backward compatibility but '
-                         'the default will be changed in the future.')
+                         'the default will be changed in the future.',
+                         location=self.current_node)
         return GeneratedObjectsHolder(gobjs)
 
     @noPosargs
@@ -835,10 +892,9 @@
         return IncludeDirsHolder(build.IncludeDirs('', [], False,
                                                    [os.path.join('@BUILD_ROOT@', self.interpreter.backend.get_target_dir(self.held_object))]))
 
-class RunTargetHolder(InterpreterObject, ObjectHolder):
-    def __init__(self, name, command, args, dependencies, subdir, subproject):
-        InterpreterObject.__init__(self)
-        ObjectHolder.__init__(self, build.RunTarget(name, command, args, dependencies, subdir, subproject))
+class RunTargetHolder(TargetHolder):
+    def __init__(self, target, interp):
+        super().__init__(target, interp)
 
     def __repr__(self):
         r = '<{} {}: {}>'
@@ -846,8 +902,11 @@
         return r.format(self.__class__.__name__, h.get_id(), h.command)
 
 class Test(InterpreterObject):
-    def __init__(self, name, project, suite, exe, depends, is_parallel,
-                 cmd_args, env, should_fail, timeout, workdir):
+    def __init__(self, name: str, project: str, suite: List[str], exe: build.Executable,
+                 depends: List[Union[build.CustomTarget, build.BuildTarget]],
+                 is_parallel: bool, cmd_args: List[str], env: build.EnvironmentVariables,
+                 should_fail: bool, timeout: int, workdir: Optional[str], protocol: str,
+                 priority: int):
         InterpreterObject.__init__(self)
         self.name = name
         self.suite = suite
@@ -860,6 +919,8 @@
         self.should_fail = should_fail
         self.timeout = timeout
         self.workdir = workdir
+        self.protocol = protocol
+        self.priority = priority
 
     def get_exe(self):
         return self.exe
@@ -887,18 +948,43 @@
         return self.held_object is not None
 
     @permittedKwargs({})
+    @noArgsFlattening
     def get_variable_method(self, args, kwargs):
-        if len(args) != 1:
-            raise InterpreterException('Get_variable takes one argument.')
+        if len(args) < 1 or len(args) > 2:
+            raise InterpreterException('Get_variable takes one or two arguments.')
         if not self.found():
             raise InterpreterException('Subproject "%s/%s" disabled can\'t get_variable on it.' % (
                 self.subproject_dir, self.name))
         varname = args[0]
         if not isinstance(varname, str):
-            raise InterpreterException('Get_variable takes a string argument.')
-        if varname not in self.held_object.variables:
-            raise InvalidArguments('Requested variable "{0}" not found.'.format(varname))
-        return self.held_object.variables[varname]
+            raise InterpreterException('Get_variable first argument must be a string.')
+        try:
+            return self.held_object.variables[varname]
+        except KeyError:
+            pass
+
+        if len(args) == 2:
+            return args[1]
+
+        raise InvalidArguments('Requested variable "{0}" not found.'.format(varname))
+
+header_permitted_kwargs = set([
+    'required',
+    'prefix',
+    'no_builtin_args',
+    'include_directories',
+    'args',
+    'dependencies',
+])
+
+find_library_permitted_kwargs = set([
+    'has_headers',
+    'required',
+    'dirs',
+    'static',
+])
+
+find_library_permitted_kwargs |= set(['header_' + k for k in header_permitted_kwargs])
 
 class CompilerHolder(InterpreterObject):
     def __init__(self, compiler, env, subproject):
@@ -980,7 +1066,8 @@
                                     i.held_object.get_curdir(), idir)
                 args += self.compiler.get_include_args(idir, False)
         if not nobuiltins:
-            opts = self.environment.coredata.compiler_options
+            for_machine = Interpreter.machine_from_native_kwarg(kwargs)
+            opts = self.environment.coredata.compiler_options[for_machine]
             args += self.compiler.get_option_compile_args(opts)
             if mode == 'link':
                 args += self.compiler.get_option_link_args(opts)
@@ -1015,7 +1102,7 @@
         typename = args[0]
         prefix = kwargs.get('prefix', '')
         if not isinstance(prefix, str):
-            raise InterpreterException('Prefix argument of sizeof must be a string.')
+            raise InterpreterException('Prefix argument of alignment must be a string.')
         extra_args = mesonlib.stringlistify(kwargs.get('args', []))
         deps, msg = self.determine_dependencies(kwargs)
         result = self.compiler.alignment(typename, prefix, self.environment,
@@ -1094,23 +1181,23 @@
         if len(args) != 2:
             raise InterpreterException('Has_member takes exactly two arguments.')
         check_stringlist(args)
-        typename = args[0]
-        membername = args[1]
+        typename, membername = args
         prefix = kwargs.get('prefix', '')
         if not isinstance(prefix, str):
             raise InterpreterException('Prefix argument of has_member must be a string.')
         extra_args = functools.partial(self.determine_args, kwargs)
         deps, msg = self.determine_dependencies(kwargs)
-        had = self.compiler.has_members(typename, [membername], prefix,
-                                        self.environment,
-                                        extra_args=extra_args,
-                                        dependencies=deps)
+        had, cached = self.compiler.has_members(typename, [membername], prefix,
+                                                self.environment,
+                                                extra_args=extra_args,
+                                                dependencies=deps)
+        cached = '(cached)' if cached else ''
         if had:
             hadtxt = mlog.green('YES')
         else:
             hadtxt = mlog.red('NO')
         mlog.log('Checking whether type', mlog.bold(typename, True),
-                 'has member', mlog.bold(membername, True), msg, hadtxt)
+                 'has member', mlog.bold(membername, True), msg, hadtxt, cached)
         return had
 
     @permittedKwargs({
@@ -1124,24 +1211,24 @@
         if len(args) < 2:
             raise InterpreterException('Has_members needs at least two arguments.')
         check_stringlist(args)
-        typename = args[0]
-        membernames = args[1:]
+        typename, *membernames = args
         prefix = kwargs.get('prefix', '')
         if not isinstance(prefix, str):
             raise InterpreterException('Prefix argument of has_members must be a string.')
         extra_args = functools.partial(self.determine_args, kwargs)
         deps, msg = self.determine_dependencies(kwargs)
-        had = self.compiler.has_members(typename, membernames, prefix,
-                                        self.environment,
-                                        extra_args=extra_args,
-                                        dependencies=deps)
+        had, cached = self.compiler.has_members(typename, membernames, prefix,
+                                                self.environment,
+                                                extra_args=extra_args,
+                                                dependencies=deps)
+        cached = '(cached)' if cached else ''
         if had:
             hadtxt = mlog.green('YES')
         else:
             hadtxt = mlog.red('NO')
         members = mlog.bold(', '.join(['"{}"'.format(m) for m in membernames]))
         mlog.log('Checking whether type', mlog.bold(typename, True),
-                 'has members', members, msg, hadtxt)
+                 'has members', members, msg, hadtxt, cached)
         return had
 
     @permittedKwargs({
@@ -1161,14 +1248,15 @@
             raise InterpreterException('Prefix argument of has_function must be a string.')
         extra_args = self.determine_args(kwargs)
         deps, msg = self.determine_dependencies(kwargs)
-        had = self.compiler.has_function(funcname, prefix, self.environment,
-                                         extra_args=extra_args,
-                                         dependencies=deps)
+        had, cached = self.compiler.has_function(funcname, prefix, self.environment,
+                                                 extra_args=extra_args,
+                                                 dependencies=deps)
+        cached = '(cached)' if cached else ''
         if had:
             hadtxt = mlog.green('YES')
         else:
             hadtxt = mlog.red('NO')
-        mlog.log('Checking for function', mlog.bold(funcname, True), msg, hadtxt)
+        mlog.log('Checking for function', mlog.bold(funcname, True), msg, hadtxt, cached)
         return had
 
     @permittedKwargs({
@@ -1188,13 +1276,14 @@
             raise InterpreterException('Prefix argument of has_type must be a string.')
         extra_args = functools.partial(self.determine_args, kwargs)
         deps, msg = self.determine_dependencies(kwargs)
-        had = self.compiler.has_type(typename, prefix, self.environment,
-                                     extra_args=extra_args, dependencies=deps)
+        had, cached = self.compiler.has_type(typename, prefix, self.environment,
+                                             extra_args=extra_args, dependencies=deps)
+        cached = '(cached)' if cached else ''
         if had:
             hadtxt = mlog.green('YES')
         else:
             hadtxt = mlog.red('NO')
-        mlog.log('Checking for type', mlog.bold(typename, True), msg, hadtxt)
+        mlog.log('Checking for type', mlog.bold(typename, True), msg, hadtxt, cached)
         return had
 
     @FeatureNew('compiler.compute_int', '0.40.0')
@@ -1273,10 +1362,11 @@
             raise InterpreterException('Prefix argument of get_define() must be a string.')
         extra_args = functools.partial(self.determine_args, kwargs)
         deps, msg = self.determine_dependencies(kwargs)
-        value = self.compiler.get_define(element, prefix, self.environment,
-                                         extra_args=extra_args,
-                                         dependencies=deps)
-        mlog.log('Fetching value of define', mlog.bold(element, True), msg, value)
+        value, cached = self.compiler.get_define(element, prefix, self.environment,
+                                                 extra_args=extra_args,
+                                                 dependencies=deps)
+        cached = '(cached)' if cached else ''
+        mlog.log('Fetching value of define', mlog.bold(element, True), msg, value, cached)
         return value
 
     @permittedKwargs({
@@ -1300,15 +1390,16 @@
             raise InterpreterException('Testname argument must be a string.')
         extra_args = functools.partial(self.determine_args, kwargs)
         deps, msg = self.determine_dependencies(kwargs, endl=None)
-        result = self.compiler.compiles(code, self.environment,
-                                        extra_args=extra_args,
-                                        dependencies=deps)
+        result, cached = self.compiler.compiles(code, self.environment,
+                                                extra_args=extra_args,
+                                                dependencies=deps)
         if len(testname) > 0:
             if result:
                 h = mlog.green('YES')
             else:
                 h = mlog.red('NO')
-            mlog.log('Checking if', mlog.bold(testname, True), msg, 'compiles:', h)
+            cached = '(cached)' if cached else ''
+            mlog.log('Checking if', mlog.bold(testname, True), msg, 'compiles:', h, cached)
         return result
 
     @permittedKwargs({
@@ -1332,25 +1423,21 @@
             raise InterpreterException('Testname argument must be a string.')
         extra_args = functools.partial(self.determine_args, kwargs)
         deps, msg = self.determine_dependencies(kwargs, endl=None)
-        result = self.compiler.links(code, self.environment,
-                                     extra_args=extra_args,
-                                     dependencies=deps)
+        result, cached = self.compiler.links(code, self.environment,
+                                             extra_args=extra_args,
+                                             dependencies=deps)
+        cached = '(cached)' if cached else ''
         if len(testname) > 0:
             if result:
                 h = mlog.green('YES')
             else:
                 h = mlog.red('NO')
-            mlog.log('Checking if', mlog.bold(testname, True), msg, 'links:', h)
+            mlog.log('Checking if', mlog.bold(testname, True), msg, 'links:', h, cached)
         return result
 
     @FeatureNew('compiler.check_header', '0.47.0')
-    @permittedKwargs({
-        'prefix',
-        'no_builtin_args',
-        'include_directories',
-        'args',
-        'dependencies',
-    })
+    @FeatureNewKwargs('compiler.check_header', '0.50.0', ['required'])
+    @permittedKwargs(header_permitted_kwargs)
     def check_header_method(self, args, kwargs):
         if len(args) != 1:
             raise InterpreterException('check_header method takes exactly one argument.')
@@ -1359,25 +1446,27 @@
         prefix = kwargs.get('prefix', '')
         if not isinstance(prefix, str):
             raise InterpreterException('Prefix argument of has_header must be a string.')
+        disabled, required, feature = extract_required_kwarg(kwargs, self.subproject, default=False)
+        if disabled:
+            mlog.log('Check usable header', mlog.bold(hname, True), 'skipped: feature', mlog.bold(feature), 'disabled')
+            return False
         extra_args = functools.partial(self.determine_args, kwargs)
         deps, msg = self.determine_dependencies(kwargs)
-        haz = self.compiler.check_header(hname, prefix, self.environment,
-                                         extra_args=extra_args,
-                                         dependencies=deps)
-        if haz:
+        haz, cached = self.compiler.check_header(hname, prefix, self.environment,
+                                                 extra_args=extra_args,
+                                                 dependencies=deps)
+        cached = '(cached)' if cached else ''
+        if required and not haz:
+            raise InterpreterException('{} header {!r} not usable'.format(self.compiler.get_display_language(), hname))
+        elif haz:
             h = mlog.green('YES')
         else:
             h = mlog.red('NO')
-        mlog.log('Check usable header', mlog.bold(hname, True), msg, h)
+        mlog.log('Check usable header', mlog.bold(hname, True), msg, h, cached)
         return haz
 
-    @permittedKwargs({
-        'prefix',
-        'no_builtin_args',
-        'include_directories',
-        'args',
-        'dependencies',
-    })
+    @FeatureNewKwargs('compiler.has_header', '0.50.0', ['required'])
+    @permittedKwargs(header_permitted_kwargs)
     def has_header_method(self, args, kwargs):
         if len(args) != 1:
             raise InterpreterException('has_header method takes exactly one argument.')
@@ -1386,51 +1475,65 @@
         prefix = kwargs.get('prefix', '')
         if not isinstance(prefix, str):
             raise InterpreterException('Prefix argument of has_header must be a string.')
+        disabled, required, feature = extract_required_kwarg(kwargs, self.subproject, default=False)
+        if disabled:
+            mlog.log('Has header', mlog.bold(hname, True), 'skipped: feature', mlog.bold(feature), 'disabled')
+            return False
         extra_args = functools.partial(self.determine_args, kwargs)
         deps, msg = self.determine_dependencies(kwargs)
-        haz = self.compiler.has_header(hname, prefix, self.environment,
-                                       extra_args=extra_args, dependencies=deps)
-        if haz:
+        haz, cached = self.compiler.has_header(hname, prefix, self.environment,
+                                               extra_args=extra_args, dependencies=deps)
+        cached = '(cached)' if cached else ''
+        if required and not haz:
+            raise InterpreterException('{} header {!r} not found'.format(self.compiler.get_display_language(), hname))
+        elif haz:
             h = mlog.green('YES')
         else:
             h = mlog.red('NO')
-        mlog.log('Has header', mlog.bold(hname, True), msg, h)
+        mlog.log('Has header', mlog.bold(hname, True), msg, h, cached)
         return haz
 
-    @permittedKwargs({
-        'prefix',
-        'no_builtin_args',
-        'include_directories',
-        'args',
-        'dependencies',
-    })
+    @FeatureNewKwargs('compiler.has_header_symbol', '0.50.0', ['required'])
+    @permittedKwargs(header_permitted_kwargs)
     def has_header_symbol_method(self, args, kwargs):
         if len(args) != 2:
             raise InterpreterException('has_header_symbol method takes exactly two arguments.')
         check_stringlist(args)
-        hname = args[0]
-        symbol = args[1]
+        hname, symbol = args
         prefix = kwargs.get('prefix', '')
         if not isinstance(prefix, str):
             raise InterpreterException('Prefix argument of has_header_symbol must be a string.')
+        disabled, required, feature = extract_required_kwarg(kwargs, self.subproject, default=False)
+        if disabled:
+            mlog.log('Header <{0}> has symbol'.format(hname), mlog.bold(symbol, True), 'skipped: feature', mlog.bold(feature), 'disabled')
+            return False
         extra_args = functools.partial(self.determine_args, kwargs)
         deps, msg = self.determine_dependencies(kwargs)
-        haz = self.compiler.has_header_symbol(hname, symbol, prefix, self.environment,
-                                              extra_args=extra_args,
-                                              dependencies=deps)
-        if haz:
+        haz, cached = self.compiler.has_header_symbol(hname, symbol, prefix, self.environment,
+                                                      extra_args=extra_args,
+                                                      dependencies=deps)
+        if required and not haz:
+            raise InterpreterException('{} symbol {} not found in header {}'.format(self.compiler.get_display_language(), symbol, hname))
+        elif haz:
             h = mlog.green('YES')
         else:
             h = mlog.red('NO')
-        mlog.log('Header <{0}> has symbol'.format(hname), mlog.bold(symbol, True), msg, h)
+        cached = '(cached)' if cached else ''
+        mlog.log('Header <{0}> has symbol'.format(hname), mlog.bold(symbol, True), msg, h, cached)
         return haz
 
+    def notfound_library(self, libname):
+        lib = dependencies.ExternalLibrary(libname, None,
+                                           self.environment,
+                                           self.compiler.language,
+                                           silent=True)
+        return ExternalLibraryHolder(lib, self.subproject)
+
+    @FeatureNewKwargs('compiler.find_library', '0.51.0', ['static'])
+    @FeatureNewKwargs('compiler.find_library', '0.50.0', ['has_headers'])
     @FeatureNewKwargs('compiler.find_library', '0.49.0', ['disabler'])
     @disablerIfNotFound
-    @permittedKwargs({
-        'required',
-        'dirs',
-    })
+    @permittedKwargs(find_library_permitted_kwargs)
     def find_library_method(self, args, kwargs):
         # TODO add dependencies support?
         if len(args) != 1:
@@ -1442,19 +1545,35 @@
         disabled, required, feature = extract_required_kwarg(kwargs, self.subproject)
         if disabled:
             mlog.log('Library', mlog.bold(libname), 'skipped: feature', mlog.bold(feature), 'disabled')
-            lib = dependencies.ExternalLibrary(libname, None,
-                                               self.environment,
-                                               self.compiler.language,
-                                               silent=True)
-            return ExternalLibraryHolder(lib, self.subproject)
+            return self.notfound_library(libname)
+
+        has_header_kwargs = {k[7:]: v for k, v in kwargs.items() if k.startswith('header_')}
+        has_header_kwargs['required'] = required
+        headers = mesonlib.stringlistify(kwargs.get('has_headers', []))
+        for h in headers:
+            if not self.has_header_method([h], has_header_kwargs):
+                return self.notfound_library(libname)
 
         search_dirs = mesonlib.stringlistify(kwargs.get('dirs', []))
-        for i in search_dirs:
-            if not os.path.isabs(i):
-                raise InvalidCode('Search directory %s is not an absolute path.' % i)
-        linkargs = self.compiler.find_library(libname, self.environment, search_dirs)
+        search_dirs = [Path(d).expanduser() for d in search_dirs]
+        for d in search_dirs:
+            if mesonlib.is_windows() and d.root.startswith('\\'):
+                # a Unix-path starting with `/` that is not absolute on Windows.
+                # discard without failing for end-user ease of cross-platform directory arrays
+                continue
+            if not d.is_absolute():
+                raise InvalidCode('Search directory {} is not an absolute path.'.format(d))
+        search_dirs = list(map(str, search_dirs))
+
+        libtype = mesonlib.LibType.PREFER_SHARED
+        if 'static' in kwargs:
+            if not isinstance(kwargs['static'], bool):
+                raise InterpreterException('static must be a boolean')
+            libtype = mesonlib.LibType.STATIC if kwargs['static'] else mesonlib.LibType.SHARED
+        linkargs = self.compiler.find_library(libname, self.environment, search_dirs, libtype)
         if required and not linkargs:
-            raise InterpreterException('{} library {!r} not found'.format(self.compiler.get_display_language(), libname))
+            raise InterpreterException(
+                '{} library {!r} not found'.format(self.compiler.get_display_language(), libname))
         lib = dependencies.ExternalLibrary(libname, linkargs, self.environment,
                                            self.compiler.language)
         return ExternalLibraryHolder(lib, self.subproject)
@@ -1469,15 +1588,16 @@
     @permittedKwargs({})
     def has_multi_arguments_method(self, args, kwargs):
         args = mesonlib.stringlistify(args)
-        result = self.compiler.has_multi_arguments(args, self.environment)
+        result, cached = self.compiler.has_multi_arguments(args, self.environment)
         if result:
             h = mlog.green('YES')
         else:
             h = mlog.red('NO')
+        cached = '(cached)' if cached else ''
         mlog.log(
             'Compiler for {} supports arguments {}:'.format(
                 self.compiler.get_display_language(), ' '.join(args)),
-            h)
+            h, cached)
         return result
 
     @FeatureNew('compiler.get_supported_arguments', '0.43.0')
@@ -1511,7 +1631,8 @@
     @permittedKwargs({})
     def has_multi_link_arguments_method(self, args, kwargs):
         args = mesonlib.stringlistify(args)
-        result = self.compiler.has_multi_link_arguments(args, self.environment)
+        result, cached = self.compiler.has_multi_link_arguments(args, self.environment)
+        cached = '(cached)' if cached else ''
         if result:
             h = mlog.green('YES')
         else:
@@ -1519,7 +1640,7 @@
         mlog.log(
             'Compiler for {} supports link arguments {}:'.format(
                 self.compiler.get_display_language(), ' '.join(args)),
-            h)
+            h, cached)
         return result
 
     @FeatureNew('compiler.get_supported_link_arguments_method', '0.46.0')
@@ -1548,9 +1669,10 @@
         args = mesonlib.stringlistify(args)
         if len(args) != 1:
             raise InterpreterException('has_func_attribute takes exactly one argument.')
-        result = self.compiler.has_func_attribute(args[0], self.environment)
+        result, cached = self.compiler.has_func_attribute(args[0], self.environment)
+        cached = '(cached)' if cached else ''
         h = mlog.green('YES') if result else mlog.red('NO')
-        mlog.log('Compiler for {} supports function attribute {}:'.format(self.compiler.get_display_language(), args[0]), h)
+        mlog.log('Compiler for {} supports function attribute {}:'.format(self.compiler.get_display_language(), args[0]), h, cached)
         return result
 
     @FeatureNew('compiler.get_supported_function_attributes', '0.48.0')
@@ -1568,9 +1690,9 @@
 
 ModuleState = namedtuple('ModuleState', [
     'build_to_src', 'subproject', 'subdir', 'current_lineno', 'environment',
-    'project_name', 'project_version', 'backend', 'compilers', 'targets',
+    'project_name', 'project_version', 'backend', 'targets',
     'data', 'headers', 'man', 'global_args', 'project_args', 'build_machine',
-    'host_machine', 'target_machine'])
+    'host_machine', 'target_machine', 'current_node'])
 
 class ModuleHolder(InterpreterObject, ObjectHolder):
     def __init__(self, modname, module, interpreter):
@@ -1603,16 +1725,18 @@
             # The backend object is under-used right now, but we will need it:
             # https://github.com/mesonbuild/meson/issues/1419
             backend=self.interpreter.backend,
-            compilers=self.interpreter.build.compilers,
             targets=self.interpreter.build.targets,
             data=self.interpreter.build.data,
             headers=self.interpreter.build.get_headers(),
             man=self.interpreter.build.get_man(),
-            global_args=self.interpreter.build.global_args,
-            project_args=self.interpreter.build.projects_args.get(self.interpreter.subproject, {}),
+            #global_args_for_build = self.interpreter.build.global_args.build,
+            global_args = self.interpreter.build.global_args.host,
+            #project_args_for_build = self.interpreter.build.projects_args.build.get(self.interpreter.subproject, {}),
+            project_args = self.interpreter.build.projects_args.host.get(self.interpreter.subproject, {}),
             build_machine=self.interpreter.builtin['build_machine'].held_object,
             host_machine=self.interpreter.builtin['host_machine'].held_object,
             target_machine=self.interpreter.builtin['target_machine'].held_object,
+            current_node=self.current_node
         )
         if self.held_object.is_snippet(method_name):
             value = fn(self.interpreter, state, args, kwargs)
@@ -1732,7 +1856,7 @@
     @permittedKwargs({})
     def has_exe_wrapper_method(self, args, kwargs):
         if self.is_cross_build_method(None, None) and \
-           self.build.environment.cross_info.need_exe_wrapper():
+           self.build.environment.need_exe_wrapper():
             if self.build.environment.exe_wrapper is None:
                 return False
         # We return True when exe_wrap is defined, when it's not needed, and
@@ -1750,18 +1874,8 @@
         if len(args) != 1:
             raise InterpreterException('get_compiler_method must have one and only one argument.')
         cname = args[0]
-        native = kwargs.get('native', None)
-        if native is None:
-            if self.build.environment.is_cross_build():
-                native = False
-            else:
-                native = True
-        if not isinstance(native, bool):
-            raise InterpreterException('Type of "native" must be a boolean.')
-        if native:
-            clist = self.build.compilers
-        else:
-            clist = self.build.cross_compilers
+        for_machine = Interpreter.machine_from_native_kwarg(kwargs)
+        clist = self.interpreter.coredata.compilers[for_machine]
         if cname in clist:
             return CompilerHolder(clist[cname], self.build.environment, self.interpreter.subproject)
         raise InterpreterException('Tried to access compiler for unspecified language "%s".' % cname)
@@ -1792,8 +1906,7 @@
     def override_find_program_method(self, args, kwargs):
         if len(args) != 2:
             raise InterpreterException('Override needs two arguments')
-        name = args[0]
-        exe = args[1]
+        name, exe = args
         if not isinstance(name, str):
             raise InterpreterException('First argument must be a string')
         if hasattr(exe, 'held_object'):
@@ -1803,7 +1916,7 @@
                                         self.interpreter.environment.build_dir)
             if not os.path.exists(abspath):
                 raise InterpreterException('Tried to override %s with a file that does not exist.' % name)
-            exe = dependencies.ExternalProgram(abspath)
+            exe = OverrideProgram(abspath)
         if not isinstance(exe, (dependencies.ExternalProgram, build.Executable)):
             raise InterpreterException('Second argument must be an external program or executable.')
         self.interpreter.add_find_program_override(name, exe)
@@ -1838,7 +1951,7 @@
         if not isinstance(propname, str):
             raise InterpreterException('Property name must be string.')
         try:
-            props = self.interpreter.environment.cross_info.get_properties()
+            props = self.interpreter.environment.properties.host
             return props[propname]
         except Exception:
             if len(args) == 2:
@@ -1858,21 +1971,77 @@
     {'target_type'}
 )
 
+_base_test_args = {'args', 'depends', 'env', 'should_fail', 'timeout', 'workdir', 'suite', 'priority', 'protocol'}
+
 permitted_kwargs = {'add_global_arguments': {'language', 'native'},
                     'add_global_link_arguments': {'language', 'native'},
                     'add_languages': {'required'},
                     'add_project_link_arguments': {'language', 'native'},
                     'add_project_arguments': {'language', 'native'},
-                    'add_test_setup': {'exe_wrapper', 'gdb', 'timeout_multiplier', 'env'},
-                    'benchmark': {'args', 'env', 'should_fail', 'timeout', 'workdir', 'suite'},
+                    'add_test_setup': {'exe_wrapper', 'gdb', 'timeout_multiplier', 'env', 'is_default'},
+                    'benchmark': _base_test_args,
                     'build_target': known_build_target_kwargs,
-                    'configure_file': {'input', 'output', 'configuration', 'command', 'copy', 'install_dir', 'install_mode', 'capture', 'install', 'format', 'output_format', 'encoding'},
-                    'custom_target': {'input', 'output', 'command', 'install', 'install_dir', 'install_mode', 'build_always', 'capture', 'depends', 'depend_files', 'depfile', 'build_by_default', 'build_always_stale', 'console'},
-                    'dependency': {'default_options', 'fallback', 'language', 'main', 'method', 'modules', 'optional_modules', 'native', 'required', 'static', 'version', 'private_headers'},
-                    'declare_dependency': {'include_directories', 'link_with', 'sources', 'dependencies', 'compile_args', 'link_args', 'link_whole', 'version'},
+                    'configure_file': {'input',
+                                       'output',
+                                       'configuration',
+                                       'command',
+                                       'copy',
+                                       'depfile',
+                                       'install_dir',
+                                       'install_mode',
+                                       'capture',
+                                       'install',
+                                       'format',
+                                       'output_format',
+                                       'encoding'},
+                    'custom_target': {'input',
+                                      'output',
+                                      'command',
+                                      'install',
+                                      'install_dir',
+                                      'install_mode',
+                                      'build_always',
+                                      'capture',
+                                      'depends',
+                                      'depend_files',
+                                      'depfile',
+                                      'build_by_default',
+                                      'build_always_stale',
+                                      'console'},
+                    'dependency': {'default_options',
+                                   'fallback',
+                                   'language',
+                                   'main',
+                                   'method',
+                                   'modules',
+                                   'cmake_module_path',
+                                   'optional_modules',
+                                   'native',
+                                   'not_found_message',
+                                   'required',
+                                   'static',
+                                   'version',
+                                   'private_headers',
+                                   'cmake_args',
+                                   'include_type',
+                                   },
+                    'declare_dependency': {'include_directories',
+                                           'link_with',
+                                           'sources',
+                                           'dependencies',
+                                           'compile_args',
+                                           'link_args',
+                                           'link_whole',
+                                           'version',
+                                           },
                     'executable': build.known_exe_kwargs,
-                    'find_program': {'required', 'native'},
-                    'generator': {'arguments', 'output', 'depfile', 'capture', 'preserve_path_from'},
+                    'find_program': {'required', 'native', 'version'},
+                    'generator': {'arguments',
+                                  'output',
+                                  'depends',
+                                  'depfile',
+                                  'capture',
+                                  'preserve_path_from'},
                     'include_directories': {'is_system'},
                     'install_data': {'install_dir', 'install_mode', 'rename', 'sources'},
                     'install_headers': {'install_dir', 'install_mode', 'subdir'},
@@ -1880,7 +2049,7 @@
                     'install_subdir': {'exclude_files', 'exclude_directories', 'install_dir', 'install_mode', 'strip_directory'},
                     'jar': build.known_jar_kwargs,
                     'project': {'version', 'meson_version', 'default_options', 'license', 'subproject_dir'},
-                    'run_command': {'check', 'capture'},
+                    'run_command': {'check', 'capture', 'env'},
                     'run_target': {'command', 'depends'},
                     'shared_library': build.known_shlib_kwargs,
                     'shared_module': build.known_shmod_kwargs,
@@ -1889,7 +2058,7 @@
                     'library': known_library_kwargs,
                     'subdir': {'if_found'},
                     'subproject': {'version', 'default_options', 'required'},
-                    'test': {'args', 'depends', 'env', 'is_parallel', 'should_fail', 'timeout', 'workdir', 'suite'},
+                    'test': set.union(_base_test_args, {'is_parallel'}),
                     'vcs_tag': {'input', 'output', 'fallback', 'command', 'replace_string'},
                     }
 
@@ -1897,7 +2066,7 @@
 class Interpreter(InterpreterBase):
 
     def __init__(self, build, backend=None, subproject='', subdir='', subproject_dir='subprojects',
-                 modules = None, default_project_options=None, mock=False):
+                 modules = None, default_project_options=None, mock=False, ast=None):
         super().__init__(build.environment.get_source_dir(), subdir)
         self.an_unpicklable_object = mesonlib.an_unpicklable_object
         self.build = build
@@ -1914,9 +2083,12 @@
         self.subproject_directory_name = subdir.split(os.path.sep)[-1]
         self.subproject_dir = subproject_dir
         self.option_file = os.path.join(self.source_root, self.subdir, 'meson_options.txt')
-        if not mock:
+        if not mock and ast is None:
             self.load_root_meson_file()
             self.sanity_check_ast()
+        elif ast is not None:
+            self.ast = ast
+            self.sanity_check_ast()
         self.builtin.update({'meson': MesonMain(build, self)})
         self.generators = []
         self.visited_subdirs = {}
@@ -1937,12 +2109,12 @@
         if not mock:
             self.parse_project()
 
-        # Initialize machine descriptions. We can do a better job now because we
+        # Re-initialize machine descriptions. We can do a better job now because we
         # have the compilers needed to gain more knowledge, so wipe out old
         # inferrence and start over.
-        self.build.environment.machines.miss_defaulting()
-        self.build.environment.machines.detect_build(self.coredata.compilers)
-        self.build.environment.machines.default_missing()
+        machines = self.build.environment.machines.miss_defaulting()
+        machines.build = environment.detect_machine_info(self.coredata.compilers.build)
+        self.build.environment.machines = machines.default_missing()
         assert self.build.environment.machines.build.cpu is not None
         assert self.build.environment.machines.host.cpu is not None
         assert self.build.environment.machines.target.cpu is not None
@@ -1957,14 +2129,12 @@
     def get_non_matching_default_options(self):
         env = self.environment
         for def_opt_name, def_opt_value in self.project_default_options.items():
-            for option_type in [
-                    env.coredata.builtins, env.coredata.compiler_options,
-                    env.coredata.backend_options, env.coredata.base_options,
-                    env.coredata.user_options]:
-                for cur_opt_name, cur_opt_value in option_type.items():
-                    if (def_opt_name == cur_opt_name and
-                            def_opt_value != cur_opt_value.value):
-                        yield (def_opt_name, def_opt_value, cur_opt_value.value)
+            for opts in env.coredata.get_all_options():
+                cur_opt_value = opts.get(def_opt_name)
+                if cur_opt_value is not None:
+                    def_opt_value = env.coredata.validate_option_value(def_opt_name, def_opt_value)
+                    if def_opt_value != cur_opt_value.value:
+                        yield (def_opt_name, def_opt_value, cur_opt_value)
 
     def build_func_dict(self):
         self.funcs.update({'add_global_arguments': self.func_add_global_arguments,
@@ -1973,6 +2143,7 @@
                            'add_project_link_arguments': self.func_add_project_link_arguments,
                            'add_test_setup': self.func_add_test_setup,
                            'add_languages': self.func_add_languages,
+                           'alias_target': self.func_alias_target,
                            'assert': self.func_assert,
                            'benchmark': self.func_benchmark,
                            'build_target': self.func_build_target,
@@ -1998,6 +2169,7 @@
                            'install_headers': self.func_install_headers,
                            'install_man': self.func_install_man,
                            'install_subdir': self.func_install_subdir,
+                           'is_disabler': self.func_is_disabler,
                            'is_variable': self.func_is_variable,
                            'jar': self.func_jar,
                            'join_paths': self.func_join_paths,
@@ -2025,6 +2197,9 @@
     def holderify(self, item):
         if isinstance(item, list):
             return [self.holderify(x) for x in item]
+        if isinstance(item, dict):
+            return {k: self.holderify(v) for k, v in item.items()}
+
         if isinstance(item, build.CustomTarget):
             return CustomTargetHolder(item, self)
         elif isinstance(item, (int, str, bool)) or item is None:
@@ -2039,9 +2214,7 @@
             raise RuntimeError('Do not do this.')
         elif isinstance(item, build.Data):
             return DataHolder(item)
-        elif isinstance(item, dependencies.InternalDependency):
-            return InternalDependencyHolder(item, self.subproject)
-        elif isinstance(item, dependencies.ExternalDependency):
+        elif isinstance(item, dependencies.Dependency):
             return DependencyHolder(item, self.subproject)
         elif isinstance(item, dependencies.ExternalProgram):
             return ExternalProgramHolder(item)
@@ -2092,18 +2265,18 @@
     def get_variables(self):
         return self.variables
 
-    def check_cross_stdlibs(self):
-        if self.build.environment.is_cross_build():
-            cross_info = self.build.environment.cross_info
-            for l, c in self.build.cross_compilers.items():
+    def check_stdlibs(self):
+        for for_machine in MachineChoice:
+            props = self.build.environment.properties[for_machine]
+            for l in self.coredata.compilers[for_machine].keys():
                 try:
-                    di = mesonlib.stringlistify(cross_info.get_stdlib(l))
+                    di = mesonlib.stringlistify(props.get_stdlib(l))
                     if len(di) != 2:
                         raise InterpreterException('Stdlib definition for %s should have exactly two elements.'
                                                    % l)
                     projname, depname = di
-                    subproj = self.do_subproject(projname, {})
-                    self.build.cross_stdlibs[l] = subproj.get_variable_method([depname], {})
+                    subproj = self.do_subproject(projname, 'meson', {})
+                    self.build.stdlibs.host[l] = subproj.get_variable_method([depname], {})
                 except KeyError:
                     pass
                 except InvalidArguments:
@@ -2139,7 +2312,7 @@
         version = kwargs.get('version', self.project_version)
         if not isinstance(version, str):
             raise InterpreterException('Version must be a string.')
-        incs = extract_as_list(kwargs, 'include_directories', unholder=True)
+        incs = self.extract_incdirs(kwargs)
         libs = extract_as_list(kwargs, 'link_with', unholder=True)
         libs_whole = extract_as_list(kwargs, 'link_whole', unholder=True)
         sources = extract_as_list(kwargs, 'sources')
@@ -2181,13 +2354,12 @@
             if argcount != len(args):
                 raise InvalidArguments('Expected %d arguments, got %d.' %
                                        (argcount, len(args)))
-        for i in range(min(len(args), len(arg_types))):
-            wanted = arg_types[i]
-            actual = args[i]
+        for actual, wanted in zip(args, arg_types):
             if wanted is not None:
                 if not isinstance(actual, wanted):
                     raise InvalidArguments('Incorrect argument type.')
 
+    @FeatureNewKwargs('run_command', '0.50.0', ['env'])
     @FeatureNewKwargs('run_command', '0.47.0', ['check', 'capture'])
     @permittedKwargs(permitted_kwargs['run_command'])
     def func_run_command(self, node, args, kwargs):
@@ -2196,8 +2368,7 @@
     def run_command_impl(self, node, args, kwargs, in_builddir=False):
         if len(args) < 1:
             raise InterpreterException('Not enough arguments')
-        cmd = args[0]
-        cargs = args[1:]
+        cmd, *cargs = args
         capture = kwargs.get('capture', True)
         srcdir = self.environment.get_source_dir()
         builddir = self.environment.get_build_dir()
@@ -2206,6 +2377,8 @@
         if not isinstance(check, bool):
             raise InterpreterException('Check must be boolean.')
 
+        env = self.unpack_env_kwarg(kwargs)
+
         m = 'must be a string, or the output of find_program(), files() '\
             'or configure_file(), or a compiler object; not {!r}'
         if isinstance(cmd, ExternalProgramHolder):
@@ -2235,8 +2408,12 @@
                                            'or not executable'.format(cmd))
             cmd = prog
         cmd_path = mesonlib.relpath(cmd.get_path(), start=srcdir)
-        if not cmd_path.startswith('..') and cmd_path not in self.build_def_files:
-            self.build_def_files.append(cmd_path)
+        if not cmd_path.startswith('..'):
+            # On Windows, program on a different drive than srcdir won't have
+            # an expressible relative path; cmd_path will be absolute instead.
+            if not os.path.isabs(cmd_path):
+                if cmd_path not in self.build_def_files:
+                    self.build_def_files.append(cmd_path)
         expanded_args = []
         for a in listify(cargs):
             if isinstance(a, str):
@@ -2247,15 +2424,16 @@
                 expanded_args.append(a.held_object.get_path())
             else:
                 raise InterpreterException('Arguments ' + m.format(a))
+        # If any file that was used as an argument to the command
+        # changes, we must re-run the configuration step.
         for a in expanded_args:
             if not os.path.isabs(a):
                 a = os.path.join(builddir if in_builddir else srcdir, self.subdir, a)
             if os.path.isfile(a):
                 a = mesonlib.relpath(a, start=srcdir)
-                if not a.startswith('..'):
-                    if a not in self.build_def_files:
-                        self.build_def_files.append(a)
-        return RunProcess(cmd, expanded_args, srcdir, builddir, self.subdir,
+                if a not in self.build_def_files:
+                    self.build_def_files.append(a)
+        return RunProcess(cmd, expanded_args, env, srcdir, builddir, self.subdir,
                           self.environment.get_build_command() + ['introspect'],
                           in_builddir=in_builddir, check=check, capture=capture)
 
@@ -2273,16 +2451,16 @@
         if len(args) != 1:
             raise InterpreterException('Subproject takes exactly one argument')
         dirname = args[0]
-        return self.do_subproject(dirname, kwargs)
+        return self.do_subproject(dirname, 'meson', kwargs)
 
     def disabled_subproject(self, dirname):
         self.subprojects[dirname] = SubprojectHolder(None, self.subproject_dir, dirname)
         return self.subprojects[dirname]
 
-    def do_subproject(self, dirname, kwargs):
+    def do_subproject(self, dirname: str, method: str, kwargs):
         disabled, required, feature = extract_required_kwarg(kwargs, self.subproject)
         if disabled:
-            mlog.log('\nSubproject', mlog.bold(dirname), ':', 'skipped: feature', mlog.bold(feature), 'disabled')
+            mlog.log('Subproject', mlog.bold(dirname), ':', 'skipped: feature', mlog.bold(feature), 'disabled')
             return self.disabled_subproject(dirname)
 
         default_options = mesonlib.stringlistify(kwargs.get('default_options', []))
@@ -2296,62 +2474,78 @@
         if os.path.isabs(dirname):
             raise InterpreterException('Subproject name must not be an absolute path.')
         if has_path_sep(dirname):
-            mlog.warning('Subproject name has a path separator. This may cause unexpected behaviour.')
+            mlog.warning('Subproject name has a path separator. This may cause unexpected behaviour.',
+                         location=self.current_node)
         if dirname in self.subproject_stack:
             fullstack = self.subproject_stack + [dirname]
             incpath = ' => '.join(fullstack)
             raise InvalidCode('Recursive include of subprojects: %s.' % incpath)
         if dirname in self.subprojects:
             subproject = self.subprojects[dirname]
-
             if required and not subproject.found():
                 raise InterpreterException('Subproject "%s/%s" required but not found.' % (
                                            self.subproject_dir, dirname))
-
             return subproject
+
         subproject_dir_abs = os.path.join(self.environment.get_source_dir(), self.subproject_dir)
         r = wrap.Resolver(subproject_dir_abs, self.coredata.get_builtin_option('wrap_mode'))
         try:
-            resolved = r.resolve(dirname)
+            resolved = r.resolve(dirname, method)
         except wrap.WrapException as e:
             subprojdir = os.path.join(self.subproject_dir, r.directory)
-            if not required:
-                mlog.log('\nSubproject ', mlog.bold(subprojdir), 'is buildable:', mlog.red('NO'), '(disabling)\n')
-                return self.disabled_subproject(dirname)
-
             if isinstance(e, wrap.WrapNotFoundException):
                 # if the reason subproject execution failed was because
                 # the directory doesn't exist, try to give some helpful
                 # advice if it's a nested subproject that needs
                 # promotion...
                 self.print_nested_info(dirname)
-
-            msg = 'Failed to initialize {!r}:\n{}'
-            raise InterpreterException(msg.format(subprojdir, e))
+            if not required:
+                mlog.log(e)
+                mlog.log('Subproject ', mlog.bold(subprojdir), 'is buildable:', mlog.red('NO'), '(disabling)')
+                return self.disabled_subproject(dirname)
+            raise e
 
         subdir = os.path.join(self.subproject_dir, resolved)
+        subdir_abs = os.path.join(subproject_dir_abs, resolved)
         os.makedirs(os.path.join(self.build.environment.get_build_dir(), subdir), exist_ok=True)
         self.global_args_frozen = True
+
         mlog.log()
         with mlog.nested():
-            try:
-                mlog.log('\nExecuting subproject', mlog.bold(dirname), '\n')
-                new_build = self.build.copy()
-                subi = Interpreter(new_build, self.backend, dirname, subdir, self.subproject_dir,
-                                   self.modules, default_options)
-                subi.subprojects = self.subprojects
-
-                subi.subproject_stack = self.subproject_stack + [dirname]
-                current_active = self.active_projectname
-                subi.run()
-                mlog.log('\nSubproject', mlog.bold(dirname), 'finished.')
-            except Exception as e:
-                if not required:
-                    mlog.log(e)
-                    mlog.log('\nSubproject', mlog.bold(dirname), 'is buildable:', mlog.red('NO'), '(disabling)')
-                    return self.disabled_subproject(dirname)
-                else:
-                    raise e
+            mlog.log('Executing subproject', mlog.bold(dirname), 'method', mlog.bold(method), '\n')
+        try:
+            if method == 'meson':
+                return self._do_subproject_meson(dirname, subdir, default_options, kwargs)
+            elif method == 'cmake':
+                return self._do_subproject_cmake(dirname, subdir, subdir_abs, default_options, kwargs)
+            else:
+                raise InterpreterException('The method {} is invalid for the subproject {}'.format(method, dirname))
+        # Invalid code is always an error
+        except InvalidCode:
+            raise
+        except Exception as e:
+            if not required:
+                with mlog.nested():
+                    # Suppress the 'ERROR:' prefix because this exception is not
+                    # fatal and VS CI treat any logs with "ERROR:" as fatal.
+                    mlog.exception(e, prefix=mlog.yellow('Exception:'))
+                mlog.log('\nSubproject', mlog.bold(dirname), 'is buildable:', mlog.red('NO'), '(disabling)')
+                return self.disabled_subproject(dirname)
+            raise e
+
+    def _do_subproject_meson(self, dirname, subdir, default_options, kwargs, ast=None, build_def_files=None):
+        with mlog.nested():
+            new_build = self.build.copy()
+            subi = Interpreter(new_build, self.backend, dirname, subdir, self.subproject_dir,
+                               self.modules, default_options, ast=ast)
+            subi.subprojects = self.subprojects
+
+            subi.subproject_stack = self.subproject_stack + [dirname]
+            current_active = self.active_projectname
+            subi.run()
+            mlog.log('Subproject', mlog.bold(dirname), 'finished.')
+
+        mlog.log()
 
         if 'version' in kwargs:
             pv = subi.project_version
@@ -2359,22 +2553,61 @@
             if pv == 'undefined' or not mesonlib.version_compare_many(pv, wanted)[0]:
                 raise InterpreterException('Subproject %s version is %s but %s required.' % (dirname, pv, wanted))
         self.active_projectname = current_active
-        self.build.subprojects[dirname] = subi.project_version
         self.subprojects.update(subi.subprojects)
         self.subprojects[dirname] = SubprojectHolder(subi, self.subproject_dir, dirname)
-        self.build_def_files += subi.build_def_files
+        # Duplicates are possible when subproject uses files from project root
+        if build_def_files:
+            self.build_def_files = list(set(self.build_def_files + build_def_files))
+        else:
+            self.build_def_files = list(set(self.build_def_files + subi.build_def_files))
         self.build.merge(subi.build)
+        self.build.subprojects[dirname] = subi.project_version
         return self.subprojects[dirname]
 
+    def _do_subproject_cmake(self, dirname, subdir, subdir_abs, default_options, kwargs):
+        with mlog.nested():
+            new_build = self.build.copy()
+            prefix = self.coredata.builtins['prefix'].value
+            cmake_options = mesonlib.stringlistify(kwargs.get('cmake_options', []))
+            cm_int = CMakeInterpreter(new_build, subdir, subdir_abs, prefix, new_build.environment, self.backend)
+            cm_int.initialise(cmake_options)
+            cm_int.analyse()
+
+            # Generate a meson ast and execute it with the normal do_subproject_meson
+            ast = cm_int.pretend_to_be_meson()
+
+            mlog.log()
+            with mlog.nested():
+                mlog.log('Processing generated meson AST')
+
+                # Debug print the generated meson file
+                from .ast import AstIndentationGenerator, AstPrinter
+                printer = AstPrinter()
+                ast.accept(AstIndentationGenerator())
+                ast.accept(printer)
+                printer.post_process()
+                meson_filename = os.path.join(self.build.environment.get_build_dir(), subdir, 'meson.build')
+                with open(meson_filename, "w") as f:
+                    f.write(printer.result)
+
+                mlog.log('Build file:', meson_filename)
+                mlog.log()
+
+            result = self._do_subproject_meson(dirname, subdir, default_options, kwargs, ast, cm_int.bs_files)
+            result.cm_interpreter = cm_int
+
+        mlog.log()
+        return result
+
     def get_option_internal(self, optname):
-        # Some base options are not defined in some environments, return the
-        # default value from compilers.base_options in that case.
-        for d in [self.coredata.base_options, compilers.base_options,
-                  self.coredata.builtins, self.coredata.compiler_options]:
-            try:
-                return d[optname]
-            except KeyError:
-                pass
+        for opts in chain(
+                [self.coredata.base_options, compilers.base_options, self.coredata.builtins],
+                self.coredata.get_prefixed_options_per_machine(self.coredata.builtins_per_machine),
+                self.coredata.get_prefixed_options_per_machine(self.coredata.compiler_options),
+        ):
+            v = opts.get(optname)
+            if v is not None:
+                return v
 
         raw_optname = optname
         if self.is_subproject():
@@ -2395,7 +2628,8 @@
                     mlog.warning('Option {0!r} of type {1!r} in subproject {2!r} cannot yield '
                                  'to parent option of type {3!r}, ignoring parent value. '
                                  'Use -D{2}:{0}=value to set the value for this option manually'
-                                 '.'.format(raw_optname, opt_type, self.subproject, popt_type))
+                                 '.'.format(raw_optname, opt_type, self.subproject, popt_type),
+                                 location=self.current_node)
             return opt
         except KeyError:
             pass
@@ -2414,7 +2648,7 @@
                                        'options of other subprojects.')
         opt = self.get_option_internal(optname)
         if isinstance(opt, coredata.UserFeatureOption):
-            return FeatureOptionHolder(self.environment, opt)
+            return FeatureOptionHolder(self.environment, optname, opt)
         elif isinstance(opt, coredata.UserOption):
             return opt.value
         return opt
@@ -2424,72 +2658,28 @@
         if len(args) > 1:
             raise InterpreterException('configuration_data takes only one optional positional arguments')
         elif len(args) == 1:
+            FeatureNew('configuration_data dictionary', '0.49.0').use(self.subproject)
             initial_values = args[0]
             if not isinstance(initial_values, dict):
                 raise InterpreterException('configuration_data first argument must be a dictionary')
         else:
             initial_values = {}
-        cdata = ConfigurationDataHolder(self.subproject)
-        for k, v in initial_values.items():
-            cdata.set_method([k, v], {})
-        return cdata
-
-    def set_options(self, default_options):
-        # Set default options as if they were passed to the command line.
-        # Subprojects can only define default for user options.
-        for k, v in default_options.items():
-            if self.subproject:
-                if optinterpreter.is_invalid_name(k):
-                    continue
-                k = self.subproject + ':' + k
-            self.environment.cmd_line_options.setdefault(k, v)
-
-        # Create a subset of cmd_line_options, keeping only options for this
-        # subproject. Also take builtin options if it's the main project.
-        # Language and backend specific options will be set later when adding
-        # languages and setting the backend (builtin options must be set first
-        # to know which backend we'll use).
-        options = {}
-        for k, v in self.environment.cmd_line_options.items():
-            if self.subproject:
-                if not k.startswith(self.subproject + ':'):
-                    continue
-            elif k not in coredata.get_builtin_options():
-                if ':' in k:
-                    continue
-                if optinterpreter.is_invalid_name(k):
-                    continue
-            options[k] = v
-
-        self.coredata.set_options(options, self.subproject)
+        return ConfigurationDataHolder(self.subproject, initial_values)
 
     def set_backend(self):
         # The backend is already set when parsing subprojects
         if self.backend is not None:
             return
         backend = self.coredata.get_builtin_option('backend')
-        if backend == 'ninja':
-            from .backend import ninjabackend
-            self.backend = ninjabackend.NinjaBackend(self.build)
-        elif backend == 'vs':
-            from .backend import vs2010backend
-            self.backend = vs2010backend.autodetect_vs_version(self.build)
-            self.coredata.set_builtin_option('backend', self.backend.name)
-            mlog.log('Auto detected Visual Studio backend:', mlog.bold(self.backend.name))
-        elif backend == 'vs2010':
-            from .backend import vs2010backend
-            self.backend = vs2010backend.Vs2010Backend(self.build)
-        elif backend == 'vs2015':
-            from .backend import vs2015backend
-            self.backend = vs2015backend.Vs2015Backend(self.build)
-        elif backend == 'vs2017':
-            from .backend import vs2017backend
-            self.backend = vs2017backend.Vs2017Backend(self.build)
-        elif backend == 'xcode':
-            from .backend import xcodebackend
-            self.backend = xcodebackend.XCodeBackend(self.build)
-        else:
+        from .backend import backends
+        self.backend = backends.get_backend_from_name(backend, self.build)
+
+        if self.backend is None:
             raise InterpreterException('Unknown backend "%s".' % backend)
+        if backend != self.backend.name:
+            if self.backend.name.startswith('vs'):
+                mlog.log('Auto detected Visual Studio backend:', mlog.bold(self.backend.name))
+            self.coredata.set_builtin_option('backend', self.backend.name)
 
         # Only init backend options on first invocation otherwise it would
         # override values previously set from command line.
@@ -2504,11 +2694,16 @@
     def func_project(self, node, args, kwargs):
         if len(args) < 1:
             raise InvalidArguments('Not enough arguments to project(). Needs at least the project name.')
-        proj_name = args[0]
-        proj_langs = args[1:]
+        proj_name, *proj_langs = args
         if ':' in proj_name:
             raise InvalidArguments("Project name {!r} must not contain ':'".format(proj_name))
 
+        if 'meson_version' in kwargs:
+            cv = coredata.version
+            pv = kwargs['meson_version']
+            if not mesonlib.version_compare(cv, pv):
+                raise InterpreterException('Meson version is %s but project requires %s' % (cv, pv))
+
         if os.path.exists(self.option_file):
             oi = optinterpreter.OptionInterpreter(self.subproject)
             oi.process(self.option_file)
@@ -2525,8 +2720,7 @@
             default_options.update(self.default_project_options)
         else:
             default_options = {}
-        self.set_options(default_options)
-        self.set_backend()
+        self.coredata.set_default_options(default_options, self.subproject, self.environment)
 
         if not self.is_subproject():
             self.build.project_name = proj_name
@@ -2555,21 +2749,15 @@
 
         mesonlib.project_meson_versions[self.subproject] = ''
         if 'meson_version' in kwargs:
-            cv = coredata.version
-            pv = kwargs['meson_version']
-            mesonlib.project_meson_versions[self.subproject] = pv
-            if not mesonlib.version_compare(cv, pv):
-                raise InterpreterException('Meson version is %s but project requires %s.' % (cv, pv))
+            mesonlib.project_meson_versions[self.subproject] = kwargs['meson_version']
+
         self.build.projects[self.subproject] = proj_name
         mlog.log('Project name:', mlog.bold(proj_name))
         mlog.log('Project version:', mlog.bold(self.project_version))
         self.add_languages(proj_langs, True)
-        langs = self.coredata.compilers.keys()
-        if 'vala' in langs:
-            if 'c' not in langs:
-                raise InterpreterException('Compiling Vala requires C. Add C to your project languages and rerun Meson.')
+        self.set_backend()
         if not self.is_subproject():
-            self.check_cross_stdlibs()
+            self.check_stdlibs()
 
     @permittedKwargs(permitted_kwargs['add_languages'])
     @stringArgs
@@ -2604,6 +2792,9 @@
     @noKwargs
     def func_message(self, node, args, kwargs):
         argstr = self.get_message_string_arg(node)
+        self.message_impl(argstr)
+
+    def message_impl(self, argstr):
         mlog.log(mlog.bold('Message:'), argstr)
 
     @FeatureNew('warning', '0.44.0')
@@ -2622,133 +2813,57 @@
         self.validate_arguments(args, 0, [])
         raise Exception()
 
-    def detect_compilers(self, lang, need_cross_compiler):
-        cross_comp = None
-        if lang == 'c':
-            comp = self.environment.detect_c_compiler(False)
-            if need_cross_compiler:
-                cross_comp = self.environment.detect_c_compiler(True)
-        elif lang == 'cpp':
-            comp = self.environment.detect_cpp_compiler(False)
-            if need_cross_compiler:
-                cross_comp = self.environment.detect_cpp_compiler(True)
-        elif lang == 'objc':
-            comp = self.environment.detect_objc_compiler(False)
-            if need_cross_compiler:
-                cross_comp = self.environment.detect_objc_compiler(True)
-        elif lang == 'objcpp':
-            comp = self.environment.detect_objcpp_compiler(False)
-            if need_cross_compiler:
-                cross_comp = self.environment.detect_objcpp_compiler(True)
-        elif lang == 'java':
-            comp = self.environment.detect_java_compiler()
-            if need_cross_compiler:
-                cross_comp = comp  # Java is platform independent.
-        elif lang == 'cs':
-            comp = self.environment.detect_cs_compiler()
-            if need_cross_compiler:
-                cross_comp = comp  # C# is platform independent.
-        elif lang == 'vala':
-            comp = self.environment.detect_vala_compiler()
-            if need_cross_compiler:
-                cross_comp = comp  # Vala compiles to platform-independent C
-        elif lang == 'd':
-            comp = self.environment.detect_d_compiler(False)
-            if need_cross_compiler:
-                cross_comp = self.environment.detect_d_compiler(True)
-        elif lang == 'rust':
-            comp = self.environment.detect_rust_compiler(False)
-            if need_cross_compiler:
-                cross_comp = self.environment.detect_rust_compiler(True)
-        elif lang == 'fortran':
-            comp = self.environment.detect_fortran_compiler(False)
-            if need_cross_compiler:
-                cross_comp = self.environment.detect_fortran_compiler(True)
-        elif lang == 'swift':
-            comp = self.environment.detect_swift_compiler()
-            if need_cross_compiler:
-                raise InterpreterException('Cross compilation with Swift is not working yet.')
-                # cross_comp = self.environment.detect_fortran_compiler(True)
-        else:
-            raise InvalidCode('Tried to use unknown language "%s".' % lang)
-        comp.sanity_check(self.environment.get_scratch_dir(), self.environment)
-        self.coredata.compilers[lang] = comp
-        # Native compiler always exist so always add its options.
-        new_options = comp.get_options()
-        if cross_comp is not None:
-            cross_comp.sanity_check(self.environment.get_scratch_dir(), self.environment)
-            self.coredata.cross_compilers[lang] = cross_comp
-            new_options.update(cross_comp.get_options())
-
-        optprefix = lang + '_'
-        for k, o in new_options.items():
-            if not k.startswith(optprefix):
-                raise InterpreterException('Internal error, %s has incorrect prefix.' % k)
-            if k in self.environment.cmd_line_options:
-                o.set_value(self.environment.cmd_line_options[k])
-            self.coredata.compiler_options.setdefault(k, o)
-
-        # Unlike compiler and linker flags, preprocessor flags are not in
-        # compiler_options because they are not visible to user.
-        preproc_flags = comp.get_preproc_flags()
-        preproc_flags = shlex.split(preproc_flags)
-        self.coredata.external_preprocess_args.setdefault(lang, preproc_flags)
-
-        return comp, cross_comp
+    def add_languages(self, args: Sequence[str], required: bool) -> bool:
+        success = self.add_languages_for(args, required, MachineChoice.BUILD)
+        success &= self.add_languages_for(args, required, MachineChoice.HOST)
+        if not self.coredata.is_cross_build():
+            self.coredata.copy_build_options_from_regular_ones()
+        return success
 
-    def add_languages(self, args, required):
+    def add_languages_for(self, args, required, for_machine: MachineChoice):
         success = True
-        need_cross_compiler = self.environment.is_cross_build() and self.environment.cross_info.need_cross_compiler()
         for lang in sorted(args, key=compilers.sort_clink):
             lang = lang.lower()
-            if lang in self.coredata.compilers:
-                comp = self.coredata.compilers[lang]
-                cross_comp = self.coredata.cross_compilers.get(lang, None)
+            clist = self.coredata.compilers[for_machine]
+            machine_name = for_machine.get_lower_case_name()
+            if lang in clist:
+                comp = clist[lang]
             else:
                 try:
-                    (comp, cross_comp) = self.detect_compilers(lang, need_cross_compiler)
+                    comp = self.environment.detect_compiler_for(lang, for_machine)
+                    if comp is None:
+                        raise InvalidArguments('Tried to use unknown language "%s".' % lang)
+                    comp.sanity_check(self.environment.get_scratch_dir(), self.environment)
                 except Exception:
                     if not required:
-                        mlog.log('Compiler for language', mlog.bold(lang), 'not found.')
+                        mlog.log('Compiler for language',
+                                 mlog.bold(lang), 'for the', machine_name,
+                                 'machine not found.')
                         success = False
                         continue
                     else:
                         raise
-            if comp.full_version is not None:
-                version_string = '(%s %s "%s")' % (comp.id, comp.version, comp.full_version)
+
+            if for_machine == MachineChoice.HOST or self.environment.is_cross_build():
+                logger_fun = mlog.log
             else:
-                version_string = '(%s %s)' % (comp.id, comp.version)
-            mlog.log('Native', comp.get_display_language(), 'compiler:',
-                     mlog.bold(' '.join(comp.get_exelist())), version_string)
-            self.build.add_compiler(comp)
-            if need_cross_compiler:
-                version_string = '(%s %s)' % (cross_comp.id, cross_comp.version)
-                mlog.log('Cross', cross_comp.get_display_language(), 'compiler:',
-                         mlog.bold(' '.join(cross_comp.get_exelist())), version_string)
-                self.build.add_cross_compiler(cross_comp)
-            if self.environment.is_cross_build() and not need_cross_compiler:
-                self.build.add_cross_compiler(comp)
-            self.add_base_options(comp)
-        return success
+                logger_fun = mlog.debug
+            logger_fun(comp.get_display_language(), 'compiler for the', machine_name, 'machine:',
+                       mlog.bold(' '.join(comp.get_exelist())), comp.get_version_string())
+            if comp.linker is not None:
+                logger_fun(comp.get_display_language(), 'linker for the', machine_name, 'machine:',
+                           mlog.bold(comp.linker.id), comp.linker.version)
+            self.build.ensure_static_linker(comp)
 
-    def emit_base_options_warnings(self, enabled_opts):
-        if 'b_bitcode' in enabled_opts:
-            mlog.warning('Base option \'b_bitcode\' is enabled, which is incompatible with many linker options. Incompatible options such as such as \'b_asneeded\' have been disabled.')
-            mlog.warning('Please see https://mesonbuild.com/Builtin-options.html#Notes_about_Apple_Bitcode_support for more details.')
-
-    def add_base_options(self, compiler):
-        enabled_opts = []
-        for optname in compiler.base_options:
-            if optname in self.coredata.base_options:
-                continue
-            oobj = compilers.base_options[optname]
-            if optname in self.environment.cmd_line_options:
-                oobj.set_value(self.environment.cmd_line_options[optname])
-                enabled_opts.append(optname)
-            self.coredata. base_options[optname] = oobj
-        self.emit_base_options_warnings(enabled_opts)
+        langs = self.coredata.compilers[for_machine].keys()
+        if 'vala' in langs:
+            if 'c' not in langs:
+                raise InterpreterException('Compiling Vala requires C. Add C to your project languages and rerun Meson.')
+
+        return success
 
-    def _program_from_file(self, prognames, bins, silent):
+    def program_from_file_for(self, for_machine, prognames, silent):
+        bins = self.environment.binaries[for_machine]
         for p in prognames:
             if hasattr(p, 'held_object'):
                 p = p.held_object
@@ -2761,14 +2876,6 @@
                 return ExternalProgramHolder(prog)
         return None
 
-    def program_from_cross_file(self, prognames, silent=False):
-        bins = self.environment.cross_info.config['binaries']
-        return self._program_from_file(prognames, bins, silent)
-
-    def program_from_config_file(self, prognames, silent=False):
-        bins = self.environment.config_info.binaries
-        return self._program_from_file(prognames, bins, silent)
-
     def program_from_system(self, args, silent=False):
         # Search for scripts relative to current subdir.
         # Do not cache found programs because find_program('foobar')
@@ -2820,27 +2927,40 @@
                                        % name)
         self.build.find_overrides[name] = exe
 
-    def find_program_impl(self, args, native=False, required=True, silent=True):
+    # TODO update modules to always pass `for_machine`. It is bad-form to assume
+    # the host machine.
+    def find_program_impl(self, args, for_machine: MachineChoice = MachineChoice.HOST, required=True, silent=True, wanted=''):
         if not isinstance(args, list):
             args = [args]
 
         progobj = self.program_from_overrides(args, silent=silent)
         if progobj is None:
-            if self.build.environment.is_cross_build() and not native:
-                progobj = self.program_from_cross_file(args, silent=silent)
-            else:
-                progobj = self.program_from_config_file(args, silent=silent)
-
+            progobj = self.program_from_file_for(for_machine, args, silent=silent)
         if progobj is None:
             progobj = self.program_from_system(args, silent=silent)
+        if progobj is None and args[0].endswith('python3'):
+            prog = dependencies.ExternalProgram('python3', mesonlib.python_command, silent=True)
+            progobj = ExternalProgramHolder(prog)
         if required and (progobj is None or not progobj.found()):
             raise InvalidArguments('Program(s) {!r} not found or not executable'.format(args))
         if progobj is None:
             return ExternalProgramHolder(dependencies.NonExistingExternalProgram())
         # Only store successful lookups
         self.store_name_lookups(args)
+        if wanted:
+            version = progobj.get_version(self)
+            is_found, not_found, found = mesonlib.version_compare_many(version, wanted)
+            if not is_found:
+                mlog.log('Program', mlog.bold(progobj.get_name()), 'found:', mlog.red('NO'),
+                         'found {!r} but need:'.format(version),
+                         ', '.join(["'{}'".format(e) for e in not_found]))
+                if required:
+                    m = 'Invalid version of program, need {!r} {!r} found {!r}.'
+                    raise InvalidArguments(m.format(progobj.get_name(), not_found, version))
+                return ExternalProgramHolder(dependencies.NonExistingExternalProgram())
         return progobj
 
+    @FeatureNewKwargs('find_program', '0.52.0', ['version'])
     @FeatureNewKwargs('find_program', '0.49.0', ['disabler'])
     @disablerIfNotFound
     @permittedKwargs(permitted_kwargs['find_program'])
@@ -2855,10 +2975,9 @@
 
         if not isinstance(required, bool):
             raise InvalidArguments('"required" argument must be a boolean.')
-        use_native = kwargs.get('native', False)
-        if not isinstance(use_native, bool):
-            raise InvalidArguments('Argument to "native" must be a boolean.')
-        return self.find_program_impl(args, native=use_native, required=required, silent=False)
+        wanted = mesonlib.stringlistify(kwargs.get('version', []))
+        for_machine = self.machine_from_native_kwarg(kwargs)
+        return self.find_program_impl(args, for_machine, required=required, silent=False, wanted=wanted)
 
     def func_find_library(self, node, args, kwargs):
         raise InvalidCode('find_library() is removed, use meson.get_compiler(\'name\').find_library() instead.\n'
@@ -2867,37 +2986,27 @@
                           )
 
     def _find_cached_dep(self, name, kwargs):
-        # Check if we want this as a cross-dep or a native-dep
-        # FIXME: Not all dependencies support such a distinction right now,
-        # and we repeat this check inside dependencies that do. We need to
-        # consolidate this somehow.
-        is_cross = self.environment.is_cross_build()
-        if 'native' in kwargs and is_cross:
-            want_cross = not kwargs['native']
-        else:
-            want_cross = is_cross
-        identifier = dependencies.get_dep_identifier(name, kwargs, want_cross)
-        cached_dep = None
-        # Check if we've already searched for and found this dep
-        if identifier in self.coredata.deps:
-            cached_dep = self.coredata.deps[identifier]
-            mlog.log('Dependency', mlog.bold(name),
-                     'found:', mlog.green('YES'), '(cached)')
-        else:
-            # Check if exactly the same dep with different version requirements
-            # was found already.
-            wanted = identifier[1]
-            for trial, trial_dep in self.coredata.deps.items():
-                # trial[1], identifier[1] are the version requirements
-                if trial[0] != identifier[0] or trial[2:] != identifier[2:]:
-                    continue
-                found = trial_dep.get_version()
-                if not wanted or mesonlib.version_compare_many(found, wanted)[0]:
-                    # We either don't care about the version, or our
-                    # version requirements matched the trial dep's version.
-                    cached_dep = trial_dep
-                    break
-        return identifier, cached_dep
+        # Check if we want this as a build-time / build machine or runt-time /
+        # host machine dep.
+        for_machine = self.machine_from_native_kwarg(kwargs)
+
+        identifier = dependencies.get_dep_identifier(name, kwargs)
+        cached_dep = self.coredata.deps[for_machine].get(identifier)
+        if cached_dep:
+            if not cached_dep.found():
+                mlog.log('Dependency', mlog.bold(name),
+                         'found:', mlog.red('NO'), '(cached)')
+                return identifier, cached_dep
+
+            # Verify the cached dep version match
+            wanted = kwargs.get('version', [])
+            found = cached_dep.get_version()
+            if not wanted or mesonlib.version_compare_many(found, wanted)[0]:
+                mlog.log('Dependency', mlog.bold(name),
+                         'found:', mlog.green('YES'), '(cached)')
+                return identifier, cached_dep
+
+        return identifier, None
 
     @staticmethod
     def check_subproject_version(wanted, found):
@@ -2907,54 +3016,50 @@
             return False
         return True
 
-    def get_subproject_dep(self, name, dirname, varname, required):
-        dep = DependencyHolder(NotFoundDependency(self.environment), self.subproject)
+    def notfound_dependency(self):
+        return DependencyHolder(NotFoundDependency(self.environment), self.subproject)
+
+    def get_subproject_dep(self, display_name, dirname, varname, kwargs):
+        dep = self.notfound_dependency()
         try:
             subproject = self.subprojects[dirname]
             if subproject.found():
                 dep = self.subprojects[dirname].get_variable_method([varname], {})
-        except InvalidArguments as e:
+        except InvalidArguments:
             pass
 
         if not isinstance(dep, DependencyHolder):
             raise InvalidCode('Fetched variable {!r} in the subproject {!r} is '
                               'not a dependency object.'.format(varname, dirname))
 
+        required = kwargs.get('required', True)
+        wanted = kwargs.get('version', 'undefined')
+        subproj_path = os.path.join(self.subproject_dir, dirname)
+
         if not dep.found():
             if required:
                 raise DependencyException('Could not find dependency {} in subproject {}'
                                           ''.format(varname, dirname))
             # If the dependency is not required, don't raise an exception
-            subproj_path = os.path.join(self.subproject_dir, dirname)
-            mlog.log('Dependency', mlog.bold(name), 'from subproject',
+            mlog.log('Dependency', mlog.bold(display_name), 'from subproject',
                      mlog.bold(subproj_path), 'found:', mlog.red('NO'))
-
-        return dep
-
-    def _find_cached_fallback_dep(self, name, dirname, varname, wanted, required):
-        if dirname not in self.subprojects:
-            return False
-        dep = self.get_subproject_dep(name, dirname, varname, required)
-        if not dep.found():
             return dep
 
-        found = dep.version_method([], {})
-        # Don't do a version check if the dependency is not found and not required
-        if not dep.found_method([], {}) and not required:
-            subproj_path = os.path.join(self.subproject_dir, dirname)
-            mlog.log('Dependency', mlog.bold(name), 'from subproject',
-                     mlog.bold(subproj_path), 'found:', mlog.red('NO'), '(cached)')
-            return dep
-        if self.check_subproject_version(wanted, found):
-            subproj_path = os.path.join(self.subproject_dir, dirname)
-            mlog.log('Dependency', mlog.bold(name), 'from subproject',
-                     mlog.bold(subproj_path), 'found:', mlog.green('YES'), '(cached)')
-            return dep
-        if required:
-            raise DependencyException('Version {} of subproject dependency {} already '
-                                      'cached, requested incompatible version {} for '
-                                      'dep {}'.format(found, dirname, wanted, name))
-        return None
+        found = dep.held_object.get_version()
+        if not self.check_subproject_version(wanted, found):
+            if required:
+                raise DependencyException('Version {} of subproject dependency {} already '
+                                          'cached, requested incompatible version {} for '
+                                          'dep {}'.format(found, dirname, wanted, display_name))
+
+            mlog.log('Subproject', mlog.bold(subproj_path), 'dependency',
+                     mlog.bold(display_name), 'version is', mlog.bold(found),
+                     'but', mlog.bold(wanted), 'is required.')
+            return self.notfound_dependency()
+
+        mlog.log('Dependency', mlog.bold(display_name), 'from subproject',
+                 mlog.bold(subproj_path), 'found:', mlog.green('YES'))
+        return dep
 
     def _handle_featurenew_dependencies(self, name):
         'Do a feature check on dependencies used by this subproject'
@@ -2969,6 +3074,8 @@
         elif name == 'openmp':
             FeatureNew('OpenMP Dependency', '0.46.0').use(self.subproject)
 
+    @FeatureNewKwargs('dependency', '0.52.0', ['include_type'])
+    @FeatureNewKwargs('dependency', '0.50.0', ['not_found_message', 'cmake_module_path', 'cmake_args'])
     @FeatureNewKwargs('dependency', '0.49.0', ['disabler'])
     @FeatureNewKwargs('dependency', '0.40.0', ['method'])
     @FeatureNewKwargs('dependency', '0.38.0', ['default_options'])
@@ -2978,70 +3085,73 @@
         self.validate_arguments(args, 1, [str])
         name = args[0]
         display_name = name if name else '(anonymous)'
+        not_found_message = kwargs.get('not_found_message', '')
+        if not isinstance(not_found_message, str):
+            raise InvalidArguments('The not_found_message must be a string.')
+        try:
+            d = self.dependency_impl(name, display_name, kwargs)
+        except Exception:
+            if not_found_message:
+                self.message_impl(not_found_message)
+            raise
+        if not d.found() and not_found_message:
+            self.message_impl(not_found_message)
+        return d
 
+    def dependency_impl(self, name, display_name, kwargs):
         disabled, required, feature = extract_required_kwarg(kwargs, self.subproject)
         if disabled:
             mlog.log('Dependency', mlog.bold(display_name), 'skipped: feature', mlog.bold(feature), 'disabled')
-            return DependencyHolder(NotFoundDependency(self.environment), self.subproject)
+            return self.notfound_dependency()
+
+        has_fallback = 'fallback' in kwargs
+        if 'default_options' in kwargs and not has_fallback:
+            mlog.warning('The "default_options" keyworg argument does nothing without a "fallback" keyword argument.',
+                         location=self.current_node)
 
         # writing just "dependency('')" is an error, because it can only fail
-        if name == '' and required and 'fallback' not in kwargs:
+        if name == '' and required and not has_fallback:
             raise InvalidArguments('Dependency is both required and not-found')
 
         if '<' in name or '>' in name or '=' in name:
             raise InvalidArguments('Characters <, > and = are forbidden in dependency names. To specify'
                                    'version\n requirements use the \'version\' keyword argument instead.')
-        identifier, cached_dep = self._find_cached_dep(name, kwargs)
 
+        identifier, cached_dep = self._find_cached_dep(name, kwargs)
         if cached_dep:
             if required and not cached_dep.found():
                 m = 'Dependency {!r} was already checked and was not found'
                 raise DependencyException(m.format(display_name))
-            dep = cached_dep
-        else:
-            # If the dependency has already been configured, possibly by
-            # a higher level project, try to use it first.
-            if 'fallback' in kwargs:
-                dirname, varname = self.get_subproject_infos(kwargs)
-                wanted = kwargs.get('version', 'undefined')
-                dep = self._find_cached_fallback_dep(name, dirname, varname, wanted, required)
-                if dep:
-                    return dep
-
-            # We need to actually search for this dep
-            exception = None
-            dep = NotFoundDependency(self.environment)
+            return DependencyHolder(cached_dep, self.subproject)
 
-            # Unless a fallback exists and is forced ...
-            if self.coredata.get_builtin_option('wrap_mode') == WrapMode.forcefallback and 'fallback' in kwargs:
-                pass
-            # ... search for it outside the project
-            elif name != '':
-                self._handle_featurenew_dependencies(name)
-                try:
-                    dep = dependencies.find_external_dependency(name, self.environment, kwargs)
-                except DependencyException as e:
-                    exception = e
-
-            # Search inside the projects list
-            if not dep.found():
-                if 'fallback' in kwargs:
-                    if not exception:
-                        exception = DependencyException("fallback for %s not found" % display_name)
-                    fallback_dep = self.dependency_fallback(name, kwargs)
-                    if fallback_dep:
-                        # Never add fallback deps to self.coredata.deps since we
-                        # cannot cache them. They must always be evaluated else
-                        # we won't actually read all the build files.
-                        return fallback_dep
-                if required:
-                    assert(exception is not None)
-                    raise exception
+        # If the dependency has already been configured, possibly by
+        # a higher level project, try to use it first.
+        if has_fallback:
+            dirname, varname = self.get_subproject_infos(kwargs)
+            if dirname in self.subprojects:
+                return self.get_subproject_dep(name, dirname, varname, kwargs)
+
+        wrap_mode = self.coredata.get_builtin_option('wrap_mode')
+        forcefallback = wrap_mode == WrapMode.forcefallback and has_fallback
+        if name != '' and not forcefallback:
+            self._handle_featurenew_dependencies(name)
+            kwargs['required'] = required and not has_fallback
+            dep = dependencies.find_external_dependency(name, self.environment, kwargs)
+
+            kwargs['required'] = required
+            # Only store found-deps in the cache
+            # Never add fallback deps to self.coredata.deps since we
+            # cannot cache them. They must always be evaluated else
+            # we won't actually read all the build files.
+            if dep.found():
+                for_machine = self.machine_from_native_kwarg(kwargs)
+                self.coredata.deps[for_machine].put(identifier, dep)
+                return DependencyHolder(dep, self.subproject)
 
-        # Only store found-deps in the cache
-        if dep.found():
-            self.coredata.deps[identifier] = dep
-        return DependencyHolder(dep, self.subproject)
+        if has_fallback:
+            return self.dependency_fallback(display_name, kwargs)
+
+        return self.notfound_dependency()
 
     @FeatureNew('disabler', '0.44.0')
     @noKwargs
@@ -3064,7 +3174,7 @@
         command_templ = '\nmeson wrap promote {}'
         for l in found:
             message.append(mlog.bold(command_templ.format(l[len(self.source_root) + 1:])))
-        mlog.warning(*message)
+        mlog.warning(*message, location=self.current_node)
 
     def get_subproject_infos(self, kwargs):
         fbinfo = kwargs['fallback']
@@ -3073,13 +3183,12 @@
             raise InterpreterException('Fallback info must have exactly two items.')
         return fbinfo
 
-    def dependency_fallback(self, name, kwargs):
-        display_name = name if name else '(anonymous)'
-        if self.coredata.get_builtin_option('wrap_mode') in (WrapMode.nofallback, WrapMode.nodownload):
+    def dependency_fallback(self, display_name, kwargs):
+        if self.coredata.get_builtin_option('wrap_mode') == WrapMode.nofallback:
             mlog.log('Not looking for a fallback subproject for the dependency',
                      mlog.bold(display_name), 'because:\nUse of fallback'
                      'dependencies is disabled.')
-            return None
+            return self.notfound_dependency()
         elif self.coredata.get_builtin_option('wrap_mode') == WrapMode.forcefallback:
             mlog.log('Looking for a fallback subproject for the dependency',
                      mlog.bold(display_name), 'because:\nUse of fallback dependencies is forced.')
@@ -3087,52 +3196,12 @@
             mlog.log('Looking for a fallback subproject for the dependency',
                      mlog.bold(display_name))
         dirname, varname = self.get_subproject_infos(kwargs)
-        # Try to execute the subproject
-        try:
-            sp_kwargs = {}
-            try:
-                sp_kwargs['default_options'] = kwargs['default_options']
-            except KeyError:
-                pass
-            self.do_subproject(dirname, sp_kwargs)
-        # Invalid code is always an error
-        except InvalidCode:
-            raise
-        # If the subproject execution failed in a non-fatal way, don't raise an
-        # exception; let the caller handle things.
-        except Exception as e:
-            msg = ['Couldn\'t use fallback subproject in',
-                   mlog.bold(os.path.join(self.subproject_dir, dirname)),
-                   'for the dependency', mlog.bold(display_name), '\nReason:']
-            if isinstance(e, mesonlib.MesonException):
-                msg.append(e.get_msg_with_context())
-            else:
-                msg.append(traceback.format_exc())
-            mlog.log(*msg)
-            return None
-        required = kwargs.get('required', True)
-        dep = self.get_subproject_dep(name, dirname, varname, required)
-        if not dep.found():
-            return dep
-        subproj_path = os.path.join(self.subproject_dir, dirname)
-        # Check if the version of the declared dependency matches what we want
-        if 'version' in kwargs:
-            wanted = kwargs['version']
-            found = dep.version_method([], {})
-            # Don't do a version check if the dependency is not found and not required
-            if not dep.found_method([], {}) and not required:
-                subproj_path = os.path.join(self.subproject_dir, dirname)
-                mlog.log('Dependency', mlog.bold(display_name), 'from subproject',
-                         mlog.bold(subproj_path), 'found:', mlog.red('NO'))
-                return dep
-            if not self.check_subproject_version(wanted, found):
-                mlog.log('Subproject', mlog.bold(subproj_path), 'dependency',
-                         mlog.bold(display_name), 'version is', mlog.bold(found),
-                         'but', mlog.bold(wanted), 'is required.')
-                return None
-        mlog.log('Dependency', mlog.bold(display_name), 'from subproject',
-                 mlog.bold(subproj_path), 'found:', mlog.green('YES'))
-        return dep
+        sp_kwargs = {
+            'default_options': kwargs.get('default_options', []),
+            'required': kwargs.get('required', True),
+        }
+        self.do_subproject(dirname, 'meson', sp_kwargs)
+        return self.get_subproject_dep(display_name, dirname, varname, kwargs)
 
     @FeatureNewKwargs('executable', '0.42.0', ['implib'])
     @permittedKwargs(permitted_kwargs['executable'])
@@ -3176,6 +3245,10 @@
             return self.build_target(node, args, kwargs, ExecutableHolder)
         elif target_type == 'shared_library':
             return self.build_target(node, args, kwargs, SharedLibraryHolder)
+        elif target_type == 'shared_module':
+            FeatureNew('build_target(target_type: \'shared_module\')',
+                       '0.51.0').use(self.subproject)
+            return self.build_target(node, args, kwargs, SharedModuleHolder)
         elif target_type == 'static_library':
             return self.build_target(node, args, kwargs, StaticLibraryHolder)
         elif target_type == 'both_libraries':
@@ -3257,8 +3330,8 @@
                 kwargs['input'] = self.source_strings_to_files(extract_as_list(kwargs, 'input'))
             except mesonlib.MesonException:
                 mlog.warning('''Custom target input \'%s\' can\'t be converted to File object(s).
-This will become a hard error in the future.''' % kwargs['input'])
-        tg = CustomTargetHolder(build.CustomTarget(name, self.subdir, self.subproject, kwargs), self)
+This will become a hard error in the future.''' % kwargs['input'], location=self.current_node)
+        tg = CustomTargetHolder(build.CustomTarget(name, self.subdir, self.subproject, kwargs, backend=self.backend), self)
         self.add_target(name, tg.held_object)
         return tg
 
@@ -3290,9 +3363,24 @@
             if not isinstance(d, (build.BuildTarget, build.CustomTarget)):
                 raise InterpreterException('Depends items must be build targets.')
             cleaned_deps.append(d)
-        command = cleaned_args[0]
-        cmd_args = cleaned_args[1:]
-        tg = RunTargetHolder(name, command, cmd_args, cleaned_deps, self.subdir, self.subproject)
+        command, *cmd_args = cleaned_args
+        tg = RunTargetHolder(build.RunTarget(name, command, cmd_args, cleaned_deps, self.subdir, self.subproject), self)
+        self.add_target(name, tg.held_object)
+        return tg
+
+    @FeatureNew('alias_target', '0.52.0')
+    @noKwargs
+    def func_alias_target(self, node, args, kwargs):
+        if len(args) < 2:
+            raise InvalidCode('alias_target takes at least 2 arguments.')
+        name = args[0]
+        if not isinstance(name, str):
+            raise InterpreterException('First argument must be a string.')
+        deps = listify(args[1:], unholder=True)
+        for d in deps:
+            if not isinstance(d, (build.BuildTarget, build.CustomTarget)):
+                raise InterpreterException('Depends items must be build targets.')
+        tg = RunTargetHolder(build.AliasTarget(name, deps, self.subdir, self.subproject), self)
         self.add_target(name, tg.held_object)
         return tg
 
@@ -3302,32 +3390,33 @@
         self.generators.append(gen)
         return gen
 
+    @FeatureNewKwargs('benchmark', '0.46.0', ['depends'])
+    @FeatureNewKwargs('benchmark', '0.52.0', ['priority'])
     @permittedKwargs(permitted_kwargs['benchmark'])
     def func_benchmark(self, node, args, kwargs):
+        # is_parallel isn't valid here, so make sure it isn't passed
+        if 'is_parallel' in kwargs:
+            del kwargs['is_parallel']
         self.add_test(node, args, kwargs, False)
 
     @FeatureNewKwargs('test', '0.46.0', ['depends'])
+    @FeatureNewKwargs('test', '0.52.0', ['priority'])
     @permittedKwargs(permitted_kwargs['test'])
     def func_test(self, node, args, kwargs):
         self.add_test(node, args, kwargs, True)
 
-    def unpack_env_kwarg(self, kwargs):
+    def unpack_env_kwarg(self, kwargs) -> build.EnvironmentVariables:
         envlist = kwargs.get('env', EnvironmentVariablesHolder())
         if isinstance(envlist, EnvironmentVariablesHolder):
             env = envlist.held_object
+        elif isinstance(envlist, dict):
+            FeatureNew('environment dictionary', '0.52.0').use(self.subproject)
+            env = EnvironmentVariablesHolder(envlist)
+            env = env.held_object
         else:
             envlist = listify(envlist)
             # Convert from array to environment object
-            env = EnvironmentVariablesHolder()
-            for e in envlist:
-                if '=' not in e:
-                    raise InterpreterException('Env var definition must be of type key=val.')
-                (k, val) = e.split('=', 1)
-                k = k.strip()
-                val = val.strip()
-                if ' ' in k:
-                    raise InterpreterException('Env var key must not have spaces in it.')
-                env.set_method([k, val], {})
+            env = EnvironmentVariablesHolder(envlist)
             env = env.held_object
         return env
 
@@ -3364,6 +3453,9 @@
             workdir = None
         if not isinstance(timeout, int):
             raise InterpreterException('Timeout must be an integer.')
+        protocol = kwargs.get('protocol', 'exitcode')
+        if protocol not in ('exitcode', 'tap'):
+            raise InterpreterException('Protocol must be "exitcode" or "tap".')
         suite = []
         prj = self.subproject if self.is_subproject() else self.build.project_name
         for s in mesonlib.stringlistify(kwargs.get('suite', '')):
@@ -3374,8 +3466,11 @@
         for dep in depends:
             if not isinstance(dep, (build.CustomTarget, build.BuildTarget)):
                 raise InterpreterException('Depends items must be build targets.')
+        priority = kwargs.get('priority', 0)
+        if not isinstance(priority, int):
+            raise InterpreterException('Keyword argument priority must be an integer.')
         t = Test(args[0], prj, suite, exe.held_object, depends, par, cmd_args,
-                 env, should_fail, timeout, workdir)
+                 env, should_fail, timeout, workdir, protocol, priority)
         if is_base_test:
             self.build.tests.append(t)
             mlog.debug('Adding test', mlog.bold(args[0], True))
@@ -3479,8 +3574,10 @@
         for s in raw_sources:
             if isinstance(s, mesonlib.File):
                 sources.append(s)
-            else:
+            elif isinstance(s, str):
                 source_strings.append(s)
+            else:
+                raise InvalidArguments('Argument {!r} must be string or file.'.format(s))
         sources += self.source_strings_to_files(source_strings)
         install_dir = kwargs.get('install_dir', None)
         if not isinstance(install_dir, (str, type(None))):
@@ -3539,6 +3636,8 @@
     @FeatureNewKwargs('configure_file', '0.47.0', ['copy', 'output_format', 'install_mode', 'encoding'])
     @FeatureNewKwargs('configure_file', '0.46.0', ['format'])
     @FeatureNewKwargs('configure_file', '0.41.0', ['capture'])
+    @FeatureNewKwargs('configure_file', '0.50.0', ['install'])
+    @FeatureNewKwargs('configure_file', '0.52.0', ['depfile'])
     @permittedKwargs(permitted_kwargs['configure_file'])
     def func_configure_file(self, node, args, kwargs):
         if len(args) > 0:
@@ -3584,33 +3683,32 @@
         if output_format not in ('c', 'nasm'):
             raise InterpreterException('"format" possible values are "c" or "nasm".')
 
+        if 'depfile' in kwargs:
+            depfile = kwargs['depfile']
+            if not isinstance(depfile, str):
+                raise InterpreterException('depfile file name must be a string')
+        else:
+            depfile = None
+
         # Validate input
-        inputfile = None
-        ifile_abs = None
-        if 'input' in kwargs:
-            inputfile = kwargs['input']
-            if isinstance(inputfile, list):
-                if len(inputfile) != 1:
-                    m = "Keyword argument 'input' requires exactly one file"
-                    raise InterpreterException(m)
-                inputfile = inputfile[0]
-            if not isinstance(inputfile, (str, mesonlib.File)):
-                raise InterpreterException('Input must be a string or a file')
-            if isinstance(inputfile, str):
-                inputfile = mesonlib.File.from_source_file(self.environment.source_dir,
-                                                           self.subdir, inputfile)
-            ifile_abs = inputfile.absolute_path(self.environment.source_dir,
-                                                self.environment.build_dir)
-        elif 'command' in kwargs and '@INPUT@' in kwargs['command']:
-            raise InterpreterException('@INPUT@ used as command argument, but no input file specified.')
+        inputs = self.source_strings_to_files(extract_as_list(kwargs, 'input'))
+        inputs_abs = []
+        for f in inputs:
+            if isinstance(f, mesonlib.File):
+                inputs_abs.append(f.absolute_path(self.environment.source_dir,
+                                                  self.environment.build_dir))
+            else:
+                raise InterpreterException('Inputs can only be strings or file objects')
         # Validate output
         output = kwargs['output']
         if not isinstance(output, str):
             raise InterpreterException('Output file name must be a string')
-        if ifile_abs:
-            values = mesonlib.get_filenames_templates_dict([ifile_abs], None)
+        if inputs_abs:
+            values = mesonlib.get_filenames_templates_dict(inputs_abs, None)
             outputs = mesonlib.substitute_values([output], values)
             output = outputs[0]
+            if depfile:
+                depfile = mesonlib.substitute_values([depfile], values)[0]
         ofile_rpath = os.path.join(self.subdir, output)
         if ofile_rpath in self.configure_file_outputs:
             mesonbuildfile = os.path.join(self.subdir, 'meson.build')
@@ -3627,27 +3725,27 @@
         if 'configuration' in kwargs:
             conf = kwargs['configuration']
             if isinstance(conf, dict):
-                cdata = ConfigurationDataHolder(self.subproject)
-                for k, v in conf.items():
-                    cdata.set_method([k, v], {})
-                conf = cdata
+                FeatureNew('configure_file.configuration dictionary', '0.49.0').use(self.subproject)
+                conf = ConfigurationDataHolder(self.subproject, conf)
             elif not isinstance(conf, ConfigurationDataHolder):
                 raise InterpreterException('Argument "configuration" is not of type configuration_data')
             mlog.log('Configuring', mlog.bold(output), 'using configuration')
-            if inputfile is not None:
+            if len(inputs) > 1:
+                raise InterpreterException('At most one input file can given in configuration mode')
+            if inputs:
                 os.makedirs(os.path.join(self.environment.build_dir, self.subdir), exist_ok=True)
                 file_encoding = kwargs.setdefault('encoding', 'utf-8')
                 missing_variables, confdata_useless = \
-                    mesonlib.do_conf_file(ifile_abs, ofile_abs, conf.held_object,
+                    mesonlib.do_conf_file(inputs_abs[0], ofile_abs, conf.held_object,
                                           fmt, file_encoding)
                 if missing_variables:
                     var_list = ", ".join(map(repr, sorted(missing_variables)))
                     mlog.warning(
                         "The variable(s) %s in the input file '%s' are not "
                         "present in the given configuration data." % (
-                            var_list, inputfile), location=node)
+                            var_list, inputs[0]), location=node)
                 if confdata_useless:
-                    ifbase = os.path.basename(ifile_abs)
+                    ifbase = os.path.basename(inputs_abs[0])
                     mlog.warning('Got an empty configuration_data() object and found no '
                                  'substitutions in the input file {!r}. If you want to '
                                  'copy a file to the build dir, use the \'copy:\' keyword '
@@ -3656,13 +3754,15 @@
                 mesonlib.dump_conf_header(ofile_abs, conf.held_object, output_format)
             conf.mark_used()
         elif 'command' in kwargs:
+            if len(inputs) > 1:
+                FeatureNew('multiple inputs in configure_file()', '0.52.0').use(self.subproject)
             # We use absolute paths for input and output here because the cwd
             # that the command is run from is 'unspecified', so it could change.
             # Currently it's builddir/subdir for in_builddir else srcdir/subdir.
-            if ifile_abs:
-                values = mesonlib.get_filenames_templates_dict([ifile_abs], [ofile_abs])
-            else:
-                values = mesonlib.get_filenames_templates_dict(None, [ofile_abs])
+            values = mesonlib.get_filenames_templates_dict(inputs_abs, [ofile_abs])
+            if depfile:
+                depfile = os.path.join(self.environment.get_scratch_dir(), depfile)
+                values['@DEPFILE@'] = depfile
             # Substitute @INPUT@, @OUTPUT@, etc here.
             cmd = mesonlib.substitute_values(kwargs['command'], values)
             mlog.log('Configuring', mlog.bold(output), 'with command')
@@ -3675,36 +3775,77 @@
                 file_encoding = kwargs.setdefault('encoding', 'utf-8')
                 with open(dst_tmp, 'w', encoding=file_encoding) as f:
                     f.writelines(res.stdout)
-                if ifile_abs:
-                    shutil.copymode(ifile_abs, dst_tmp)
+                if inputs_abs:
+                    shutil.copymode(inputs_abs[0], dst_tmp)
                 mesonlib.replace_if_different(ofile_abs, dst_tmp)
+            if depfile:
+                mlog.log('Reading depfile:', mlog.bold(depfile))
+                with open(depfile, 'r') as f:
+                    df = DepFile(f.readlines())
+                    deps = df.get_all_dependencies(ofile_fname)
+                    for dep in deps:
+                        if dep not in self.build_def_files:
+                            self.build_def_files.append(dep)
+
         elif 'copy' in kwargs:
+            if len(inputs_abs) != 1:
+                raise InterpreterException('Exactly one input file must be given in copy mode')
             os.makedirs(os.path.join(self.environment.build_dir, self.subdir), exist_ok=True)
-            shutil.copyfile(ifile_abs, ofile_abs)
-            shutil.copymode(ifile_abs, ofile_abs)
+            shutil.copyfile(inputs_abs[0], ofile_abs)
+            shutil.copymode(inputs_abs[0], ofile_abs)
         else:
             # Not reachable
             raise AssertionError
         # If the input is a source file, add it to the list of files that we
-        # need to reconfigure on when they change. FIXME: Do the same for
-        # files() objects in the command: kwarg.
-        if inputfile and not inputfile.is_built:
-            # Normalize the path of the conffile (relative to the
-            # source root) to avoid duplicates. This is especially
-            # important to convert '/' to '\' on Windows
-            conffile = os.path.normpath(inputfile.relative_name())
-            if conffile not in self.build_def_files:
-                self.build_def_files.append(conffile)
+        # need to reconfigure on when they change.
+        for f in chain(inputs, kwargs.get('command', [])):
+            if isinstance(f, mesonlib.File) and not f.is_built:
+                # Normalize the path of the conffile (relative to the
+                # source root) to avoid duplicates. This is especially
+                # important to convert '/' to '\' on Windows
+                conffile = os.path.normpath(f.relative_name())
+                if conffile not in self.build_def_files:
+                    self.build_def_files.append(conffile)
         # Install file if requested, we check for the empty string
         # for backwards compatibility. That was the behaviour before
         # 0.45.0 so preserve it.
-        idir = kwargs.get('install_dir', None)
-        if isinstance(idir, str) and idir:
+        idir = kwargs.get('install_dir', '')
+        if idir is False:
+            idir = ''
+            mlog.deprecation('Please use the new `install:` kwarg instead of passing '
+                             '`false` to `install_dir:`', location=node)
+        if not isinstance(idir, str):
+            if isinstance(idir, list) and len(idir) == 0:
+                mlog.deprecation('install_dir: kwarg must be a string and not an empty array. '
+                                 'Please use the install: kwarg to enable or disable installation. '
+                                 'This will be a hard error in the next release.')
+            else:
+                raise InterpreterException('"install_dir" must be a string')
+        install = kwargs.get('install', idir != '')
+        if not isinstance(install, bool):
+            raise InterpreterException('"install" must be a boolean')
+        if install:
+            if not idir:
+                raise InterpreterException('"install_dir" must be specified '
+                                           'when "install" in a configure_file '
+                                           'is true')
             cfile = mesonlib.File.from_built_file(ofile_path, ofile_fname)
             install_mode = self._get_kwarg_install_mode(kwargs)
             self.build.data.append(build.Data([cfile], idir, install_mode))
         return mesonlib.File.from_built_file(self.subdir, output)
 
+    def extract_incdirs(self, kwargs):
+        prospectives = listify(kwargs.get('include_directories', []), unholder=True)
+        result = []
+        for p in prospectives:
+            if isinstance(p, build.IncludeDirs):
+                result.append(p)
+            elif isinstance(p, str):
+                result.append(self.build_incdir_object([p]).held_object)
+            else:
+                raise InterpreterException('Include directory objects can only be created from strings or include directories.')
+        return result
+
     @permittedKwargs(permitted_kwargs['include_directories'])
     @stringArgs
     def func_include_directories(self, node, args, kwargs):
@@ -3783,50 +3924,48 @@
                                            'is_default can be set to true only once' % self.build.test_setup_default_name)
             self.build.test_setup_default_name = setup_name
         env = self.unpack_env_kwarg(kwargs)
-        self.build.test_setups[setup_name] = build.TestSetup(exe_wrapper=exe_wrapper,
-                                                             gdb=gdb,
-                                                             timeout_multiplier=timeout_multiplier,
-                                                             env=env)
-
-    def get_argdict_on_crossness(self, native_dict, cross_dict, kwargs):
-        for_native = kwargs.get('native', not self.environment.is_cross_build())
-        if not isinstance(for_native, bool):
-            raise InterpreterException('Keyword native must be a boolean.')
-        if for_native:
-            return native_dict
-        else:
-            return cross_dict
+        self.build.test_setups[setup_name] = build.TestSetup(exe_wrapper, gdb, timeout_multiplier, env)
 
     @permittedKwargs(permitted_kwargs['add_global_arguments'])
     @stringArgs
     def func_add_global_arguments(self, node, args, kwargs):
-        argdict = self.get_argdict_on_crossness(self.build.global_args,
-                                                self.build.cross_global_args,
-                                                kwargs)
-        self.add_global_arguments(node, argdict, args, kwargs)
+        for_machine = self.machine_from_native_kwarg(kwargs)
+        self.add_global_arguments(node, self.build.global_args[for_machine], args, kwargs)
 
     @permittedKwargs(permitted_kwargs['add_global_link_arguments'])
     @stringArgs
     def func_add_global_link_arguments(self, node, args, kwargs):
-        argdict = self.get_argdict_on_crossness(self.build.global_link_args,
-                                                self.build.cross_global_link_args,
-                                                kwargs)
-        self.add_global_arguments(node, argdict, args, kwargs)
+        for_machine = self.machine_from_native_kwarg(kwargs)
+        self.add_global_arguments(node, self.build.global_link_args[for_machine], args, kwargs)
 
     @permittedKwargs(permitted_kwargs['add_project_arguments'])
     @stringArgs
     def func_add_project_arguments(self, node, args, kwargs):
-        argdict = self.get_argdict_on_crossness(self.build.projects_args,
-                                                self.build.cross_projects_args,
-                                                kwargs)
-        self.add_project_arguments(node, argdict, args, kwargs)
+        for_machine = self.machine_from_native_kwarg(kwargs)
+        self.add_project_arguments(node, self.build.projects_args[for_machine], args, kwargs)
 
     @permittedKwargs(permitted_kwargs['add_project_link_arguments'])
     @stringArgs
     def func_add_project_link_arguments(self, node, args, kwargs):
-        argdict = self.get_argdict_on_crossness(self.build.projects_link_args,
-                                                self.build.cross_projects_link_args, kwargs)
-        self.add_project_arguments(node, argdict, args, kwargs)
+        for_machine = self.machine_from_native_kwarg(kwargs)
+        self.add_project_arguments(node, self.build.projects_link_args[for_machine], args, kwargs)
+
+    def warn_about_builtin_args(self, args):
+        warnargs = ('/W1', '/W2', '/W3', '/W4', '/Wall', '-Wall', '-Wextra', '-Wpedantic')
+        optargs = ('-O0', '-O2', '-O3', '-Os', '/O1', '/O2', '/Os')
+        for arg in args:
+            if arg in warnargs:
+                mlog.warning("Consider using the builtin warning_level option instead of adding warning flags by hand.")
+            elif arg in optargs:
+                mlog.warning('Consider using the builtin optimization level rather than adding flags by hand.')
+            elif arg == '-g':
+                mlog.warning('Consider using the builtin debug option rather than adding flags by hand.')
+            elif arg == '-pipe':
+                mlog.warning("You don't need to add -pipe, Meson will use it automatically when it is available.")
+            elif arg.startswith('-fsanitize'):
+                mlog.warning('Consider using the builtin option for sanitizers rather than adding flags by hand.')
+            elif arg.startswith('-std=') or arg.startswith('/std:'):
+                mlog.warning('Consider using the builtin option for language standard version rather than adding flags by hand.')
 
     def add_global_arguments(self, node, argsdict, args, kwargs):
         if self.is_subproject():
@@ -3856,14 +3995,25 @@
         if 'language' not in kwargs:
             raise InvalidCode('Missing language definition in {}'.format(node.func_name))
 
+        self.warn_about_builtin_args(args)
+
         for lang in mesonlib.stringlistify(kwargs['language']):
             lang = lang.lower()
             argsdict[lang] = argsdict.get(lang, []) + args
 
     @noKwargs
-    @noPosargs
+    @noArgsFlattening
     def func_environment(self, node, args, kwargs):
-        return EnvironmentVariablesHolder()
+        if len(args) > 1:
+            raise InterpreterException('environment takes only one optional positional arguments')
+        elif len(args) == 1:
+            FeatureNew('environment positional arguments', '0.52.0').use(self.subproject)
+            initial_values = args[0]
+            if not isinstance(initial_values, dict) and not isinstance(initial_values, list):
+                raise InterpreterException('environment first argument must be a dictionary or a list')
+        else:
+            initial_values = {}
+        return EnvironmentVariablesHolder(initial_values)
 
     @stringArgs
     @noKwargs
@@ -3879,7 +4029,8 @@
             self.print_extra_warnings()
 
     def print_extra_warnings(self):
-        for c in self.build.compilers.values():
+        # TODO cross compilation
+        for c in self.coredata.compilers.host.values():
             if c.get_id() == 'clang':
                 self.check_clang_asan_lundef()
                 break
@@ -3893,7 +4044,8 @@
                 self.coredata.base_options['b_sanitize'].value != 'none'):
             mlog.warning('''Trying to use {} sanitizer on Clang with b_lundef.
 This will probably not work.
-Try setting b_lundef to false instead.'''.format(self.coredata.base_options['b_sanitize'].value))
+Try setting b_lundef to false instead.'''.format(self.coredata.base_options['b_sanitize'].value),
+                         location=self.current_node)
 
     def evaluate_subproject_info(self, path_from_source_root, subproject_dirname):
         depth = 0
@@ -3949,7 +4101,8 @@
             sources = [sources]
         for s in sources:
             if isinstance(s, (mesonlib.File, GeneratedListHolder,
-                              TargetHolder, CustomTargetIndexHolder)):
+                              TargetHolder, CustomTargetIndexHolder,
+                              GeneratedObjectsHolder)):
                 pass
             elif isinstance(s, str):
                 self.validate_within_subproject(self.subdir, s)
@@ -4028,15 +4181,8 @@
 
         if not args:
             raise InterpreterException('Target does not have a name.')
-        name = args[0]
-        sources = listify(args[1:])
-        if self.environment.is_cross_build():
-            if kwargs.get('native', False):
-                is_cross = False
-            else:
-                is_cross = True
-        else:
-            is_cross = False
+        name, *sources = args
+        for_machine = self.machine_from_native_kwarg(kwargs)
         if 'sources' in kwargs:
             sources += listify(kwargs['sources'])
         sources = self.source_strings_to_files(sources)
@@ -4066,9 +4212,10 @@
         # passed to library() when default_library == 'static'.
         kwargs = {k: v for k, v in kwargs.items() if k in targetclass.known_kwargs}
 
-        target = targetclass(name, self.subdir, self.subproject, is_cross, sources, objs, self.environment, kwargs)
+        kwargs['include_directories'] = self.extract_incdirs(kwargs)
+        target = targetclass(name, self.subdir, self.subproject, for_machine, sources, objs, self.environment, kwargs)
 
-        if is_cross:
+        if not self.environment.machines.matches_build_machine(for_machine):
             self.add_cross_stdlib_info(target)
         l = targetholder(target, self)
         self.add_target(name, l.held_object)
@@ -4086,7 +4233,7 @@
                     # path declarations.
                     if os.path.normpath(i).startswith(self.environment.get_source_dir()):
                         mlog.warning('''Building a path to the source dir is not supported. Use a relative path instead.
-This will become a hard error in the future.''')
+This will become a hard error in the future.''', location=self.current_node)
                         i = os.path.relpath(i, os.path.join(self.environment.get_source_dir(), self.subdir))
                         i = self.build_incdir_object([i])
                 cleaned_items.append(i)
@@ -4095,17 +4242,21 @@
     def get_used_languages(self, target):
         result = {}
         for i in target.sources:
-            for lang, c in self.build.compilers.items():
+            # TODO other platforms
+            for lang, c in self.coredata.compilers.host.items():
                 if c.can_compile(i):
                     result[lang] = True
                     break
         return result
 
     def add_cross_stdlib_info(self, target):
+        if target.for_machine != MachineChoice.HOST:
+            return
         for l in self.get_used_languages(target):
-            if self.environment.cross_info.has_stdlib(l) \
-                    and self.subproject != self.environment.cross_info.get_stdlib(l)[0]:
-                target.add_deps(self.build.cross_stdlibs[l])
+            props = self.environment.properties.host
+            if props.has_stdlib(l) \
+                    and self.subproject != props.get_stdlib(l)[0]:
+                target.add_deps(self.build.stdlibs.host[l])
 
     def check_sources_exist(self, subdir, sources):
         for s in sources:
@@ -4115,24 +4266,6 @@
             if not os.path.isfile(fname):
                 raise InterpreterException('Tried to add non-existing source file %s.' % s)
 
-    def format_string(self, templ, args):
-        if isinstance(args, mparser.ArgumentNode):
-            args = args.arguments
-        arg_strings = []
-        for arg in args:
-            arg = self.evaluate_statement(arg)
-            if isinstance(arg, bool): # Python boolean is upper case.
-                arg = str(arg).lower()
-            arg_strings.append(str(arg))
-
-        def arg_replace(match):
-            idx = int(match.group(1))
-            if idx >= len(arg_strings):
-                raise InterpreterException('Format placeholder @{}@ out of range.'.format(idx))
-            return arg_strings[idx]
-
-        return re.sub(r'@(\d+)@', arg_replace, templ)
-
     # Only permit object extraction from the same subproject
     def validate_extraction(self, buildtarget):
         if not self.subdir.startswith(self.subproject_dir):
@@ -4165,8 +4298,7 @@
     def func_set_variable(self, node, args, kwargs):
         if len(args) != 2:
             raise InvalidCode('Set_variable takes two arguments.')
-        varname = args[0]
-        value = args[1]
+        varname, value = args
         self.set_variable(varname, value)
 
     @noKwargs
@@ -4192,3 +4324,18 @@
             raise InvalidCode('Is_variable takes two arguments.')
         varname = args[0]
         return varname in self.variables
+
+    @staticmethod
+    def machine_from_native_kwarg(kwargs: Dict[str, Any]) -> MachineChoice:
+        native = kwargs.get('native', False)
+        if not isinstance(native, bool):
+            raise InvalidArguments('Argument to "native" must be a boolean.')
+        return MachineChoice.BUILD if native else MachineChoice.HOST
+
+    @FeatureNew('is_disabler', '0.52.0')
+    @noKwargs
+    def func_is_disabler(self, node, args, kwargs):
+        if len(args) != 1:
+            raise InvalidCode('Is_disabler takes one argument.')
+        varname = args[0]
+        return isinstance(varname, Disabler)
diff -Nru meson-0.49.0/mesonbuild/linkers.py meson-0.52.1/mesonbuild/linkers.py
--- meson-0.49.0/mesonbuild/linkers.py	2018-12-09 14:27:16.000000000 +0000
+++ meson-0.52.1/mesonbuild/linkers.py	2019-11-28 17:37:44.000000000 +0000
@@ -12,234 +12,965 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-from .mesonlib import Popen_safe, is_windows
+import abc
+import os
+import typing
+
 from . import mesonlib
 
+if typing.TYPE_CHECKING:
+    from .coredata import OptionDictType
+    from .environment import Environment
+
+
 class StaticLinker:
-    def can_linker_accept_rsp(self):
+
+    def __init__(self, exelist: typing.List[str]):
+        self.exelist = exelist
+
+    def can_linker_accept_rsp(self) -> bool:
         """
         Determines whether the linker can accept arguments using the @rsp syntax.
         """
         return mesonlib.is_windows()
 
+    def get_base_link_args(self, options: 'OptionDictType') -> typing.List[str]:
+        """Like compilers.get_base_link_args, but for the static linker."""
+        return []
 
-class VisualStudioLinker(StaticLinker):
-    always_args = ['/NOLOGO']
+    def get_exelist(self) -> typing.List[str]:
+        return self.exelist.copy()
 
-    def __init__(self, exelist):
-        self.exelist = exelist
+    def get_std_link_args(self) -> typing.List[str]:
+        return []
+
+    def get_buildtype_linker_args(self, buildtype: str) -> typing.List[str]:
+        return []
 
-    def get_exelist(self):
-        return self.exelist[:]
+    def get_output_args(self, target: str) -> typing.List[str]:
+        return[]
 
-    def get_std_link_args(self):
+    def get_coverage_link_args(self) -> typing.List[str]:
         return []
 
-    def get_buildtype_linker_args(self, buildtype):
+    def build_rpath_args(self, env: 'Environment', build_dir: str, from_dir: str,
+                         rpath_paths: str, build_rpath: str,
+                         install_rpath: str) -> typing.List[str]:
         return []
 
-    def get_output_args(self, target):
-        return ['/OUT:' + target]
+    def thread_link_flags(self, env: 'Environment') -> typing.List[str]:
+        return []
 
-    def get_coverage_link_args(self):
+    def openmp_flags(self) -> typing.List[str]:
         return []
 
-    def get_always_args(self):
-        return VisualStudioLinker.always_args[:]
+    def get_option_link_args(self, options: 'OptionDictType') -> typing.List[str]:
+        return []
 
-    def get_linker_always_args(self):
-        return VisualStudioLinker.always_args[:]
+    @classmethod
+    def unix_args_to_native(cls, args: typing.List[str]) -> typing.List[str]:
+        return args[:]
 
-    def build_rpath_args(self, build_dir, from_dir, rpath_paths, build_rpath, install_rpath):
-        return []
+    @classmethod
+    def native_args_to_unix(cls, args: typing.List[str]) -> typing.List[str]:
+        return args[:]
 
-    def thread_link_flags(self, env):
+    def get_link_debugfile_args(self, targetfile: str) -> typing.List[str]:
+        # Static libraries do not have PDB files
         return []
 
-    def openmp_flags(self):
+    def get_always_args(self) -> typing.List[str]:
         return []
 
-    def get_option_link_args(self, options):
+    def get_linker_always_args(self) -> typing.List[str]:
         return []
 
+
+class VisualStudioLikeLinker:
+    always_args = ['/NOLOGO']
+
+    def __init__(self, machine: str):
+        self.machine = machine
+
+    def get_always_args(self) -> typing.List[str]:
+        return self.always_args.copy()
+
+    def get_linker_always_args(self) -> typing.List[str]:
+        return self.always_args.copy()
+
+    def get_output_args(self, target: str) -> typing.List[str]:
+        args = []  # type: typing.List[str]
+        if self.machine:
+            args += ['/MACHINE:' + self.machine]
+        args += ['/OUT:' + target]
+        return args
+
     @classmethod
-    def unix_args_to_native(cls, args):
+    def unix_args_to_native(cls, args: typing.List[str]) -> typing.List[str]:
         from .compilers import VisualStudioCCompiler
         return VisualStudioCCompiler.unix_args_to_native(args)
 
-    def get_link_debugfile_args(self, targetfile):
-        # Static libraries do not have PDB files
-        return []
+    @classmethod
+    def native_args_to_unix(cls, args: typing.List[str]) -> typing.List[str]:
+        from .compilers import VisualStudioCCompiler
+        return VisualStudioCCompiler.native_args_to_unix(args)
+
+
+class VisualStudioLinker(VisualStudioLikeLinker, StaticLinker):
+
+    """Microsoft's lib static linker."""
+
+    def __init__(self, exelist: typing.List[str], machine: str):
+        StaticLinker.__init__(self, exelist)
+        VisualStudioLikeLinker.__init__(self, machine)
+
+
+class IntelVisualStudioLinker(VisualStudioLikeLinker, StaticLinker):
+
+    """Intel's xilib static linker."""
+
+    def __init__(self, exelist: typing.List[str], machine: str):
+        StaticLinker.__init__(self, exelist)
+        VisualStudioLikeLinker.__init__(self, machine)
 
 
 class ArLinker(StaticLinker):
 
-    def __init__(self, exelist):
-        self.exelist = exelist
+    def __init__(self, exelist: typing.List[str]):
+        super().__init__(exelist)
         self.id = 'ar'
-        pc, stdo = Popen_safe(self.exelist + ['-h'])[0:2]
+        pc, stdo = mesonlib.Popen_safe(self.exelist + ['-h'])[0:2]
         # Enable deterministic builds if they are available.
         if '[D]' in stdo:
             self.std_args = ['csrD']
         else:
             self.std_args = ['csr']
 
-    def can_linker_accept_rsp(self):
-        return mesonlib.is_windows()
+    def get_std_link_args(self) -> typing.List[str]:
+        return self.std_args
 
-    def build_rpath_args(self, build_dir, from_dir, rpath_paths, build_rpath, install_rpath):
-        return []
+    def get_output_args(self, target: str) -> typing.List[str]:
+        return [target]
 
-    def get_exelist(self):
-        return self.exelist[:]
 
-    def get_std_link_args(self):
-        return self.std_args
+class ArmarLinker(ArLinker):
 
-    def get_output_args(self, target):
-        return [target]
+    def __init__(self, exelist: typing.List[str]):
+        StaticLinker.__init__(self, exelist)
+        self.id = 'armar'
+        self.std_args = ['-csr']
 
-    def get_buildtype_linker_args(self, buildtype):
+    def can_linker_accept_rsp(self) -> bool:
+        # armar cann't accept arguments using the @rsp syntax
+        return False
+
+
+class DLinker(StaticLinker):
+    def __init__(self, exelist: typing.List[str], arch: str):
+        super().__init__(exelist)
+        self.id = exelist[0]
+        self.arch = arch
+
+    def get_std_link_args(self) -> typing.List[str]:
+        return ['-lib']
+
+    def get_output_args(self, target: str) -> typing.List[str]:
+        return ['-of=' + target]
+
+    def get_linker_always_args(self) -> typing.List[str]:
+        if mesonlib.is_windows():
+            if self.arch == 'x86_64':
+                return ['-m64']
+            elif self.arch == 'x86_mscoff' and self.id == 'dmd':
+                return ['-m32mscoff']
+            return ['-m32']
         return []
 
-    def get_linker_always_args(self):
+
+class CcrxLinker(StaticLinker):
+
+    def __init__(self, exelist: typing.List[str]):
+        super().__init__(exelist)
+        self.id = 'rlink'
+
+    def can_linker_accept_rsp(self) -> bool:
+        return False
+
+    def get_output_args(self, target: str) -> typing.List[str]:
+        return ['-output=%s' % target]
+
+    def get_linker_always_args(self) -> typing.List[str]:
+        return ['-nologo', '-form=library']
+
+
+def prepare_rpaths(raw_rpaths: str, build_dir: str, from_dir: str) -> typing.List[str]:
+    # The rpaths we write must be relative if they point to the build dir,
+    # because otherwise they have different length depending on the build
+    # directory. This breaks reproducible builds.
+    internal_format_rpaths = [evaluate_rpath(p, build_dir, from_dir) for p in raw_rpaths]
+    ordered_rpaths = order_rpaths(internal_format_rpaths)
+    return ordered_rpaths
+
+
+def order_rpaths(rpath_list: typing.List[str]) -> typing.List[str]:
+    # We want rpaths that point inside our build dir to always override
+    # those pointing to other places in the file system. This is so built
+    # binaries prefer our libraries to the ones that may lie somewhere
+    # in the file system, such as /lib/x86_64-linux-gnu.
+    #
+    # The correct thing to do here would be C++'s std::stable_partition.
+    # Python standard library does not have it, so replicate it with
+    # sort, which is guaranteed to be stable.
+    return sorted(rpath_list, key=os.path.isabs)
+
+
+def evaluate_rpath(p: str, build_dir: str, from_dir: str) -> str:
+    if p == from_dir:
+        return '' # relpath errors out in this case
+    elif os.path.isabs(p):
+        return p # These can be outside of build dir.
+    else:
+        return os.path.relpath(os.path.join(build_dir, p), os.path.join(build_dir, from_dir))
+
+
+class DynamicLinker(metaclass=abc.ABCMeta):
+
+    """Base class for dynamic linkers."""
+
+    _BUILDTYPE_ARGS = {
+        'plain': [],
+        'debug': [],
+        'debugoptimized': [],
+        'release': [],
+        'minsize': [],
+        'custom': [],
+    }  # type: typing.Dict[str, typing.List[str]]
+
+    def _apply_prefix(self, arg: str) -> typing.List[str]:
+        if isinstance(self.prefix_arg, str):
+            return [self.prefix_arg + arg]
+        return self.prefix_arg + [arg]
+
+    def __init__(self, exelist: typing.List[str], for_machine: mesonlib.MachineChoice,
+                 id_: str, prefix_arg: str, *, version: str = 'unknown version'):
+        self.exelist = exelist
+        self.for_machine = for_machine
+        self.version = version
+        self.id = id_
+        self.prefix_arg = prefix_arg
+
+    def __repr__(self) -> str:
+        return '<{}: v{} `{}`>'.format(type(self).__name__, self.version, ' '.join(self.exelist))
+
+    def get_id(self) -> str:
+        return self.id
+
+    def get_version_string(self) -> str:
+        return '({} {})'.format(self.id, self.version)
+
+    def get_exelist(self) -> typing.List[str]:
+        return self.exelist.copy()
+
+    def get_accepts_rsp(self) -> bool:
+        # TODO: is it really a matter of is_windows or is it for_windows?
+        return mesonlib.is_windows()
+
+    def get_always_args(self) -> typing.List[str]:
         return []
 
-    def get_coverage_link_args(self):
+    def get_lib_prefix(self) -> str:
+        return ''
+
+    # XXX: is use_ldflags a compiler or a linker attribute?
+
+    def get_args_from_envvars(self) -> typing.List[str]:
+        flags = os.environ.get('LDFLAGS')
+        if not flags:
+            return []
+        return mesonlib.split_args(flags)
+
+    def get_option_args(self, options: 'OptionDictType') -> typing.List[str]:
         return []
 
-    def get_always_args(self):
+    def has_multi_arguments(self, args: typing.List[str], env: 'Environment') -> typing.Tuple[bool, bool]:
+        m = 'Language {} does not support has_multi_link_arguments.'
+        raise mesonlib.EnvironmentException(m.format(self.id))
+
+    def get_debugfile_args(self, targetfile: str) -> typing.List[str]:
+        """Some compilers (MSVC) write debug into a separate file.
+
+        This method takes the target object path and returns a list of
+        commands to append to the linker invocation to control where that
+        file is written.
+        """
         return []
 
-    def thread_link_flags(self, env):
+    def get_std_shared_lib_args(self) -> typing.List[str]:
         return []
 
-    def openmp_flags(self):
+    def get_std_shared_module_args(self, options: 'OptionDictType') -> typing.List[str]:
+        return self.get_std_shared_lib_args()
+
+    def get_pie_args(self) -> typing.List[str]:
+        # TODO: this really needs to take a boolean and return the args to
+        # disable pie, otherwise it only acts to enable pie if pie *isn't* the
+        # default.
+        m = 'Linker {} does not support position-independent executable'
+        raise mesonlib.EnvironmentException(m.format(self.id))
+
+    def get_lto_args(self) -> typing.List[str]:
         return []
 
-    def get_option_link_args(self, options):
+    def sanitizer_args(self, value: str) -> typing.List[str]:
         return []
 
-    @classmethod
-    def unix_args_to_native(cls, args):
-        return args[:]
+    def get_buildtype_args(self, buildtype: str) -> typing.List[str]:
+        # We can override these in children by just overriding the
+        # _BUILDTYPE_ARGS value.
+        return self._BUILDTYPE_ARGS[buildtype]
 
-    def get_link_debugfile_args(self, targetfile):
+    def get_asneeded_args(self) -> typing.List[str]:
         return []
 
-class ArmarLinker(ArLinker):
+    def get_link_whole_for(self, args: typing.List[str]) -> typing.List[str]:
+        raise mesonlib.EnvironmentException(
+            'Linker {} does not support link_whole'.format(self.id))
 
-    def __init__(self, exelist):
-        self.exelist = exelist
-        self.id = 'armar'
-        self.std_args = ['-csr']
+    def get_allow_undefined_args(self) -> typing.List[str]:
+        raise mesonlib.EnvironmentException(
+            'Linker {} does not support allow undefined'.format(self.id))
 
-    def can_linker_accept_rsp(self):
-        # armar cann't accept arguments using the @rsp syntax
-        return False
+    def invoked_by_compiler(self) -> bool:
+        """True if meson uses the compiler to invoke the linker."""
+        return True
 
-class DLinker(StaticLinker):
-    def __init__(self, exelist, arch):
-        self.exelist = exelist
-        self.id = exelist[0]
-        self.arch = arch
+    @abc.abstractmethod
+    def get_output_args(self, outname: str) -> typing.List[str]:
+        pass
 
-    def can_linker_accept_rsp(self):
-        return mesonlib.is_windows()
+    def get_coverage_args(self) -> typing.List[str]:
+        m = "Linker {} doesn't implement coverage data generation.".format(self.id)
+        raise mesonlib.EnvironmentException(m)
+
+    @abc.abstractmethod
+    def get_search_args(self, dirname: str) -> typing.List[str]:
+        pass
 
-    def build_rpath_args(self, build_dir, from_dir, rpath_paths, build_rpath, install_rpath):
+    def export_dynamic_args(self, env: 'Environment') -> typing.List[str]:
         return []
 
-    def get_exelist(self):
-        return self.exelist[:]
+    def import_library_args(self, implibname: str) -> typing.List[str]:
+        """The name of the outputted import library.
 
-    def get_std_link_args(self):
-        return ['-lib']
+        This implementation is used only on Windows by compilers that use GNU ld
+        """
+        return []
 
-    def get_output_args(self, target):
-        return ['-of=' + target]
+    def thread_flags(self, env: 'Environment') -> typing.List[str]:
+        return []
+
+    def no_undefined_args(self) -> typing.List[str]:
+        """Arguments to error if there are any undefined symbols at link time.
 
-    def get_buildtype_linker_args(self, buildtype):
+        This is the inverse of get_allow_undefined_args().
+
+        TODO: A future cleanup might merge this and
+              get_allow_undefined_args() into a single method taking a
+              boolean
+        """
         return []
 
-    def get_linker_always_args(self):
-        if is_windows():
-            if self.arch == 'x86_64':
-                return ['-m64']
-            elif self.arch == 'x86_mscoff' and self.id == 'dmd':
-                return ['-m32mscoff']
-            return ['-m32']
+    def fatal_warnings(self) -> typing.List[str]:
+        """Arguments to make all warnings errors."""
         return []
 
-    def get_coverage_link_args(self):
+    def bitcode_args(self) -> typing.List[str]:
+        raise mesonlib.MesonException('This linker does not support bitcode bundles')
+
+    def get_debug_crt_args(self) -> typing.List[str]:
         return []
 
-    def get_always_args(self):
+    def build_rpath_args(self, env: 'Environment', build_dir: str, from_dir: str,
+                         rpath_paths: str, build_rpath: str,
+                         install_rpath: str) -> typing.List[str]:
         return []
 
-    def thread_link_flags(self, env):
+
+class PosixDynamicLinkerMixin:
+
+    """Mixin class for POSIX-ish linkers.
+
+    This is obviously a pretty small subset of the linker interface, but
+    enough dynamic linkers that meson supports are POSIX-like but not
+    GNU-like that it makes sense to split this out.
+    """
+
+    def get_output_args(self, outname: str) -> typing.List[str]:
+        return ['-o', outname]
+
+    def get_std_shared_lib_args(self) -> typing.List[str]:
+        return ['-shared']
+
+    def get_search_args(self, dirname: str) -> typing.List[str]:
+        return ['-L' + dirname]
+
+
+class GnuLikeDynamicLinkerMixin:
+
+    """Mixin class for dynamic linkers that provides gnu-like interface.
+
+    This acts as a base for the GNU linkers (bfd and gold), the Intel Xild
+    (which comes with ICC), LLVM's lld, and other linkers like GNU-ld.
+    """
+
+    _BUILDTYPE_ARGS = {
+        'plain': [],
+        'debug': [],
+        'debugoptimized': [],
+        'release': ['-O1'],
+        'minsize': [],
+        'custom': [],
+    }  # type: typing.Dict[str, typing.List[str]]
+
+    def get_buildtype_args(self, buildtype: str) -> typing.List[str]:
+        # We can override these in children by just overriding the
+        # _BUILDTYPE_ARGS value.
+        return mesonlib.listify([self._apply_prefix(a) for a in self._BUILDTYPE_ARGS[buildtype]])
+
+    def get_pie_args(self) -> typing.List[str]:
+        return ['-pie']
+
+    def get_asneeded_args(self) -> typing.List[str]:
+        return self._apply_prefix('--as-needed')
+
+    def get_link_whole_for(self, args: typing.List[str]) -> typing.List[str]:
+        if not args:
+            return args
+        return self._apply_prefix('--whole-archive') + args + self._apply_prefix('--no-whole-archive')
+
+    def get_allow_undefined_args(self) -> typing.List[str]:
+        return self._apply_prefix('--allow-shlib-undefined')
+
+    def get_lto_args(self) -> typing.List[str]:
+        return ['-flto']
+
+    def sanitizer_args(self, value: str) -> typing.List[str]:
+        if value == 'none':
+            return []
+        return ['-fsanitize=' + value]
+
+    def invoked_by_compiler(self) -> bool:
+        """True if meson uses the compiler to invoke the linker."""
+        return True
+
+    def get_coverage_args(self) -> typing.List[str]:
+        return ['--coverage']
+
+    def export_dynamic_args(self, env: 'Environment') -> typing.List[str]:
+        m = env.machines[self.for_machine]
+        if m.is_windows() or m.is_cygwin():
+            return self._apply_prefix('--export-all-symbols')
+        return self._apply_prefix('-export-dynamic')
+
+    def import_library_args(self, implibname: str) -> typing.List[str]:
+        return self._apply_prefix('--out-implib=' + implibname)
+
+    def thread_flags(self, env: 'Environment') -> typing.List[str]:
+        if env.machines[self.for_machine].is_haiku():
+            return []
+        return ['-pthread']
+
+    def no_undefined_args(self) -> typing.List[str]:
+        return self._apply_prefix('--no-undefined')
+
+    def fatal_warnings(self) -> typing.List[str]:
+        return self._apply_prefix('--fatal-warnings')
+
+    def get_soname_args(self, env: 'Environment', prefix: str, shlib_name: str,
+                        suffix: str, soversion: str, darwin_versions: typing.Tuple[str, str],
+                        is_shared_module: bool) -> typing.List[str]:
+        m = env.machines[self.for_machine]
+        if m.is_windows() or m.is_cygwin():
+            # For PE/COFF the soname argument has no effect
+            return []
+        sostr = '' if soversion is None else '.' + soversion
+        return self._apply_prefix('-soname,{}{}.{}{}'.format(prefix, shlib_name, suffix, sostr))
+
+    def build_rpath_args(self, env: 'Environment', build_dir: str, from_dir: str,
+                         rpath_paths: str, build_rpath: str,
+                         install_rpath: str) -> typing.List[str]:
+        m = env.machines[self.for_machine]
+        if m.is_windows() or m.is_cygwin():
+            return []
+        if not rpath_paths and not install_rpath and not build_rpath:
+            return []
+        args = []
+        origin_placeholder = '$ORIGIN'
+        processed_rpaths = prepare_rpaths(rpath_paths, build_dir, from_dir)
+        # Need to deduplicate rpaths, as macOS's install_name_tool
+        # is *very* allergic to duplicate -delete_rpath arguments
+        # when calling depfixer on installation.
+        all_paths = mesonlib.OrderedSet([os.path.join(origin_placeholder, p) for p in processed_rpaths])
+        # Build_rpath is used as-is (it is usually absolute).
+        if build_rpath != '':
+            all_paths.add(build_rpath)
+
+        # TODO: should this actually be "for (dragonfly|open)bsd"?
+        if mesonlib.is_dragonflybsd() or mesonlib.is_openbsd():
+            # This argument instructs the compiler to record the value of
+            # ORIGIN in the .dynamic section of the elf. On Linux this is done
+            # by default, but is not on dragonfly/openbsd for some reason. Without this
+            # $ORIGIN in the runtime path will be undefined and any binaries
+            # linked against local libraries will fail to resolve them.
+            args.extend(self._apply_prefix('-z,origin'))
+
+        # In order to avoid relinking for RPATH removal, the binary needs to contain just
+        # enough space in the ELF header to hold the final installation RPATH.
+        paths = ':'.join(all_paths)
+        if len(paths) < len(install_rpath):
+            padding = 'X' * (len(install_rpath) - len(paths))
+            if not paths:
+                paths = padding
+            else:
+                paths = paths + ':' + padding
+        args.extend(self._apply_prefix('-rpath,' + paths))
+
+        # TODO: should this actually be "for solaris/sunos"?
+        if mesonlib.is_sunos():
+            return args
+
+        # Rpaths to use while linking must be absolute. These are not
+        # written to the binary. Needed only with GNU ld:
+        # https://sourceware.org/bugzilla/show_bug.cgi?id=16936
+        # Not needed on Windows or other platforms that don't use RPATH
+        # https://github.com/mesonbuild/meson/issues/1897
+        #
+        # In addition, this linker option tends to be quite long and some
+        # compilers have trouble dealing with it. That's why we will include
+        # one option per folder, like this:
+        #
+        #   -Wl,-rpath-link,/path/to/folder1 -Wl,-rpath,/path/to/folder2 ...
+        #
+        # ...instead of just one single looooong option, like this:
+        #
+        #   -Wl,-rpath-link,/path/to/folder1:/path/to/folder2:...
+        for p in rpath_paths:
+            args.extend(self._apply_prefix('-rpath-link,' + os.path.join(build_dir, p)))
+
+        return args
+
+
+class AppleDynamicLinker(PosixDynamicLinkerMixin, DynamicLinker):
+
+    """Apple's ld implementation."""
+
+    def get_asneeded_args(self) -> typing.List[str]:
+        return self._apply_prefix('-dead_strip_dylibs')
+
+    def get_allow_undefined_args(self) -> typing.List[str]:
+        return self._apply_prefix('-undefined,dynamic_lookup')
+
+    def get_std_shared_module_args(self, options: 'OptionDictType') -> typing.List[str]:
+        return ['-bundle'] + self._apply_prefix('-undefined,dynamic_lookup')
+
+    def get_link_whole_for(self, args: typing.List[str]) -> typing.List[str]:
+        result = []  # type: typing.List[str]
+        for a in args:
+            result.extend(self._apply_prefix('-force_load'))
+            result.append(a)
+        return result
+
+    def no_undefined_args(self) -> typing.List[str]:
+        return self._apply_prefix('-undefined,error')
+
+    def get_always_args(self) -> typing.List[str]:
+        return self._apply_prefix('-headerpad_max_install_names')
+
+    def bitcode_args(self) -> typing.List[str]:
+        return self._apply_prefix('-bitcode_bundle')
+
+    def fatal_warnings(self) -> typing.List[str]:
+        return self._apply_prefix('-fatal_warnings')
+
+    def get_soname_args(self, env: 'Environment', prefix: str, shlib_name: str,
+                        suffix: str, soversion: str, darwin_versions: typing.Tuple[str, str],
+                        is_shared_module: bool) -> typing.List[str]:
+        if is_shared_module:
+            return []
+        install_name = ['@rpath/', prefix, shlib_name]
+        if soversion is not None:
+            install_name.append('.' + soversion)
+        install_name.append('.dylib')
+        args = ['-install_name', ''.join(install_name)]
+        if darwin_versions:
+            args.extend(['-compatibility_version', darwin_versions[0],
+                         '-current_version', darwin_versions[1]])
+        return args
+
+    def build_rpath_args(self, env: 'Environment', build_dir: str, from_dir: str,
+                         rpath_paths: str, build_rpath: str,
+                         install_rpath: str) -> typing.List[str]:
+        if not rpath_paths and not install_rpath and not build_rpath:
+            return []
+        # Ensure that there is enough space for install_name_tool in-place
+        # editing of large RPATHs
+        args = self._apply_prefix('-headerpad_max_install_names')
+        # @loader_path is the equivalent of $ORIGIN on macOS
+        # https://stackoverflow.com/q/26280738
+        origin_placeholder = '@loader_path'
+        processed_rpaths = prepare_rpaths(rpath_paths, build_dir, from_dir)
+        all_paths = mesonlib.OrderedSet([os.path.join(origin_placeholder, p) for p in processed_rpaths])
+        if build_rpath != '':
+            all_paths.add(build_rpath)
+        for rp in all_paths:
+            args.extend(self._apply_prefix('-rpath,' + rp))
+
+        return args
+
+
+class GnuDynamicLinker(GnuLikeDynamicLinkerMixin, PosixDynamicLinkerMixin, DynamicLinker):
+
+    """Representation of GNU ld.bfd and ld.gold."""
+
+    pass
+
+
+class LLVMDynamicLinker(GnuLikeDynamicLinkerMixin, PosixDynamicLinkerMixin, DynamicLinker):
+
+    """Representation of LLVM's lld (not lld-link) linker.
+
+    This is only the posix-like linker.
+    """
+
+    pass
+
+
+class XildLinuxDynamicLinker(GnuLikeDynamicLinkerMixin, PosixDynamicLinkerMixin, DynamicLinker):
+
+    """Representation of Intel's Xild linker.
+
+    This is only the linux-like linker which dispatches to Gnu ld.
+    """
+
+    pass
+
+
+class XildAppleDynamicLinker(AppleDynamicLinker):
+
+    """Representation of Intel's Xild linker.
+
+    This is the apple linker, which dispatches to Apple's ld.
+    """
+
+    pass
+
+
+class CcrxDynamicLinker(DynamicLinker):
+
+    """Linker for Renesis CCrx compiler."""
+
+    def __init__(self, for_machine: mesonlib.MachineChoice,
+                 *, version: str = 'unknown version'):
+        super().__init__(['rlink.exe'], for_machine, 'rlink', '',
+                         version=version)
+
+    def get_accepts_rsp(self) -> bool:
+        return False
+
+    def get_lib_prefix(self) -> str:
+        return '-lib='
+
+    def get_std_shared_lib_args(self) -> typing.List[str]:
         return []
 
-    def openmp_flags(self):
+    def get_output_args(self, outputname: str) -> typing.List[str]:
+        return ['-output=%s' % outputname]
+
+    def get_search_args(self, dirname: str) -> 'typing.NoReturn':
+        raise EnvironmentError('rlink.exe does not have a search dir argument')
+
+    def get_allow_undefined_args(self) -> typing.List[str]:
         return []
 
-    def get_option_link_args(self, options):
+    def get_soname_args(self, env: 'Environment', prefix: str, shlib_name: str,
+                        suffix: str, soversion: str, darwin_versions: typing.Tuple[str, str],
+                        is_shared_module: bool) -> typing.List[str]:
         return []
 
-    @classmethod
-    def unix_args_to_native(cls, args):
-        return args[:]
 
-    def get_link_debugfile_args(self, targetfile):
-        return []
+class ArmDynamicLinker(PosixDynamicLinkerMixin, DynamicLinker):
 
-class CcrxLinker(StaticLinker):
+    """Linker for the ARM compiler."""
 
-    def __init__(self, exelist):
-        self.exelist = exelist
-        self.id = 'rlink'
-        pc, stdo = Popen_safe(self.exelist + ['-h'])[0:2]
-        self.std_args = []
+    def __init__(self, for_machine: mesonlib.MachineChoice,
+                 *, version: str = 'unknown version'):
+        super().__init__(['armlink'], for_machine, 'armlink', '',
+                         version=version)
 
-    def can_linker_accept_rsp(self):
+    def get_accepts_rsp(self) -> bool:
         return False
 
-    def build_rpath_args(self, build_dir, from_dir, rpath_paths, build_rpath, install_rpath):
+    def get_std_shared_lib_args(self) -> 'typing.NoReturn':
+        raise mesonlib.MesonException('The Arm Linkers do not support shared libraries')
+
+    def get_allow_undefined_args(self) -> typing.List[str]:
         return []
 
-    def get_exelist(self):
-        return self.exelist[:]
 
-    def get_std_link_args(self):
-        return self.std_args
+class ArmClangDynamicLinker(ArmDynamicLinker):
 
-    def get_output_args(self, target):
-        return ['-output=%s' % target]
+    """Linker used with ARM's clang fork.
 
-    def get_buildtype_linker_args(self, buildtype):
-        return []
+    The interface is similar enough to the old ARM ld that it inherits and
+    extends a few things as needed.
+    """
 
-    def get_linker_always_args(self):
-        return ['-nologo', '-form=library']
+    def export_dynamic_args(self, env: 'Environment') -> typing.List[str]:
+        return ['--export_dynamic']
+
+    def import_library_args(self, implibname: str) -> typing.List[str]:
+        return ['--symdefs=' + implibname]
 
-    def get_coverage_link_args(self):
+
+class PGIDynamicLinker(PosixDynamicLinkerMixin, DynamicLinker):
+
+    """PGI linker."""
+
+    def get_allow_undefined_args(self) -> typing.List[str]:
         return []
 
-    def get_always_args(self):
+    def get_soname_args(self, env: 'Environment', prefix: str, shlib_name: str,
+                        suffix: str, soversion: str, darwin_versions: typing.Tuple[str, str],
+                        is_shared_module: bool) -> typing.List[str]:
         return []
 
-    def thread_link_flags(self, env):
+    def get_std_shared_lib_args(self) -> typing.List[str]:
+        # PGI -shared is Linux only.
+        if mesonlib.is_windows():
+            return ['-Bdynamic', '-Mmakedll']
+        elif mesonlib.is_linux():
+            return ['-shared']
         return []
 
-    def openmp_flags(self):
+    def build_rpath_args(self, env: 'Environment', build_dir: str, from_dir: str,
+                         rpath_paths: str, build_rpath: str,
+                         install_rpath: str) -> typing.List[str]:
+        if not env.machines[self.for_machine].is_windows():
+            return ['-R' + os.path.join(build_dir, p) for p in rpath_paths]
         return []
 
-    def get_option_link_args(self, options):
+
+class PGIStaticLinker(StaticLinker):
+    def __init__(self, exelist: typing.List[str]):
+        super().__init__(exelist)
+        self.id = 'ar'
+        self.std_args = ['-r']
+
+    def get_std_link_args(self) -> typing.List[str]:
+        return self.std_args
+
+    def get_output_args(self, target: str) -> typing.List[str]:
+        return [target]
+
+class VisualStudioLikeLinkerMixin:
+
+    _BUILDTYPE_ARGS = {
+        'plain': [],
+        'debug': [],
+        'debugoptimized': [],
+        # The otherwise implicit REF and ICF linker optimisations are disabled by
+        # /DEBUG. REF implies ICF.
+        'release': ['/OPT:REF'],
+        'minsize': ['/INCREMENTAL:NO', '/OPT:REF'],
+        'custom': [],
+    }  # type: typing.Dict[str, typing.List[str]]
+
+    def __init__(self, *args, direct: bool = True, machine: str = 'x86', **kwargs):
+        super().__init__(*args, **kwargs)
+        self.direct = direct
+        self.machine = machine
+
+    def invoked_by_compiler(self) -> bool:
+        return self.direct
+
+    def get_debug_crt_args(self) -> typing.List[str]:
+        """Arguments needed to select a debug crt for the linker.
+
+        Sometimes we need to manually select the CRT (C runtime) to use with
+        MSVC. One example is when trying to link with static libraries since
+        MSVC won't auto-select a CRT for us in that case and will error out
+        asking us to select one.
+        """
+        return self._apply_prefix('/MDd')
+
+    def get_output_args(self, outputname: str) -> typing.List[str]:
+        return self._apply_prefix('/MACHINE:' + self.machine) + self._apply_prefix('/OUT:' + outputname)
+
+    def get_always_args(self) -> typing.List[str]:
+        return self._apply_prefix('/nologo')
+
+    def get_search_args(self, dirname: str) -> typing.List[str]:
+        return self._apply_prefix('/LIBPATH:' + dirname)
+
+    def get_std_shared_lib_args(self) -> typing.List[str]:
+        return self._apply_prefix('/DLL')
+
+    def get_debugfile_args(self, targetfile: str) -> typing.List[str]:
+        pdbarr = targetfile.split('.')[:-1]
+        pdbarr += ['pdb']
+        return self._apply_prefix('/DEBUG') + self._apply_prefix('/PDB:' + '.'.join(pdbarr))
+
+    def get_link_whole_for(self, args: typing.List[str]) -> typing.List[str]:
+        # Only since VS2015
+        args = mesonlib.listify(args)
+        l = []  # typing.List[str]
+        for a in args:
+            l.extend(self._apply_prefix('/WHOLEARCHIVE:' + a))
+        return l
+
+    def get_allow_undefined_args(self) -> typing.List[str]:
+        # link.exe
+        return self._apply_prefix('/FORCE:UNRESOLVED')
+
+    def get_soname_args(self, env: 'Environment', prefix: str, shlib_name: str,
+                        suffix: str, soversion: str, darwin_versions: typing.Tuple[str, str],
+                        is_shared_module: bool) -> typing.List[str]:
         return []
 
-    @classmethod
-    def unix_args_to_native(cls, args):
-        return args[:]
 
-    def get_link_debugfile_args(self, targetfile):
+class MSVCDynamicLinker(VisualStudioLikeLinkerMixin, DynamicLinker):
+
+    """Microsoft's Link.exe."""
+
+    def __init__(self, for_machine: mesonlib.MachineChoice, *,
+                 exelist: typing.Optional[typing.List[str]] = None,
+                 prefix: typing.Union[str, typing.List[str]] = '',
+                 machine: str = 'x86', version: str = 'unknown version'):
+        super().__init__(exelist or ['link.exe'], for_machine, 'link',
+                         prefix, machine=machine, version=version)
+
+
+class ClangClDynamicLinker(VisualStudioLikeLinkerMixin, DynamicLinker):
+
+    """Clang's lld-link.exe."""
+
+    def __init__(self, for_machine: mesonlib.MachineChoice, *,
+                 exelist: typing.Optional[typing.List[str]] = None,
+                 prefix: typing.Union[str, typing.List[str]] = '',
+                 version: str = 'unknown version'):
+        super().__init__(exelist or ['lld-link.exe'], for_machine,
+                         'lld-link', prefix, version=version)
+
+
+class XilinkDynamicLinker(VisualStudioLikeLinkerMixin, DynamicLinker):
+
+    """Intel's Xilink.exe."""
+
+    def __init__(self, for_machine: mesonlib.MachineChoice,
+                 *, version: str = 'unknown version'):
+        super().__init__(['xilink.exe'], for_machine, 'xilink', '', version=version)
+
+
+class SolarisDynamicLinker(PosixDynamicLinkerMixin, DynamicLinker):
+
+    """Sys-V derived linker used on Solaris and OpenSolaris."""
+
+    def get_link_whole_for(self, args: typing.List[str]) -> typing.List[str]:
+        if not args:
+            return args
+        return self._apply_prefix('--whole-archive') + args + self._apply_prefix('--no-whole-archive')
+
+    def no_undefined_args(self) -> typing.List[str]:
+        return ['-z', 'defs']
+
+    def get_allow_undefined_args(self) -> typing.List[str]:
+        return ['-z', 'nodefs']
+
+    def fatal_warnings(self) -> typing.List[str]:
+        return ['-z', 'fatal-warnings']
+
+    def build_rpath_args(self, env: 'Environment', build_dir: str, from_dir: str,
+                         rpath_paths: str, build_rpath: str,
+                         install_rpath: str) -> typing.List[str]:
+        if not rpath_paths and not install_rpath and not build_rpath:
+            return []
+        processed_rpaths = prepare_rpaths(rpath_paths, build_dir, from_dir)
+        all_paths = mesonlib.OrderedSet([os.path.join('$ORIGIN', p) for p in processed_rpaths])
+        if build_rpath != '':
+            all_paths.add(build_rpath)
+
+        # In order to avoid relinking for RPATH removal, the binary needs to contain just
+        # enough space in the ELF header to hold the final installation RPATH.
+        paths = ':'.join(all_paths)
+        if len(paths) < len(install_rpath):
+            padding = 'X' * (len(install_rpath) - len(paths))
+            if not paths:
+                paths = padding
+            else:
+                paths = paths + ':' + padding
+        return self._apply_prefix('-rpath,{}'.format(paths))
+
+    def get_soname_args(self, env: 'Environment', prefix: str, shlib_name: str,
+                        suffix: str, soversion: str, darwin_versions: typing.Tuple[str, str],
+                        is_shared_module: bool) -> typing.List[str]:
+        sostr = '' if soversion is None else '.' + soversion
+        return self._apply_prefix('-soname,{}{}.{}{}'.format(prefix, shlib_name, suffix, sostr))
+
+
+class OptlinkDynamicLinker(VisualStudioLikeLinkerMixin, DynamicLinker):
+
+    """Digital Mars dynamic linker for windows."""
+
+    def __init__(self, for_machine: mesonlib.MachineChoice,
+                 *, version: str = 'unknown version'):
+        # Use optlink instead of link so we don't interfer with other link.exe
+        # implementations.
+        super().__init__(['optlink.exe'], for_machine, 'optlink', prefix_arg='', version=version)
+
+    def get_allow_undefined_args(self) -> typing.List[str]:
+        return []
+
+class CudaLinker(PosixDynamicLinkerMixin, DynamicLinker):
+    """Cuda linker (nvlink)"""
+    @staticmethod
+    def parse_version():
+        version_cmd = ['nvlink', '--version']
+        try:
+            _, out, _ = mesonlib.Popen_safe(version_cmd)
+        except OSError:
+            return 'unknown version'
+        # Output example:
+        # nvlink: NVIDIA (R) Cuda linker
+        # Copyright (c) 2005-2018 NVIDIA Corporation
+        # Built on Sun_Sep_30_21:09:22_CDT_2018
+        # Cuda compilation tools, release 10.0, V10.0.166
+        # we need the most verbose version output. Luckily starting with V
+        return out.strip().split('V')[-1]
+
+    def get_accepts_rsp(self) -> bool:
+        # nvcc does not support response files
+        return False
+
+    def get_lib_prefix(self) -> str:
+        if not mesonlib.is_windows():
+            return ''
+        # nvcc doesn't recognize Meson's default .a extension for static libraries on
+        # Windows and passes it to cl as an object file, resulting in 'warning D9024 :
+        # unrecognized source file type 'xxx.a', object file assumed'.
+        #
+        # nvcc's --library= option doesn't help: it takes the library name without the
+        # extension and assumes that the extension on Windows is .lib; prefixing the
+        # library with -Xlinker= seems to work.
+        from .compilers import CudaCompiler
+        return CudaCompiler.LINKER_PREFIX
+
+    def fatal_warnings(self) -> typing.List[str]:
+        return ['--warning-as-error']
+
+    def get_allow_undefined_args(self) -> typing.List[str]:
+        return []
+
+    def get_soname_args(self, env: 'Environment', prefix: str, shlib_name: str,
+                        suffix: str, soversion: str, darwin_versions: typing.Tuple[str, str],
+                        is_shared_module: bool) -> typing.List[str]:
         return []
diff -Nru meson-0.49.0/mesonbuild/mconf.py meson-0.52.1/mesonbuild/mconf.py
--- meson-0.49.0/mesonbuild/mconf.py	2018-12-09 14:27:23.000000000 +0000
+++ meson-0.52.1/mesonbuild/mconf.py	2019-11-28 17:37:44.000000000 +0000
@@ -13,7 +13,8 @@
 # limitations under the License.
 
 import os
-from . import (coredata, mesonlib, build)
+from . import coredata, environment, mesonlib, build, mintro, mlog
+from .ast import AstIDGenerator
 
 def add_arguments(parser):
     coredata.register_builtin_arguments(parser)
@@ -22,45 +23,69 @@
                         help='Clear cached state (e.g. found dependencies)')
 
 
+def make_lower_case(val):
+    if isinstance(val, bool):
+        return str(val).lower()
+    elif isinstance(val, list):
+        return [make_lower_case(i) for i in val]
+    else:
+        return str(val)
+
+
 class ConfException(mesonlib.MesonException):
     pass
 
 
 class Conf:
     def __init__(self, build_dir):
-        self.build_dir = build_dir
-        if not os.path.isdir(os.path.join(build_dir, 'meson-private')):
-            raise ConfException('Directory %s does not seem to be a Meson build directory.' % build_dir)
-        self.build = build.load(self.build_dir)
-        self.coredata = coredata.load(self.build_dir)
+        self.build_dir = os.path.abspath(os.path.realpath(build_dir))
+        if 'meson.build' in [os.path.basename(self.build_dir), self.build_dir]:
+            self.build_dir = os.path.dirname(self.build_dir)
+        self.build = None
+        self.max_choices_line_length = 60
+
+        if os.path.isdir(os.path.join(self.build_dir, 'meson-private')):
+            self.build = build.load(self.build_dir)
+            self.source_dir = self.build.environment.get_source_dir()
+            self.coredata = coredata.load(self.build_dir)
+            self.default_values_only = False
+        elif os.path.isfile(os.path.join(self.build_dir, environment.build_filename)):
+            # Make sure that log entries in other parts of meson don't interfere with the JSON output
+            mlog.disable()
+            self.source_dir = os.path.abspath(os.path.realpath(self.build_dir))
+            intr = mintro.IntrospectionInterpreter(self.source_dir, '', 'ninja', visitors = [AstIDGenerator()])
+            intr.analyze()
+            # Reenable logging just in case
+            mlog.enable()
+            self.coredata = intr.coredata
+            self.default_values_only = True
+        else:
+            raise ConfException('Directory {} is neither a Meson build directory nor a project source directory.'.format(build_dir))
 
     def clear_cache(self):
-        self.coredata.deps = {}
+        self.coredata.deps.host.clear()
+        self.coredata.deps.build.clear()
 
     def set_options(self, options):
         self.coredata.set_options(options)
 
     def save(self):
+        # Do nothing when using introspection
+        if self.default_values_only:
+            return
         # Only called if something has changed so overwrite unconditionally.
         coredata.save(self.coredata, self.build_dir)
         # We don't write the build file because any changes to it
         # are erased when Meson is executed the next time, i.e. when
         # Ninja is run.
 
-    @staticmethod
-    def print_aligned(arr):
-        def make_lower_case(val):
-            if isinstance(val, bool):
-                return str(val).lower()
-            elif isinstance(val, list):
-                return [make_lower_case(i) for i in val]
-            else:
-                return str(val)
-
+    def print_aligned(self, arr):
         if not arr:
             return
 
         titles = {'name': 'Option', 'descr': 'Description', 'value': 'Current Value', 'choices': 'Possible Values'}
+        if self.default_values_only:
+            titles['value'] = 'Default Value'
 
         name_col = [titles['name'], '-' * len(titles['name'])]
         value_col = [titles['value'], '-' * len(titles['value'])]
@@ -78,7 +103,20 @@
             if opt['choices']:
                 choices_found = True
                 if isinstance(opt['choices'], list):
-                    choices_col.append('[{0}]'.format(', '.join(make_lower_case(opt['choices']))))
+                    choices_list = make_lower_case(opt['choices'])
+                    current = '['
+                    while choices_list:
+                        i = choices_list.pop(0)
+                        if len(current) + len(i) >= self.max_choices_line_length:
+                            choices_col.append(current + ',')
+                            name_col.append('')
+                            value_col.append('')
+                            descr_col.append('')
+                            current = ' '
+                        if len(current) > 1:
+                            current += ', '
+                        current += i
+                    choices_col.append(current + ']')
                 else:
                     choices_col.append(make_lower_case(opt['choices']))
             else:
@@ -100,20 +138,26 @@
         if not options:
             print('  No {}\n'.format(title.lower()))
         arr = []
-        for k in sorted(options):
-            o = options[k]
+        for k, o in sorted(options.items()):
             d = o.description
-            v = o.value
+            v = o.printable_value()
             c = o.choices
-            if isinstance(o, coredata.UserUmaskOption):
-                v = format(v, '04o')
             arr.append({'name': k, 'descr': d, 'value': v, 'choices': c})
         self.print_aligned(arr)
 
     def print_conf(self):
+        def print_default_values_warning():
+            mlog.warning('The source directory instead of the build directory was specified.')
+            mlog.warning('Only the default values for the project are printed, and all command line parameters are ignored.')
+
+        if self.default_values_only:
+            print_default_values_warning()
+            print('')
+
         print('Core properties:')
-        print('  Source dir', self.build.environment.source_dir)
-        print('  Build dir ', self.build.environment.build_dir)
+        print('  Source dir', self.source_dir)
+        if not self.default_values_only:
+            print('  Build dir ', self.build_dir)
 
         dir_option_names = ['bindir',
                             'datadir',
@@ -137,19 +181,41 @@
         core_options = {k: o for k, o in self.coredata.builtins.items() if k in core_option_names}
 
         self.print_options('Core options', core_options)
+        if self.default_values_only or self.build.environment.is_cross_build():
+            self.print_options('Core options (for host machine)', self.coredata.builtins_per_machine.host)
+            self.print_options(
+                'Core options (for build machine)',
+                {'build.' + k: o for k, o in self.coredata.builtins_per_machine.build.items()})
+        else:
+            self.print_options('Core options', self.coredata.builtins_per_machine.host)
         self.print_options('Backend options', self.coredata.backend_options)
         self.print_options('Base options', self.coredata.base_options)
-        self.print_options('Compiler options', self.coredata.compiler_options)
+        if self.default_values_only or self.build.environment.is_cross_build():
+            self.print_options('Compiler options (for host machine)', self.coredata.compiler_options.host)
+            self.print_options(
+                'Compiler options (for build machine)',
+                {'build.' + k: o for k, o in self.coredata.compiler_options.build.items()})
+        else:
+            self.print_options('Compiler options', self.coredata.compiler_options.host)
         self.print_options('Directories', dir_options)
         self.print_options('Project options', self.coredata.user_options)
         self.print_options('Testing options', test_options)
 
+        # Print the warning twice so that the user shouldn't be able to miss it
+        if self.default_values_only:
+            print('')
+            print_default_values_warning()
 
 def run(options):
     coredata.parse_cmd_line_options(options)
     builddir = os.path.abspath(os.path.realpath(options.builddir))
+    c = None
     try:
         c = Conf(builddir)
+        if c.default_values_only:
+            c.print_conf()
+            return 0
+
         save = False
         if len(options.cmd_line_options) > 0:
             c.set_options(options.cmd_line_options)
@@ -162,7 +228,11 @@
             c.print_conf()
         if save:
             c.save()
+            mintro.update_build_options(c.coredata, c.build.environment.info_dir)
+            mintro.write_meson_info_file(c.build, [])
     except ConfException as e:
         print('Meson configurator encountered an error:')
+        if c is not None and c.build is not None:
+            mintro.write_meson_info_file(c.build, [e])
         raise e
     return 0
diff -Nru meson-0.49.0/mesonbuild/mdist.py meson-0.52.1/mesonbuild/mdist.py
--- meson-0.49.0/mesonbuild/mdist.py	1970-01-01 00:00:00.000000000 +0000
+++ meson-0.52.1/mesonbuild/mdist.py	2019-11-28 17:37:44.000000000 +0000
@@ -0,0 +1,232 @@
+# Copyright 2017 The Meson development team
+
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+
+#     http://www.apache.org/licenses/LICENSE-2.0
+
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+import lzma
+import gzip
+import os
+import sys
+import shutil
+import subprocess
+import hashlib
+import json
+from glob import glob
+from pathlib import Path
+from mesonbuild.environment import detect_ninja
+from mesonbuild.mesonlib import windows_proof_rmtree, MesonException
+from mesonbuild import mlog, build
+
+archive_choices = ['gztar', 'xztar', 'zip']
+archive_extension = {'gztar': '.tar.gz',
+                     'xztar': '.tar.xz',
+                     'zip': '.zip'}
+
+def add_arguments(parser):
+    parser.add_argument('-C', default='.', dest='wd',
+                        help='directory to cd into before running')
+    parser.add_argument('--formats', default='xztar',
+                        help='Comma separated list of archive types to create.')
+
+
+def create_hash(fname):
+    hashname = fname + '.sha256sum'
+    m = hashlib.sha256()
+    m.update(open(fname, 'rb').read())
+    with open(hashname, 'w') as f:
+        f.write('%s %s\n' % (m.hexdigest(), os.path.basename(fname)))
+
+
+def del_gitfiles(dirname):
+    for f in glob(os.path.join(dirname, '.git*')):
+        if os.path.isdir(f) and not os.path.islink(f):
+            windows_proof_rmtree(f)
+        else:
+            os.unlink(f)
+
+def process_submodules(dirname):
+    module_file = os.path.join(dirname, '.gitmodules')
+    if not os.path.exists(module_file):
+        return
+    subprocess.check_call(['git', 'submodule', 'update', '--init', '--recursive'], cwd=dirname)
+    for line in open(module_file):
+        line = line.strip()
+        if '=' not in line:
+            continue
+        k, v = line.split('=', 1)
+        k = k.strip()
+        v = v.strip()
+        if k != 'path':
+            continue
+        del_gitfiles(os.path.join(dirname, v))
+
+
+def run_dist_scripts(dist_root, dist_scripts):
+    assert(os.path.isabs(dist_root))
+    env = os.environ.copy()
+    env['MESON_DIST_ROOT'] = dist_root
+    for d in dist_scripts:
+        script = d['exe']
+        args = d['args']
+        name = ' '.join(script + args)
+        print('Running custom dist script {!r}'.format(name))
+        try:
+            rc = subprocess.call(script + args, env=env)
+            if rc != 0:
+                sys.exit('Dist script errored out')
+        except OSError:
+            print('Failed to run dist script {!r}'.format(name))
+            sys.exit(1)
+
+
+def git_have_dirty_index(src_root):
+    '''Check whether there are uncommitted changes in git'''
+    ret = subprocess.call(['git', '-C', src_root, 'diff-index', '--quiet', 'HEAD'])
+    return ret == 1
+
+def create_dist_git(dist_name, archives, src_root, bld_root, dist_sub, dist_scripts):
+    if git_have_dirty_index(src_root):
+        mlog.warning('Repository has uncommitted changes that will not be included in the dist tarball')
+    distdir = os.path.join(dist_sub, dist_name)
+    if os.path.exists(distdir):
+        shutil.rmtree(distdir)
+    os.makedirs(distdir)
+    subprocess.check_call(['git', 'clone', '--shared', src_root, distdir])
+    process_submodules(distdir)
+    del_gitfiles(distdir)
+    run_dist_scripts(distdir, dist_scripts)
+    output_names = []
+    for a in archives:
+        compressed_name = distdir + archive_extension[a]
+        shutil.make_archive(distdir, a, root_dir=dist_sub, base_dir=dist_name)
+        output_names.append(compressed_name)
+    shutil.rmtree(distdir)
+    return output_names
+
+
+def hg_have_dirty_index(src_root):
+    '''Check whether there are uncommitted changes in hg'''
+    out = subprocess.check_output(['hg', '-R', src_root, 'summary'])
+    return b'commit: (clean)' not in out
+
+def create_dist_hg(dist_name, archives, src_root, bld_root, dist_sub, dist_scripts):
+    if hg_have_dirty_index(src_root):
+        mlog.warning('Repository has uncommitted changes that will not be included in the dist tarball')
+
+    os.makedirs(dist_sub, exist_ok=True)
+    tarname = os.path.join(dist_sub, dist_name + '.tar')
+    xzname = tarname + '.xz'
+    gzname = tarname + '.gz'
+    zipname = os.path.join(dist_sub, dist_name + '.zip')
+    subprocess.check_call(['hg', 'archive', '-R', src_root, '-S', '-t', 'tar', tarname])
+    output_names = []
+    if dist_scripts:
+        mlog.warning('dist scripts are not supported in Mercurial projects')
+    if 'xztar' in archives:
+        with lzma.open(xzname, 'wb') as xf, open(tarname, 'rb') as tf:
+            shutil.copyfileobj(tf, xf)
+        output_names.append(xzname)
+    if 'gztar' in archives:
+        with gzip.open(gzname, 'wb') as zf, open(tarname, 'rb') as tf:
+            shutil.copyfileobj(tf, zf)
+        output_names.append(gzname)
+    os.unlink(tarname)
+    if 'zip' in archives:
+        subprocess.check_call(['hg', 'archive', '-R', src_root, '-S', '-t', 'zip', zipname])
+        output_names.append(zipname)
+    return output_names
+
+
+def check_dist(packagename, meson_command, bld_root, privdir):
+    print('Testing distribution package %s' % packagename)
+    unpackdir = os.path.join(privdir, 'dist-unpack')
+    builddir = os.path.join(privdir, 'dist-build')
+    installdir = os.path.join(privdir, 'dist-install')
+    for p in (unpackdir, builddir, installdir):
+        if os.path.exists(p):
+            shutil.rmtree(p)
+        os.mkdir(p)
+    ninja_bin = detect_ninja()
+    try:
+        shutil.unpack_archive(packagename, unpackdir)
+        unpacked_files = glob(os.path.join(unpackdir, '*'))
+        assert(len(unpacked_files) == 1)
+        unpacked_src_dir = unpacked_files[0]
+        with open(os.path.join(bld_root, 'meson-info', 'intro-buildoptions.json')) as boptions:
+            meson_command += ['-D{name}={value}'.format(**o) for o in json.load(boptions)
+                              if o['name'] not in ['backend', 'install_umask']]
+        if subprocess.call(meson_command + ['--backend=ninja', unpacked_src_dir, builddir]) != 0:
+            print('Running Meson on distribution package failed')
+            return 1
+        if subprocess.call([ninja_bin], cwd=builddir) != 0:
+            print('Compiling the distribution package failed')
+            return 1
+        if subprocess.call([ninja_bin, 'test'], cwd=builddir) != 0:
+            print('Running unit tests on the distribution package failed')
+            return 1
+        myenv = os.environ.copy()
+        myenv['DESTDIR'] = installdir
+        if subprocess.call([ninja_bin, 'install'], cwd=builddir, env=myenv) != 0:
+            print('Installing the distribution package failed')
+            return 1
+    finally:
+        shutil.rmtree(unpackdir)
+        shutil.rmtree(builddir)
+        shutil.rmtree(installdir)
+    print('Distribution package %s tested' % packagename)
+    return 0
+
+def determine_archives_to_generate(options):
+    result = []
+    for i in options.formats.split(','):
+        if i not in archive_choices:
+            sys.exit('Value "{}" not one of permitted values {}.'.format(i, archive_choices))
+        result.append(i)
+    if len(i) == 0:
+        sys.exit('No archive types specified.')
+    return result
+
+def run(options):
+    options.wd = os.path.abspath(options.wd)
+    buildfile = Path(options.wd) / 'meson-private' / 'build.dat'
+    if not buildfile.is_file():
+        raise MesonException('Directory {!r} does not seem to be a Meson build directory.'.format(options.wd))
+    b = build.load(options.wd)
+    # This import must be load delayed, otherwise it will get the default
+    # value of None.
+    from mesonbuild.mesonlib import meson_command
+    src_root = b.environment.source_dir
+    bld_root = b.environment.build_dir
+    priv_dir = os.path.join(bld_root, 'meson-private')
+    dist_sub = os.path.join(bld_root, 'meson-dist')
+
+    dist_name = b.project_name + '-' + b.project_version
+
+    archives = determine_archives_to_generate(options)
+
+    _git = os.path.join(src_root, '.git')
+    if os.path.isdir(_git) or os.path.isfile(_git):
+        names = create_dist_git(dist_name, archives, src_root, bld_root, dist_sub, b.dist_scripts)
+    elif os.path.isdir(os.path.join(src_root, '.hg')):
+        names = create_dist_hg(dist_name, archives, src_root, bld_root, dist_sub, b.dist_scripts)
+    else:
+        print('Dist currently only works with Git or Mercurial repos')
+        return 1
+    if names is None:
+        return 1
+    # Check only one.
+    rc = check_dist(names[0], meson_command, bld_root, priv_dir)
+    if rc == 0:
+        for name in names:
+            create_hash(name)
+    return rc
diff -Nru meson-0.49.0/mesonbuild/mesonlib.py meson-0.52.1/mesonbuild/mesonlib.py
--- meson-0.49.0/mesonbuild/mesonlib.py	2018-12-09 14:27:16.000000000 +0000
+++ meson-0.52.1/mesonbuild/mesonlib.py	2019-11-28 17:37:44.000000000 +0000
@@ -13,18 +13,22 @@
 # limitations under the License.
 
 """A library of random helper functionality."""
-
-import functools
+from pathlib import Path
 import sys
 import stat
 import time
-import platform, subprocess, operator, os, shutil, re
+import platform, subprocess, operator, os, shlex, shutil, re
 import collections
 from enum import Enum
-from functools import lru_cache
+from functools import lru_cache, update_wrapper
+import typing
+import uuid
 
 from mesonbuild import mlog
 
+_T = typing.TypeVar('_T')
+_U = typing.TypeVar('_U')
+
 have_fcntl = False
 have_msvcrt = False
 # {subproject: project_meson_version}
@@ -68,11 +72,11 @@
     if 'MESON_COMMAND_TESTS' in os.environ:
         mlog.log('meson_command is {!r}'.format(meson_command))
 
-def is_ascii_string(astring):
+def is_ascii_string(astring) -> bool:
     try:
         if isinstance(astring, str):
             astring.encode('ascii')
-        if isinstance(astring, bytes):
+        elif isinstance(astring, bytes):
             astring.decode('ascii')
     except UnicodeDecodeError:
         return False
@@ -206,17 +210,17 @@
         return perms
 
 class File:
-    def __init__(self, is_built, subdir, fname):
+    def __init__(self, is_built: bool, subdir: str, fname: str):
         self.is_built = is_built
         self.subdir = subdir
         self.fname = fname
         assert(isinstance(self.subdir, str))
         assert(isinstance(self.fname, str))
 
-    def __str__(self):
+    def __str__(self) -> str:
         return self.relative_name()
 
-    def __repr__(self):
+    def __repr__(self) -> str:
         ret = ' str:
         if self.is_built:
             return self.relative_name()
         else:
             return os.path.join(build_to_src, self.subdir, self.fname)
 
     @lru_cache(maxsize=None)
-    def absolute_path(self, srcdir, builddir):
+    def absolute_path(self, srcdir: str, builddir: str) -> str:
         absdir = srcdir
         if self.is_built:
             absdir = builddir
         return os.path.join(absdir, self.relative_name())
 
-    def endswith(self, ending):
+    def endswith(self, ending: str) -> bool:
         return self.fname.endswith(ending)
 
-    def split(self, s):
+    def split(self, s: str) -> typing.List[str]:
         return self.fname.split(s)
 
-    def __eq__(self, other):
+    def __eq__(self, other) -> bool:
         return (self.fname, self.subdir, self.is_built) == (other.fname, other.subdir, other.is_built)
 
-    def __hash__(self):
+    def __hash__(self) -> int:
         return hash((self.fname, self.subdir, self.is_built))
 
     @lru_cache(maxsize=None)
-    def relative_name(self):
+    def relative_name(self) -> str:
         return os.path.join(self.subdir, self.fname)
 
+
 def get_compiler_for_source(compilers, src):
     for comp in compilers:
         if comp.can_compile(src):
@@ -308,159 +313,187 @@
             return self.value < other.value
         return NotImplemented
 
-MachineChoice = OrderedEnum('MachineChoice', ['BUILD', 'HOST', 'TARGET'])
-
-class PerMachine:
-    def __init__(self, build, host, target):
-        self.build = build
-        self.host = host
-        self.target = target
-
-    def __getitem__(self, machine: MachineChoice):
-        return {
-            MachineChoice.BUILD:  self.build,
-            MachineChoice.HOST:   self.host,
-            MachineChoice.TARGET: self.target
-        }[machine]
-
-    def __setitem__(self, machine: MachineChoice, val):
-        key = {
-            MachineChoice.BUILD:  'build',
-            MachineChoice.HOST:   'host',
-            MachineChoice.TARGET: 'target'
-        }[machine]
-        setattr(self, key, val)
 
-def is_osx():
-    return platform.system().lower() == 'darwin'
+class MachineChoice(OrderedEnum):
 
-def is_linux():
-    return platform.system().lower() == 'linux'
+    """Enum class representing one of the two abstract machine names used in
+    most places: the build, and host, machines.
+    """
 
-def is_android():
-    return platform.system().lower() == 'android'
+    BUILD = 0
+    HOST = 1
 
-def is_haiku():
-    return platform.system().lower() == 'haiku'
+    def get_lower_case_name(self):
+        return PerMachine('build', 'host')[self]
 
-def is_openbsd():
-    return platform.system().lower() == 'openbsd'
+    def get_prefix(self):
+        return PerMachine('build.', '')[self]
 
-def is_windows():
-    platname = platform.system().lower()
-    return platname == 'windows' or 'mingw' in platname
 
-def is_cygwin():
-    platname = platform.system().lower()
-    return platname.startswith('cygwin')
+class PerMachine(typing.Generic[_T]):
+    def __init__(self, build: _T, host: _T):
+        self.build = build
+        self.host = host
 
-def is_debianlike():
-    return os.path.isfile('/etc/debian_version')
+    def __getitem__(self, machine: MachineChoice) -> _T:
+        return {
+            MachineChoice.BUILD:  self.build,
+            MachineChoice.HOST:   self.host,
+        }[machine]
 
-def is_dragonflybsd():
-    return platform.system().lower() == 'dragonfly'
+    def __setitem__(self, machine: MachineChoice, val: _T) -> None:
+        setattr(self, machine.get_lower_case_name(), val)
 
-def is_freebsd():
-    return platform.system().lower() == 'freebsd'
+    def miss_defaulting(self) -> "PerMachineDefaultable[typing.Optional[_T]]":
+        """Unset definition duplicated from their previous to None
 
-def _get_machine_is_cross(env, is_cross):
+        This is the inverse of ''default_missing''. By removing defaulted
+        machines, we can elaborate the original and then redefault them and thus
+        avoid repeating the elaboration explicitly.
+        """
+        unfreeze = PerMachineDefaultable() # type: PerMachineDefaultable[typing.Optional[_T]]
+        unfreeze.build = self.build
+        unfreeze.host = self.host
+        if unfreeze.host == unfreeze.build:
+            unfreeze.host = None
+        return unfreeze
+
+
+class PerThreeMachine(PerMachine[_T]):
+    """Like `PerMachine` but includes `target` too.
+
+    It turns out just one thing do we need track the target machine. There's no
+    need to computer the `target` field so we don't bother overriding the
+    `__getitem__`/`__setitem__` methods.
     """
-    This is not morally correct, but works for now. For cross builds the build
-    and host machines differ. `is_cross == true` means the host machine, while
-    `is_cross == false` means the build machine. Both are used in practice,
-    even though the documentation refers to the host machine implying we should
-    hard-code it. For non-cross builds `is_cross == false` is passed but the
-    host and build machines are identical so it doesn't matter.
+    def __init__(self, build: _T, host: _T, target: _T):
+        super().__init__(build, host)
+        self.target = target
 
-    Users for `for_*` should instead specify up front which machine they want
-    and query that like:
+    def miss_defaulting(self) -> "PerThreeMachineDefaultable[typing.Optional[_T]]":
+        """Unset definition duplicated from their previous to None
 
-        env.machines[MachineChoice.HOST].is_haiku()
+        This is the inverse of ''default_missing''. By removing defaulted
+        machines, we can elaborate the original and then redefault them and thus
+        avoid repeating the elaboration explicitly.
+        """
+        unfreeze = PerThreeMachineDefaultable() # type: PerThreeMachineDefaultable[typing.Optional[_T]]
+        unfreeze.build = self.build
+        unfreeze.host = self.host
+        unfreeze.target = self.target
+        if unfreeze.target == unfreeze.host:
+            unfreeze.target = None
+        if unfreeze.host == unfreeze.build:
+            unfreeze.host = None
+        return unfreeze
 
-    """
-    for_machine = MachineChoice.HOST if is_cross else MachineChoice.BUILD
-    return env.machines[for_machine]
+    def matches_build_machine(self, machine: MachineChoice) -> bool:
+        return self.build == self[machine]
 
-def for_windows(is_cross, env):
+class PerMachineDefaultable(PerMachine[typing.Optional[_T]]):
+    """Extends `PerMachine` with the ability to default from `None`s.
     """
-    Host machine is windows?
+    def __init__(self) -> None:
+        super().__init__(None, None)
 
-    Deprecated: Please use `env.machines[for_machine].is_windows()`.
+    def default_missing(self) -> "PerMachine[typing.Optional[_T]]":
+        """Default host to buid
 
-    Note: 'host' is the machine on which compiled binaries will run
-    """
-    return _get_machine_is_cross(env, is_cross).is_windows()
-
-def for_cygwin(is_cross, env):
-    """
-    Host machine is cygwin?
+        This allows just specifying nothing in the native case, and just host in the
+        cross non-compiler case.
+        """
+        freeze = PerMachine(self.build, self.host)
+        if freeze.host is None:
+            freeze.host = freeze.build
+        return freeze
 
-    Deprecated: Please use `env.machines[for_machine].is_cygwin()`.
 
-    Note: 'host' is the machine on which compiled binaries will run
+class PerThreeMachineDefaultable(PerMachineDefaultable, PerThreeMachine[typing.Optional[_T]]):
+    """Extends `PerThreeMachine` with the ability to default from `None`s.
     """
-    return _get_machine_is_cross(env, is_cross).is_cygwin()
+    def __init__(self) -> None:
+        PerThreeMachine.__init__(self, None, None, None)
 
-def for_linux(is_cross, env):
-    """
-    Host machine is linux?
+    def default_missing(self) -> "PerThreeMachine[typing.Optional[_T]]":
+        """Default host to buid and target to host.
 
-    Deprecated: Please use `env.machines[for_machine].is_linux()`.
+        This allows just specifying nothing in the native case, just host in the
+        cross non-compiler case, and just target in the native-built
+        cross-compiler case.
+        """
+        freeze = PerThreeMachine(self.build, self.host, self.target)
+        if freeze.host is None:
+            freeze.host = freeze.build
+        if freeze.target is None:
+            freeze.target = freeze.host
+        return freeze
 
-    Note: 'host' is the machine on which compiled binaries will run
-    """
-    return _get_machine_is_cross(env, is_cross).is_linux()
 
-def for_darwin(is_cross, env):
-    """
-    Host machine is Darwin (iOS/OS X)?
+def is_sunos() -> bool:
+    return platform.system().lower() == 'sunos'
 
-    Deprecated: Please use `env.machines[for_machine].is_darwin()`.
+def is_osx() -> bool:
+    return platform.system().lower() == 'darwin'
 
-    Note: 'host' is the machine on which compiled binaries will run
-    """
-    return _get_machine_is_cross(env, is_cross).is_darwin()
+def is_linux() -> bool:
+    return platform.system().lower() == 'linux'
 
-def for_android(is_cross, env):
-    """
-    Host machine is Android?
+def is_android() -> bool:
+    return platform.system().lower() == 'android'
 
-    Deprecated: Please use `env.machines[for_machine].is_android()`.
+def is_haiku() -> bool:
+    return platform.system().lower() == 'haiku'
 
-    Note: 'host' is the machine on which compiled binaries will run
-    """
-    return _get_machine_is_cross(env, is_cross).is_android()
+def is_openbsd() -> bool:
+    return platform.system().lower() == 'openbsd'
 
-def for_haiku(is_cross, env):
-    """
-    Host machine is Haiku?
+def is_windows() -> bool:
+    platname = platform.system().lower()
+    return platname == 'windows' or 'mingw' in platname
 
-    Deprecated: Please use `env.machines[for_machine].is_haiku()`.
+def is_cygwin() -> bool:
+    return platform.system().lower().startswith('cygwin')
 
-    Note: 'host' is the machine on which compiled binaries will run
-    """
-    return _get_machine_is_cross(env, is_cross).is_haiku()
+def is_debianlike() -> bool:
+    return os.path.isfile('/etc/debian_version')
 
-def for_openbsd(is_cross, env):
-    """
-    Host machine is OpenBSD?
+def is_dragonflybsd() -> bool:
+    return platform.system().lower() == 'dragonfly'
 
-    Deprecated: Please use `env.machines[for_machine].is_openbsd()`.
+def is_netbsd() -> bool:
+    return platform.system().lower() == 'netbsd'
 
-    Note: 'host' is the machine on which compiled binaries will run
-    """
-    return _get_machine_is_cross(env, is_cross).is_openbsd()
+def is_freebsd() -> bool:
+    return platform.system().lower() == 'freebsd'
 
-def exe_exists(arglist):
+def exe_exists(arglist: typing.List[str]) -> bool:
     try:
-        p = subprocess.Popen(arglist, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
-        p.communicate()
-        if p.returncode == 0:
+        if subprocess.run(arglist, timeout=10).returncode == 0:
             return True
-    except FileNotFoundError:
+    except (FileNotFoundError, subprocess.TimeoutExpired):
         pass
     return False
 
+@lru_cache(maxsize=None)
+def darwin_get_object_archs(objpath):
+    '''
+    For a specific object (executable, static library, dylib, etc), run `lipo`
+    to fetch the list of archs supported by it. Supports both thin objects and
+    'fat' objects.
+    '''
+    _, stdo, stderr = Popen_safe(['lipo', '-info', objpath])
+    if not stdo:
+        mlog.debug('lipo {}: {}'.format(objpath, stderr))
+        return None
+    stdo = stdo.rsplit(': ', 1)[1]
+    # Convert from lipo-style archs to meson-style CPUs
+    stdo = stdo.replace('i386', 'x86')
+    stdo = stdo.replace('arm64', 'aarch64')
+    # Add generic name for armv7 and armv7s
+    if 'armv7' in stdo:
+        stdo += ' arm'
+    return stdo.split()
+
 def detect_vcs(source_dir):
     vcs_systems = [
         dict(name = 'git',        cmd = 'git', repo_dir = '.git', get_rev = 'git describe --dirty=+', rev_regex = '(.*)', dep = '.git/logs/HEAD'),
@@ -468,7 +501,7 @@
         dict(name = 'subversion', cmd = 'svn', repo_dir = '.svn', get_rev = 'svn info',               rev_regex = 'Revision: (.*)', dep = '.svn/wc.db'),
         dict(name = 'bazaar',     cmd = 'bzr', repo_dir = '.bzr', get_rev = 'bzr revno',              rev_regex = '(.*)', dep = '.bzr'),
     ]
-
+    # FIXME: this is much cleaner with pathlib.Path
     segs = source_dir.replace('\\', '/').split('/')
     for i in range(len(segs), -1, -1):
         curdir = '/'.join(segs[:i])
@@ -479,7 +512,6 @@
     return None
 
 # a helper class which implements the same version ordering as RPM
-@functools.total_ordering
 class Version:
     def __init__(self, s):
         self._s = s
@@ -488,49 +520,64 @@
         sequences = re.finditer(r'(\d+|[a-zA-Z]+|[^a-zA-Z\d]+)', s)
         # non-alphanumeric separators are discarded
         sequences = [m for m in sequences if not re.match(r'[^a-zA-Z\d]+', m.group(1))]
-        # numeric sequences have leading zeroes discarded
-        sequences = [re.sub(r'^0+(\d)', r'\1', m.group(1), 1) for m in sequences]
+        # numeric sequences are converted from strings to ints
+        sequences = [int(m.group(1)) if m.group(1).isdigit() else m.group(1) for m in sequences]
 
         self._v = sequences
 
     def __str__(self):
         return '%s (V=%s)' % (self._s, str(self._v))
 
+    def __repr__(self):
+        return ''.format(self._s)
+
     def __lt__(self, other):
-        return self.__cmp__(other) == -1
+        if isinstance(other, Version):
+            return self.__cmp(other, operator.lt)
+        return NotImplemented
+
+    def __gt__(self, other):
+        if isinstance(other, Version):
+            return self.__cmp(other, operator.gt)
+        return NotImplemented
+
+    def __le__(self, other):
+        if isinstance(other, Version):
+            return self.__cmp(other, operator.le)
+        return NotImplemented
+
+    def __ge__(self, other):
+        if isinstance(other, Version):
+            return self.__cmp(other, operator.ge)
+        return NotImplemented
 
     def __eq__(self, other):
-        return self.__cmp__(other) == 0
+        if isinstance(other, Version):
+            return self._v == other._v
+        return NotImplemented
 
-    def __cmp__(self, other):
-        def cmp(a, b):
-            return (a > b) - (a < b)
+    def __ne__(self, other):
+        if isinstance(other, Version):
+            return self._v != other._v
+        return NotImplemented
 
+    def __cmp(self, other, comparator):
         # compare each sequence in order
-        for i in range(0, min(len(self._v), len(other._v))):
+        for ours, theirs in zip(self._v, other._v):
             # sort a non-digit sequence before a digit sequence
-            if self._v[i].isdigit() != other._v[i].isdigit():
-                return 1 if self._v[i].isdigit() else -1
+            ours_is_int = isinstance(ours, int)
+            theirs_is_int = isinstance(theirs, int)
+            if ours_is_int != theirs_is_int:
+                return comparator(ours_is_int, theirs_is_int)
 
-            # compare as numbers
-            if self._v[i].isdigit():
-                # because leading zeros have already been removed, if one number
-                # has more digits, it is greater
-                c = cmp(len(self._v[i]), len(other._v[i]))
-                if c != 0:
-                    return c
-                # fallthrough
-
-            # compare lexicographically
-            c = cmp(self._v[i], other._v[i])
-            if c != 0:
-                return c
+            if ours != theirs:
+                return comparator(ours, theirs)
 
         # if equal length, all components have matched, so equal
         # otherwise, the version with a suffix remaining is greater
-        return cmp(len(self._v), len(other._v))
+        return comparator(len(self._v), len(other._v))
 
-def _version_extract_cmpop(vstr2):
+def _version_extract_cmpop(vstr2: str) -> typing.Tuple[typing.Callable[[typing.Any, typing.Any], bool], str]:
     if vstr2.startswith('>='):
         cmpop = operator.ge
         vstr2 = vstr2[2:]
@@ -557,7 +604,7 @@
 
     return (cmpop, vstr2)
 
-def version_compare(vstr1, vstr2):
+def version_compare(vstr1: str, vstr2: str) -> bool:
     (cmpop, vstr2) = _version_extract_cmpop(vstr2)
     return cmpop(Version(vstr1), Version(vstr2))
 
@@ -575,7 +622,7 @@
 
 # determine if the minimum version satisfying the condition |condition| exceeds
 # the minimum version for a feature |minimum|
-def version_compare_condition_with_min(condition, minimum):
+def version_compare_condition_with_min(condition: str, minimum: str) -> bool:
     if condition.startswith('>='):
         cmpop = operator.le
         condition = condition[2:]
@@ -608,7 +655,7 @@
     # Map versions in the constraint of the form '0.46' to '0.46.0', to embed
     # this knowledge of the meson versioning scheme.
     condition = condition.strip()
-    if re.match('^\d+.\d+$', condition):
+    if re.match(r'^\d+.\d+$', condition):
         condition += '.0'
 
     return cmpop(Version(minimum), Version(condition))
@@ -625,6 +672,8 @@
                 return 'lib/' + archpath
         except Exception:
             pass
+    if is_freebsd():
+        return 'lib'
     if os.path.isdir('/usr/lib64') and not os.path.islink('/usr/lib64'):
         return 'lib64'
     return 'lib'
@@ -636,31 +685,49 @@
 def default_prefix():
     return 'c:/' if is_windows() else '/usr/local'
 
-def get_library_dirs():
+def get_library_dirs() -> typing.List[str]:
     if is_windows():
-        return ['C:/mingw/lib'] # Fixme
+        return ['C:/mingw/lib'] # TODO: get programatically
     if is_osx():
-        return ['/usr/lib'] # Fix me as well.
+        return ['/usr/lib'] # TODO: get programatically
     # The following is probably Debian/Ubuntu specific.
     # /usr/local/lib is first because it contains stuff
     # installed by the sysadmin and is probably more up-to-date
     # than /usr/lib. If you feel that this search order is
     # problematic, please raise the issue on the mailing list.
     unixdirs = ['/usr/local/lib', '/usr/lib', '/lib']
-    plat = subprocess.check_output(['uname', '-m']).decode().strip()
-    # This is a terrible hack. I admit it and I'm really sorry.
-    # I just don't know what the correct solution is.
-    if plat == 'i686':
+
+    if is_freebsd():
+        return unixdirs
+    # FIXME: this needs to be further genericized for aarch64 etc.
+    machine = platform.machine()
+    if machine in ('i386', 'i486', 'i586', 'i686'):
         plat = 'i386'
-    if plat.startswith('arm'):
+    elif machine.startswith('arm'):
         plat = 'arm'
-    unixdirs += glob('/usr/lib/' + plat + '*')
+    else:
+        plat = ''
+
+    # Solaris puts 32-bit libraries in the main /lib & /usr/lib directories
+    # and 64-bit libraries in platform specific subdirectories.
+    if is_sunos():
+        if machine == 'i86pc':
+            plat = 'amd64'
+        elif machine.startswith('sun4'):
+            plat = 'sparcv9'
+
+    usr_platdir = Path('/usr/lib/') / plat
+    if usr_platdir.is_dir():
+        unixdirs += [str(x) for x in (usr_platdir).iterdir() if x.is_dir()]
     if os.path.exists('/usr/lib64'):
         unixdirs.append('/usr/lib64')
-    unixdirs += glob('/lib/' + plat + '*')
+
+    lib_platdir = Path('/lib/') / plat
+    if lib_platdir.is_dir():
+        unixdirs += [str(x) for x in (lib_platdir).iterdir() if x.is_dir()]
     if os.path.exists('/lib64'):
         unixdirs.append('/lib64')
-    unixdirs += glob('/lib/' + plat + '*')
+
     return unixdirs
 
 def has_path_sep(name, sep='/\\'):
@@ -670,11 +737,89 @@
             return True
     return False
 
-def do_replacement(regex, line, format, confdata):
+
+if is_windows():
+    # shlex.split is not suitable for splitting command line on Window (https://bugs.python.org/issue1724822);
+    # shlex.quote is similarly problematic. Below are "proper" implementations of these functions according to
+    # https://docs.microsoft.com/en-us/cpp/c-language/parsing-c-command-line-arguments and
+    # https://blogs.msdn.microsoft.com/twistylittlepassagesallalike/2011/04/23/everyone-quotes-command-line-arguments-the-wrong-way/
+
+    _whitespace = ' \t\n\r'
+    _find_unsafe_char = re.compile(r'[{}"]'.format(_whitespace)).search
+
+    def quote_arg(arg):
+        if arg and not _find_unsafe_char(arg):
+            return arg
+
+        result = '"'
+        num_backslashes = 0
+        for c in arg:
+            if c == '\\':
+                num_backslashes += 1
+            else:
+                if c == '"':
+                    # Escape all backslashes and the following double quotation mark
+                    num_backslashes = num_backslashes * 2 + 1
+
+                result += num_backslashes * '\\' + c
+                num_backslashes = 0
+
+        # Escape all backslashes, but let the terminating double quotation
+        # mark we add below be interpreted as a metacharacter
+        result += (num_backslashes * 2) * '\\' + '"'
+        return result
+
+    def split_args(cmd):
+        result = []
+        arg = ''
+        num_backslashes = 0
+        num_quotes = 0
+        in_quotes = False
+        for c in cmd:
+            if c == '\\':
+                num_backslashes += 1
+            else:
+                if c == '"' and not (num_backslashes % 2):
+                    # unescaped quote, eat it
+                    arg += (num_backslashes // 2) * '\\'
+                    num_quotes += 1
+                    in_quotes = not in_quotes
+                elif c in _whitespace and not in_quotes:
+                    if arg or num_quotes:
+                        # reached the end of the argument
+                        result.append(arg)
+                        arg = ''
+                        num_quotes = 0
+                else:
+                    if c == '"':
+                        # escaped quote
+                        num_backslashes = (num_backslashes - 1) // 2
+
+                    arg += num_backslashes * '\\' + c
+
+                num_backslashes = 0
+
+        if arg or num_quotes:
+            result.append(arg)
+
+        return result
+else:
+    def quote_arg(arg):
+        return shlex.quote(arg)
+
+    def split_args(cmd):
+        return shlex.split(cmd)
+
+
+def join_args(args):
+    return ' '.join([quote_arg(x) for x in args])
+
+
+def do_replacement(regex, line, variable_format, confdata):
     missing_variables = set()
     start_tag = '@'
     backslash_tag = '\\@'
-    if format == 'cmake':
+    if variable_format == 'cmake':
         start_tag = '${'
         backslash_tag = '\\${'
 
@@ -727,23 +872,23 @@
         raise MesonException('#mesondefine argument "%s" is of unknown type.' % varname)
 
 
-def do_conf_file(src, dst, confdata, format, encoding='utf-8'):
+def do_conf_file(src, dst, confdata, variable_format, encoding='utf-8'):
     try:
-        with open(src, encoding=encoding) as f:
+        with open(src, encoding=encoding, newline='') as f:
             data = f.readlines()
     except Exception as e:
         raise MesonException('Could not read input file %s: %s' % (src, str(e)))
     # Only allow (a-z, A-Z, 0-9, _, -) as valid characters for a define
     # Also allow escaping '@' with '\@'
-    if format in ['meson', 'cmake@']:
+    if variable_format in ['meson', 'cmake@']:
         regex = re.compile(r'(?:\\\\)+(?=\\?@)|\\@|@([-a-zA-Z0-9_]+)@')
-    elif format == 'cmake':
+    elif variable_format == 'cmake':
         regex = re.compile(r'(?:\\\\)+(?=\\?\$)|\\\${|\${([-a-zA-Z0-9_]+)}')
     else:
-        raise MesonException('Format "{}" not handled'.format(format))
+        raise MesonException('Format "{}" not handled'.format(variable_format))
 
     search_token = '#mesondefine'
-    if format != 'meson':
+    if variable_format != 'meson':
         search_token = '#cmakedefine'
 
     result = []
@@ -756,14 +901,14 @@
             confdata_useless = False
             line = do_mesondefine(line, confdata)
         else:
-            line, missing = do_replacement(regex, line, format, confdata)
+            line, missing = do_replacement(regex, line, variable_format, confdata)
             missing_variables.update(missing)
             if missing:
                 confdata_useless = False
         result.append(line)
     dst_tmp = dst + '~'
     try:
-        with open(dst_tmp, 'w', encoding=encoding) as f:
+        with open(dst_tmp, 'w', encoding=encoding, newline='') as f:
             f.writelines(result)
     except Exception as e:
         raise MesonException('Could not write output file %s: %s' % (dst, str(e)))
@@ -870,14 +1015,14 @@
         result.append(listify(fetch(key, []), **kwargs))
     return result
 
-
-def typeslistify(item, types):
+def typeslistify(item: 'typing.Union[_T, typing.List[_T]]',
+                 types: 'typing.Union[typing.Type[_T], typing.Tuple[typing.Type[_T]]]') -> typing.List[_T]:
     '''
     Ensure that type(@item) is one of @types or a
     list of items all of which are of type @types
     '''
     if isinstance(item, types):
-        item = [item]
+        item = typing.cast(typing.List[_T], [item])
     if not isinstance(item, list):
         raise MesonException('Item must be a list or one of {!r}'.format(types))
     for i in item:
@@ -885,7 +1030,7 @@
             raise MesonException('List item must be one of {!r}'.format(types))
     return item
 
-def stringlistify(item):
+def stringlistify(item: typing.Union[str, typing.List[str]]) -> typing.List[str]:
     return typeslistify(item, str)
 
 def expand_arguments(args):
@@ -906,7 +1051,10 @@
             return None
     return expended_args
 
-def Popen_safe(args, write=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE, **kwargs):
+def Popen_safe(args: typing.List[str], write: typing.Optional[str] = None,
+               stdout: typing.Union[typing.BinaryIO, int] = subprocess.PIPE,
+               stderr: typing.Union[typing.BinaryIO, int] = subprocess.PIPE,
+               **kwargs: typing.Any) -> typing.Tuple[subprocess.Popen, str, str]:
     import locale
     encoding = locale.getpreferredencoding()
     if sys.version_info < (3, 6) or not sys.stdout.encoding or encoding.upper() != 'UTF-8':
@@ -916,12 +1064,16 @@
     o, e = p.communicate(write)
     return p, o, e
 
-def Popen_safe_legacy(args, write=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE, **kwargs):
-    p = subprocess.Popen(args, universal_newlines=False,
+def Popen_safe_legacy(args: typing.List[str], write: typing.Optional[str] = None,
+                      stdout: typing.Union[typing.BinaryIO, int] = subprocess.PIPE,
+                      stderr: typing.Union[typing.BinaryIO, int] = subprocess.PIPE,
+                      **kwargs: typing.Any) -> typing.Tuple[subprocess.Popen, str, str]:
+    p = subprocess.Popen(args, universal_newlines=False, close_fds=False,
                          stdout=stdout, stderr=stderr, **kwargs)
+    input_ = None  # type: typing.Optional[bytes]
     if write is not None:
-        write = write.encode('utf-8')
-    o, e = p.communicate(write)
+        input_ = write.encode('utf-8')
+    o, e = p.communicate(input_)
     if o is not None:
         if sys.stdout.encoding:
             o = o.decode(encoding=sys.stdout.encoding, errors='replace').replace('\r\n', '\n')
@@ -1116,6 +1268,22 @@
     shutil.rmtree(f)
 
 
+def windows_proof_rm(fpath):
+    """Like windows_proof_rmtree, but for a single file."""
+    if os.path.isfile(fpath):
+        os.chmod(fpath, os.stat(fpath).st_mode | stat.S_IWRITE | stat.S_IREAD)
+    delays = [0.1, 0.1, 0.2, 0.2, 0.2, 0.5, 0.5, 1, 1, 1, 1, 2]
+    for d in delays:
+        try:
+            os.unlink(fpath)
+            return
+        except FileNotFoundError:
+            return
+        except (OSError, PermissionError):
+            time.sleep(d)
+    os.unlink(fpath)
+
+
 def detect_subprojects(spdir_name, current_dir='', result=None):
     if result is None:
         result = {}
@@ -1140,10 +1308,17 @@
                 result[basename] = [trial]
     return result
 
-def get_error_location_string(fname, lineno):
+# This isn't strictly correct. What we really want here is something like:
+# class StringProtocol(typing_extensions.Protocol):
+#
+#      def __str__(self) -> str: ...
+#
+# This would more accurately embody what this funcitonc an handle, but we
+# don't have that yet, so instead we'll do some casting to work around it
+def get_error_location_string(fname: str, lineno: str) -> str:
     return '{}:{}:'.format(fname, lineno)
 
-def substring_is_in_list(substr, strlist):
+def substring_is_in_list(substr: str, strlist: typing.List[str]) -> bool:
     for s in strlist:
         if substr in s:
             return True
@@ -1222,3 +1397,144 @@
         return os.path.relpath(path, start)
     except ValueError:
         return path
+
+
+class LibType(Enum):
+
+    """Enumeration for library types."""
+
+    SHARED = 0
+    STATIC = 1
+    PREFER_SHARED = 2
+    PREFER_STATIC = 3
+
+
+class ProgressBarFallback:
+    '''Fallback progress bar implementation when tqdm is not found'''
+    def __init__(self, iterable=None, total=None, bar_type=None, desc=None):
+        if iterable is not None:
+            self.iterable = iter(iterable)
+            return
+        self.total = total
+        self.done = 0
+        self.printed_dots = 0
+        if self.total and bar_type == 'download':
+            print('Download size:', self.total)
+        if desc:
+            print('{}: '.format(desc), end='')
+
+    # Pretend to be an iterator when called as one and don't print any
+    # progress
+    def __iter__(self):
+        return self.iterable
+
+    def __next__(self):
+        return next(self.iterable)
+
+    def print_dot(self):
+        print('.', end='')
+        sys.stdout.flush()
+        self.printed_dots += 1
+
+    def update(self, progress):
+        self.done += progress
+        if not self.total:
+            # Just print one dot per call if we don't have a total length
+            self.print_dot()
+            return
+        ratio = int(self.done / self.total * 10)
+        while self.printed_dots < ratio:
+            self.print_dot()
+
+    def close(self):
+        print('')
+
+try:
+    from tqdm import tqdm
+
+    class ProgressBar(tqdm):
+        def __init__(self, *args, bar_type=None, **kwargs):
+            if bar_type == 'download':
+                kwargs.update({'unit': 'bytes', 'leave': True})
+            else:
+                kwargs.update({'leave': False})
+            kwargs['ncols'] = 100
+            super().__init__(*args, **kwargs)
+except ImportError:
+    ProgressBar = ProgressBarFallback
+
+
+def get_wine_shortpath(winecmd, wine_paths):
+
+    """ Get A short version of @wine_paths to avoid
+    reaching WINEPATH number of char limit.
+    """
+
+    seen = set()
+    wine_paths = [p for p in wine_paths if not (p in seen or seen.add(p))]
+
+    getShortPathScript = '%s.bat' % str(uuid.uuid4()).lower()[:5]
+    with open(getShortPathScript, mode='w') as f:
+        f.write("@ECHO OFF\nfor %%x in (%*) do (\n echo|set /p=;%~sx\n)\n")
+        f.flush()
+    try:
+        with open(os.devnull, 'w') as stderr:
+            wine_path = subprocess.check_output(
+                winecmd +
+                ['cmd', '/C', getShortPathScript] + wine_paths,
+                stderr=stderr).decode('utf-8')
+    except subprocess.CalledProcessError as e:
+        print("Could not get short paths: %s" % e)
+        wine_path = ';'.join(wine_paths)
+    finally:
+        os.remove(getShortPathScript)
+    if len(wine_path) > 2048:
+        raise MesonException(
+            'WINEPATH size {} > 2048'
+            ' this will cause random failure.'.format(
+                len(wine_path)))
+
+    return wine_path.strip(';')
+
+def run_once(func):
+    ret = []
+
+    def wrapper(*args, **kwargs):
+        if ret:
+            return ret[0]
+
+        val = func(*args, **kwargs)
+        ret.append(val)
+        return val
+
+    return update_wrapper(wrapper, func)
+
+
+class OptionProxy:
+    def __init__(self, value):
+        self.value = value
+
+class OptionOverrideProxy:
+    '''Mimic an option list but transparently override
+    selected option values.'''
+    def __init__(self, overrides, *options):
+        self.overrides = overrides
+        self.options = options
+
+    def __getitem__(self, option_name):
+        for opts in self.options:
+            if option_name in opts:
+                return self._get_override(option_name, opts[option_name])
+        raise KeyError('Option not found', option_name)
+
+    def _get_override(self, option_name, base_opt):
+        if option_name in self.overrides:
+            return OptionProxy(base_opt.validate_value(self.overrides[option_name]))
+        return base_opt
+
+    def copy(self):
+        result = {}
+        for opts in self.options:
+            for option_name in opts:
+                result[option_name] = self._get_override(option_name, opts[option_name])
+        return result
diff -Nru meson-0.49.0/mesonbuild/mesonmain.py meson-0.52.1/mesonbuild/mesonmain.py
--- meson-0.49.0/mesonbuild/mesonmain.py	2018-12-09 14:27:23.000000000 +0000
+++ meson-0.52.1/mesonbuild/mesonmain.py	2019-11-28 17:37:44.000000000 +0000
@@ -17,67 +17,85 @@
 import importlib
 import traceback
 import argparse
+import codecs
+import shutil
 
 from . import mesonlib
 from . import mlog
-from . import mconf, minit, minstall, mintro, msetup, mtest, rewriter, msubprojects
+from . import mconf, mdist, minit, minstall, mintro, msetup, mtest, rewriter, msubprojects, munstable_coredata
 from .mesonlib import MesonException
 from .environment import detect_msys2_arch
 from .wrap import wraptool
 
 
+# Note: when adding arguments, please also add them to the completion
+# scripts in $MESONSRC/data/shell-completions/
 class CommandLineParser:
     def __init__(self):
+        self.term_width = shutil.get_terminal_size().columns
+        self.formater = lambda prog: argparse.HelpFormatter(prog, max_help_position=int(self.term_width / 2), width=self.term_width)
+
         self.commands = {}
         self.hidden_commands = []
-        self.parser = argparse.ArgumentParser(prog='meson')
+        self.parser = argparse.ArgumentParser(prog='meson', formatter_class=self.formater)
         self.subparsers = self.parser.add_subparsers(title='Commands',
                                                      description='If no command is specified it defaults to setup command.')
         self.add_command('setup', msetup.add_arguments, msetup.run,
-                         help='Configure the project')
+                         help_msg='Configure the project')
         self.add_command('configure', mconf.add_arguments, mconf.run,
-                         help='Change project options',)
+                         help_msg='Change project options',)
+        self.add_command('dist', mdist.add_arguments, mdist.run,
+                         help_msg='Generate release archive',)
         self.add_command('install', minstall.add_arguments, minstall.run,
-                         help='Install the project')
+                         help_msg='Install the project')
         self.add_command('introspect', mintro.add_arguments, mintro.run,
-                         help='Introspect project')
+                         help_msg='Introspect project')
         self.add_command('init', minit.add_arguments, minit.run,
-                         help='Create a new project')
+                         help_msg='Create a new project')
         self.add_command('test', mtest.add_arguments, mtest.run,
-                         help='Run tests')
+                         help_msg='Run tests')
         self.add_command('wrap', wraptool.add_arguments, wraptool.run,
-                         help='Wrap tools')
+                         help_msg='Wrap tools')
         self.add_command('subprojects', msubprojects.add_arguments, msubprojects.run,
-                         help='Manage subprojects')
+                         help_msg='Manage subprojects')
         self.add_command('help', self.add_help_arguments, self.run_help_command,
-                         help='Print help of a subcommand')
+                         help_msg='Print help of a subcommand')
+        self.add_command('rewrite', lambda parser: rewriter.add_arguments(parser, self.formater), rewriter.run,
+                         help_msg='Modify the project definition')
 
         # Hidden commands
-        self.add_command('rewrite', rewriter.add_arguments, rewriter.run,
-                         help=argparse.SUPPRESS)
         self.add_command('runpython', self.add_runpython_arguments, self.run_runpython_command,
-                         help=argparse.SUPPRESS)
+                         help_msg=argparse.SUPPRESS)
+        self.add_command('unstable-coredata', munstable_coredata.add_arguments, munstable_coredata.run,
+                         help_msg=argparse.SUPPRESS)
 
-    def add_command(self, name, add_arguments_func, run_func, help):
+    def add_command(self, name, add_arguments_func, run_func, help_msg, aliases=None):
+        aliases = aliases or []
         # FIXME: Cannot have hidden subparser:
         # https://bugs.python.org/issue22848
-        if help == argparse.SUPPRESS:
-            p = argparse.ArgumentParser(prog='meson ' + name)
+        if help_msg == argparse.SUPPRESS:
+            p = argparse.ArgumentParser(prog='meson ' + name, formatter_class=self.formater)
             self.hidden_commands.append(name)
         else:
-            p = self.subparsers.add_parser(name, help=help)
+            p = self.subparsers.add_parser(name, help=help_msg, aliases=aliases, formatter_class=self.formater)
         add_arguments_func(p)
         p.set_defaults(run_func=run_func)
-        self.commands[name] = p
+        for i in [name] + aliases:
+            self.commands[i] = p
 
     def add_runpython_arguments(self, parser):
+        parser.add_argument('-c', action='store_true', dest='eval_arg', default=False)
         parser.add_argument('script_file')
         parser.add_argument('script_args', nargs=argparse.REMAINDER)
 
     def run_runpython_command(self, options):
         import runpy
-        sys.argv[1:] = options.script_args
-        runpy.run_path(options.script_file, run_name='__main__')
+        if options.eval_arg:
+            exec(options.script_file)
+        else:
+            sys.argv[1:] = options.script_args
+            sys.path.insert(0, os.path.dirname(options.script_file))
+            runpy.run_path(options.script_file, run_name='__main__')
         return 0
 
     def add_help_arguments(self, parser):
@@ -94,7 +112,7 @@
         # If first arg is not a known command, assume user wants to run the setup
         # command.
         known_commands = list(self.commands.keys()) + ['-h', '--help']
-        if len(args) == 0 or args[0] not in known_commands:
+        if not args or args[0] not in known_commands:
             args = ['setup'] + args
 
         # Hidden commands have their own parser instead of using the global one
@@ -117,7 +135,7 @@
             if os.environ.get('MESON_FORCE_BACKTRACE'):
                 raise
             return 1
-        except Exception as e:
+        except Exception:
             if os.environ.get('MESON_FORCE_BACKTRACE'):
                 raise
             traceback.print_exc()
@@ -148,6 +166,17 @@
         mlog.exception(e)
         return 1
 
+def ensure_stdout_accepts_unicode():
+    if sys.stdout.encoding and not sys.stdout.encoding.upper().startswith('UTF-'):
+        if sys.version_info >= (3, 7):
+            sys.stdout.reconfigure(errors='surrogateescape')
+        else:
+            sys.stdout = codecs.getwriter('utf-8')(sys.stdout.detach(),
+                                                   errors='surrogateescape')
+            sys.stdout.encoding = 'UTF-8'
+            if not hasattr(sys.stdout, 'buffer'):
+                sys.stdout.buffer = sys.stdout.raw if hasattr(sys.stdout, 'raw') else sys.stdout
+
 def run(original_args, mainfile):
     if sys.version_info < (3, 5):
         print('Meson works correctly only with python 3.5+.')
@@ -155,6 +184,11 @@
         print('Please update your environment')
         return 1
 
+    # Meson gets confused if stdout can't output Unicode, if the
+    # locale isn't Unicode, just force stdout to accept it. This tries
+    # to emulate enough of PEP 540 to work elsewhere.
+    ensure_stdout_accepts_unicode()
+
     # https://github.com/mesonbuild/meson/issues/3653
     if sys.platform.lower() == 'msys':
         mlog.error('This python3 seems to be msys/python on MSYS2 Windows, which is known to have path semantics incompatible with Meson')
diff -Nru meson-0.49.0/mesonbuild/minit.py meson-0.52.1/mesonbuild/minit.py
--- meson-0.49.0/mesonbuild/minit.py	2018-12-09 14:27:16.000000000 +0000
+++ meson-0.52.1/mesonbuild/minit.py	2019-11-28 17:37:44.000000000 +0000
@@ -442,7 +442,7 @@
     parser.add_argument('--version', default='0.1')
 
 def run(options):
-    if len(glob('*')) == 0:
+    if not glob('*'):
         autodetect_options(options, sample=True)
         if not options.language:
             print('Defaulting to generating a C language project.')
diff -Nru meson-0.49.0/mesonbuild/minstall.py meson-0.52.1/mesonbuild/minstall.py
--- meson-0.49.0/mesonbuild/minstall.py	2018-12-09 14:27:23.000000000 +0000
+++ meson-0.52.1/mesonbuild/minstall.py	2019-11-28 17:37:44.000000000 +0000
@@ -65,7 +65,7 @@
     def __enter__(self):
         return self
 
-    def __exit__(self, type, value, traceback):
+    def __exit__(self, exception_type, value, traceback):
         self.dirs.reverse()
         for d in self.dirs:
             append_to_log(self.lf, d)
@@ -93,7 +93,7 @@
                                                  dir_fd=dir_fd,
                                                  follow_symlinks=follow_symlinks)
         shutil.chown(path, user, group)
-    except:
+    except Exception:
         raise
     finally:
         os.chown = real_os_chown
@@ -101,12 +101,12 @@
 def set_chmod(path, mode, dir_fd=None, follow_symlinks=True):
     try:
         os.chmod(path, mode, dir_fd=dir_fd, follow_symlinks=follow_symlinks)
-    except (NotImplementedError, OSError, SystemError) as e:
+    except (NotImplementedError, OSError, SystemError):
         if not os.path.islink(path):
             os.chmod(path, mode, dir_fd=dir_fd)
 
 def sanitize_permissions(path, umask):
-    if umask is None:
+    if umask == 'preserve':
         return
     new_perms = 0o777 if is_executable(path, follow_symlinks=False) else 0o666
     new_perms &= ~umask
@@ -157,7 +157,7 @@
     '''
     try:
         subprocess.check_call(['selinuxenabled'])
-    except (FileNotFoundError, PermissionError, subprocess.CalledProcessError) as e:
+    except (FileNotFoundError, NotADirectoryError, PermissionError, subprocess.CalledProcessError):
         # If we don't have selinux or selinuxenabled returned 1, failure
         # is ignored quietly.
         return
@@ -211,6 +211,7 @@
 class Installer:
 
     def __init__(self, options, lf):
+        self.did_install_something = False
         self.options = options
         self.lf = lf
 
@@ -331,9 +332,10 @@
         d.destdir = os.environ.get('DESTDIR', '')
         d.fullprefix = destdir_join(d.destdir, d.prefix)
 
-        if d.install_umask is not None:
+        if d.install_umask != 'preserve':
             os.umask(d.install_umask)
 
+        self.did_install_something = False
         try:
             d.dirmaker = DirMaker(self.lf)
             with d.dirmaker:
@@ -344,6 +346,8 @@
                 self.install_data(d)
                 restore_selinux_contexts()
                 self.run_install_script(d)
+                if not self.did_install_something:
+                    print('Nothing to install.')
         except PermissionError:
             if shutil.which('pkexec') is not None and 'PKEXEC_UID' not in os.environ:
                 print('Installation failed due to insufficient permissions.')
@@ -355,6 +359,7 @@
 
     def install_subdirs(self, d):
         for (src_dir, dst_dir, mode, exclude) in d.install_subdirs:
+            self.did_install_something = True
             full_dst_dir = get_destdir_path(d, dst_dir)
             print('Installing subdir %s to %s' % (src_dir, full_dst_dir))
             d.dirmaker.makedirs(full_dst_dir, exist_ok=True)
@@ -362,6 +367,7 @@
 
     def install_data(self, d):
         for i in d.data:
+            self.did_install_something = True
             fullfilename = i[0]
             outfilename = get_destdir_path(d, i[1])
             mode = i[2]
@@ -372,6 +378,7 @@
 
     def install_man(self, d):
         for m in d.man:
+            self.did_install_something = True
             full_source_filename = m[0]
             outfilename = get_destdir_path(d, m[1])
             outdir = os.path.dirname(outfilename)
@@ -382,6 +389,7 @@
 
     def install_headers(self, d):
         for t in d.headers:
+            self.did_install_something = True
             fullfilename = t[0]
             fname = os.path.basename(fullfilename)
             outdir = get_destdir_path(d, t[1])
@@ -403,6 +411,7 @@
         child_env.update(env)
 
         for i in d.install_scripts:
+            self.did_install_something = True  # Custom script must report itself if it does nothing.
             script = i['exe']
             args = i['args']
             name = ' '.join(script + args)
@@ -417,6 +426,7 @@
 
     def install_targets(self, d):
         for t in d.targets:
+            self.did_install_something = True
             if not os.path.exists(t.fname):
                 # For example, import libraries of shared modules are optional
                 if t.optional:
@@ -443,7 +453,7 @@
                     if fname.endswith('.jar'):
                         print('Not stripping jar target:', os.path.basename(fname))
                         continue
-                    print('Stripping target {!r}'.format(fname))
+                    print('Stripping target {!r} using {}.'.format(fname, d.strip_bin[0]))
                     ps, stdo, stde = Popen_safe(d.strip_bin + [outname])
                     if ps.returncode != 0:
                         print('Could not strip file.\n')
@@ -455,6 +465,13 @@
                     pdb_outname = os.path.splitext(outname)[0] + '.pdb'
                     self.do_copyfile(pdb_filename, pdb_outname)
                     set_mode(pdb_outname, install_mode, d.install_umask)
+                if fname.endswith('.js'):
+                    # Emscripten outputs js files and optionally a wasm file.
+                    # If one was generated, install it as well.
+                    wasm_source = os.path.splitext(fname)[0] + '.wasm'
+                    if os.path.exists(wasm_source):
+                        wasm_output = os.path.splitext(outname)[0] + '.wasm'
+                        self.do_copyfile(wasm_source, wasm_output)
             elif os.path.isdir(fname):
                 fname = os.path.join(d.build_dir, fname.rstrip('/'))
                 outname = os.path.join(outdir, os.path.basename(fname))
diff -Nru meson-0.49.0/mesonbuild/mintro.py meson-0.52.1/mesonbuild/mintro.py
--- meson-0.49.0/mesonbuild/mintro.py	2018-12-09 14:27:23.000000000 +0000
+++ meson-0.52.1/mesonbuild/mintro.py	2019-11-28 17:37:44.000000000 +0000
@@ -20,49 +20,96 @@
 project files and don't need this info."""
 
 import json
-from . import build, mtest, coredata as cdata
+from . import build, coredata as cdata
 from . import mesonlib
-from . import astinterpreter
-from . import mparser
-from .interpreterbase import InvalidArguments
-from .backend import ninjabackend
-import sys, os
+from .ast import IntrospectionInterpreter, build_target_functions, AstConditionLevel, AstIDGenerator, AstIndentationGenerator
+from . import mlog
+from .backend import backends
+from .mparser import FunctionNode, ArrayNode, ArgumentNode, StringNode
+from typing import Dict, List, Optional
+import os
 import pathlib
 
-def add_arguments(parser):
-    parser.add_argument('--targets', action='store_true', dest='list_targets', default=False,
-                        help='List top level targets.')
-    parser.add_argument('--installed', action='store_true', dest='list_installed', default=False,
-                        help='List all installed files and directories.')
-    parser.add_argument('--target-files', action='store', dest='target_files', default=None,
-                        help='List source files for a given target.')
-    parser.add_argument('--buildsystem-files', action='store_true', dest='buildsystem_files', default=False,
-                        help='List files that make up the build system.')
-    parser.add_argument('--buildoptions', action='store_true', dest='buildoptions', default=False,
-                        help='List all build options.')
-    parser.add_argument('--tests', action='store_true', dest='tests', default=False,
-                        help='List all unit tests.')
-    parser.add_argument('--benchmarks', action='store_true', dest='benchmarks', default=False,
-                        help='List all benchmarks.')
-    parser.add_argument('--dependencies', action='store_true', dest='dependencies', default=False,
-                        help='List external dependencies.')
-    parser.add_argument('--projectinfo', action='store_true', dest='projectinfo', default=False,
-                        help='Information about projects.')
-    parser.add_argument('builddir', nargs='?', default='.', help='The build directory')
+def get_meson_info_file(info_dir: str):
+    return os.path.join(info_dir, 'meson-info.json')
 
-def determine_installed_path(target, installdata):
-    install_target = None
-    for i in installdata.targets:
-        if os.path.basename(i.fname) == target.get_filename(): # FIXME, might clash due to subprojects.
-            install_target = i
-            break
-    if install_target is None:
-        raise RuntimeError('Something weird happened. File a bug.')
-    outname = os.path.join(installdata.prefix, i.outdir, os.path.basename(i.fname))
-    # Normalize the path by using os.path.sep consistently, etc.
-    # Does not change the effective path.
-    return str(pathlib.PurePath(outname))
+def get_meson_introspection_version():
+    return '1.0.0'
+
+def get_meson_introspection_required_version():
+    return ['>=1.0', '<2.0']
+
+def get_meson_introspection_types(coredata: Optional[cdata.CoreData] = None,
+                                  builddata: Optional[build.Build] = None,
+                                  backend: Optional[backends.Backend] = None,
+                                  sourcedir: Optional[str] = None):
+    if backend and builddata:
+        benchmarkdata = backend.create_test_serialisation(builddata.get_benchmarks())
+        testdata = backend.create_test_serialisation(builddata.get_tests())
+        installdata = backend.create_install_data()
+    else:
+        benchmarkdata = testdata = installdata = None
 
+    return {
+        'benchmarks': {
+            'func': lambda: list_benchmarks(benchmarkdata),
+            'desc': 'List all benchmarks.',
+        },
+        'buildoptions': {
+            'func': lambda: list_buildoptions(coredata),
+            'no_bd': lambda intr: list_buildoptions_from_source(intr),
+            'desc': 'List all build options.',
+        },
+        'buildsystem_files': {
+            'func': lambda: list_buildsystem_files(builddata),
+            'desc': 'List files that make up the build system.',
+            'key': 'buildsystem-files',
+        },
+        'dependencies': {
+            'func': lambda: list_deps(coredata),
+            'no_bd': lambda intr: list_deps_from_source(intr),
+            'desc': 'List external dependencies.',
+        },
+        'scan_dependencies': {
+            'no_bd': lambda intr: list_deps_from_source(intr),
+            'desc': 'Scan for dependencies used in the meson.build file.',
+            'key': 'scan-dependencies',
+        },
+        'installed': {
+            'func': lambda: list_installed(installdata),
+            'desc': 'List all installed files and directories.',
+        },
+        'projectinfo': {
+            'func': lambda: list_projinfo(builddata),
+            'no_bd': lambda intr: list_projinfo_from_source(sourcedir, intr),
+            'desc': 'Information about projects.',
+        },
+        'targets': {
+            'func': lambda: list_targets(builddata, installdata, backend),
+            'no_bd': lambda intr: list_targets_from_source(intr),
+            'desc': 'List top level targets.',
+        },
+        'tests': {
+            'func': lambda: list_tests(testdata),
+            'desc': 'List all unit tests.',
+        }
+    }
+
+def add_arguments(parser):
+    intro_types = get_meson_introspection_types()
+    for key, val in intro_types.items():
+        flag = '--' + val.get('key', key)
+        parser.add_argument(flag, action='store_true', dest=key, default=False, help=val['desc'])
+
+    parser.add_argument('--backend', choices=cdata.backendlist, dest='backend', default='ninja',
+                        help='The backend to use for the --buildoptions introspection.')
+    parser.add_argument('-a', '--all', action='store_true', dest='all', default=False,
+                        help='Print all available information.')
+    parser.add_argument('-i', '--indent', action='store_true', dest='indent', default=False,
+                        help='Enable pretty printed JSON.')
+    parser.add_argument('-f', '--force-object-output', action='store_true', dest='force_dict', default=False,
+                        help='Always use the new JSON format for multiple entries (even for 0 and 1 introspection commands)')
+    parser.add_argument('builddir', nargs='?', default='.', help='The build directory')
 
 def list_installed(installdata):
     res = {}
@@ -70,62 +117,94 @@
         for t in installdata.targets:
             res[os.path.join(installdata.build_dir, t.fname)] = \
                 os.path.join(installdata.prefix, t.outdir, os.path.basename(t.fname))
-        for path, installpath, unused_prefix in installdata.data:
+        for path, installpath, _ in installdata.data:
             res[path] = os.path.join(installdata.prefix, installpath)
-        for path, installdir, unused_custom_install_mode in installdata.headers:
+        for path, installdir, _ in installdata.headers:
             res[path] = os.path.join(installdata.prefix, installdir, os.path.basename(path))
-        for path, installpath, unused_custom_install_mode in installdata.man:
+        for path, installpath, _ in installdata.man:
+            res[path] = os.path.join(installdata.prefix, installpath)
+        for path, installpath, _, _ in installdata.install_subdirs:
             res[path] = os.path.join(installdata.prefix, installpath)
-    print(json.dumps(res))
+    return res
 
+def list_targets_from_source(intr: IntrospectionInterpreter):
+    tlist = []
+    for i in intr.targets:
+        sources = []
+        for n in i['sources']:
+            args = []
+            if isinstance(n, FunctionNode):
+                args = list(n.args.arguments)
+                if n.func_name in build_target_functions:
+                    args.pop(0)
+            elif isinstance(n, ArrayNode):
+                args = n.args.arguments
+            elif isinstance(n, ArgumentNode):
+                args = n.arguments
+            for j in args:
+                if isinstance(j, StringNode):
+                    sources += [j.value]
+                elif isinstance(j, str):
+                    sources += [j]
+
+        tlist += [{
+            'name': i['name'],
+            'id': i['id'],
+            'type': i['type'],
+            'defined_in': i['defined_in'],
+            'filename': [os.path.join(i['subdir'], x) for x in i['outputs']],
+            'build_by_default': i['build_by_default'],
+            'target_sources': [{
+                'language': 'unknown',
+                'compiler': [],
+                'parameters': [],
+                'sources': [os.path.normpath(os.path.join(os.path.abspath(intr.source_root), i['subdir'], x)) for x in sources],
+                'generated_sources': []
+            }],
+            'subproject': None, # Subprojects are not supported
+            'installed': i['installed']
+        }]
+
+    return tlist
 
-def list_targets(coredata, builddata, installdata):
+def list_targets(builddata: build.Build, installdata, backend: backends.Backend):
     tlist = []
+    build_dir = builddata.environment.get_build_dir()
+    src_dir = builddata.environment.get_source_dir()
+
+    # Fast lookup table for installation files
+    install_lookuptable = {}
+    for i in installdata.targets:
+        outname = os.path.join(installdata.prefix, i.outdir, os.path.basename(i.fname))
+        install_lookuptable[os.path.basename(i.fname)] = str(pathlib.PurePath(outname))
+
     for (idname, target) in builddata.get_targets().items():
-        t = {'name': target.get_basename(), 'id': idname}
-        fname = target.get_filename()
-        if isinstance(fname, list):
-            fname = [os.path.join(target.subdir, x) for x in fname]
-        else:
-            fname = os.path.join(target.subdir, fname)
-        t['filename'] = fname
-        if isinstance(target, build.Executable):
-            typename = 'executable'
-        elif isinstance(target, build.SharedLibrary):
-            typename = 'shared library'
-        elif isinstance(target, build.StaticLibrary):
-            typename = 'static library'
-        elif isinstance(target, build.CustomTarget):
-            typename = 'custom'
-        elif isinstance(target, build.RunTarget):
-            typename = 'run'
-        else:
-            typename = 'unknown'
-        t['type'] = typename
+        if not isinstance(target, build.Target):
+            raise RuntimeError('The target object in `builddata.get_targets()` is not of type `build.Target`. Please file a bug with this error message.')
+
+        t = {
+            'name': target.get_basename(),
+            'id': idname,
+            'type': target.get_typename(),
+            'defined_in': os.path.normpath(os.path.join(src_dir, target.subdir, 'meson.build')),
+            'filename': [os.path.join(build_dir, target.subdir, x) for x in target.get_outputs()],
+            'build_by_default': target.build_by_default,
+            'target_sources': backend.get_introspection_data(idname, target),
+            'subproject': target.subproject or None
+        }
+
         if installdata and target.should_install():
             t['installed'] = True
-            t['install_filename'] = determine_installed_path(target, installdata)
+            t['install_filename'] = [install_lookuptable.get(x, None) for x in target.get_outputs()]
         else:
             t['installed'] = False
-        t['build_by_default'] = target.build_by_default
         tlist.append(t)
-    print(json.dumps(tlist))
+    return tlist
 
-def list_target_files(target_name, coredata, builddata):
-    try:
-        t = builddata.targets[target_name]
-        sources = t.sources + t.extra_files
-    except KeyError:
-        print("Unknown target %s." % target_name)
-        sys.exit(1)
-    out = []
-    for i in sources:
-        if isinstance(i, mesonlib.File):
-            i = os.path.join(i.subdir, i.fname)
-        out.append(i)
-    print(json.dumps(out))
+def list_buildoptions_from_source(intr: IntrospectionInterpreter) -> List[dict]:
+    return list_buildoptions(intr.coredata)
 
-def list_buildoptions(coredata, builddata):
+def list_buildoptions(coredata: cdata.CoreData) -> List[dict]:
     optlist = []
 
     dir_option_names = ['bindir',
@@ -150,20 +229,33 @@
     core_options = {k: o for k, o in coredata.builtins.items() if k in core_option_names}
 
     add_keys(optlist, core_options, 'core')
+    add_keys(optlist, coredata.builtins_per_machine.host, 'core', machine='host')
+    add_keys(
+        optlist,
+        {'build.' + k: o for k, o in coredata.builtins_per_machine.build.items()},
+        'core',
+        machine='build',
+    )
     add_keys(optlist, coredata.backend_options, 'backend')
     add_keys(optlist, coredata.base_options, 'base')
-    add_keys(optlist, coredata.compiler_options, 'compiler')
+    add_keys(optlist, coredata.compiler_options.host, 'compiler', machine='host')
+    add_keys(
+        optlist,
+        {'build.' + k: o for k, o in coredata.compiler_options.build.items()},
+        'compiler',
+        machine='build',
+    )
     add_keys(optlist, dir_options, 'directory')
     add_keys(optlist, coredata.user_options, 'user')
     add_keys(optlist, test_options, 'test')
-    print(json.dumps(optlist))
+    return optlist
 
-def add_keys(optlist, options, section):
+def add_keys(optlist, options: Dict[str, cdata.UserOption], section: str, machine: str = 'any'):
     keys = list(options.keys())
     keys.sort()
     for key in keys:
         opt = options[key]
-        optdict = {'name': key, 'value': opt.value, 'section': section}
+        optdict = {'name': key, 'value': opt.value, 'section': section, 'machine': machine}
         if isinstance(opt, cdata.UserStringOption):
             typestr = 'string'
         elif isinstance(opt, cdata.UserBooleanOption):
@@ -190,21 +282,28 @@
                 filelist.append(os.path.relpath(os.path.join(root, f), src_dir))
     return filelist
 
-def list_buildsystem_files(builddata):
+def list_buildsystem_files(builddata: build.Build):
     src_dir = builddata.environment.get_source_dir()
     filelist = find_buildsystem_files_list(src_dir)
-    print(json.dumps(filelist))
+    filelist = [os.path.join(src_dir, x) for x in filelist]
+    return filelist
+
+def list_deps_from_source(intr: IntrospectionInterpreter):
+    result = []
+    for i in intr.dependencies:
+        result += [{k: v for k, v in i.items() if k in ['name', 'required', 'has_fallback', 'conditional']}]
+    return result
 
-def list_deps(coredata):
+def list_deps(coredata: cdata.CoreData):
     result = []
-    for d in coredata.deps.values():
+    for d in coredata.deps.host.values():
         if d.found():
             result += [{'name': d.name,
                         'compile_args': d.get_compile_args(),
                         'link_args': d.get_link_args()}]
-    print(json.dumps(result))
+    return result
 
-def list_tests(testdata):
+def get_test_list(testdata):
     result = []
     for t in testdata:
         to = {}
@@ -214,7 +313,7 @@
             fname = t.fname
         to['cmd'] = fname + t.cmd_args
         if isinstance(t.env, build.EnvironmentVariables):
-            to['env'] = t.env.get_env(os.environ)
+            to['env'] = t.env.get_env({})
         else:
             to['env'] = t.env
         to['name'] = t.name
@@ -222,12 +321,20 @@
         to['timeout'] = t.timeout
         to['suite'] = t.suite
         to['is_parallel'] = t.is_parallel
+        to['priority'] = t.priority
         result.append(to)
-    print(json.dumps(result))
+    return result
+
+def list_tests(testdata):
+    return get_test_list(testdata)
+
+def list_benchmarks(benchdata):
+    return get_test_list(benchdata)
 
-def list_projinfo(builddata):
+def list_projinfo(builddata: build.Build):
     result = {'version': builddata.project_version,
-              'descriptive_name': builddata.project_name}
+              'descriptive_name': builddata.project_name,
+              'subproject_dir': builddata.subproject_dir}
     subprojects = []
     for k, v in builddata.subprojects.items():
         c = {'name': k,
@@ -235,107 +342,175 @@
              'descriptive_name': builddata.projects.get(k)}
         subprojects.append(c)
     result['subprojects'] = subprojects
-    print(json.dumps(result))
-
-class ProjectInfoInterperter(astinterpreter.AstInterpreter):
-    def __init__(self, source_root, subdir):
-        super().__init__(source_root, subdir)
-        self.funcs.update({'project': self.func_project})
-        self.project_name = None
-        self.project_version = None
-
-    def func_project(self, node, args, kwargs):
-        if len(args) < 1:
-            raise InvalidArguments('Not enough arguments to project(). Needs at least the project name.')
-        self.project_name = args[0]
-        self.project_version = kwargs.get('version', 'undefined')
-        if isinstance(self.project_version, mparser.ElementaryNode):
-            self.project_version = self.project_version.value
-
-    def set_variable(self, varname, variable):
-        pass
-
-    def analyze(self):
-        self.load_root_meson_file()
-        self.sanity_check_ast()
-        self.parse_project()
-        self.run()
+    return result
 
-def list_projinfo_from_source(sourcedir):
+def list_projinfo_from_source(sourcedir: str, intr: IntrospectionInterpreter):
     files = find_buildsystem_files_list(sourcedir)
+    files = [os.path.normpath(x) for x in files]
 
-    result = {'buildsystem_files': []}
-    subprojects = {}
-
-    for f in files:
-        f = f.replace('\\', '/')
-        if f == 'meson.build':
-            interpreter = ProjectInfoInterperter(sourcedir, '')
-            interpreter.analyze()
-            version = None
-            if interpreter.project_version is str:
-                version = interpreter.project_version
-            result.update({'version': version, 'descriptive_name': interpreter.project_name})
-            result['buildsystem_files'].append(f)
-        elif f.startswith('subprojects/'):
-            subproject_id = f.split('/')[1]
-            subproject = subprojects.setdefault(subproject_id, {'buildsystem_files': []})
-            subproject['buildsystem_files'].append(f)
-            if f.count('/') == 2 and f.endswith('meson.build'):
-                interpreter = ProjectInfoInterperter(os.path.join(sourcedir, 'subprojects', subproject_id), '')
-                interpreter.analyze()
-                subproject.update({'name': subproject_id, 'version': interpreter.project_version, 'descriptive_name': interpreter.project_name})
-        else:
-            result['buildsystem_files'].append(f)
+    for i in intr.project_data['subprojects']:
+        basedir = os.path.join(intr.subproject_dir, i['name'])
+        i['buildsystem_files'] = [x for x in files if x.startswith(basedir)]
+        files = [x for x in files if not x.startswith(basedir)]
+
+    intr.project_data['buildsystem_files'] = files
+    intr.project_data['subproject_dir'] = intr.subproject_dir
+    return intr.project_data
 
-    subprojects = [obj for name, obj in subprojects.items()]
-    result['subprojects'] = subprojects
-    print(json.dumps(result))
+def print_results(options, results, indent):
+    if not results and not options.force_dict:
+        print('No command specified')
+        return 1
+    elif len(results) == 1 and not options.force_dict:
+        # Make to keep the existing output format for a single option
+        print(json.dumps(results[0][1], indent=indent))
+    else:
+        out = {}
+        for i in results:
+            out[i[0]] = i[1]
+        print(json.dumps(out, indent=indent))
+    return 0
 
 def run(options):
     datadir = 'meson-private'
+    infodir = 'meson-info'
     if options.builddir is not None:
         datadir = os.path.join(options.builddir, datadir)
-    if options.builddir.endswith('/meson.build') or options.builddir.endswith('\\meson.build') or options.builddir == 'meson.build':
-        if options.projectinfo:
-            sourcedir = '.' if options.builddir == 'meson.build' else options.builddir[:-11]
-            list_projinfo_from_source(sourcedir)
-            return 0
-    if not os.path.isdir(datadir):
-        print('Current directory is not a build dir. Please specify it or '
-              'change the working directory to it.')
+        infodir = os.path.join(options.builddir, infodir)
+    indent = 4 if options.indent else None
+    results = []
+    sourcedir = '.' if options.builddir == 'meson.build' else options.builddir[:-11]
+    intro_types = get_meson_introspection_types(sourcedir=sourcedir)
+
+    if 'meson.build' in [os.path.basename(options.builddir), options.builddir]:
+        # Make sure that log entries in other parts of meson don't interfere with the JSON output
+        mlog.disable()
+        backend = backends.get_backend_from_name(options.backend, None)
+        intr = IntrospectionInterpreter(sourcedir, '', backend.name, visitors = [AstIDGenerator(), AstIndentationGenerator(), AstConditionLevel()])
+        intr.analyze()
+        # Reenable logging just in case
+        mlog.enable()
+        for key, val in intro_types.items():
+            if (not options.all and not getattr(options, key, False)) or 'no_bd' not in val:
+                continue
+            results += [(key, val['no_bd'](intr))]
+        return print_results(options, results, indent)
+
+    infofile = get_meson_info_file(infodir)
+    if not os.path.isdir(datadir) or not os.path.isdir(infodir) or not os.path.isfile(infofile):
+        print('Current directory is not a meson build directory.\n'
+              'Please specify a valid build dir or change the working directory to it.\n'
+              'It is also possible that the build directory was generated with an old\n'
+              'meson version. Please regenerate it in this case.')
         return 1
 
-    coredata = cdata.load(options.builddir)
-    builddata = build.load(options.builddir)
-    testdata = mtest.load_tests(options.builddir)
-    benchmarkdata = mtest.load_benchmarks(options.builddir)
-
-    # Install data is only available with the Ninja backend
-    try:
-        installdata = ninjabackend.load(options.builddir)
-    except FileNotFoundError:
-        installdata = None
-
-    if options.list_targets:
-        list_targets(coredata, builddata, installdata)
-    elif options.list_installed:
-        list_installed(installdata)
-    elif options.target_files is not None:
-        list_target_files(options.target_files, coredata, builddata)
-    elif options.buildsystem_files:
-        list_buildsystem_files(builddata)
-    elif options.buildoptions:
-        list_buildoptions(coredata, builddata)
-    elif options.tests:
-        list_tests(testdata)
-    elif options.benchmarks:
-        list_tests(benchmarkdata)
-    elif options.dependencies:
-        list_deps(coredata)
-    elif options.projectinfo:
-        list_projinfo(builddata)
+    intro_vers = '0.0.0'
+    with open(infofile, 'r') as fp:
+        raw = json.load(fp)
+        intro_vers = raw.get('introspection', {}).get('version', {}).get('full', '0.0.0')
+
+    vers_to_check = get_meson_introspection_required_version()
+    for i in vers_to_check:
+        if not mesonlib.version_compare(intro_vers, i):
+            print('Introspection version {} is not supported. '
+                  'The required version is: {}'
+                  .format(intro_vers, ' and '.join(vers_to_check)))
+            return 1
+
+    # Extract introspection information from JSON
+    for i in intro_types.keys():
+        if 'func' not in intro_types[i]:
+            continue
+        if not options.all and not getattr(options, i, False):
+            continue
+        curr = os.path.join(infodir, 'intro-{}.json'.format(i))
+        if not os.path.isfile(curr):
+            print('Introspection file {} does not exist.'.format(curr))
+            return 1
+        with open(curr, 'r') as fp:
+            results += [(i, json.load(fp))]
+
+    return print_results(options, results, indent)
+
+updated_introspection_files = []
+
+def write_intro_info(intro_info, info_dir):
+    global updated_introspection_files
+    for i in intro_info:
+        out_file = os.path.join(info_dir, 'intro-{}.json'.format(i[0]))
+        tmp_file = os.path.join(info_dir, 'tmp_dump.json')
+        with open(tmp_file, 'w') as fp:
+            json.dump(i[1], fp)
+            fp.flush() # Not sure if this is needed
+        os.replace(tmp_file, out_file)
+        updated_introspection_files += [i[0]]
+
+def generate_introspection_file(builddata: build.Build, backend: backends.Backend):
+    coredata = builddata.environment.get_coredata()
+    intro_types = get_meson_introspection_types(coredata=coredata, builddata=builddata, backend=backend)
+    intro_info = []
+
+    for key, val in intro_types.items():
+        if 'func' not in val:
+            continue
+        intro_info += [(key, val['func']())]
+
+    write_intro_info(intro_info, builddata.environment.info_dir)
+
+def update_build_options(coredata: cdata.CoreData, info_dir):
+    intro_info = [
+        ('buildoptions', list_buildoptions(coredata))
+    ]
+
+    write_intro_info(intro_info, info_dir)
+
+def split_version_string(version: str):
+    vers_list = version.split('.')
+    return {
+        'full': version,
+        'major': int(vers_list[0] if len(vers_list) > 0 else 0),
+        'minor': int(vers_list[1] if len(vers_list) > 1 else 0),
+        'patch': int(vers_list[2] if len(vers_list) > 2 else 0)
+    }
+
+def write_meson_info_file(builddata: build.Build, errors: list, build_files_updated: bool = False):
+    global updated_introspection_files
+    info_dir = builddata.environment.info_dir
+    info_file = get_meson_info_file(info_dir)
+    intro_types = get_meson_introspection_types()
+    intro_info = {}
+
+    for i in intro_types.keys():
+        if 'func' not in intro_types[i]:
+            continue
+        intro_info[i] = {
+            'file': 'intro-{}.json'.format(i),
+            'updated': i in updated_introspection_files
+        }
+
+    info_data = {
+        'meson_version': split_version_string(cdata.version),
+        'directories': {
+            'source': builddata.environment.get_source_dir(),
+            'build': builddata.environment.get_build_dir(),
+            'info': info_dir,
+        },
+        'introspection': {
+            'version': split_version_string(get_meson_introspection_version()),
+            'information': intro_info,
+        },
+        'build_files_updated': build_files_updated,
+    }
+
+    if errors:
+        info_data['error'] = True
+        info_data['error_list'] = [x if isinstance(x, str) else str(x) for x in errors]
     else:
-        print('No command specified')
-        return 1
-    return 0
+        info_data['error'] = False
+
+    # Write the data to disc
+    tmp_file = os.path.join(info_dir, 'tmp_dump.json')
+    with open(tmp_file, 'w') as fp:
+        json.dump(info_data, fp)
+        fp.flush()
+    os.replace(tmp_file, info_file)
diff -Nru meson-0.49.0/mesonbuild/mlog.py meson-0.52.1/mesonbuild/mlog.py
--- meson-0.49.0/mesonbuild/mlog.py	2018-12-09 14:27:23.000000000 +0000
+++ meson-0.52.1/mesonbuild/mlog.py	2019-11-28 17:37:44.000000000 +0000
@@ -18,13 +18,16 @@
 import time
 import platform
 from contextlib import contextmanager
+import typing
+from typing import Any, Generator, List, Optional, Sequence, TextIO, Union
 
 """This is (mostly) a standalone module used to write logging
 information about Meson runs. Some output goes to screen,
 some to logging dir and some goes to both."""
 
-def _windows_ansi():
-    from ctypes import windll, byref
+def _windows_ansi() -> bool:
+    # windll only exists on windows, so mypy will get mad
+    from ctypes import windll, byref  # type: ignore
     from ctypes.wintypes import DWORD
 
     kernel = windll.kernel32
@@ -35,30 +38,51 @@
     # ENABLE_VIRTUAL_TERMINAL_PROCESSING == 0x4
     # If the call to enable VT processing fails (returns 0), we fallback to
     # original behavior
-    return kernel.SetConsoleMode(stdout, mode.value | 0x4) or os.environ.get('ANSICON')
+    return bool(kernel.SetConsoleMode(stdout, mode.value | 0x4) or os.environ.get('ANSICON'))
 
-if platform.system().lower() == 'windows':
-    colorize_console = os.isatty(sys.stdout.fileno()) and _windows_ansi()
-else:
-    colorize_console = os.isatty(sys.stdout.fileno()) and os.environ.get('TERM') != 'dumb'
-log_dir = None
-log_file = None
-log_fname = 'meson-log.txt'
-log_depth = 0
-log_timestamp_start = None
-log_fatal_warnings = False
+try:
+    if platform.system().lower() == 'windows':
+        colorize_console = os.isatty(sys.stdout.fileno()) and _windows_ansi()  # type: bool
+    else:
+        colorize_console = os.isatty(sys.stdout.fileno()) and os.environ.get('TERM') != 'dumb'
+except Exception:
+    colorize_console = False
+log_dir = None               # type: Optional[str]
+log_file = None              # type: Optional[TextIO]
+log_fname = 'meson-log.txt'  # type: str
+log_depth = 0                # type: int
+log_timestamp_start = None   # type: Optional[float]
+log_fatal_warnings = False   # type: bool
+log_disable_stdout = False   # type: bool
+log_errors_only = False      # type: bool
+
+def disable() -> None:
+    global log_disable_stdout
+    log_disable_stdout = True
+
+def enable() -> None:
+    global log_disable_stdout
+    log_disable_stdout = False
+
+def set_quiet() -> None:
+    global log_errors_only
+    log_errors_only = True
+
+def set_verbose() -> None:
+    global log_errors_only
+    log_errors_only = False
 
-def initialize(logdir, fatal_warnings=False):
+def initialize(logdir: str, fatal_warnings: bool = False) -> None:
     global log_dir, log_file, log_fatal_warnings
     log_dir = logdir
     log_file = open(os.path.join(logdir, log_fname), 'w', encoding='utf8')
     log_fatal_warnings = fatal_warnings
 
-def set_timestamp_start(start):
+def set_timestamp_start(start: float) -> None:
     global log_timestamp_start
     log_timestamp_start = start
 
-def shutdown():
+def shutdown() -> Optional[str]:
     global log_file
     if log_file is not None:
         path = log_file.name
@@ -71,12 +95,12 @@
 class AnsiDecorator:
     plain_code = "\033[0m"
 
-    def __init__(self, text, code, quoted=False):
+    def __init__(self, text: str, code: str, quoted: bool = False):
         self.text = text
         self.code = code
         self.quoted = quoted
 
-    def get_text(self, with_codes):
+    def get_text(self, with_codes: bool) -> str:
         text = self.text
         if with_codes:
             text = self.code + self.text + AnsiDecorator.plain_code
@@ -84,26 +108,28 @@
             text = '"{}"'.format(text)
         return text
 
-def bold(text, quoted=False):
+def bold(text: str, quoted: bool = False) -> AnsiDecorator:
     return AnsiDecorator(text, "\033[1m", quoted=quoted)
 
-def red(text):
+def red(text: str) -> AnsiDecorator:
     return AnsiDecorator(text, "\033[1;31m")
 
-def green(text):
+def green(text: str) -> AnsiDecorator:
     return AnsiDecorator(text, "\033[1;32m")
 
-def yellow(text):
+def yellow(text: str) -> AnsiDecorator:
     return AnsiDecorator(text, "\033[1;33m")
 
-def blue(text):
+def blue(text: str) -> AnsiDecorator:
     return AnsiDecorator(text, "\033[1;34m")
 
-def cyan(text):
+def cyan(text: str) -> AnsiDecorator:
     return AnsiDecorator(text, "\033[1;36m")
 
-def process_markup(args, keep):
-    arr = []
+# This really should be AnsiDecorator or anything that implements
+# __str__(), but that requires protocols from typing_extensions
+def process_markup(args: Sequence[Union[AnsiDecorator, str]], keep: bool) -> List[str]:
+    arr = []  # type: List[str]
     if log_timestamp_start is not None:
         arr = ['[{:.3f}]'.format(time.monotonic() - log_timestamp_start)]
     for arg in args:
@@ -117,7 +143,10 @@
             arr.append(str(arg))
     return arr
 
-def force_print(*args, **kwargs):
+def force_print(*args: str, **kwargs: Any) -> None:
+    global log_disable_stdout
+    if log_disable_stdout:
+        return
     iostr = io.StringIO()
     kwargs['file'] = iostr
     print(*args, **kwargs)
@@ -134,39 +163,51 @@
         cleaned = raw.encode('ascii', 'replace').decode('ascii')
         print(cleaned, end='')
 
-def debug(*args, **kwargs):
+# We really want a heterogenous dict for this, but that's in typing_extensions
+def debug(*args: Union[str, AnsiDecorator], **kwargs: Any) -> None:
     arr = process_markup(args, False)
     if log_file is not None:
-        print(*arr, file=log_file, **kwargs) # Log file never gets ANSI codes.
+        print(*arr, file=log_file, **kwargs)
         log_file.flush()
 
-def log(*args, **kwargs):
+def log(*args: Union[str, AnsiDecorator], is_error: bool = False,
+        **kwargs: Any) -> None:
+    global log_errors_only
     arr = process_markup(args, False)
     if log_file is not None:
-        print(*arr, file=log_file, **kwargs) # Log file never gets ANSI codes.
+        print(*arr, file=log_file, **kwargs)
         log_file.flush()
     if colorize_console:
         arr = process_markup(args, True)
-    force_print(*arr, **kwargs)
+    if not log_errors_only or is_error:
+        force_print(*arr, **kwargs)
 
-def _log_error(severity, *args, **kwargs):
+def _log_error(severity: str, *rargs: Union[str, AnsiDecorator], **kwargs: Any) -> None:
     from .mesonlib import get_error_location_string
     from .environment import build_filename
     from .mesonlib import MesonException
+
+    # The tping requirements here are non-obvious. Lists are invariant,
+    # therefore List[A] and List[Union[A, B]] are not able to be joined
     if severity == 'warning':
-        args = (yellow('WARNING:'),) + args
+        label = [yellow('WARNING:')]  # type: List[Union[str, AnsiDecorator]]
     elif severity == 'error':
-        args = (red('ERROR:'),) + args
+        label = [red('ERROR:')]
     elif severity == 'deprecation':
-        args = (red('DEPRECATION:'),) + args
+        label = [red('DEPRECATION:')]
     else:
-        assert False, 'Invalid severity ' + severity
+        raise MesonException('Invalid severity ' + severity)
+    # rargs is a tuple, not a list
+    args = label + list(rargs)
 
     location = kwargs.pop('location', None)
     if location is not None:
         location_file = os.path.join(location.subdir, build_filename)
         location_str = get_error_location_string(location_file, location.lineno)
-        args = (location_str,) + args
+        # Unions are frankly awful, and we have to cast here to get mypy
+        # to understand that the list concatenation is safe
+        location_list = typing.cast(List[Union[str, AnsiDecorator]], [location_str])
+        args = location_list + args
 
     log(*args, **kwargs)
 
@@ -174,37 +215,44 @@
     if log_fatal_warnings:
         raise MesonException("Fatal warnings enabled, aborting")
 
-def error(*args, **kwargs):
-    return _log_error('error', *args, **kwargs)
+def error(*args: Union[str, AnsiDecorator], **kwargs: Any) -> None:
+    return _log_error('error', *args, **kwargs, is_error=True)
 
-def warning(*args, **kwargs):
-    return _log_error('warning', *args, **kwargs)
+def warning(*args: Union[str, AnsiDecorator], **kwargs: Any) -> None:
+    return _log_error('warning', *args, **kwargs, is_error=True)
 
-def deprecation(*args, **kwargs):
-    return _log_error('deprecation', *args, **kwargs)
+def deprecation(*args: Union[str, AnsiDecorator], **kwargs: Any) -> None:
+    return _log_error('deprecation', *args, **kwargs, is_error=True)
 
-def exception(e):
+def exception(e: Exception, prefix: Optional[AnsiDecorator] = None) -> None:
+    if prefix is None:
+        prefix = red('ERROR:')
     log()
+    args = []  # type: List[Union[AnsiDecorator, str]]
     if hasattr(e, 'file') and hasattr(e, 'lineno') and hasattr(e, 'colno'):
-        log('%s:%d:%d:' % (e.file, e.lineno, e.colno), red('ERROR: '), e)
-    else:
-        log(red('ERROR:'), e)
+        # Mypy can't figure this out, and it's pretty easy to vidual inspect
+        # that this is correct, so we'll just ignore it.
+        args.append('%s:%d:%d:' % (e.file, e.lineno, e.colno))  # type: ignore
+    if prefix:
+        args.append(prefix)
+    args.append(str(e))
+    log(*args)
 
 # Format a list for logging purposes as a string. It separates
 # all but the last item with commas, and the last with 'and'.
-def format_list(list):
-    l = len(list)
+def format_list(input_list: List[str]) -> str:
+    l = len(input_list)
     if l > 2:
-        return ' and '.join([', '.join(list[:-1]), list[-1]])
+        return ' and '.join([', '.join(input_list[:-1]), input_list[-1]])
     elif l == 2:
-        return ' and '.join(list)
+        return ' and '.join(input_list)
     elif l == 1:
-        return list[0]
+        return input_list[0]
     else:
         return ''
 
 @contextmanager
-def nested():
+def nested() -> Generator[None, None, None]:
     global log_depth
     log_depth += 1
     try:
diff -Nru meson-0.49.0/mesonbuild/modules/cmake.py meson-0.52.1/mesonbuild/modules/cmake.py
--- meson-0.49.0/mesonbuild/modules/cmake.py	1970-01-01 00:00:00.000000000 +0000
+++ meson-0.52.1/mesonbuild/modules/cmake.py	2019-11-28 17:37:44.000000000 +0000
@@ -0,0 +1,295 @@
+# Copyright 2018 The Meson development team
+
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+
+#     http://www.apache.org/licenses/LICENSE-2.0
+
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import re
+import os, os.path, pathlib
+import shutil
+
+from . import ExtensionModule, ModuleReturnValue
+
+from .. import build, dependencies, mesonlib, mlog
+from ..interpreterbase import permittedKwargs, FeatureNew, stringArgs, InterpreterObject, ObjectHolder
+from ..interpreter import ConfigurationDataHolder, InterpreterException, SubprojectHolder
+
+
+COMPATIBILITIES = ['AnyNewerVersion', 'SameMajorVersion', 'SameMinorVersion', 'ExactVersion']
+
+# Taken from https://github.com/Kitware/CMake/blob/master/Modules/CMakePackageConfigHelpers.cmake
+PACKAGE_INIT_BASE = '''
+####### Expanded from \\@PACKAGE_INIT\\@ by configure_package_config_file() #######
+####### Any changes to this file will be overwritten by the next CMake run ####
+####### The input file was @inputFileName@ ########
+
+get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/@PACKAGE_RELATIVE_PATH@" ABSOLUTE)
+'''
+PACKAGE_INIT_EXT = '''
+# Use original install prefix when loaded through a "/usr move"
+# cross-prefix symbolic link such as /lib -> /usr/lib.
+get_filename_component(_realCurr "${CMAKE_CURRENT_LIST_DIR}" REALPATH)
+get_filename_component(_realOrig "@absInstallDir@" REALPATH)
+if(_realCurr STREQUAL _realOrig)
+  set(PACKAGE_PREFIX_DIR "@installPrefix@")
+endif()
+unset(_realOrig)
+unset(_realCurr)
+'''
+PACKAGE_INIT_SET_AND_CHECK = '''
+macro(set_and_check _var _file)
+  set(${_var} "${_file}")
+  if(NOT EXISTS "${_file}")
+    message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !")
+  endif()
+endmacro()
+
+####################################################################################
+'''
+
+class CMakeSubprojectHolder(InterpreterObject, ObjectHolder):
+    def __init__(self, subp, pv):
+        assert(isinstance(subp, SubprojectHolder))
+        assert(hasattr(subp, 'cm_interpreter'))
+        InterpreterObject.__init__(self)
+        ObjectHolder.__init__(self, subp, pv)
+        self.methods.update({'get_variable': self.get_variable,
+                             'dependency': self.dependency,
+                             'include_directories': self.include_directories,
+                             'target': self.target,
+                             'target_type': self.target_type,
+                             'target_list': self.target_list,
+                             })
+
+    def _args_to_info(self, args):
+        if len(args) != 1:
+            raise InterpreterException('Exactly one argument is required.')
+
+        tgt = args[0]
+        res = self.held_object.cm_interpreter.target_info(tgt)
+        if res is None:
+            raise InterpreterException('The CMake target {} does not exist'.format(tgt))
+
+        # Make sure that all keys are present (if not this is a bug)
+        assert(all([x in res for x in ['inc', 'src', 'dep', 'tgt', 'func']]))
+        return res
+
+    @permittedKwargs({})
+    def get_variable(self, args, kwargs):
+        return self.held_object.get_variable_method(args, kwargs)
+
+    @permittedKwargs({})
+    def dependency(self, args, kwargs):
+        info = self._args_to_info(args)
+        return self.get_variable([info['dep']], kwargs)
+
+    @permittedKwargs({})
+    def include_directories(self, args, kwargs):
+        info = self._args_to_info(args)
+        return self.get_variable([info['inc']], kwargs)
+
+    @permittedKwargs({})
+    def target(self, args, kwargs):
+        info = self._args_to_info(args)
+        return self.get_variable([info['tgt']], kwargs)
+
+    @permittedKwargs({})
+    def target_type(self, args, kwargs):
+        info = self._args_to_info(args)
+        return info['func']
+
+    @permittedKwargs({})
+    def target_list(self, args, kwargs):
+        if len(args) > 0:
+            raise InterpreterException('target_list does not take any parameters.')
+        return self.held_object.cm_interpreter.target_list()
+
+class CmakeModule(ExtensionModule):
+    cmake_detected = False
+    cmake_root = None
+
+    def __init__(self, interpreter):
+        super().__init__(interpreter)
+        self.snippets.add('configure_package_config_file')
+        self.snippets.add('subproject')
+
+    def detect_voidp_size(self, env):
+        compilers = env.coredata.compilers.host
+        compiler = compilers.get('c', None)
+        if not compiler:
+            compiler = compilers.get('cpp', None)
+
+        if not compiler:
+            raise mesonlib.MesonException('Requires a C or C++ compiler to compute sizeof(void *).')
+
+        return compiler.sizeof('void *', '', env)
+
+    def detect_cmake(self):
+        if self.cmake_detected:
+            return True
+
+        cmakebin = dependencies.ExternalProgram('cmake', silent=False)
+        p, stdout, stderr = mesonlib.Popen_safe(cmakebin.get_command() + ['--system-information', '-G', 'Ninja'])[0:3]
+        if p.returncode != 0:
+            mlog.log('error retrieving cmake informations: returnCode={0} stdout={1} stderr={2}'.format(p.returncode, stdout, stderr))
+            return False
+
+        match = re.search('\nCMAKE_ROOT \\"([^"]+)"\n', stdout.strip())
+        if not match:
+            mlog.log('unable to determine cmake root')
+            return False
+
+        cmakePath = pathlib.PurePath(match.group(1))
+        self.cmake_root = os.path.join(*cmakePath.parts)
+        self.cmake_detected = True
+        return True
+
+    @permittedKwargs({'version', 'name', 'compatibility', 'install_dir'})
+    def write_basic_package_version_file(self, state, _args, kwargs):
+        version = kwargs.get('version', None)
+        if not isinstance(version, str):
+            raise mesonlib.MesonException('Version must be specified.')
+
+        name = kwargs.get('name', None)
+        if not isinstance(name, str):
+            raise mesonlib.MesonException('Name not specified.')
+
+        compatibility = kwargs.get('compatibility', 'AnyNewerVersion')
+        if not isinstance(compatibility, str):
+            raise mesonlib.MesonException('compatibility is not string.')
+        if compatibility not in COMPATIBILITIES:
+            raise mesonlib.MesonException('compatibility must be either AnyNewerVersion, SameMajorVersion or ExactVersion.')
+
+        if not self.detect_cmake():
+            raise mesonlib.MesonException('Unable to find cmake')
+
+        pkgroot = kwargs.get('install_dir', None)
+        if pkgroot is None:
+            pkgroot = os.path.join(state.environment.coredata.get_builtin_option('libdir'), 'cmake', name)
+        if not isinstance(pkgroot, str):
+            raise mesonlib.MesonException('Install_dir must be a string.')
+
+        template_file = os.path.join(self.cmake_root, 'Modules', 'BasicConfigVersion-{}.cmake.in'.format(compatibility))
+        if not os.path.exists(template_file):
+            raise mesonlib.MesonException('your cmake installation doesn\'t support the {} compatibility'.format(compatibility))
+
+        version_file = os.path.join(state.environment.scratch_dir, '{}ConfigVersion.cmake'.format(name))
+
+        conf = {
+            'CVF_VERSION': (version, ''),
+            'CMAKE_SIZEOF_VOID_P': (str(self.detect_voidp_size(state.environment)), '')
+        }
+        mesonlib.do_conf_file(template_file, version_file, conf, 'meson')
+
+        res = build.Data(mesonlib.File(True, state.environment.get_scratch_dir(), version_file), pkgroot)
+        return ModuleReturnValue(res, [res])
+
+    def create_package_file(self, infile, outfile, PACKAGE_RELATIVE_PATH, extra, confdata):
+        package_init = PACKAGE_INIT_BASE.replace('@PACKAGE_RELATIVE_PATH@', PACKAGE_RELATIVE_PATH)
+        package_init = package_init.replace('@inputFileName@', infile)
+        package_init += extra
+        package_init += PACKAGE_INIT_SET_AND_CHECK
+
+        try:
+            with open(infile, "r") as fin:
+                data = fin.readlines()
+        except Exception as e:
+            raise mesonlib.MesonException('Could not read input file %s: %s' % (infile, str(e)))
+
+        result = []
+        regex = re.compile(r'(?:\\\\)+(?=\\?@)|\\@|@([-a-zA-Z0-9_]+)@')
+        for line in data:
+            line = line.replace('@PACKAGE_INIT@', package_init)
+            line, _missing = mesonlib.do_replacement(regex, line, 'meson', confdata)
+
+            result.append(line)
+
+        outfile_tmp = outfile + "~"
+        with open(outfile_tmp, "w", encoding='utf-8') as fout:
+            fout.writelines(result)
+
+        shutil.copymode(infile, outfile_tmp)
+        mesonlib.replace_if_different(outfile, outfile_tmp)
+
+    @permittedKwargs({'input', 'name', 'install_dir', 'configuration'})
+    def configure_package_config_file(self, interpreter, state, args, kwargs):
+        if args:
+            raise mesonlib.MesonException('configure_package_config_file takes only keyword arguments.')
+
+        if 'input' not in kwargs:
+            raise mesonlib.MesonException('configure_package_config_file requires "input" keyword.')
+        inputfile = kwargs['input']
+        if isinstance(inputfile, list):
+            if len(inputfile) != 1:
+                m = "Keyword argument 'input' requires exactly one file"
+                raise mesonlib.MesonException(m)
+            inputfile = inputfile[0]
+        if not isinstance(inputfile, (str, mesonlib.File)):
+            raise mesonlib.MesonException("input must be a string or a file")
+        if isinstance(inputfile, str):
+            inputfile = mesonlib.File.from_source_file(state.environment.source_dir, state.subdir, inputfile)
+
+        ifile_abs = inputfile.absolute_path(state.environment.source_dir, state.environment.build_dir)
+
+        if 'name' not in kwargs:
+            raise mesonlib.MesonException('"name" not specified.')
+        name = kwargs['name']
+
+        (ofile_path, ofile_fname) = os.path.split(os.path.join(state.subdir, '{}Config.cmake'.format(name)))
+        ofile_abs = os.path.join(state.environment.build_dir, ofile_path, ofile_fname)
+
+        if 'install_dir' not in kwargs:
+            install_dir = os.path.join(state.environment.coredata.get_builtin_option('libdir'), 'cmake', name)
+        if not isinstance(install_dir, str):
+            raise mesonlib.MesonException('"install_dir" must be a string.')
+
+        if 'configuration' not in kwargs:
+            raise mesonlib.MesonException('"configuration" not specified.')
+        conf = kwargs['configuration']
+        if not isinstance(conf, ConfigurationDataHolder):
+            raise mesonlib.MesonException('Argument "configuration" is not of type configuration_data')
+
+        prefix = state.environment.coredata.get_builtin_option('prefix')
+        abs_install_dir = install_dir
+        if not os.path.isabs(abs_install_dir):
+            abs_install_dir = os.path.join(prefix, install_dir)
+
+        PACKAGE_RELATIVE_PATH = os.path.relpath(prefix, abs_install_dir)
+        extra = ''
+        if re.match('^(/usr)?/lib(64)?/.+', abs_install_dir):
+            extra = PACKAGE_INIT_EXT.replace('@absInstallDir@', abs_install_dir)
+            extra = extra.replace('@installPrefix@', prefix)
+
+        self.create_package_file(ifile_abs, ofile_abs, PACKAGE_RELATIVE_PATH, extra, conf.held_object)
+        conf.mark_used()
+
+        conffile = os.path.normpath(inputfile.relative_name())
+        if conffile not in interpreter.build_def_files:
+            interpreter.build_def_files.append(conffile)
+
+        res = build.Data(mesonlib.File(True, ofile_path, ofile_fname), install_dir)
+        interpreter.build.data.append(res)
+
+        return res
+
+    @FeatureNew('subproject', '0.51.0')
+    @permittedKwargs({'cmake_options', 'required'})
+    @stringArgs
+    def subproject(self, interpreter, state, args, kwargs):
+        if len(args) != 1:
+            raise InterpreterException('Subproject takes exactly one argument')
+        dirname = args[0]
+        subp = interpreter.do_subproject(dirname, 'cmake', kwargs)
+        if not subp.held_object:
+            return subp
+        return CMakeSubprojectHolder(subp, dirname)
+
+def initialize(*args, **kwargs):
+    return CmakeModule(*args, **kwargs)
diff -Nru meson-0.49.0/mesonbuild/modules/gnome.py meson-0.52.1/mesonbuild/modules/gnome.py
--- meson-0.49.0/mesonbuild/modules/gnome.py	2018-12-09 14:27:23.000000000 +0000
+++ meson-0.52.1/mesonbuild/modules/gnome.py	2019-11-28 17:37:44.000000000 +0000
@@ -17,19 +17,20 @@
 
 import os
 import copy
-import shlex
 import subprocess
+import functools
 
 from .. import build
 from .. import mlog
 from .. import mesonlib
-from .. import compilers
 from .. import interpreter
 from . import GResourceTarget, GResourceHeaderTarget, GirTarget, TypelibTarget, VapiTarget
 from . import get_include_args
 from . import ExtensionModule
 from . import ModuleReturnValue
-from ..mesonlib import MesonException, OrderedSet, Popen_safe, extract_as_list
+from ..mesonlib import (
+    MachineChoice, MesonException, OrderedSet, Popen_safe, extract_as_list, join_args
+)
 from ..dependencies import Dependency, PkgConfigDependency, InternalDependency
 from ..interpreterbase import noKwargs, permittedKwargs, FeatureNew, FeatureNewKwargs
 
@@ -41,24 +42,20 @@
 gresource_dep_needed_version = '>= 2.51.1'
 
 native_glib_version = None
-girwarning_printed = False
-gdbuswarning_printed = False
-gresource_warning_printed = False
-_gir_has_extra_lib_arg = None
-
-def gir_has_extra_lib_arg(intr_obj):
-    global _gir_has_extra_lib_arg
-    if _gir_has_extra_lib_arg is not None:
-        return _gir_has_extra_lib_arg
 
-    _gir_has_extra_lib_arg = False
+@functools.lru_cache(maxsize=None)
+def gir_has_option(intr_obj, option):
     try:
-        g_ir_scanner = intr_obj.find_program_impl('g-ir-scanner').get_command()
-        opts = Popen_safe(g_ir_scanner + ['--help'], stderr=subprocess.STDOUT)[1]
-        _gir_has_extra_lib_arg = '--extra-library' in opts
+        g_ir_scanner = intr_obj.find_program_impl('g-ir-scanner')
+        # Handle overriden g-ir-scanner
+        if isinstance(getattr(g_ir_scanner, "held_object", g_ir_scanner), interpreter.OverrideProgram):
+            assert option in ['--extra-library', '--sources-top-dirs']
+            return True
+
+        opts = Popen_safe(g_ir_scanner.get_command() + ['--help'], stderr=subprocess.STDOUT)[1]
+        return option in opts
     except (MesonException, FileNotFoundError, subprocess.CalledProcessError):
-        pass
-    return _gir_has_extra_lib_arg
+        return False
 
 class GnomeModule(ExtensionModule):
     gir_dep = None
@@ -77,24 +74,20 @@
                 native_glib_version = '2.54'
         return native_glib_version
 
+    @mesonlib.run_once
     def __print_gresources_warning(self, state):
-        global gresource_warning_printed
-        if not gresource_warning_printed:
-            if not mesonlib.version_compare(self._get_native_glib_version(state), gresource_dep_needed_version):
-                mlog.warning('GLib compiled dependencies do not work reliably with \n'
-                             'the current version of GLib. See the following upstream issue:',
-                             mlog.bold('https://bugzilla.gnome.org/show_bug.cgi?id=774368'))
-            gresource_warning_printed = True
-        return []
+        if not mesonlib.version_compare(self._get_native_glib_version(state),
+                                        gresource_dep_needed_version):
+            mlog.warning('GLib compiled dependencies do not work reliably with \n'
+                         'the current version of GLib. See the following upstream issue:',
+                         mlog.bold('https://bugzilla.gnome.org/show_bug.cgi?id=774368'))
 
     @staticmethod
+    @mesonlib.run_once
     def _print_gdbus_warning():
-        global gdbuswarning_printed
-        if not gdbuswarning_printed:
-            mlog.warning('Code generated with gdbus_codegen() requires the root directory be added to\n'
-                         '  include_directories of targets with GLib < 2.51.3:',
-                         mlog.bold('https://github.com/mesonbuild/meson/issues/1387'))
-            gdbuswarning_printed = True
+        mlog.warning('Code generated with gdbus_codegen() requires the root directory be added to\n'
+                     '  include_directories of targets with GLib < 2.51.3:',
+                     mlog.bold('https://github.com/mesonbuild/meson/issues/1387'))
 
     @FeatureNewKwargs('gnome.compile_resources', '0.37.0', ['gresource_bundle', 'export', 'install_header'])
     @permittedKwargs({'source_dir', 'c_name', 'dependencies', 'export', 'gresource_bundle', 'install_header',
@@ -296,6 +289,9 @@
         if isinstance(lib, build.SharedLibrary):
             libdir = os.path.join(state.environment.get_build_dir(), state.backend.get_target_dir(lib))
             link_command.append('-L' + libdir)
+            if include_rpath:
+                link_command.append('-Wl,-rpath,' + libdir)
+            depends.append(lib)
             # Needed for the following binutils bug:
             # https://github.com/mesonbuild/meson/issues/1911
             # However, g-ir-scanner does not understand -Wl,-rpath
@@ -305,10 +301,7 @@
                 link_command.append('-L' + d)
                 if include_rpath:
                     link_command.append('-Wl,-rpath,' + d)
-            if include_rpath:
-                link_command.append('-Wl,-rpath,' + libdir)
-            depends.append(lib)
-        if gir_has_extra_lib_arg(self.interpreter) and use_gir_args:
+        if gir_has_option(self.interpreter, '--extra-library') and use_gir_args:
             link_command.append('--extra-library=' + lib.name)
         else:
             link_command.append('-l' + lib.name)
@@ -392,7 +385,7 @@
                 mlog.log('dependency {!r} not handled to build gir files'.format(dep))
                 continue
 
-        if gir_has_extra_lib_arg(self.interpreter) and use_gir_args:
+        if gir_has_option(self.interpreter, '--extra-library') and use_gir_args:
             def fix_ldflags(ldflags):
                 fixed_ldflags = OrderedSet()
                 for ldflag in ldflags:
@@ -530,11 +523,7 @@
         ret = []
 
         for lang in langs:
-            if state.environment.is_cross_build():
-                link_args = state.environment.cross_info.config["properties"].get(lang + '_link_args', "")
-            else:
-                link_args = state.environment.coredata.get_external_link_args(lang)
-
+            link_args = state.environment.coredata.get_external_link_args(MachineChoice.HOST, lang)
             for link_arg in link_args:
                 if link_arg.startswith('-L'):
                     ret.append(link_arg)
@@ -554,6 +543,11 @@
                     libname = girtarget.get_basename()
                 else:
                     libname = os.path.join("@PRIVATE_OUTDIR_ABS_%s@" % girtarget.get_id(), girtarget.get_filename())
+                ret += ['--library', libname]
+                # need to put our output directory first as we need to use the
+                # generated libraries instead of any possibly installed system/prefix
+                # ones.
+                ret += ["-L@PRIVATE_OUTDIR_ABS_%s@" % girtarget.get_id()]
                 # Needed for the following binutils bug:
                 # https://github.com/mesonbuild/meson/issues/1911
                 # However, g-ir-scanner does not understand -Wl,-rpath
@@ -561,11 +555,6 @@
                 for d in state.backend.determine_rpath_dirs(girtarget):
                     d = os.path.join(state.environment.get_build_dir(), d)
                     ret.append('-L' + d)
-                ret += ['--library', libname]
-                # need to put our output directory first as we need to use the
-                # generated libraries instead of any possibly installed system/prefix
-                # ones.
-                ret += ["-L@PRIVATE_OUTDIR_ABS_%s@" % girtarget.get_id()]
 
         return ret
 
@@ -605,12 +594,18 @@
                 cflags += state.project_args[lang]
             if 'b_sanitize' in compiler.base_options:
                 sanitize = state.environment.coredata.base_options['b_sanitize'].value
-                cflags += compilers.sanitizer_compile_args(sanitize)
-                if 'address' in sanitize.split(','):
-                    internal_ldflags += ['-lasan']  # This must be first in ldflags
-                # FIXME: Linking directly to libasan is not recommended but g-ir-scanner
+                cflags += compiler.sanitizer_compile_args(sanitize)
+                sanitize = sanitize.split(',')
+                # These must be first in ldflags
+                if 'address' in sanitize:
+                    internal_ldflags += ['-lasan']
+                if 'thread' in sanitize:
+                    internal_ldflags += ['-ltsan']
+                if 'undefined' in sanitize:
+                    internal_ldflags += ['-lubsan']
+                # FIXME: Linking directly to lib*san is not recommended but g-ir-scanner
                 # does not understand -f LDFLAGS. https://bugzilla.gnome.org/show_bug.cgi?id=783892
-                # ldflags += compilers.sanitizer_link_args(sanitize)
+                # ldflags += compiler.sanitizer_link_args(sanitize)
 
         return cflags, internal_ldflags, external_ldflags
 
@@ -713,10 +708,7 @@
     def _get_external_args_for_langs(self, state, langs):
         ret = []
         for lang in langs:
-            if state.environment.is_cross_build():
-                ret += state.environment.cross_info.config["properties"].get(lang + '_args', "")
-            else:
-                ret += state.environment.coredata.get_external_args(lang)
+            ret += state.environment.coredata.get_external_args(MachineChoice.HOST, lang)
         return ret
 
     @staticmethod
@@ -805,6 +797,10 @@
         scan_command += self._scan_langs(state, [lc[0] for lc in langs_compilers])
         scan_command += list(external_ldflags)
 
+        if gir_has_option(self.interpreter, '--sources-top-dirs'):
+            scan_command += ['--sources-top-dirs', os.path.join(state.environment.get_source_dir(), self.interpreter.subproject_dir, state.subproject)]
+            scan_command += ['--sources-top-dirs', os.path.join(state.environment.get_build_dir(), self.interpreter.subproject_dir, state.subproject)]
+
         scan_target = self._make_gir_target(state, girfile, scan_command, depends, kwargs)
 
         typelib_output = '%s-%s.typelib' % (ns, nsversion)
@@ -907,6 +903,7 @@
         rv = [inscript, pottarget, potarget]
         return ModuleReturnValue(None, rv)
 
+    @FeatureNewKwargs('gnome.gtkdoc', '0.52.0', ['check'])
     @FeatureNewKwargs('gnome.gtkdoc', '0.48.0', ['c_args'])
     @FeatureNewKwargs('gnome.gtkdoc', '0.48.0', ['module_version'])
     @FeatureNewKwargs('gnome.gtkdoc', '0.37.0', ['namespace', 'mode'])
@@ -970,6 +967,11 @@
                 '--modulename=' + modulename,
                 '--moduleversion=' + moduleversion,
                 '--mode=' + mode]
+        for tool in ['scan', 'scangobj', 'mkdb', 'mkhtml', 'fixxref']:
+            program_name = 'gtkdoc-' + tool
+            program = self.interpreter.find_program_impl(program_name)
+            path = program.held_object.get_path()
+            args.append('--{}={}'.format(program_name, path))
         if namespace:
             args.append('--namespace=' + namespace)
         args += self._unpack_args('--htmlargs=', 'html_args', kwargs)
@@ -1013,16 +1015,32 @@
         args += self._unpack_args('--ignore-headers=', 'ignore_headers', kwargs)
         args += self._unpack_args('--installdir=', 'install_dir', kwargs)
         args += self._get_build_args(kwargs, state, depends)
-        res = [build.RunTarget(targetname, command[0], command[1:] + args, depends, state.subdir, state.subproject)]
+        custom_kwargs = {'output': modulename + '-decl.txt',
+                         'command': command + args,
+                         'depends': depends,
+                         'build_always_stale': True,
+                         }
+        custom_target = build.CustomTarget(targetname, state.subdir, state.subproject, custom_kwargs)
+        alias_target = build.AliasTarget(targetname, [custom_target], state.subdir, state.subproject)
+        if kwargs.get('check', False):
+            check_cmd = self.interpreter.find_program_impl('gtkdoc-check')
+            check_env = ['DOC_MODULE=' + modulename,
+                         'DOC_MAIN_SGML_FILE=' + main_file]
+            check_args = [targetname + '-check', check_cmd]
+            check_kwargs = {'env': check_env,
+                            'workdir': os.path.join(state.environment.get_build_dir(), state.subdir),
+                            'depends': custom_target}
+            self.interpreter.add_test(state.current_node, check_args, check_kwargs, True)
+        res = [custom_target, alias_target]
         if kwargs.get('install', True):
             res.append(build.RunScript(command, args))
-        return ModuleReturnValue(None, res)
+        return ModuleReturnValue(custom_target, res)
 
     def _get_build_args(self, kwargs, state, depends):
         args = []
         deps = extract_as_list(kwargs, 'dependencies', unholder=True)
-        cflags = OrderedSet()
-        cflags.update(mesonlib.stringlistify(kwargs.pop('c_args', [])))
+        cflags = []
+        cflags.extend(mesonlib.stringlistify(kwargs.pop('c_args', [])))
         deps_cflags, internal_ldflags, external_ldflags, gi_includes = \
             self._get_dependencies_flags(deps, state, depends, include_rpath=True)
         inc_dirs = mesonlib.extract_as_list(kwargs, 'include_directories')
@@ -1031,32 +1049,27 @@
                 raise MesonException(
                     'Gir include dirs should be include_directories().')
 
-        cflags.update(deps_cflags)
-        cflags.update(get_include_args(inc_dirs))
-        ldflags = OrderedSet()
-        ldflags.update(internal_ldflags)
-        ldflags.update(external_ldflags)
-
-        if state.environment.is_cross_build():
-            cflags.update(state.environment.cross_info.config["properties"].get('c_args', ""))
-            ldflags.update(state.environment.cross_info.config["properties"].get('c_link_args', ""))
-            compiler = state.environment.coredata.cross_compilers.get('c')
-        else:
-            cflags.update(state.environment.coredata.get_external_args('c'))
-            ldflags.update(state.environment.coredata.get_external_link_args('c'))
-            compiler = state.environment.coredata.compilers.get('c')
+        cflags.extend(deps_cflags)
+        cflags.extend(get_include_args(inc_dirs))
+        ldflags = []
+        ldflags.extend(internal_ldflags)
+        ldflags.extend(external_ldflags)
+
+        cflags.extend(state.environment.coredata.get_external_args(MachineChoice.HOST, 'c'))
+        ldflags.extend(state.environment.coredata.get_external_link_args(MachineChoice.HOST, 'c'))
+        compiler = state.environment.coredata.compilers[MachineChoice.HOST]['c']
 
         compiler_flags = self._get_langs_compilers_flags(state, [('c', compiler)])
-        cflags.update(compiler_flags[0])
-        ldflags.update(compiler_flags[1])
-        ldflags.update(compiler_flags[2])
+        cflags.extend(compiler_flags[0])
+        ldflags.extend(compiler_flags[1])
+        ldflags.extend(compiler_flags[2])
         if compiler:
-            args += ['--cc=%s' % ' '.join([shlex.quote(x) for x in compiler.get_exelist()])]
-            args += ['--ld=%s' % ' '.join([shlex.quote(x) for x in compiler.get_linker_exelist()])]
+            args += ['--cc=%s' % join_args(compiler.get_exelist())]
+            args += ['--ld=%s' % join_args(compiler.get_linker_exelist())]
         if cflags:
-            args += ['--cflags=%s' % ' '.join([shlex.quote(x) for x in cflags])]
+            args += ['--cflags=%s' % join_args(cflags)]
         if ldflags:
-            args += ['--ldflags=%s' % ' '.join([shlex.quote(x) for x in ldflags])]
+            args += ['--ldflags=%s' % join_args(ldflags)]
 
         return args
 
@@ -1411,7 +1424,7 @@
         c_file_kwargs['vtail'] = '''    { 0, NULL, NULL }
   };
   if (g_once_init_enter (>ype_id)) {
-    GType new_type = g_@type@_register_static ("@EnumName@", values);
+    GType new_type = g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);
     g_once_init_leave (>ype_id, new_type);
   }
   return (GType) gtype_id;
diff -Nru meson-0.49.0/mesonbuild/modules/hotdoc.py meson-0.52.1/mesonbuild/modules/hotdoc.py
--- meson-0.49.0/mesonbuild/modules/hotdoc.py	2018-12-09 14:27:23.000000000 +0000
+++ meson-0.52.1/mesonbuild/modules/hotdoc.py	2019-11-28 15:13:28.000000000 +0000
@@ -76,16 +76,33 @@
             return
 
         if isinstance(value, bool):
-            self.cmd.append(option)
+            if value:
+                self.cmd.append(option)
         elif isinstance(value, list):
             # Do not do anything on empty lists
             if value:
+                # https://bugs.python.org/issue9334 (from 2010 :( )
+                # The syntax with nargs=+ is inherently ambiguous
+                # A workaround for this case is to simply prefix with a space
+                # every value starting with a dash
+                escaped_value = []
+                for e in value:
+                    if isinstance(e, str) and e.startswith('-'):
+                        escaped_value += [' %s' % e]
+                    else:
+                        escaped_value += [e]
                 if option:
-                    self.cmd.extend([option] + value)
+                    self.cmd.extend([option] + escaped_value)
                 else:
-                    self.cmd.extend(value)
+                    self.cmd.extend(escaped_value)
         else:
-            self.cmd.extend([option, value])
+            # argparse gets confused if value(s) start with a dash.
+            # When an option expects a single value, the unambiguous way
+            # to specify it is with =
+            if isinstance(value, str):
+                self.cmd.extend(['%s=%s' % (option, value)])
+            else:
+                self.cmd.extend([option, value])
 
     def check_extra_arg_type(self, arg, value):
         value = getattr(value, 'held_object', value)
@@ -155,6 +172,19 @@
     def replace_dirs_in_string(self, string):
         return string.replace("@SOURCE_ROOT@", self.sourcedir).replace("@BUILD_ROOT@", self.builddir)
 
+    def process_gi_c_source_roots(self):
+        if self.hotdoc.run_hotdoc(['--has-extension=gi-extension']) != 0:
+            return
+
+        value, _ = self.get_value([list, str], 'gi_c_source_roots', default=[], force_list=True)
+        value.extend([
+            os.path.join(self.state.environment.get_source_dir(),
+                         self.interpreter.subproject_dir, self.state.subproject),
+            os.path.join(self.state.environment.get_build_dir(), self.interpreter.subproject_dir, self.state.subproject)
+        ])
+
+        self.cmd += ['--gi-c-source-roots'] + value
+
     def process_dependencies(self, deps):
         cflags = set()
         for dep in mesonlib.listify(ensure_list(deps)):
@@ -271,6 +301,7 @@
         self.process_known_arg('--c-include-directories',
                                [Dependency, build.StaticLibrary, build.SharedLibrary, list], argname="dependencies",
                                force_list=True, value_processor=self.process_dependencies)
+        self.process_gi_c_source_roots()
         self.process_extra_assets()
         self.process_extra_extension_paths()
         self.process_subprojects()
@@ -294,6 +325,9 @@
 
         for path in self.include_paths.keys():
             self.cmd.extend(['--include-path', path])
+
+        if self.state.environment.coredata.get_builtin_option('werror'):
+            self.cmd.append('--fatal-warning')
         self.generate_hotdoc_config()
 
         target_cmd = self.build_command + ["--internal", "hotdoc"] + \
diff -Nru meson-0.49.0/mesonbuild/modules/i18n.py meson-0.52.1/mesonbuild/modules/i18n.py
--- meson-0.49.0/mesonbuild/modules/i18n.py	2018-12-09 14:27:16.000000000 +0000
+++ meson-0.52.1/mesonbuild/modules/i18n.py	2019-09-28 23:52:33.000000000 +0000
@@ -15,8 +15,8 @@
 import shutil
 
 from os import path
-from .. import coredata, mesonlib, build
-from ..mesonlib import MesonException
+from .. import coredata, mesonlib, build, mlog
+from ..mesonlib import MesonException, run_once
 from . import ModuleReturnValue
 from . import ExtensionModule
 from ..interpreterbase import permittedKwargs, FeatureNew, FeatureNewKwargs
@@ -44,21 +44,38 @@
         '--flag=g_string_append_printf:2:c-format',
         '--flag=g_error_new:3:c-format',
         '--flag=g_set_error:4:c-format',
+        '--flag=g_markup_printf_escaped:1:c-format',
+        '--flag=g_log:3:c-format',
+        '--flag=g_print:1:c-format',
+        '--flag=g_printerr:1:c-format',
+        '--flag=g_printf:1:c-format',
+        '--flag=g_fprintf:2:c-format',
+        '--flag=g_sprintf:2:c-format',
+        '--flag=g_snprintf:3:c-format',
     ]
 }
 
+
 class I18nModule(ExtensionModule):
 
     @staticmethod
+    @run_once
+    def nogettext_warning():
+        mlog.warning('Gettext not found, all translation targets will be ignored.')
+        return ModuleReturnValue(None, [])
+
+    @staticmethod
     def _get_data_dirs(state, dirs):
         """Returns source directories of relative paths"""
         src_dir = path.join(state.environment.get_source_dir(), state.subdir)
         return [path.join(src_dir, d) for d in dirs]
 
     @FeatureNew('i18n.merge_file', '0.37.0')
-    @permittedKwargs({'languages', 'data_dirs', 'preset', 'args', 'po_dir', 'type',
-                      'input', 'output', 'install', 'install_dir'})
+    @FeatureNewKwargs('i18n.merge_file', '0.51.0', ['args'])
+    @permittedKwargs(build.CustomTarget.known_kwargs | {'data_dirs', 'po_dir', 'type', 'args'})
     def merge_file(self, state, args, kwargs):
+        if not shutil.which('xgettext'):
+            return self.nogettext_warning()
         podir = kwargs.pop('po_dir', None)
         if not podir:
             raise MesonException('i18n: po_dir is a required kwarg')
@@ -79,6 +96,10 @@
         if datadirs:
             command.append(datadirs)
 
+        if 'args' in kwargs:
+            command.append('--')
+            command.append(mesonlib.stringlistify(kwargs.pop('args', [])))
+
         kwargs['command'] = command
 
         inputfile = kwargs['input']
@@ -102,12 +123,13 @@
         return ModuleReturnValue(ct, [ct])
 
     @FeatureNewKwargs('i18n.gettext', '0.37.0', ['preset'])
-    @permittedKwargs({'po_dir', 'data_dirs', 'type', 'languages', 'args', 'preset', 'install'})
+    @FeatureNewKwargs('i18n.gettext', '0.50.0', ['install_dir'])
+    @permittedKwargs({'po_dir', 'data_dirs', 'type', 'languages', 'args', 'preset', 'install', 'install_dir'})
     def gettext(self, state, args, kwargs):
         if len(args) != 1:
             raise coredata.MesonException('Gettext requires one positional argument (package name).')
         if not shutil.which('xgettext'):
-            raise coredata.MesonException('Can not do gettext because xgettext is not installed.')
+            return self.nogettext_warning()
         packagename = args[0]
         languages = mesonlib.stringlistify(kwargs.get('languages', []))
         datadirs = self._get_data_dirs(state, mesonlib.stringlistify(kwargs.get('data_dirs', [])))
@@ -151,10 +173,11 @@
 
         install = kwargs.get('install', True)
         if install:
+            install_dir = kwargs.get('install_dir', state.environment.coredata.get_builtin_option('localedir'))
             script = state.environment.get_build_command()
             args = ['--internal', 'gettext', 'install',
                     '--subdir=' + state.subdir,
-                    '--localedir=' + state.environment.coredata.get_builtin_option('localedir'),
+                    '--localedir=' + install_dir,
                     pkg_arg]
             if lang_arg:
                 args.append(lang_arg)
diff -Nru meson-0.49.0/mesonbuild/modules/pkgconfig.py meson-0.52.1/mesonbuild/modules/pkgconfig.py
--- meson-0.49.0/mesonbuild/modules/pkgconfig.py	2018-12-09 14:27:23.000000000 +0000
+++ meson-0.52.1/mesonbuild/modules/pkgconfig.py	2019-11-28 17:37:44.000000000 +0000
@@ -23,6 +23,8 @@
 from . import ExtensionModule
 from ..interpreterbase import permittedKwargs, FeatureNew, FeatureNewKwargs
 
+already_warned_objs = set()
+
 class DependenciesHelper:
     def __init__(self, name):
         self.name = name
@@ -35,13 +37,13 @@
 
     def add_pub_libs(self, libs):
         libs, reqs, cflags = self._process_libs(libs, True)
-        self.pub_libs += libs
+        self.pub_libs = libs + self.pub_libs # prepend to preserve dependencies
         self.pub_reqs += reqs
         self.cflags += cflags
 
     def add_priv_libs(self, libs):
         libs, reqs, _ = self._process_libs(libs, False)
-        self.priv_libs += libs
+        self.priv_libs = libs + self.priv_libs
         self.priv_reqs += reqs
 
     def add_pub_reqs(self, reqs):
@@ -51,16 +53,21 @@
         self.priv_reqs += self._process_reqs(reqs)
 
     def _check_generated_pc_deprecation(self, obj):
-        if hasattr(obj, 'generated_pc_warn'):
-            mlog.deprecation('Library', mlog.bold(obj.name), 'was passed to the '
-                             '"libraries" keyword argument of a previous call '
-                             'to generate() method instead of first positional '
-                             'argument.', 'Adding', mlog.bold(obj.generated_pc),
-                             'to "Requires" field, but this is a deprecated '
-                             'behaviour that will change in a future version '
-                             'of Meson. Please report the issue if this '
-                             'warning cannot be avoided in your case.',
-                             location=obj.generated_pc_warn)
+        if not hasattr(obj, 'generated_pc_warn'):
+            return
+        name = obj.generated_pc_warn[0]
+        if (name, obj.name) in already_warned_objs:
+            return
+        mlog.deprecation('Library', mlog.bold(obj.name), 'was passed to the '
+                         '"libraries" keyword argument of a previous call '
+                         'to generate() method instead of first positional '
+                         'argument.', 'Adding', mlog.bold(obj.generated_pc),
+                         'to "Requires" field, but this is a deprecated '
+                         'behaviour that will change in a future version '
+                         'of Meson. Please report the issue if this '
+                         'warning cannot be avoided in your case.',
+                         location=obj.generated_pc_warn[1])
+        already_warned_objs.add((name, obj.name))
 
     def _process_reqs(self, reqs):
         '''Returns string names of requirements'''
@@ -84,6 +91,8 @@
                 self.add_version_reqs(name, version_req)
             elif isinstance(obj, dependencies.Dependency) and not obj.found():
                 pass
+            elif isinstance(obj, dependencies.ThreadDependency):
+                pass
             else:
                 raise mesonlib.MesonException('requires argument not a string, '
                                               'library with pkgconfig-generated file '
@@ -139,10 +148,10 @@
             elif isinstance(obj, (build.SharedLibrary, build.StaticLibrary)):
                 processed_libs.append(obj)
                 if isinstance(obj, build.StaticLibrary) and public:
-                    self.add_pub_libs(obj.get_dependencies(internal=False))
+                    self.add_pub_libs(obj.get_dependencies(for_pkgconfig=True))
                     self.add_pub_libs(obj.get_external_deps())
                 else:
-                    self.add_priv_libs(obj.get_dependencies(internal=False))
+                    self.add_priv_libs(obj.get_dependencies(for_pkgconfig=True))
                     self.add_priv_libs(obj.get_external_deps())
             elif isinstance(obj, str):
                 processed_libs.append(obj)
@@ -192,7 +201,11 @@
             for x in xs:
                 # Don't de-dup unknown strings to avoid messing up arguments like:
                 # ['-framework', 'CoreAudio', '-framework', 'CoreMedia']
-                if x not in result or (libs and (isinstance(x, str) and not x.endswith(('-l', '-L')))):
+                known_flags = ['-pthread']
+                cannot_dedup = libs and isinstance(x, str) and \
+                    not x.startswith(('-l', '-L')) and \
+                    x not in known_flags
+                if x not in result or cannot_dedup:
                     result.append(x)
             return result
         self.pub_libs = _fn(self.pub_libs, True)
@@ -227,7 +240,7 @@
 
     def _escape(self, value):
         '''
-        We cannot use shlex.quote because it quotes with ' and " which does not
+        We cannot use quote_arg because it quotes with ' and " which does not
         work with pkg-config and pkgconf at all.
         '''
         # We should always write out paths with / because pkg-config requires
@@ -235,7 +248,7 @@
         # https://bugs.freedesktop.org/show_bug.cgi?id=103203
         if isinstance(value, PurePath):
             value = value.as_posix()
-        return value.replace(' ', '\ ')
+        return value.replace(' ', r'\ ')
 
     def _make_relative(self, prefix, subdir):
         if isinstance(prefix, PurePath):
@@ -256,7 +269,7 @@
         # These always return paths relative to prefix
         libdir = PurePath(coredata.get_builtin_option('libdir'))
         incdir = PurePath(coredata.get_builtin_option('includedir'))
-        with open(fname, 'w') as ofile:
+        with open(fname, 'w', encoding='utf-8') as ofile:
             ofile.write('prefix={}\n'.format(self._escape(prefix)))
             ofile.write('libdir={}\n'.format(self._escape('${prefix}' / libdir)))
             ofile.write('includedir={}\n'.format(self._escape('${prefix}' / incdir)))
@@ -342,7 +355,9 @@
         default_description = None
         default_name = None
         mainlib = None
-        if len(args) == 1:
+        if not args and 'version' not in kwargs:
+            FeatureNew('pkgconfig.generate implicit version keyword', '0.46.0').use(state.subproject)
+        elif len(args) == 1:
             FeatureNew('pkgconfig.generate optional positional argument', '0.46.0').use(state.subproject)
             mainlib = getattr(args[0], 'held_object', args[0])
             if not isinstance(mainlib, (build.StaticLibrary, build.SharedLibrary)):
@@ -373,10 +388,15 @@
             raise mesonlib.MesonException('URL is not a string.')
         conflicts = mesonlib.stringlistify(kwargs.get('conflicts', []))
 
-        deps = DependenciesHelper(filebase)
+        # Prepend the main library to public libraries list. This is required
+        # so dep.add_pub_libs() can handle dependency ordering correctly and put
+        # extra libraries after the main library.
+        libraries = mesonlib.extract_as_list(kwargs, 'libraries')
         if mainlib:
-            deps.add_pub_libs(mainlib)
-        deps.add_pub_libs(kwargs.get('libraries', []))
+            libraries = [mainlib] + libraries
+
+        deps = DependenciesHelper(filebase)
+        deps.add_pub_libs(libraries)
         deps.add_priv_libs(kwargs.get('libraries_private', []))
         deps.add_pub_reqs(kwargs.get('requires', []))
         deps.add_priv_reqs(kwargs.get('requires_private', []))
@@ -384,7 +404,7 @@
 
         dversions = kwargs.get('d_module_versions', None)
         if dversions:
-            compiler = state.environment.coredata.compilers.get('d')
+            compiler = state.environment.coredata.compilers.host.get('d')
             if compiler:
                 deps.add_cflags(compiler.get_feature_args({'versions': dversions}, None))
 
@@ -434,11 +454,13 @@
                 mainlib.generated_pc = filebase
             else:
                 mlog.warning('Already generated a pkg-config file for', mlog.bold(mainlib.name))
-        for lib in deps.pub_libs:
-            if not isinstance(lib, str) and not hasattr(lib, 'generated_pc'):
-                lib.generated_pc = filebase
-                lib.generated_pc_warn = types.SimpleNamespace(subdir=state.subdir,
-                                                              lineno=state.current_lineno)
+        else:
+            for lib in deps.pub_libs:
+                if not isinstance(lib, str) and not hasattr(lib, 'generated_pc'):
+                    lib.generated_pc = filebase
+                    location = types.SimpleNamespace(subdir=state.subdir,
+                                                     lineno=state.current_lineno)
+                    lib.generated_pc_warn = [name, location]
         return ModuleReturnValue(res, [res])
 
 def initialize(*args, **kwargs):
diff -Nru meson-0.49.0/mesonbuild/modules/python3.py meson-0.52.1/mesonbuild/modules/python3.py
--- meson-0.49.0/mesonbuild/modules/python3.py	2018-12-09 14:27:23.000000000 +0000
+++ meson-0.52.1/mesonbuild/modules/python3.py	2019-02-07 09:08:55.000000000 +0000
@@ -48,10 +48,11 @@
 
     @noKwargs
     def find_python(self, state, args, kwargs):
-        options = [state.environment.config_info.binaries.get('python3')]
-        if not options[0]:  # because this would be [None]
-            options = ['python3', mesonlib.python_command]
-        py3 = dependencies.ExternalProgram(*options, silent=True)
+        command = state.environment.binaries.host.lookup_entry('python3')
+        if command is not None:
+            py3 = dependencies.ExternalProgram.from_entry('python3', command)
+        else:
+            py3 = dependencies.ExternalProgram('python3', mesonlib.python_command, silent=True)
         return ModuleReturnValue(py3, [py3])
 
     @noKwargs
diff -Nru meson-0.49.0/mesonbuild/modules/python.py meson-0.52.1/mesonbuild/modules/python.py
--- meson-0.49.0/mesonbuild/modules/python.py	2018-12-09 14:27:23.000000000 +0000
+++ meson-0.52.1/mesonbuild/modules/python.py	2019-10-06 17:01:35.000000000 +0000
@@ -14,6 +14,8 @@
 
 import os
 import json
+import shutil
+import typing
 
 from pathlib import Path
 from .. import mesonlib
@@ -22,11 +24,10 @@
 from mesonbuild.modules import ModuleReturnValue
 from ..interpreterbase import (
     noPosargs, noKwargs, permittedKwargs,
-    InterpreterObject, InvalidArguments,
+    InvalidArguments,
     FeatureNew, FeatureNewKwargs, disablerIfNotFound
 )
 from ..interpreter import ExternalProgramHolder, extract_required_kwarg
-from ..interpreterbase import flatten
 from ..build import known_shmod_kwargs
 from .. import mlog
 from ..environment import detect_cpu_family
@@ -40,15 +41,6 @@
 mod_kwargs.update(known_shmod_kwargs)
 mod_kwargs -= set(['name_prefix', 'name_suffix'])
 
-
-def run_command(python, command):
-    _, stdout, _ = mesonlib.Popen_safe(python.get_command() + [
-        '-c',
-        command])
-
-    return stdout.strip()
-
-
 class PythonDependency(ExternalDependency):
 
     def __init__(self, python_holder, environment, kwargs):
@@ -60,6 +52,7 @@
         self.pkgdep = None
         self.variables = python_holder.variables
         self.paths = python_holder.paths
+        self.link_libpython = python_holder.link_libpython
         if mesonlib.version_compare(self.version, '>= 3.0'):
             self.major_version = 3
         else:
@@ -122,7 +115,6 @@
                     self._find_libpy_windows(environment)
                 else:
                     self._find_libpy(python_holder, environment)
-
                 if self.is_found:
                     mlog.debug('Found "python-{}" via SYSCONFIG module'.format(self.version))
                     py_lookup_method = 'sysconfig'
@@ -149,11 +141,11 @@
             libdirs = []
 
         largs = self.clib_compiler.find_library(libname, environment, libdirs)
-
-        self.is_found = largs is not None
-        if self.is_found:
+        if largs is not None:
             self.link_args = largs
 
+        self.is_found = largs is not None or self.link_libpython
+
         inc_paths = mesonlib.OrderedSet([
             self.variables.get('INCLUDEPY'),
             self.paths.get('include'),
@@ -183,10 +175,14 @@
         if self.platform.startswith('win'):
             vernum = self.variables.get('py_version_nodot')
             if self.static:
-                libname = 'libpython{}.a'.format(vernum)
+                libpath = Path('libs') / 'libpython{}.a'.format(vernum)
             else:
-                libname = 'python{}.lib'.format(vernum)
-            lib = Path(self.variables.get('base')) / 'libs' / libname
+                comp = self.get_compiler()
+                if comp.id == "gcc":
+                    libpath = 'python{}.dll'.format(vernum)
+                else:
+                    libpath = Path('libs') / 'python{}.lib'.format(vernum)
+            lib = Path(self.variables.get('base')) / libpath
         elif self.platform == 'mingw':
             if self.static:
                 libname = self.variables.get('LIBRARY')
@@ -207,7 +203,7 @@
         if pyarch is None:
             self.is_found = False
             return
-        arch = detect_cpu_family(env.coredata.compilers)
+        arch = detect_cpu_family(env.coredata.compilers.host)
         if arch == 'x86':
             arch = '32'
         elif arch == 'x86_64':
@@ -260,13 +256,18 @@
             return super().get_pkgconfig_variable(variable_name, kwargs)
 
 
-INTROSPECT_COMMAND = '''
-import sysconfig
+INTROSPECT_COMMAND = '''import sysconfig
 import json
 import sys
 
 install_paths = sysconfig.get_paths(scheme='posix_prefix', vars={'base': '', 'platbase': '', 'installed_base': ''})
 
+def links_against_libpython():
+    from distutils.core import Distribution, Extension
+    cmd = Distribution().get_command_obj('build_ext')
+    cmd.ensure_finalized()
+    return bool(cmd.get_libraries(Extension('dummy', [])))
+
 print (json.dumps ({
   'variables': sysconfig.get_config_vars(),
   'paths': sysconfig.get_paths(),
@@ -274,14 +275,16 @@
   'version': sysconfig.get_python_version(),
   'platform': sysconfig.get_platform(),
   'is_pypy': '__pypy__' in sys.builtin_module_names,
+  'link_libpython': links_against_libpython(),
 }))
 '''
 
-class PythonInstallation(ExternalProgramHolder, InterpreterObject):
+
+class PythonInstallation(ExternalProgramHolder):
     def __init__(self, interpreter, python, info):
-        InterpreterObject.__init__(self)
         ExternalProgramHolder.__init__(self, python)
         self.interpreter = interpreter
+        self.subproject = self.interpreter.subproject
         prefix = self.interpreter.environment.coredata.get_builtin_option('prefix')
         self.variables = info['variables']
         self.paths = info['paths']
@@ -291,9 +294,23 @@
         self.version = info['version']
         self.platform = info['platform']
         self.is_pypy = info['is_pypy']
+        self.link_libpython = info['link_libpython']
+        self.methods.update({
+            'extension_module': self.extension_module_method,
+            'dependency': self.dependency_method,
+            'install_sources': self.install_sources_method,
+            'get_install_dir': self.get_install_dir_method,
+            'language_version': self.language_version_method,
+            'found': self.found_method,
+            'has_path': self.has_path_method,
+            'get_path': self.get_path_method,
+            'has_variable': self.has_variable_method,
+            'get_variable': self.get_variable_method,
+            'path': self.path_method,
+        })
 
     @permittedKwargs(mod_kwargs)
-    def extension_module(self, interpreter, state, args, kwargs):
+    def extension_module_method(self, args, kwargs):
         if 'subdir' in kwargs and 'install_dir' in kwargs:
             raise InvalidArguments('"subdir" and "install_dir" are mutually exclusive')
 
@@ -304,6 +321,18 @@
 
             kwargs['install_dir'] = os.path.join(self.platlib_install_path, subdir)
 
+        # On macOS and some Linux distros (Debian) distutils doesn't link
+        # extensions against libpython. We call into distutils and mirror its
+        # behavior. See https://github.com/mesonbuild/meson/issues/4117
+        if not self.link_libpython:
+            new_deps = []
+            for holder in mesonlib.extract_as_list(kwargs, 'dependencies'):
+                dep = holder.held_object
+                if isinstance(dep, PythonDependency):
+                    holder = self.interpreter.holderify(dep.get_partial_dependency(compile_args=True))
+                new_deps.append(holder)
+            kwargs['dependencies'] = new_deps
+
         suffix = self.variables.get('EXT_SUFFIX') or self.variables.get('SO') or self.variables.get('.so')
 
         # msys2's python3 has "-cpython-36m.dll", we have to be clever
@@ -314,14 +343,14 @@
         kwargs['name_prefix'] = ''
         kwargs['name_suffix'] = suffix
 
-        return interpreter.func_shared_module(None, args, kwargs)
+        return self.interpreter.func_shared_module(None, args, kwargs)
 
-    def dependency(self, interpreter, state, args, kwargs):
-        dep = PythonDependency(self, interpreter.environment, kwargs)
-        return interpreter.holderify(dep)
+    def dependency_method(self, args, kwargs):
+        dep = PythonDependency(self, self.interpreter.environment, kwargs)
+        return self.interpreter.holderify(dep)
 
     @permittedKwargs(['pure', 'subdir'])
-    def install_sources(self, interpreter, state, args, kwargs):
+    def install_sources_method(self, args, kwargs):
         pure = kwargs.pop('pure', False)
         if not isinstance(pure, bool):
             raise InvalidArguments('"pure" argument must be a boolean.')
@@ -335,11 +364,11 @@
         else:
             kwargs['install_dir'] = os.path.join(self.platlib_install_path, subdir)
 
-        return interpreter.func_install_data(None, args, kwargs)
+        return self.interpreter.holderify(self.interpreter.func_install_data(None, args, kwargs))
 
     @noPosargs
     @permittedKwargs(['pure', 'subdir'])
-    def get_install_dir(self, node, args, kwargs):
+    def get_install_dir_method(self, args, kwargs):
         pure = kwargs.pop('pure', True)
         if not isinstance(pure, bool):
             raise InvalidArguments('"pure" argument must be a boolean.')
@@ -353,30 +382,25 @@
         else:
             res = os.path.join(self.platlib_install_path, subdir)
 
-        return ModuleReturnValue(res, [])
+        return self.interpreter.module_method_callback(ModuleReturnValue(res, []))
 
     @noPosargs
     @noKwargs
-    def language_version(self, node, args, kwargs):
-        return ModuleReturnValue(self.version, [])
-
-    @noPosargs
-    @noKwargs
-    def found(self, node, args, kwargs):
-        return ModuleReturnValue(True, [])
+    def language_version_method(self, args, kwargs):
+        return self.interpreter.module_method_callback(ModuleReturnValue(self.version, []))
 
     @noKwargs
-    def has_path(self, node, args, kwargs):
+    def has_path_method(self, args, kwargs):
         if len(args) != 1:
             raise InvalidArguments('has_path takes exactly one positional argument.')
         path_name = args[0]
         if not isinstance(path_name, str):
             raise InvalidArguments('has_path argument must be a string.')
 
-        return ModuleReturnValue(path_name in self.paths, [])
+        return self.interpreter.module_method_callback(ModuleReturnValue(path_name in self.paths, []))
 
     @noKwargs
-    def get_path(self, node, args, kwargs):
+    def get_path_method(self, args, kwargs):
         if len(args) not in (1, 2):
             raise InvalidArguments('get_path must have one or two arguments.')
         path_name = args[0]
@@ -391,20 +415,20 @@
             else:
                 raise InvalidArguments('{} is not a valid path name'.format(path_name))
 
-        return ModuleReturnValue(path, [])
+        return self.interpreter.module_method_callback(ModuleReturnValue(path, []))
 
     @noKwargs
-    def has_variable(self, node, args, kwargs):
+    def has_variable_method(self, args, kwargs):
         if len(args) != 1:
             raise InvalidArguments('has_variable takes exactly one positional argument.')
         var_name = args[0]
         if not isinstance(var_name, str):
             raise InvalidArguments('has_variable argument must be a string.')
 
-        return ModuleReturnValue(var_name in self.variables, [])
+        return self.interpreter.module_method_callback(ModuleReturnValue(var_name in self.variables, []))
 
     @noKwargs
-    def get_variable(self, node, args, kwargs):
+    def get_variable_method(self, args, kwargs):
         if len(args) not in (1, 2):
             raise InvalidArguments('get_variable must have one or two arguments.')
         var_name = args[0]
@@ -419,25 +443,13 @@
             else:
                 raise InvalidArguments('{} is not a valid variable name'.format(var_name))
 
-        return ModuleReturnValue(var, [])
+        return self.interpreter.module_method_callback(ModuleReturnValue(var, []))
 
-    def method_call(self, method_name, args, kwargs):
-        try:
-            fn = getattr(self, method_name)
-        except AttributeError:
-            raise InvalidArguments('Python object does not have method %s.' % method_name)
-
-        if not getattr(fn, 'no-args-flattening', False):
-            args = flatten(args)
-
-        if method_name in ['extension_module', 'dependency', 'install_sources']:
-            value = fn(self.interpreter, None, args, kwargs)
-            return self.interpreter.holderify(value)
-        elif method_name in ['has_variable', 'get_variable', 'has_path', 'get_path', 'found', 'language_version', 'get_install_dir']:
-            value = fn(None, args, kwargs)
-            return self.interpreter.module_method_callback(value)
-        else:
-            raise InvalidArguments('Python object does not have method %s.' % method_name)
+    @noPosargs
+    @noKwargs
+    @FeatureNew('Python module path method', '0.50.0')
+    def path_method(self, args, kwargs):
+        return super().path_method(args, kwargs)
 
 
 class PythonModule(ExtensionModule):
@@ -451,12 +463,15 @@
     def _get_win_pythonpath(self, name_or_path):
         if name_or_path not in ['python2', 'python3']:
             return None
+        if not shutil.which('py'):
+            # program not installed, return without an exception
+            return None
         ver = {'python2': '-2', 'python3': '-3'}[name_or_path]
         cmd = ['py', ver, '-c', "import sysconfig; print(sysconfig.get_config_var('BINDIR'))"]
         _, stdout, _ = mesonlib.Popen_safe(cmd)
-        dir = stdout.strip()
-        if os.path.exists(dir):
-            return os.path.join(dir, 'python')
+        directory = stdout.strip()
+        if os.path.exists(directory):
+            return os.path.join(directory, 'python')
         else:
             return None
 
@@ -468,63 +483,99 @@
         return True
 
     @FeatureNewKwargs('python.find_installation', '0.49.0', ['disabler'])
+    @FeatureNewKwargs('python.find_installation', '0.51.0', ['modules'])
     @disablerIfNotFound
-    @permittedKwargs(['required'])
+    @permittedKwargs({'required', 'modules'})
     def find_installation(self, interpreter, state, args, kwargs):
         feature_check = FeatureNew('Passing "feature" option to find_installation', '0.48.0')
         disabled, required, feature = extract_required_kwarg(kwargs, state.subproject, feature_check)
-        if disabled:
-            mlog.log('find_installation skipped: feature', mlog.bold(feature), 'disabled')
-            return ExternalProgramHolder(NonExistingExternalProgram())
+        want_modules = mesonlib.extract_as_list(kwargs, 'modules')  # type: typing.List[str]
+        found_modules = []    # type: typing.List[str]
+        missing_modules = []  # type: typing.List[str]
 
         if len(args) > 1:
             raise InvalidArguments('find_installation takes zero or one positional argument.')
 
-        if 'python' in state.environment.config_info.binaries:
-            name_or_path = state.environment.config_info.binaries['python']
-        elif args:
+        name_or_path = state.environment.binaries.host.lookup_entry('python')
+        if name_or_path is None and args:
             name_or_path = args[0]
             if not isinstance(name_or_path, str):
                 raise InvalidArguments('find_installation argument must be a string.')
-        else:
-            name_or_path = None
+
+        if disabled:
+            mlog.log('Program', name_or_path or 'python', 'found:', mlog.red('NO'), '(disabled by:', mlog.bold(feature), ')')
+            return ExternalProgramHolder(NonExistingExternalProgram())
 
         if not name_or_path:
-            mlog.log("Using meson's python {}".format(mesonlib.python_command))
             python = ExternalProgram('python3', mesonlib.python_command, silent=True)
         else:
-            python = ExternalProgram(name_or_path, silent = True)
+            python = ExternalProgram.from_entry('python3', name_or_path)
 
             if not python.found() and mesonlib.is_windows():
                 pythonpath = self._get_win_pythonpath(name_or_path)
                 if pythonpath is not None:
                     name_or_path = pythonpath
-                    python = ExternalProgram(name_or_path, silent = True)
+                    python = ExternalProgram(name_or_path, silent=True)
 
             # Last ditch effort, python2 or python3 can be named python
             # on various platforms, let's not give up just yet, if an executable
             # named python is available and has a compatible version, let's use
             # it
             if not python.found() and name_or_path in ['python2', 'python3']:
-                python = ExternalProgram('python', silent = True)
+                python = ExternalProgram('python', silent=True)
+
+        if python.found() and want_modules:
+            for mod in want_modules:
+                p, out, err = mesonlib.Popen_safe(
+                    python.command +
+                    ['-c', 'import {0}'.format(mod)])
+                if p.returncode != 0:
+                    missing_modules.append(mod)
+                else:
+                    found_modules.append(mod)
+
+        msg = ['Program', python.name]
+        if want_modules:
+            msg.append('({})'.format(', '.join(want_modules)))
+        msg.append('found:')
+        if python.found() and not missing_modules:
+            msg.extend([mlog.green('YES'), '({})'.format(' '.join(python.command))])
+        else:
+            msg.append(mlog.red('NO'))
+        if found_modules:
+            msg.append('modules:')
+            msg.append(', '.join(found_modules))
+
+        mlog.log(*msg)
 
         if not python.found():
             if required:
                 raise mesonlib.MesonException('{} not found'.format(name_or_path or 'python'))
             res = ExternalProgramHolder(NonExistingExternalProgram())
+        elif missing_modules:
+            if required:
+                raise mesonlib.MesonException('{} is missing modules: {}'.format(name_or_path or 'python', ', '.join(missing_modules)))
+            res = ExternalProgramHolder(NonExistingExternalProgram())
         else:
             # Sanity check, we expect to have something that at least quacks in tune
             try:
-                info = json.loads(run_command(python, INTROSPECT_COMMAND))
+                cmd = python.get_command() + ['-c', INTROSPECT_COMMAND]
+                p, stdout, stderr = mesonlib.Popen_safe(cmd)
+                info = json.loads(stdout)
             except json.JSONDecodeError:
                 info = None
+                mlog.debug('Could not introspect Python (%s): exit code %d' % (str(p.args), p.returncode))
+                mlog.debug('Program stdout:\n')
+                mlog.debug(stdout)
+                mlog.debug('Program stderr:\n')
+                mlog.debug(stderr)
 
             if isinstance(info, dict) and 'version' in info and self._check_version(name_or_path, info['version']):
                 res = PythonInstallation(interpreter, python, info)
             else:
                 res = ExternalProgramHolder(NonExistingExternalProgram())
                 if required:
-                    raise mesonlib.MesonException('{} is not a valid python'.format(python))
+                    raise mesonlib.MesonException('{} is not a valid python or it is missing setuptools'.format(python))
 
         return res
 
diff -Nru meson-0.49.0/mesonbuild/modules/qt.py meson-0.52.1/mesonbuild/modules/qt.py
--- meson-0.49.0/mesonbuild/modules/qt.py	2018-12-09 14:27:23.000000000 +0000
+++ meson-0.52.1/mesonbuild/modules/qt.py	2019-11-28 17:37:44.000000000 +0000
@@ -19,7 +19,7 @@
 from ..dependencies import Dependency, Qt4Dependency, Qt5Dependency
 import xml.etree.ElementTree as ET
 from . import ModuleReturnValue, get_include_args, ExtensionModule
-from ..interpreterbase import permittedKwargs, FeatureNewKwargs
+from ..interpreterbase import permittedKwargs, FeatureNew, FeatureNewKwargs
 
 _QT_DEPS_LUT = {
     4: Qt4Dependency,
@@ -129,13 +129,13 @@
         self._detect_tools(state.environment, method)
         err_msg = "{0} sources specified and couldn't find {1}, " \
                   "please check your qt{2} installation"
-        if len(moc_headers) + len(moc_sources) > 0 and not self.moc.found():
+        if (moc_headers or moc_sources) and not self.moc.found():
             raise MesonException(err_msg.format('MOC', 'moc-qt{}'.format(self.qt_version), self.qt_version))
-        if len(rcc_files) > 0:
+        if rcc_files:
             if not self.rcc.found():
                 raise MesonException(err_msg.format('RCC', 'rcc-qt{}'.format(self.qt_version), self.qt_version))
             # custom output name set? -> one output file, multiple otherwise
-            if len(args) > 0:
+            if args:
                 qrc_deps = []
                 for i in rcc_files:
                     qrc_deps += self.parse_qrc(state, i)
@@ -160,7 +160,7 @@
                                   'depend_files': qrc_deps}
                     res_target = build.CustomTarget(name, state.subdir, state.subproject, rcc_kwargs)
                     sources.append(res_target)
-        if len(ui_files) > 0:
+        if ui_files:
             if not self.uic.found():
                 raise MesonException(err_msg.format('UIC', 'uic-qt{}'.format(self.qt_version), self.qt_version))
             arguments = uic_extra_arguments + ['-o', '@OUTPUT@', '@INPUT@']
@@ -183,14 +183,14 @@
                                      'either an external dependency (returned by find_library() or '
                                      'dependency()) or an internal dependency (returned by '
                                      'declare_dependency()).'.format(type(dep).__name__))
-        if len(moc_headers) > 0:
+        if moc_headers:
             arguments = moc_extra_arguments + inc + compile_args + ['@INPUT@', '-o', '@OUTPUT@']
             moc_kwargs = {'output': 'moc_@BASENAME@.cpp',
                           'arguments': arguments}
             moc_gen = build.Generator([self.moc], moc_kwargs)
             moc_output = moc_gen.process_files('Qt{} moc header'.format(self.qt_version), moc_headers, state)
             sources.append(moc_output)
-        if len(moc_sources) > 0:
+        if moc_sources:
             arguments = moc_extra_arguments + inc + compile_args + ['@INPUT@', '-o', '@OUTPUT@']
             moc_kwargs = {'output': '@BASENAME@.moc',
                           'arguments': arguments}
@@ -199,7 +199,7 @@
             sources.append(moc_output)
         return ModuleReturnValue(sources, sources)
 
-    @FeatureNewKwargs('build target', '0.40.0', ['build_by_default'])
+    @FeatureNew('qt.compile_translations', '0.44.0')
     @permittedKwargs({'ts_files', 'install', 'install_dir', 'build_by_default', 'method'})
     def compile_translations(self, state, args, kwargs):
         ts_files, install_dir = extract_as_list(kwargs, 'ts_files', 'install_dir', pop=True)
diff -Nru meson-0.49.0/mesonbuild/modules/rpm.py meson-0.52.1/mesonbuild/modules/rpm.py
--- meson-0.49.0/mesonbuild/modules/rpm.py	2018-08-25 08:05:43.000000000 +0000
+++ meson-0.52.1/mesonbuild/modules/rpm.py	2019-05-22 21:53:22.000000000 +0000
@@ -29,39 +29,16 @@
 class RPMModule(ExtensionModule):
 
     @noKwargs
-    def generate_spec_template(self, state, args, kwargs):
-        compiler_deps = set()
-        for compiler in state.compilers.values():
-            # Elbrus has one 'lcc' package for every compiler
-            if isinstance(compiler, compilers.GnuCCompiler):
-                compiler_deps.add('gcc')
-            elif isinstance(compiler, compilers.GnuCPPCompiler):
-                compiler_deps.add('gcc-c++')
-            elif isinstance(compiler, compilers.ElbrusCCompiler):
-                compiler_deps.add('lcc')
-            elif isinstance(compiler, compilers.ElbrusCPPCompiler):
-                compiler_deps.add('lcc')
-            elif isinstance(compiler, compilers.ElbrusFortranCompiler):
-                compiler_deps.add('lcc')
-            elif isinstance(compiler, compilers.ValaCompiler):
-                compiler_deps.add('vala')
-            elif isinstance(compiler, compilers.GnuFortranCompiler):
-                compiler_deps.add('gcc-gfortran')
-            elif isinstance(compiler, compilers.GnuObjCCompiler):
-                compiler_deps.add('gcc-objc')
-            elif compiler == compilers.GnuObjCPPCompiler:
-                compiler_deps.add('gcc-objc++')
-            else:
-                mlog.log('RPM spec file will not created, generating not allowed for:',
-                         mlog.bold(compiler.get_id()))
-                return
-        proj = state.project_name.replace(' ', '_').replace('\t', '_')
+    def generate_spec_template(self, coredata, args, kwargs):
+        self.coredata = coredata
+        required_compilers = self.__get_required_compilers()
+        proj = coredata.project_name.replace(' ', '_').replace('\t', '_')
         so_installed = False
         devel_subpkg = False
         files = set()
         files_devel = set()
         to_delete = set()
-        for target in state.targets.values():
+        for target in coredata.targets.values():
             if isinstance(target, build.Executable) and target.need_install:
                 files.add('%%{_bindir}/%s' % target.get_filename())
             elif isinstance(target, build.SharedLibrary) and target.need_install:
@@ -80,18 +57,19 @@
                 files_devel.add('%%{_datadir}/gir-1.0/%s' % target.get_filename()[0])
             elif isinstance(target, TypelibTarget) and target.should_install():
                 files.add('%%{_libdir}/girepository-1.0/%s' % target.get_filename()[0])
-        for header in state.headers:
-            if len(header.get_install_subdir()) > 0:
+        for header in coredata.headers:
+            if header.get_install_subdir():
                 files_devel.add('%%{_includedir}/%s/' % header.get_install_subdir())
             else:
                 for hdr_src in header.get_sources():
                     files_devel.add('%%{_includedir}/%s' % hdr_src)
-        for man in state.man:
+        for man in coredata.man:
             for man_file in man.get_sources():
                 files.add('%%{_mandir}/man%u/%s.*' % (int(man_file.split('.')[-1]), man_file))
-        if len(files_devel) > 0:
+        if files_devel:
             devel_subpkg = True
-        filename = os.path.join(state.environment.get_build_dir(),
+
+        filename = os.path.join(coredata.environment.get_build_dir(),
                                 '%s.spec' % proj)
         with open(filename, 'w+') as fn:
             fn.write('Name: %s\n' % proj)
@@ -102,24 +80,28 @@
             fn.write('\n')
             fn.write('Source0: %{name}-%{version}.tar.xz # FIXME\n')
             fn.write('\n')
-            for compiler in compiler_deps:
+            fn.write('BuildRequires: meson\n')
+            for compiler in required_compilers:
                 fn.write('BuildRequires: %s\n' % compiler)
-            for dep in state.environment.coredata.deps:
+            for dep in coredata.environment.coredata.deps.host:
                 fn.write('BuildRequires: pkgconfig(%s)\n' % dep[0])
-            for lib in state.environment.coredata.ext_libs.values():
-                name = lib.get_name()
-                fn.write('BuildRequires: {} # FIXME\n'.format(name))
-                mlog.warning('replace', mlog.bold(name), 'with the real package.',
-                             'You can use following command to find package which '
-                             'contains this lib:',
-                             mlog.bold("dnf provides '*/lib{}.so'".format(name)))
-            for prog in state.environment.coredata.ext_progs.values():
-                if not prog.found():
-                    fn.write('BuildRequires: %%{_bindir}/%s # FIXME\n' %
-                             prog.get_name())
-                else:
-                    fn.write('BuildRequires: {}\n'.format(prog.get_path()))
-            fn.write('BuildRequires: meson\n')
+#   ext_libs and ext_progs have been removed from coredata so the following code
+#   no longer works. It is kept as a reminder of the idea should anyone wish
+#   to re-implement it.
+#
+#            for lib in state.environment.coredata.ext_libs.values():
+#                name = lib.get_name()
+#                fn.write('BuildRequires: {} # FIXME\n'.format(name))
+#                mlog.warning('replace', mlog.bold(name), 'with the real package.',
+#                             'You can use following command to find package which '
+#                             'contains this lib:',
+#                             mlog.bold("dnf provides '*/lib{}.so'".format(name)))
+#            for prog in state.environment.coredata.ext_progs.values():
+#                if not prog.found():
+#                    fn.write('BuildRequires: %%{_bindir}/%s # FIXME\n' %
+#                             prog.get_name())
+#                else:
+#                    fn.write('BuildRequires: {}\n'.format(prog.get_path()))
             fn.write('\n')
             fn.write('%description\n')
             fn.write('\n')
@@ -140,7 +122,7 @@
             fn.write('\n')
             fn.write('%install\n')
             fn.write('%meson_install\n')
-            if len(to_delete) > 0:
+            if to_delete:
                 fn.write('rm -vf %s\n' % ' '.join(to_delete))
             fn.write('\n')
             fn.write('%check\n')
@@ -167,5 +149,33 @@
         mlog.log('RPM spec template written to %s.spec.\n' % proj)
         return ModuleReturnValue(None, [])
 
+    def __get_required_compilers(self):
+        required_compilers = set()
+        for compiler in self.coredata.compilers.values():
+            # Elbrus has one 'lcc' package for every compiler
+            if isinstance(compiler, compilers.GnuCCompiler):
+                required_compilers.add('gcc')
+            elif isinstance(compiler, compilers.GnuCPPCompiler):
+                required_compilers.add('gcc-c++')
+            elif isinstance(compiler, compilers.ElbrusCCompiler):
+                required_compilers.add('lcc')
+            elif isinstance(compiler, compilers.ElbrusCPPCompiler):
+                required_compilers.add('lcc')
+            elif isinstance(compiler, compilers.ElbrusFortranCompiler):
+                required_compilers.add('lcc')
+            elif isinstance(compiler, compilers.ValaCompiler):
+                required_compilers.add('vala')
+            elif isinstance(compiler, compilers.GnuFortranCompiler):
+                required_compilers.add('gcc-gfortran')
+            elif isinstance(compiler, compilers.GnuObjCCompiler):
+                required_compilers.add('gcc-objc')
+            elif compiler == compilers.GnuObjCPPCompiler:
+                required_compilers.add('gcc-objc++')
+            else:
+                mlog.log('RPM spec file not created, generation not allowed for:',
+                         mlog.bold(compiler.get_id()))
+        return required_compilers
+
+
 def initialize(*args, **kwargs):
     return RPMModule(*args, **kwargs)
diff -Nru meson-0.49.0/mesonbuild/modules/sourceset.py meson-0.52.1/mesonbuild/modules/sourceset.py
--- meson-0.49.0/mesonbuild/modules/sourceset.py	1970-01-01 00:00:00.000000000 +0000
+++ meson-0.52.1/mesonbuild/modules/sourceset.py	2019-08-28 17:15:39.000000000 +0000
@@ -0,0 +1,200 @@
+# Copyright 2019 The Meson development team
+
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+
+#     http://www.apache.org/licenses/LICENSE-2.0
+
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from collections import namedtuple
+from .. import mesonlib
+from ..mesonlib import listify
+from . import ExtensionModule
+from ..interpreterbase import (
+    noPosargs, noKwargs, permittedKwargs,
+    InterpreterObject, MutableInterpreterObject, ObjectHolder,
+    InterpreterException, InvalidArguments, InvalidCode, FeatureNew,
+)
+from ..interpreter import (
+    GeneratedListHolder, CustomTargetHolder,
+    CustomTargetIndexHolder
+)
+
+SourceSetRule = namedtuple('SourceSetRule', 'keys sources if_false sourcesets dependencies extra_deps')
+SourceFiles = namedtuple('SourceFiles', 'sources dependencies')
+
+class SourceSetHolder(MutableInterpreterObject, ObjectHolder):
+    def __init__(self, interpreter):
+        MutableInterpreterObject.__init__(self)
+        ObjectHolder.__init__(self, list())
+        self.subproject = interpreter.subproject
+        self.environment = interpreter.environment
+        self.subdir = interpreter.subdir
+        self.frozen = False
+        self.methods.update({
+            'add': self.add_method,
+            'add_all': self.add_all_method,
+            'all_sources': self.all_sources_method,
+            'all_dependencies': self.all_dependencies_method,
+            'apply': self.apply_method,
+        })
+
+    def check_source_files(self, arg, allow_deps):
+        sources = []
+        deps = []
+        for x in arg:
+            if isinstance(x, (str, mesonlib.File,
+                              GeneratedListHolder, CustomTargetHolder,
+                              CustomTargetIndexHolder)):
+                sources.append(x)
+            elif hasattr(x, 'found'):
+                if not allow_deps:
+                    msg = 'Dependencies are not allowed in the if_false argument.'
+                    raise InvalidArguments(msg)
+                deps.append(x)
+            else:
+                msg = 'Sources must be strings or file-like objects.'
+                raise InvalidArguments(msg)
+        mesonlib.check_direntry_issues(sources)
+        return sources, deps
+
+    def check_conditions(self, arg):
+        keys = []
+        deps = []
+        for x in listify(arg):
+            if isinstance(x, str):
+                keys.append(x)
+            elif hasattr(x, 'found'):
+                deps.append(x)
+            else:
+                raise InvalidArguments('Conditions must be strings or dependency object')
+        return keys, deps
+
+    @permittedKwargs(['when', 'if_false', 'if_true'])
+    def add_method(self, args, kwargs):
+        if self.frozen:
+            raise InvalidCode('Tried to use \'add\' after querying the source set')
+        when = listify(kwargs.get('when', []))
+        if_true = listify(kwargs.get('if_true', []))
+        if_false = listify(kwargs.get('if_false', []))
+        if not when and not if_true and not if_false:
+            if_true = args
+        elif args:
+            raise InterpreterException('add called with both positional and keyword arguments')
+        keys, dependencies = self.check_conditions(when)
+        sources, extra_deps = self.check_source_files(if_true, True)
+        if_false, _ = self.check_source_files(if_false, False)
+        self.held_object.append(SourceSetRule(keys, sources, if_false, [], dependencies, extra_deps))
+
+    @permittedKwargs(['when', 'if_true'])
+    def add_all_method(self, args, kwargs):
+        if self.frozen:
+            raise InvalidCode('Tried to use \'add_all\' after querying the source set')
+        when = listify(kwargs.get('when', []))
+        if_true = listify(kwargs.get('if_true', []))
+        if not when and not if_true:
+            if_true = args
+        elif args:
+            raise InterpreterException('add_all called with both positional and keyword arguments')
+        keys, dependencies = self.check_conditions(when)
+        for s in if_true:
+            if not isinstance(s, SourceSetHolder):
+                raise InvalidCode('Arguments to \'add_all\' after the first must be source sets')
+            s.frozen = True
+        self.held_object.append(SourceSetRule(keys, [], [], if_true, dependencies, []))
+
+    def collect(self, enabled_fn, all_sources, into=None):
+        if not into:
+            into = SourceFiles(set(), set())
+        for entry in self.held_object:
+            if all(x.found() for x in entry.dependencies) and \
+               all(enabled_fn(key) for key in entry.keys):
+                into.sources.update(entry.sources)
+                into.dependencies.update(entry.dependencies)
+                into.dependencies.update(entry.extra_deps)
+                for ss in entry.sourcesets:
+                    ss.collect(enabled_fn, all_sources, into)
+                if not all_sources:
+                    continue
+            into.sources.update(entry.if_false)
+        return into
+
+    @noKwargs
+    @noPosargs
+    def all_sources_method(self, args, kwargs):
+        self.frozen = True
+        files = self.collect(lambda x: True, True)
+        return list(files.sources)
+
+    @noKwargs
+    @noPosargs
+    @FeatureNew('source_set.all_dependencies() method', '0.52.0')
+    def all_dependencies_method(self, args, kwargs):
+        self.frozen = True
+        files = self.collect(lambda x: True, True)
+        return list(files.dependencies)
+
+    @permittedKwargs(['strict'])
+    def apply_method(self, args, kwargs):
+        if len(args) != 1:
+            raise InterpreterException('Apply takes exactly one argument')
+        config_data = args[0]
+        self.frozen = True
+        strict = kwargs.get('strict', True)
+        if isinstance(config_data, dict):
+            def _get_from_config_data(key):
+                if strict and key not in config_data:
+                    raise InterpreterException('Entry %s not in configuration dictionary.' % key)
+                return config_data.get(key, False)
+        else:
+            config_cache = dict()
+
+            def _get_from_config_data(key):
+                nonlocal config_cache
+                if key not in config_cache:
+                    args = [key] if strict else [key, False]
+                    config_cache[key] = config_data.get_method(args, {})
+                return config_cache[key]
+
+        files = self.collect(_get_from_config_data, False)
+        res = SourceFilesHolder(files)
+        return res
+
+class SourceFilesHolder(InterpreterObject, ObjectHolder):
+    def __init__(self, files):
+        InterpreterObject.__init__(self)
+        ObjectHolder.__init__(self, files)
+        self.methods.update({
+            'sources': self.sources_method,
+            'dependencies': self.dependencies_method,
+        })
+
+    @noPosargs
+    @noKwargs
+    def sources_method(self, args, kwargs):
+        return list(self.held_object.sources)
+
+    @noPosargs
+    @noKwargs
+    def dependencies_method(self, args, kwargs):
+        return list(self.held_object.dependencies)
+
+class SourceSetModule(ExtensionModule):
+    @FeatureNew('SourceSet module', '0.51.0')
+    def __init__(self, *args, **kwargs):
+        super().__init__(*args, **kwargs)
+        self.snippets.add('source_set')
+
+    @noKwargs
+    @noPosargs
+    def source_set(self, interpreter, state, args, kwargs):
+        return SourceSetHolder(interpreter)
+
+def initialize(*args, **kwargs):
+    return SourceSetModule(*args, **kwargs)
diff -Nru meson-0.49.0/mesonbuild/modules/unstable_cuda.py meson-0.52.1/mesonbuild/modules/unstable_cuda.py
--- meson-0.49.0/mesonbuild/modules/unstable_cuda.py	1970-01-01 00:00:00.000000000 +0000
+++ meson-0.52.1/mesonbuild/modules/unstable_cuda.py	2019-11-28 17:37:44.000000000 +0000
@@ -0,0 +1,270 @@
+# Copyright 2017 The Meson development team
+
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+
+#     http://www.apache.org/licenses/LICENSE-2.0
+
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import re
+
+from ..mesonlib import version_compare
+from ..interpreter import CompilerHolder
+from ..compilers import CudaCompiler
+
+from . import ExtensionModule, ModuleReturnValue
+
+from ..interpreterbase import (
+    flatten, permittedKwargs, noKwargs,
+    InvalidArguments, FeatureNew
+)
+
+class CudaModule(ExtensionModule):
+
+    @FeatureNew('CUDA module', '0.50.0')
+    def __init__(self, *args, **kwargs):
+        super().__init__(*args, **kwargs)
+
+    @noKwargs
+    def min_driver_version(self, state, args, kwargs):
+        argerror = InvalidArguments('min_driver_version must have exactly one positional argument: ' +
+                                    'an NVCC compiler object, or its version string.')
+
+        if len(args) != 1:
+            raise argerror
+        else:
+            cuda_version = self._version_from_compiler(args[0])
+            if cuda_version == 'unknown':
+                raise argerror
+
+        driver_version_table = [
+            {'cuda_version': '>=10.1.105', 'windows': '418.96', 'linux': '418.39'},
+            {'cuda_version': '>=10.0.130', 'windows': '411.31', 'linux': '410.48'},
+            {'cuda_version': '>=9.2.148',  'windows': '398.26', 'linux': '396.37'},
+            {'cuda_version': '>=9.2.88',   'windows': '397.44', 'linux': '396.26'},
+            {'cuda_version': '>=9.1.85',   'windows': '391.29', 'linux': '390.46'},
+            {'cuda_version': '>=9.0.76',   'windows': '385.54', 'linux': '384.81'},
+            {'cuda_version': '>=8.0.61',   'windows': '376.51', 'linux': '375.26'},
+            {'cuda_version': '>=8.0.44',   'windows': '369.30', 'linux': '367.48'},
+            {'cuda_version': '>=7.5.16',   'windows': '353.66', 'linux': '352.31'},
+            {'cuda_version': '>=7.0.28',   'windows': '347.62', 'linux': '346.46'},
+        ]
+
+        driver_version = 'unknown'
+        for d in driver_version_table:
+            if version_compare(cuda_version, d['cuda_version']):
+                driver_version = d.get(state.host_machine.system, d['linux'])
+                break
+
+        return ModuleReturnValue(driver_version, [driver_version])
+
+    @permittedKwargs(['detected'])
+    def nvcc_arch_flags(self, state, args, kwargs):
+        nvcc_arch_args = self._validate_nvcc_arch_args(state, args, kwargs)
+        ret = self._nvcc_arch_flags(*nvcc_arch_args)[0]
+        return ModuleReturnValue(ret, [ret])
+
+    @permittedKwargs(['detected'])
+    def nvcc_arch_readable(self, state, args, kwargs):
+        nvcc_arch_args = self._validate_nvcc_arch_args(state, args, kwargs)
+        ret = self._nvcc_arch_flags(*nvcc_arch_args)[1]
+        return ModuleReturnValue(ret, [ret])
+
+    @staticmethod
+    def _break_arch_string(s):
+        s = re.sub('[ \t\r\n,;]+', ';', s)
+        s = s.strip(';').split(';')
+        return s
+
+    @staticmethod
+    def _detected_cc_from_compiler(c):
+        if isinstance(c, CompilerHolder):
+            c = c.compiler
+        if isinstance(c, CudaCompiler):
+            return c.detected_cc
+        return ''
+
+    @staticmethod
+    def _version_from_compiler(c):
+        if isinstance(c, CompilerHolder):
+            c = c.compiler
+        if isinstance(c, CudaCompiler):
+            return c.version
+        if isinstance(c, str):
+            return c
+        return 'unknown'
+
+    def _validate_nvcc_arch_args(self, state, args, kwargs):
+        argerror = InvalidArguments('The first argument must be an NVCC compiler object, or its version string!')
+
+        if len(args) < 1:
+            raise argerror
+        else:
+            compiler = args[0]
+            cuda_version = self._version_from_compiler(compiler)
+            if cuda_version == 'unknown':
+                raise argerror
+
+        arch_list = [] if len(args) <= 1 else flatten(args[1:])
+        arch_list = [self._break_arch_string(a) for a in arch_list]
+        arch_list = flatten(arch_list)
+        if len(arch_list) > 1 and not set(arch_list).isdisjoint({'All', 'Common', 'Auto'}):
+            raise InvalidArguments('''The special architectures 'All', 'Common' and 'Auto' must appear alone, as a positional argument!''')
+        arch_list = arch_list[0] if len(arch_list) == 1 else arch_list
+
+        detected = kwargs.get('detected', self._detected_cc_from_compiler(compiler))
+        detected = flatten([detected])
+        detected = [self._break_arch_string(a) for a in detected]
+        detected = flatten(detected)
+        if not set(detected).isdisjoint({'All', 'Common', 'Auto'}):
+            raise InvalidArguments('''The special architectures 'All', 'Common' and 'Auto' must appear alone, as a positional argument!''')
+
+        return cuda_version, arch_list, detected
+
+    def _nvcc_arch_flags(self, cuda_version, cuda_arch_list='Auto', detected=''):
+        """
+        Using the CUDA Toolkit version (the NVCC version) and the target
+        architectures, compute the NVCC architecture flags.
+        """
+
+        cuda_known_gpu_architectures  = ['Fermi', 'Kepler', 'Maxwell']  # noqa: E221
+        cuda_common_gpu_architectures = ['3.0', '3.5', '5.0']           # noqa: E221
+        cuda_limit_gpu_architecture   = None                            # noqa: E221
+        cuda_all_gpu_architectures    = ['3.0', '3.2', '3.5', '5.0']    # noqa: E221
+
+        if version_compare(cuda_version, '<7.0'):
+            cuda_limit_gpu_architecture = '5.2'
+
+        if version_compare(cuda_version, '>=7.0'):
+            cuda_known_gpu_architectures  += ['Kepler+Tegra', 'Kepler+Tesla', 'Maxwell+Tegra']  # noqa: E221
+            cuda_common_gpu_architectures += ['5.2']                                            # noqa: E221
+
+            if version_compare(cuda_version, '<8.0'):
+                cuda_common_gpu_architectures += ['5.2+PTX']  # noqa: E221
+                cuda_limit_gpu_architecture    = '6.0'        # noqa: E221
+
+        if version_compare(cuda_version, '>=8.0'):
+            cuda_known_gpu_architectures  += ['Pascal', 'Pascal+Tegra']  # noqa: E221
+            cuda_common_gpu_architectures += ['6.0', '6.1']              # noqa: E221
+            cuda_all_gpu_architectures    += ['6.0', '6.1', '6.2']       # noqa: E221
+
+            if version_compare(cuda_version, '<9.0'):
+                cuda_common_gpu_architectures += ['6.1+PTX']  # noqa: E221
+                cuda_limit_gpu_architecture    = '7.0'        # noqa: E221
+
+        if version_compare(cuda_version, '>=9.0'):
+            cuda_known_gpu_architectures  += ['Volta', 'Xavier']                   # noqa: E221
+            cuda_common_gpu_architectures += ['7.0', '7.0+PTX']                    # noqa: E221
+            cuda_all_gpu_architectures    += ['7.0', '7.0+PTX', '7.2', '7.2+PTX']  # noqa: E221
+
+            if version_compare(cuda_version, '<10.0'):
+                cuda_limit_gpu_architecture = '7.5'
+
+        if version_compare(cuda_version, '>=10.0'):
+            cuda_known_gpu_architectures  += ['Turing']          # noqa: E221
+            cuda_common_gpu_architectures += ['7.5', '7.5+PTX']  # noqa: E221
+            cuda_all_gpu_architectures    += ['7.5', '7.5+PTX']  # noqa: E221
+
+            if version_compare(cuda_version, '<11.0'):
+                cuda_limit_gpu_architecture = '8.0'
+
+        if not cuda_arch_list:
+            cuda_arch_list = 'Auto'
+
+        if   cuda_arch_list == 'All':     # noqa: E271
+            cuda_arch_list = cuda_known_gpu_architectures
+        elif cuda_arch_list == 'Common':  # noqa: E271
+            cuda_arch_list = cuda_common_gpu_architectures
+        elif cuda_arch_list == 'Auto':    # noqa: E271
+            if detected:
+                if isinstance(detected, list):
+                    cuda_arch_list = detected
+                else:
+                    cuda_arch_list = self._break_arch_string(detected)
+
+                if cuda_limit_gpu_architecture:
+                    filtered_cuda_arch_list = []
+                    for arch in cuda_arch_list:
+                        if arch:
+                            if version_compare(arch, '>=' + cuda_limit_gpu_architecture):
+                                arch = cuda_common_gpu_architectures[-1]
+                            if arch not in filtered_cuda_arch_list:
+                                filtered_cuda_arch_list.append(arch)
+                    cuda_arch_list = filtered_cuda_arch_list
+            else:
+                cuda_arch_list = cuda_common_gpu_architectures
+        elif isinstance(cuda_arch_list, str):
+            cuda_arch_list = self._break_arch_string(cuda_arch_list)
+
+        cuda_arch_list = sorted([x for x in set(cuda_arch_list) if x])
+
+        cuda_arch_bin = []
+        cuda_arch_ptx = []
+        for arch_name in cuda_arch_list:
+            arch_bin = []
+            arch_ptx = []
+            add_ptx = arch_name.endswith('+PTX')
+            if add_ptx:
+                arch_name = arch_name[:-len('+PTX')]
+
+            if re.fullmatch('[0-9]+\\.[0-9](\\([0-9]+\\.[0-9]\\))?', arch_name):
+                arch_bin, arch_ptx = [arch_name], [arch_name]
+            else:
+                arch_bin, arch_ptx = {
+                    'Fermi':         (['2.0', '2.1(2.0)'], []),
+                    'Kepler+Tegra':  (['3.2'],             []),
+                    'Kepler+Tesla':  (['3.7'],             []),
+                    'Kepler':        (['3.0', '3.5'],      ['3.5']),
+                    'Maxwell+Tegra': (['5.3'],             []),
+                    'Maxwell':       (['5.0', '5.2'],      ['5.2']),
+                    'Pascal':        (['6.0', '6.1'],      ['6.1']),
+                    'Pascal+Tegra':  (['6.2'],             []),
+                    'Volta':         (['7.0'],             ['7.0']),
+                    'Xavier':        (['7.2'],             []),
+                    'Turing':        (['7.5'],             ['7.5']),
+                }.get(arch_name, (None, None))
+
+            if arch_bin is None:
+                raise InvalidArguments('Unknown CUDA Architecture Name {}!'
+                                       .format(arch_name))
+
+            cuda_arch_bin += arch_bin
+
+            if add_ptx:
+                if not arch_ptx:
+                    arch_ptx = arch_bin
+                cuda_arch_ptx += arch_ptx
+
+        cuda_arch_bin = re.sub('\\.', '', ' '.join(cuda_arch_bin))
+        cuda_arch_ptx = re.sub('\\.', '', ' '.join(cuda_arch_ptx))
+        cuda_arch_bin = re.findall('[0-9()]+', cuda_arch_bin)
+        cuda_arch_ptx = re.findall('[0-9]+',   cuda_arch_ptx)
+        cuda_arch_bin = sorted(list(set(cuda_arch_bin)))
+        cuda_arch_ptx = sorted(list(set(cuda_arch_ptx)))
+
+        nvcc_flags = []
+        nvcc_archs_readable = []
+
+        for arch in cuda_arch_bin:
+            m = re.match('([0-9]+)\\(([0-9]+)\\)', arch)
+            if m:
+                nvcc_flags += ['-gencode', 'arch=compute_' + m[2] + ',code=sm_' + m[1]]
+                nvcc_archs_readable += ['sm_' + m[1]]
+            else:
+                nvcc_flags += ['-gencode', 'arch=compute_' + arch + ',code=sm_' + arch]
+                nvcc_archs_readable += ['sm_' + arch]
+
+        for arch in cuda_arch_ptx:
+            nvcc_flags += ['-gencode', 'arch=compute_' + arch + ',code=compute_' + arch]
+            nvcc_archs_readable += ['compute_' + arch]
+
+        return nvcc_flags, nvcc_archs_readable
+
+def initialize(*args, **kwargs):
+    return CudaModule(*args, **kwargs)
diff -Nru meson-0.49.0/mesonbuild/modules/unstable_icestorm.py meson-0.52.1/mesonbuild/modules/unstable_icestorm.py
--- meson-0.49.0/mesonbuild/modules/unstable_icestorm.py	2018-08-25 08:05:43.000000000 +0000
+++ meson-0.52.1/mesonbuild/modules/unstable_icestorm.py	2019-05-02 18:59:50.000000000 +0000
@@ -36,7 +36,7 @@
     def project(self, interpreter, state, args, kwargs):
         if not self.yosys_bin:
             self.detect_binaries(interpreter)
-        if not len(args):
+        if not args:
             raise mesonlib.MesonException('Project requires at least one argument, which is the project name.')
         proj_name = args[0]
         arg_sources = args[1:]
diff -Nru meson-0.49.0/mesonbuild/modules/unstable_kconfig.py meson-0.52.1/mesonbuild/modules/unstable_kconfig.py
--- meson-0.49.0/mesonbuild/modules/unstable_kconfig.py	1970-01-01 00:00:00.000000000 +0000
+++ meson-0.52.1/mesonbuild/modules/unstable_kconfig.py	2019-08-28 17:15:39.000000000 +0000
@@ -0,0 +1,73 @@
+# Copyright 2017, 2019 The Meson development team
+
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+
+#     http://www.apache.org/licenses/LICENSE-2.0
+
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from . import ExtensionModule
+
+from .. import mesonlib
+from ..mesonlib import typeslistify
+from ..interpreterbase import FeatureNew, noKwargs
+from ..interpreter import InvalidCode
+
+import os
+
+class KconfigModule(ExtensionModule):
+
+    @FeatureNew('Kconfig Module', '0.51.0')
+    def __init__(self, *args, **kwargs):
+        super().__init__(*args, **kwargs)
+        self.snippets.add('load')
+
+    def _load_file(self, path_to_config):
+        result = dict()
+        try:
+            with open(path_to_config) as f:
+                for line in f:
+                    if '#' in line:
+                        comment_idx = line.index('#')
+                        line = line[:comment_idx]
+                    line = line.strip()
+                    try:
+                        name, val = line.split('=', 1)
+                    except ValueError:
+                        continue
+                    result[name.strip()] = val.strip()
+        except IOError as e:
+            raise mesonlib.MesonException('Failed to load {}: {}'.format(path_to_config, e))
+
+        return result
+
+    @noKwargs
+    def load(self, interpreter, state, args, kwargs):
+        sources = typeslistify(args, (str, mesonlib.File))
+        if len(sources) != 1:
+            raise InvalidCode('load takes only one file input.')
+
+        s = sources[0]
+        is_built = False
+        if isinstance(s, mesonlib.File):
+            if s.is_built:
+                FeatureNew('kconfig.load() of built files', '0.52.0').use(state.subproject)
+                is_built = True
+            s = s.absolute_path(interpreter.environment.source_dir, interpreter.environment.build_dir)
+        else:
+            s = os.path.join(interpreter.environment.source_dir, s)
+
+        if s not in interpreter.build_def_files and not is_built:
+            interpreter.build_def_files.append(s)
+
+        return self._load_file(s)
+
+
+def initialize(*args, **kwargs):
+    return KconfigModule(*args, **kwargs)
diff -Nru meson-0.49.0/mesonbuild/modules/unstable_simd.py meson-0.52.1/mesonbuild/modules/unstable_simd.py
--- meson-0.49.0/mesonbuild/modules/unstable_simd.py	2018-08-25 08:05:43.000000000 +0000
+++ meson-0.52.1/mesonbuild/modules/unstable_simd.py	2019-11-28 17:37:44.000000000 +0000
@@ -65,8 +65,8 @@
             if args is None:
                 mlog.log('Compiler supports %s:' % iset, mlog.red('NO'))
                 continue
-            if len(args) > 0:
-                if not compiler.has_multi_arguments(args, state.environment):
+            if args:
+                if not compiler.has_multi_arguments(args, state.environment)[0]:
                     mlog.log('Compiler supports %s:' % iset, mlog.red('NO'))
                     continue
             mlog.log('Compiler supports %s:' % iset, mlog.green('YES'))
diff -Nru meson-0.49.0/mesonbuild/modules/windows.py meson-0.52.1/mesonbuild/modules/windows.py
--- meson-0.49.0/mesonbuild/modules/windows.py	2018-12-09 14:27:23.000000000 +0000
+++ meson-0.52.1/mesonbuild/modules/windows.py	2019-08-28 17:15:39.000000000 +0000
@@ -18,12 +18,12 @@
 
 from .. import mlog
 from .. import mesonlib, build
-from ..mesonlib import MesonException, extract_as_list
+from ..mesonlib import MachineChoice, MesonException, extract_as_list
 from . import get_include_args
 from . import ModuleReturnValue
 from . import ExtensionModule
 from ..interpreter import CustomTargetHolder
-from ..interpreterbase import permittedKwargs, FeatureNewKwargs
+from ..interpreterbase import permittedKwargs, FeatureNewKwargs, flatten
 from ..dependencies import ExternalProgram
 
 class ResourceCompilerType(enum.Enum):
@@ -41,33 +41,18 @@
     def _find_resource_compiler(self, state):
         # FIXME: Does not handle `native: true` executables, see
         # See https://github.com/mesonbuild/meson/issues/1531
+        # Take a parameter instead of the hardcoded definition below
+        for_machine = MachineChoice.HOST
 
         if hasattr(self, '_rescomp'):
             return self._rescomp
 
-        rescomp = None
-        if state.environment.is_cross_build():
-            # If cross compiling see if windres has been specified in the
-            # cross file before trying to find it another way.
-            bins = state.environment.cross_info.config['binaries']
-            rescomp = ExternalProgram.from_bin_list(bins, 'windres')
+        # Will try cross / native file and then env var
+        rescomp = ExternalProgram.from_bin_list(state.environment.binaries[for_machine], 'windres')
 
         if not rescomp or not rescomp.found():
-            if 'WINDRES' in os.environ:
-                # Pick-up env var WINDRES if set. This is often used for
-                # specifying an arch-specific windres.
-                rescomp = ExternalProgram('windres', command=os.environ.get('WINDRES'), silent=True)
-
-        if not rescomp or not rescomp.found():
-            # Take windres from the config file after the environment, which is
-            # in keeping with the expectations on unix-like OSes that
-            # environment variables trump config files.
-            bins = state.environment.config_info.binaries
-            rescomp = ExternalProgram.from_bin_list(bins, 'windres')
-
-        if not rescomp or not rescomp.found():
-            comp = self.detect_compiler(state.compilers)
-            if comp.id == 'msvc' or comp.id == 'clang-cl':
+            comp = self.detect_compiler(state.environment.coredata.compilers[for_machine])
+            if comp.id in {'msvc', 'clang-cl', 'intel-cl'}:
                 rescomp = ExternalProgram('rc', silent=True)
             else:
                 rescomp = ExternalProgram('windres', silent=True)
@@ -75,7 +60,7 @@
         if not rescomp.found():
             raise MesonException('Could not find Windows resource compiler')
 
-        for (arg, match, type) in [
+        for (arg, match, rc_type) in [
                 ('/?', '^.*Microsoft.*Resource Compiler.*$', ResourceCompilerType.rc),
                 ('--version', '^.*GNU windres.*$', ResourceCompilerType.windres),
         ]:
@@ -83,7 +68,7 @@
             m = re.search(match, o, re.MULTILINE)
             if m:
                 mlog.log('Windows resource compiler: %s' % m.group())
-                self._rescomp = (rescomp, type)
+                self._rescomp = (rescomp, rc_type)
                 break
         else:
             raise MesonException('Could not determine type of Windows resource compiler')
@@ -93,7 +78,7 @@
     @FeatureNewKwargs('windows.compile_resources', '0.47.0', ['depend_files', 'depends'])
     @permittedKwargs({'args', 'include_directories', 'depend_files', 'depends'})
     def compile_resources(self, state, args, kwargs):
-        extra_args = mesonlib.stringlistify(kwargs.get('args', []))
+        extra_args = mesonlib.stringlistify(flatten(kwargs.get('args', [])))
         wrc_depend_files = extract_as_list(kwargs, 'depend_files', pop = True)
         wrc_depends = extract_as_list(kwargs, 'depends', pop = True)
         for d in wrc_depends:
diff -Nru meson-0.49.0/mesonbuild/mparser.py meson-0.52.1/mesonbuild/mparser.py
--- meson-0.49.0/mesonbuild/mparser.py	2018-12-09 14:27:16.000000000 +0000
+++ meson-0.52.1/mesonbuild/mparser.py	2019-11-28 17:37:44.000000000 +0000
@@ -21,12 +21,12 @@
 # This is the regex for the supported escape sequences of a regular string
 # literal, like 'abc\x00'
 ESCAPE_SEQUENCE_SINGLE_RE = re.compile(r'''
-    ( \\U........      # 8-digit hex escapes
-    | \\u....          # 4-digit hex escapes
-    | \\x..            # 2-digit hex escapes
-    | \\[0-7]{1,3}     # Octal escapes
-    | \\N\{[^}]+\}     # Unicode characters by name
-    | \\[\\'abfnrtv]   # Single-character escapes
+    ( \\U[A-Fa-f0-9]{8}   # 8-digit hex escapes
+    | \\u[A-Fa-f0-9]{4}   # 4-digit hex escapes
+    | \\x[A-Fa-f0-9]{2}   # 2-digit hex escapes
+    | \\[0-7]{1,3}        # Octal escapes
+    | \\N\{[^}]+\}        # Unicode characters by name
+    | \\[\\'abfnrtv]      # Single-character escapes
     )''', re.UNICODE | re.VERBOSE)
 
 class MesonUnicodeDecodeError(MesonException):
@@ -37,7 +37,7 @@
 def decode_match(match):
     try:
         return codecs.decode(match.group(0), 'unicode_escape')
-    except UnicodeDecodeError as err:
+    except UnicodeDecodeError:
         raise MesonUnicodeDecodeError(match.group(0))
 
 class ParseException(MesonException):
@@ -190,7 +190,11 @@
                             line_start = mo.end() - len(lines[-1])
                     elif tid == 'number':
                         value = int(match_text, base=0)
-                    elif tid == 'eol' or tid == 'eol_cont':
+                    elif tid == 'eol_cont':
+                        lineno += 1
+                        line_start = loc
+                        break
+                    elif tid == 'eol':
                         lineno += 1
                         line_start = loc
                         if par_count > 0 or bracket_count > 0 or curl_count > 0:
@@ -208,7 +212,15 @@
             if not matched:
                 raise ParseException('lexer', self.getline(line_start), lineno, col)
 
-class ElementaryNode:
+class BaseNode:
+    def accept(self, visitor):
+        fname = 'visit_{}'.format(type(self).__name__)
+        if hasattr(visitor, fname):
+            func = getattr(visitor, fname)
+            if callable(func):
+                func(self)
+
+class ElementaryNode(BaseNode):
     def __init__(self, token):
         self.lineno = token.lineno
         self.subdir = token.subdir
@@ -249,28 +261,32 @@
 class BreakNode(ElementaryNode):
     pass
 
-class ArrayNode:
-    def __init__(self, args):
+class ArrayNode(BaseNode):
+    def __init__(self, args, lineno, colno, end_lineno, end_colno):
         self.subdir = args.subdir
-        self.lineno = args.lineno
-        self.colno = args.colno
+        self.lineno = lineno
+        self.colno = colno
+        self.end_lineno = end_lineno
+        self.end_colno = end_colno
         self.args = args
 
-class DictNode:
-    def __init__(self, args):
+class DictNode(BaseNode):
+    def __init__(self, args, lineno, colno, end_lineno, end_colno):
         self.subdir = args.subdir
-        self.lineno = args.lineno
-        self.colno = args.colno
+        self.lineno = lineno
+        self.colno = colno
+        self.end_lineno = end_lineno
+        self.end_colno = end_colno
         self.args = args
 
-class EmptyNode:
+class EmptyNode(BaseNode):
     def __init__(self, lineno, colno):
         self.subdir = ''
         self.lineno = lineno
         self.colno = colno
         self.value = None
 
-class OrNode:
+class OrNode(BaseNode):
     def __init__(self, left, right):
         self.subdir = left.subdir
         self.lineno = left.lineno
@@ -278,7 +294,7 @@
         self.left = left
         self.right = right
 
-class AndNode:
+class AndNode(BaseNode):
     def __init__(self, left, right):
         self.subdir = left.subdir
         self.lineno = left.lineno
@@ -286,7 +302,7 @@
         self.left = left
         self.right = right
 
-class ComparisonNode:
+class ComparisonNode(BaseNode):
     def __init__(self, ctype, left, right):
         self.lineno = left.lineno
         self.colno = left.colno
@@ -295,7 +311,7 @@
         self.right = right
         self.ctype = ctype
 
-class ArithmeticNode:
+class ArithmeticNode(BaseNode):
     def __init__(self, operation, left, right):
         self.subdir = left.subdir
         self.lineno = left.lineno
@@ -304,21 +320,21 @@
         self.right = right
         self.operation = operation
 
-class NotNode:
+class NotNode(BaseNode):
     def __init__(self, location_node, value):
         self.subdir = location_node.subdir
         self.lineno = location_node.lineno
         self.colno = location_node.colno
         self.value = value
 
-class CodeBlockNode:
+class CodeBlockNode(BaseNode):
     def __init__(self, location_node):
         self.subdir = location_node.subdir
         self.lineno = location_node.lineno
         self.colno = location_node.colno
         self.lines = []
 
-class IndexNode:
+class IndexNode(BaseNode):
     def __init__(self, iobject, index):
         self.iobject = iobject
         self.index = index
@@ -326,7 +342,7 @@
         self.lineno = iobject.lineno
         self.colno = iobject.colno
 
-class MethodNode:
+class MethodNode(BaseNode):
     def __init__(self, subdir, lineno, colno, source_object, name, args):
         self.subdir = subdir
         self.lineno = lineno
@@ -336,32 +352,36 @@
         assert(isinstance(self.name, str))
         self.args = args
 
-class FunctionNode:
-    def __init__(self, subdir, lineno, colno, func_name, args):
+class FunctionNode(BaseNode):
+    def __init__(self, subdir, lineno, colno, end_lineno, end_colno, func_name, args):
         self.subdir = subdir
         self.lineno = lineno
         self.colno = colno
+        self.end_lineno = end_lineno
+        self.end_colno = end_colno
         self.func_name = func_name
         assert(isinstance(func_name, str))
         self.args = args
 
-class AssignmentNode:
-    def __init__(self, lineno, colno, var_name, value):
+class AssignmentNode(BaseNode):
+    def __init__(self, subdir, lineno, colno, var_name, value):
+        self.subdir = subdir
         self.lineno = lineno
         self.colno = colno
         self.var_name = var_name
         assert(isinstance(var_name, str))
         self.value = value
 
-class PlusAssignmentNode:
-    def __init__(self, lineno, colno, var_name, value):
+class PlusAssignmentNode(BaseNode):
+    def __init__(self, subdir, lineno, colno, var_name, value):
+        self.subdir = subdir
         self.lineno = lineno
         self.colno = colno
         self.var_name = var_name
         assert(isinstance(var_name, str))
         self.value = value
 
-class ForeachClauseNode:
+class ForeachClauseNode(BaseNode):
     def __init__(self, lineno, colno, varnames, items, block):
         self.lineno = lineno
         self.colno = colno
@@ -369,36 +389,37 @@
         self.items = items
         self.block = block
 
-class IfClauseNode:
+class IfClauseNode(BaseNode):
     def __init__(self, lineno, colno):
         self.lineno = lineno
         self.colno = colno
         self.ifs = []
         self.elseblock = EmptyNode(lineno, colno)
 
-class UMinusNode:
+class UMinusNode(BaseNode):
     def __init__(self, current_location, value):
         self.subdir = current_location.subdir
         self.lineno = current_location.lineno
         self.colno = current_location.colno
         self.value = value
 
-class IfNode:
+class IfNode(BaseNode):
     def __init__(self, lineno, colno, condition, block):
         self.lineno = lineno
         self.colno = colno
         self.condition = condition
         self.block = block
 
-class TernaryNode:
-    def __init__(self, lineno, colno, condition, trueblock, falseblock):
+class TernaryNode(BaseNode):
+    def __init__(self, subdir, lineno, colno, condition, trueblock, falseblock):
+        self.subdir = subdir
         self.lineno = lineno
         self.colno = colno
         self.condition = condition
         self.trueblock = trueblock
         self.falseblock = falseblock
 
-class ArgumentNode:
+class ArgumentNode(BaseNode):
     def __init__(self, token):
         self.lineno = token.lineno
         self.colno = token.colno
@@ -510,13 +531,13 @@
             value = self.e1()
             if not isinstance(left, IdNode):
                 raise ParseException('Plusassignment target must be an id.', self.getline(), left.lineno, left.colno)
-            return PlusAssignmentNode(left.lineno, left.colno, left.value, value)
+            return PlusAssignmentNode(left.subdir, left.lineno, left.colno, left.value, value)
         elif self.accept('assign'):
             value = self.e1()
             if not isinstance(left, IdNode):
                 raise ParseException('Assignment target must be an id.',
                                      self.getline(), left.lineno, left.colno)
-            return AssignmentNode(left.lineno, left.colno, left.value, value)
+            return AssignmentNode(left.subdir, left.lineno, left.colno, left.value, value)
         elif self.accept('questionmark'):
             if self.in_ternary:
                 raise ParseException('Nested ternary operators are not allowed.',
@@ -526,7 +547,7 @@
             self.expect('colon')
             falseblock = self.e1()
             self.in_ternary = False
-            return TernaryNode(left.lineno, left.colno, left, trueblock, falseblock)
+            return TernaryNode(left.subdir, left.lineno, left.colno, left, trueblock, falseblock)
         return left
 
     def e2(self):
@@ -605,7 +626,7 @@
             if not isinstance(left, IdNode):
                 raise ParseException('Function call must be applied to plain id',
                                      self.getline(), left.lineno, left.colno)
-            left = FunctionNode(left.subdir, left.lineno, left.colno, left.value, args)
+            left = FunctionNode(left.subdir, left.lineno, left.colno, self.current.lineno, self.current.colno, left.value, args)
         go_again = True
         while go_again:
             go_again = False
@@ -626,11 +647,11 @@
         elif self.accept('lbracket'):
             args = self.args()
             self.block_expect('rbracket', block_start)
-            return ArrayNode(args)
+            return ArrayNode(args, block_start.lineno, block_start.colno, self.current.lineno, self.current.colno)
         elif self.accept('lcurl'):
             key_values = self.key_values()
             self.block_expect('rcurl', block_start)
-            return DictNode(key_values)
+            return DictNode(key_values, block_start.lineno, block_start.colno, self.current.lineno, self.current.colno)
         else:
             return self.e9()
 
diff -Nru meson-0.49.0/mesonbuild/msetup.py meson-0.52.1/mesonbuild/msetup.py
--- meson-0.49.0/mesonbuild/msetup.py	2018-12-09 14:27:23.000000000 +0000
+++ meson-0.52.1/mesonbuild/msetup.py	2019-11-28 17:37:44.000000000 +0000
@@ -19,20 +19,27 @@
 import platform
 import cProfile as profile
 import argparse
+import tempfile
+import shutil
+import glob
 
 from . import environment, interpreter, mesonlib
 from . import build
 from . import mlog, coredata
+from . import mintro
+from .mconf import make_lower_case
 from .mesonlib import MesonException
 
 def add_arguments(parser):
     coredata.register_builtin_arguments(parser)
-    parser.add_argument('--cross-file', default=None,
-                        help='File describing cross compilation environment.')
     parser.add_argument('--native-file',
                         default=[],
                         action='append',
                         help='File containing overrides for native compilation environment.')
+    parser.add_argument('--cross-file',
+                        default=[],
+                        action='append',
+                        help='File describing cross compilation environment.')
     parser.add_argument('-v', '--version', action='version',
                         version=coredata.version)
     parser.add_argument('--profile-self', action='store_true', dest='profile',
@@ -56,25 +63,36 @@
                                                                options.sourcedir,
                                                                options.reconfigure,
                                                                options.wipe)
-
         if options.wipe:
             # Make a copy of the cmd line file to make sure we can always
             # restore that file if anything bad happens. For example if
             # configuration fails we need to be able to wipe again.
-            filename = coredata.get_cmd_line_file(self.build_dir)
-            with open(filename, 'r') as f:
-                content = f.read()
-
-            coredata.read_cmd_line_file(self.build_dir, options)
-
-            try:
-                mesonlib.windows_proof_rmtree(self.build_dir)
-            finally:
-                # Restore the file
-                path = os.path.dirname(filename)
-                os.makedirs(path, exist_ok=True)
-                with open(filename, 'w') as f:
-                    f.write(content)
+            restore = []
+            with tempfile.TemporaryDirectory() as d:
+                for filename in [coredata.get_cmd_line_file(self.build_dir)] + glob.glob(os.path.join(self.build_dir, environment.Environment.private_dir, '*.ini')):
+                    try:
+                        restore.append((shutil.copy(filename, d), filename))
+                    except FileNotFoundError:
+                        raise MesonException(
+                            'Cannot find cmd_line.txt. This is probably because this '
+                            'build directory was configured with a meson version < 0.49.0.')
+
+                coredata.read_cmd_line_file(self.build_dir, options)
+
+                try:
+                    # Don't delete the whole tree, just all of the files and
+                    # folders in the tree. Otherwise calling wipe form the builddir
+                    # will cause a crash
+                    for l in os.listdir(self.build_dir):
+                        l = os.path.join(self.build_dir, l)
+                        if os.path.isdir(l):
+                            mesonlib.windows_proof_rmtree(l)
+                        else:
+                            mesonlib.windows_proof_rm(l)
+                finally:
+                    for b, f in restore:
+                        os.makedirs(os.path.dirname(f), exist_ok=True)
+                        shutil.move(b, f)
 
         self.options = options
 
@@ -132,13 +150,6 @@
                 sys.exit(1)
         return src_dir, build_dir
 
-    def check_pkgconfig_envvar(self, env):
-        curvar = os.environ.get('PKG_CONFIG_PATH', '')
-        if curvar != env.coredata.pkgconf_envvar:
-            mlog.warning('PKG_CONFIG_PATH has changed between invocations from "%s" to "%s".' %
-                         (env.coredata.pkgconf_envvar, curvar))
-            env.coredata.pkgconf_envvar = curvar
-
     def generate(self):
         env = environment.Environment(self.source_dir, self.build_dir, self.options)
         mlog.initialize(env.get_log_dir(), self.options.fatal_warnings)
@@ -150,9 +161,9 @@
     def _generate(self, env):
         mlog.debug('Build started at', datetime.datetime.now().isoformat())
         mlog.debug('Main binary:', sys.executable)
+        mlog.debug('Build Options:', coredata.get_cmd_line_options(self.build_dir, self.options))
         mlog.debug('Python system:', platform.system())
         mlog.log(mlog.bold('The Meson build system'))
-        self.check_pkgconfig_envvar(env)
         mlog.log('Version:', coredata.version)
         mlog.log('Source dir:', mlog.bold(self.source_dir))
         mlog.log('Build dir:', mlog.bold(self.build_dir))
@@ -164,22 +175,29 @@
 
         intr = interpreter.Interpreter(b)
         if env.is_cross_build():
-            mlog.log('Host machine cpu family:', mlog.bold(intr.builtin['host_machine'].cpu_family_method([], {})))
-            mlog.log('Host machine cpu:', mlog.bold(intr.builtin['host_machine'].cpu_method([], {})))
-            mlog.log('Target machine cpu family:', mlog.bold(intr.builtin['target_machine'].cpu_family_method([], {})))
-            mlog.log('Target machine cpu:', mlog.bold(intr.builtin['target_machine'].cpu_method([], {})))
-        mlog.log('Build machine cpu family:', mlog.bold(intr.builtin['build_machine'].cpu_family_method([], {})))
-        mlog.log('Build machine cpu:', mlog.bold(intr.builtin['build_machine'].cpu_method([], {})))
-        if self.options.profile:
-            fname = os.path.join(self.build_dir, 'meson-private', 'profile-interpreter.log')
-            profile.runctx('intr.run()', globals(), locals(), filename=fname)
+            logger_fun = mlog.log
         else:
-            intr.run()
+            logger_fun = mlog.debug
+        logger_fun('Build machine cpu family:', mlog.bold(intr.builtin['build_machine'].cpu_family_method([], {})))
+        logger_fun('Build machine cpu:', mlog.bold(intr.builtin['build_machine'].cpu_method([], {})))
+        mlog.log('Host machine cpu family:', mlog.bold(intr.builtin['host_machine'].cpu_family_method([], {})))
+        mlog.log('Host machine cpu:', mlog.bold(intr.builtin['host_machine'].cpu_method([], {})))
+        logger_fun('Target machine cpu family:', mlog.bold(intr.builtin['target_machine'].cpu_family_method([], {})))
+        logger_fun('Target machine cpu:', mlog.bold(intr.builtin['target_machine'].cpu_method([], {})))
+        try:
+            if self.options.profile:
+                fname = os.path.join(self.build_dir, 'meson-private', 'profile-interpreter.log')
+                profile.runctx('intr.run()', globals(), locals(), filename=fname)
+            else:
+                intr.run()
+        except Exception as e:
+            mintro.write_meson_info_file(b, [e])
+            raise
         # Print all default option values that don't match the current value
         for def_opt_name, def_opt_value, cur_opt_value in intr.get_non_matching_default_options():
             mlog.log('Option', mlog.bold(def_opt_name), 'is:',
-                     mlog.bold(str(cur_opt_value)),
-                     '[default: {}]'.format(str(def_opt_value)))
+                     mlog.bold('{}'.format(make_lower_case(cur_opt_value.printable_value()))),
+                     '[default: {}]'.format(make_lower_case(def_opt_value)))
         try:
             dumpfile = os.path.join(env.get_scratch_dir(), 'build.dat')
             # We would like to write coredata as late as possible since we use the existence of
@@ -196,13 +214,23 @@
             else:
                 intr.backend.generate(intr)
             build.save(b, dumpfile)
-            # Post-conf scripts must be run after writing coredata or else introspection fails.
-            intr.backend.run_postconf_scripts()
             if env.first_invocation:
                 coredata.write_cmd_line_file(self.build_dir, self.options)
             else:
                 coredata.update_cmd_line_file(self.build_dir, self.options)
-        except:
+
+            # Generate an IDE introspection file with the same syntax as the already existing API
+            if self.options.profile:
+                fname = os.path.join(self.build_dir, 'meson-private', 'profile-introspector.log')
+                profile.runctx('mintro.generate_introspection_file(b, intr.backend)', globals(), locals(), filename=fname)
+            else:
+                mintro.generate_introspection_file(b, intr.backend)
+            mintro.write_meson_info_file(b, [], True)
+
+            # Post-conf scripts must be run after writing coredata or else introspection fails.
+            intr.backend.run_postconf_scripts()
+        except Exception as e:
+            mintro.write_meson_info_file(b, [e])
             if 'cdf' in locals():
                 old_cdf = cdf + '.prev'
                 if os.path.exists(old_cdf):
diff -Nru meson-0.49.0/mesonbuild/msubprojects.py meson-0.52.1/mesonbuild/msubprojects.py
--- meson-0.49.0/mesonbuild/msubprojects.py	2018-12-09 14:27:23.000000000 +0000
+++ meson-0.52.1/mesonbuild/msubprojects.py	2019-11-28 15:13:28.000000000 +0000
@@ -1,4 +1,5 @@
 import os, subprocess
+import argparse
 
 from . import mlog
 from .mesonlib import Popen_safe
@@ -40,6 +41,10 @@
 
 def git(cmd, workingdir):
     return subprocess.check_output(['git', '-C', workingdir] + cmd,
+                                   # Redirect stdin to DEVNULL otherwise git
+                                   # messes up the console and ANSI colors stop
+                                   # working on Windows.
+                                   stdin=subprocess.DEVNULL,
                                    stderr=subprocess.STDOUT).decode()
 
 def git_show(repo_dir):
@@ -92,7 +97,7 @@
                      '     To rebase your branch on top of', mlog.bold(revision), 'use', mlog.bold('--rebase'), 'option.')
             return
 
-    git(['submodule', 'update'], repo_dir)
+    git(['submodule', 'update', '--checkout', '--recursive'], repo_dir)
     git_show(repo_dir)
 
 def update_hg(wrap, repo_dir, options):
@@ -115,7 +120,7 @@
         mlog.log('  -> Not used.')
         return
     revno = wrap.get('revision')
-    p, out = Popen_safe(['svn', 'info', '--show-item', 'revision', repo_dir])
+    p, out, _ = Popen_safe(['svn', 'info', '--show-item', 'revision', repo_dir])
     current_revno = out
     if current_revno == revno:
         return
@@ -162,11 +167,23 @@
         return
     try:
         r = Resolver(os.path.dirname(repo_dir))
-        r.resolve(wrap.name)
+        r.resolve(wrap.name, 'meson')
         mlog.log('  -> done')
     except WrapException as e:
         mlog.log('  ->', mlog.red(str(e)))
 
+def foreach(wrap, repo_dir, options):
+    mlog.log('Executing command in %s' % repo_dir)
+    if not os.path.isdir(repo_dir):
+        mlog.log('  -> Not downloaded yet')
+        return
+    try:
+        subprocess.check_call([options.command] + options.args, cwd=repo_dir)
+        mlog.log('')
+    except subprocess.CalledProcessError as e:
+        out = e.output.decode().strip()
+        mlog.log('  -> ', mlog.red(out))
+
 def add_common_arguments(p):
     p.add_argument('--sourcedir', default='.',
                    help='Path to source directory')
@@ -197,6 +214,15 @@
     add_common_arguments(p)
     p.set_defaults(subprojects_func=download)
 
+    p = subparsers.add_parser('foreach', help='Execute a command in each subproject directory.')
+    p.add_argument('command', metavar='command ...',
+                   help='Command to execute in each subproject directory')
+    p.add_argument('args', nargs=argparse.REMAINDER,
+                   help=argparse.SUPPRESS)
+    p.add_argument('--sourcedir', default='.',
+                   help='Path to source directory')
+    p.set_defaults(subprojects_func=foreach)
+
 def run(options):
     src_dir = os.path.relpath(os.path.realpath(options.sourcedir))
     if not os.path.isfile(os.path.join(src_dir, 'meson.build')):
@@ -207,13 +233,14 @@
         mlog.log('Directory', mlog.bold(src_dir), 'does not seem to have subprojects.')
         return 0
     files = []
-    for name in options.subprojects:
-        f = os.path.join(subprojects_dir, name + '.wrap')
-        if not os.path.isfile(f):
-            mlog.error('Subproject', mlog.bold(name), 'not found.')
-            return 1
-        else:
-            files.append(f)
+    if hasattr(options, 'subprojects'):
+        for name in options.subprojects:
+            f = os.path.join(subprojects_dir, name + '.wrap')
+            if not os.path.isfile(f):
+                mlog.error('Subproject', mlog.bold(name), 'not found.')
+                return 1
+            else:
+                files.append(f)
     if not files:
         for f in os.listdir(subprojects_dir):
             if f.endswith('.wrap'):
diff -Nru meson-0.49.0/mesonbuild/mtest.py meson-0.52.1/mesonbuild/mtest.py
--- meson-0.49.0/mesonbuild/mtest.py	2018-12-09 14:27:23.000000000 +0000
+++ meson-0.52.1/mesonbuild/mtest.py	2019-11-28 17:37:44.000000000 +0000
@@ -14,37 +14,54 @@
 
 # A tool to run tests in many different ways.
 
-import shlex
-import subprocess, sys, os, argparse
-import pickle
-from mesonbuild import build
-from mesonbuild import environment
-from mesonbuild.dependencies import ExternalProgram
-from mesonbuild.mesonlib import substring_is_in_list, MesonException
-from mesonbuild import mlog
-
-import tempfile
-import time, datetime, multiprocessing, json
+from pathlib import Path
+from collections import namedtuple
+from copy import deepcopy
+import argparse
 import concurrent.futures as conc
+import datetime
+import enum
+import io
+import json
+import multiprocessing
+import os
+import pickle
 import platform
-import signal
 import random
-from copy import deepcopy
-import enum
+import re
+import signal
+import subprocess
+import sys
+import tempfile
+import time
+import typing
+
+from . import build
+from . import environment
+from . import mlog
+from .dependencies import ExternalProgram
+from .mesonlib import MesonException, get_wine_shortpath, split_args
+
+if typing.TYPE_CHECKING:
+    from .backend.backends import TestSerialisation
 
 # GNU autotools interprets a return code of 77 from tests it executes to
 # mean that the test should be skipped.
 GNU_SKIP_RETURNCODE = 77
 
-def is_windows():
+# GNU autotools interprets a return code of 99 from tests it executes to
+# mean that the test failed even before testing what it is supposed to test.
+GNU_ERROR_RETURNCODE = 99
+
+def is_windows() -> bool:
     platname = platform.system().lower()
     return platname == 'windows' or 'mingw' in platname
 
-def is_cygwin():
+def is_cygwin() -> bool:
     platname = platform.system().lower()
     return 'cygwin' in platname
 
-def determine_worker_count():
+def determine_worker_count() -> int:
     varname = 'MESON_TESTTHREADS'
     if varname in os.environ:
         try:
@@ -61,16 +78,18 @@
             num_workers = 1
     return num_workers
 
-def add_arguments(parser):
+def add_arguments(parser: argparse.ArgumentParser) -> None:
     parser.add_argument('--repeat', default=1, dest='repeat', type=int,
                         help='Number of times to run the tests.')
     parser.add_argument('--no-rebuild', default=False, action='store_true',
                         help='Do not rebuild before running tests.')
     parser.add_argument('--gdb', default=False, dest='gdb', action='store_true',
                         help='Run test under gdb.')
+    parser.add_argument('--gdb-path', default='gdb', dest='gdb_path',
+                        help='Path to the gdb binary (default: gdb).')
     parser.add_argument('--list', default=False, dest='list', action='store_true',
                         help='List available tests.')
-    parser.add_argument('--wrapper', default=None, dest='wrapper', type=shlex.split,
+    parser.add_argument('--wrapper', default=None, dest='wrapper', type=split_args,
                         help='wrapper to run tests with (e.g. Valgrind)')
     parser.add_argument('-C', default='.', dest='wd',
                         help='directory to cd into before running')
@@ -98,13 +117,13 @@
                         ' more time to execute.')
     parser.add_argument('--setup', default=None, dest='setup',
                         help='Which test setup to use.')
-    parser.add_argument('--test-args', default=[], type=shlex.split,
+    parser.add_argument('--test-args', default=[], type=split_args,
                         help='Arguments to pass to the specified test(s) or all tests')
     parser.add_argument('args', nargs='*',
                         help='Optional list of tests to run')
 
 
-def returncode_to_status(retcode):
+def returncode_to_status(retcode: int) -> str:
     # Note: We can't use `os.WIFSIGNALED(result.returncode)` and the related
     # functions here because the status returned by subprocess is munged. It
     # returns a negative value if the process was killed by a signal rather than
@@ -129,7 +148,7 @@
         signame = 'SIGinvalid'
     return '(exit status %d or signal %d %s)' % (retcode, signum, signame)
 
-def env_tuple_to_str(env):
+def env_tuple_to_str(env: typing.Iterable[typing.Tuple[str, str]]) -> str:
     return ''.join(["%s='%s' " % (k, v) for k, v in env])
 
 
@@ -146,11 +165,216 @@
     FAIL = 'FAIL'
     EXPECTEDFAIL = 'EXPECTEDFAIL'
     UNEXPECTEDPASS = 'UNEXPECTEDPASS'
+    ERROR = 'ERROR'
+
+
+class TAPParser:
+    Plan = namedtuple('Plan', ['count', 'late', 'skipped', 'explanation'])
+    Bailout = namedtuple('Bailout', ['message'])
+    Test = namedtuple('Test', ['number', 'name', 'result', 'explanation'])
+    Error = namedtuple('Error', ['message'])
+    Version = namedtuple('Version', ['version'])
+
+    _MAIN = 1
+    _AFTER_TEST = 2
+    _YAML = 3
+
+    _RE_BAILOUT = re.compile(r'Bail out!\s*(.*)')
+    _RE_DIRECTIVE = re.compile(r'(?:\s*\#\s*([Ss][Kk][Ii][Pp]\S*|[Tt][Oo][Dd][Oo])\b\s*(.*))?')
+    _RE_PLAN = re.compile(r'1\.\.([0-9]+)' + _RE_DIRECTIVE.pattern)
+    _RE_TEST = re.compile(r'((?:not )?ok)\s*(?:([0-9]+)\s*)?([^#]*)' + _RE_DIRECTIVE.pattern)
+    _RE_VERSION = re.compile(r'TAP version ([0-9]+)')
+    _RE_YAML_START = re.compile(r'(\s+)---.*')
+    _RE_YAML_END = re.compile(r'\s+\.\.\.\s*')
+
+    def __init__(self, io: typing.Iterator[str]):
+        self.io = io
+
+    def parse_test(self, ok: bool, num: int, name: str, directive: typing.Optional[str], explanation: typing.Optional[str]) -> \
+            typing.Generator[typing.Union['TAPParser.Test', 'TAPParser.Error'], None, None]:
+        name = name.strip()
+        explanation = explanation.strip() if explanation else None
+        if directive is not None:
+            directive = directive.upper()
+            if directive == 'SKIP':
+                if ok:
+                    yield self.Test(num, name, TestResult.SKIP, explanation)
+                    return
+            elif directive == 'TODO':
+                yield self.Test(num, name, TestResult.UNEXPECTEDPASS if ok else TestResult.EXPECTEDFAIL, explanation)
+                return
+            else:
+                yield self.Error('invalid directive "%s"' % (directive,))
+
+        yield self.Test(num, name, TestResult.OK if ok else TestResult.FAIL, explanation)
+
+    def parse(self) -> typing.Generator[typing.Union['TAPParser.Test', 'TAPParser.Error', 'TAPParser.Version', 'TAPParser.Plan', 'TAPParser.Bailout'], None, None]:
+        found_late_test = False
+        bailed_out = False
+        plan = None
+        lineno = 0
+        num_tests = 0
+        yaml_lineno = None
+        yaml_indent = ''
+        state = self._MAIN
+        version = 12
+        while True:
+            lineno += 1
+            try:
+                line = next(self.io).rstrip()
+            except StopIteration:
+                break
+
+            # YAML blocks are only accepted after a test
+            if state == self._AFTER_TEST:
+                if version >= 13:
+                    m = self._RE_YAML_START.match(line)
+                    if m:
+                        state = self._YAML
+                        yaml_lineno = lineno
+                        yaml_indent = m.group(1)
+                        continue
+                state = self._MAIN
+
+            elif state == self._YAML:
+                if self._RE_YAML_END.match(line):
+                    state = self._MAIN
+                    continue
+                if line.startswith(yaml_indent):
+                    continue
+                yield self.Error('YAML block not terminated (started on line {})'.format(yaml_lineno))
+                state = self._MAIN
+
+            assert state == self._MAIN
+            if line.startswith('#'):
+                continue
+
+            m = self._RE_TEST.match(line)
+            if m:
+                if plan and plan.late and not found_late_test:
+                    yield self.Error('unexpected test after late plan')
+                    found_late_test = True
+                num_tests += 1
+                num = num_tests if m.group(2) is None else int(m.group(2))
+                if num != num_tests:
+                    yield self.Error('out of order test numbers')
+                yield from self.parse_test(m.group(1) == 'ok', num,
+                                           m.group(3), m.group(4), m.group(5))
+                state = self._AFTER_TEST
+                continue
+
+            m = self._RE_PLAN.match(line)
+            if m:
+                if plan:
+                    yield self.Error('more than one plan found')
+                else:
+                    count = int(m.group(1))
+                    skipped = (count == 0)
+                    if m.group(2):
+                        if m.group(2).upper().startswith('SKIP'):
+                            if count > 0:
+                                yield self.Error('invalid SKIP directive for plan')
+                            skipped = True
+                        else:
+                            yield self.Error('invalid directive for plan')
+                    plan = self.Plan(count=count, late=(num_tests > 0),
+                                     skipped=skipped, explanation=m.group(3))
+                    yield plan
+                continue
+
+            m = self._RE_BAILOUT.match(line)
+            if m:
+                yield self.Bailout(m.group(1))
+                bailed_out = True
+                continue
+
+            m = self._RE_VERSION.match(line)
+            if m:
+                # The TAP version is only accepted as the first line
+                if lineno != 1:
+                    yield self.Error('version number must be on the first line')
+                    continue
+                version = int(m.group(1))
+                if version < 13:
+                    yield self.Error('version number should be at least 13')
+                else:
+                    yield self.Version(version=version)
+                continue
+
+            if len(line) == 0:
+                continue
+
+            yield self.Error('unexpected input at line %d' % (lineno,))
+
+        if state == self._YAML:
+            yield self.Error('YAML block not terminated (started on line {})'.format(yaml_lineno))
+
+        if not bailed_out and plan and num_tests != plan.count:
+            if num_tests < plan.count:
+                yield self.Error('Too few tests run (expected %d, got %d)' % (plan.count, num_tests))
+            else:
+                yield self.Error('Too many tests run (expected %d, got %d)' % (plan.count, num_tests))
 
 
 class TestRun:
-    def __init__(self, res, returncode, should_fail, duration, stdo, stde, cmd,
-                 env):
+
+    @classmethod
+    def make_exitcode(cls, test: 'TestSerialisation', test_env: typing.Dict[str, str],
+                      returncode: int, duration: float, stdo: typing.Optional[str],
+                      stde: typing.Optional[str],
+                      cmd: typing.Optional[typing.List[str]]) -> 'TestRun':
+        if returncode == GNU_SKIP_RETURNCODE:
+            res = TestResult.SKIP
+        elif returncode == GNU_ERROR_RETURNCODE:
+            res = TestResult.ERROR
+        elif test.should_fail:
+            res = TestResult.EXPECTEDFAIL if bool(returncode) else TestResult.UNEXPECTEDPASS
+        else:
+            res = TestResult.FAIL if bool(returncode) else TestResult.OK
+        return cls(test, test_env, res, returncode, duration, stdo, stde, cmd)
+
+    @classmethod
+    def make_tap(cls, test: 'TestSerialisation', test_env: typing.Dict[str, str],
+                 returncode: int, duration: float, stdo: str, stde: str,
+                 cmd: typing.Optional[typing.List[str]]) -> 'TestRun':
+        res = None
+        num_tests = 0
+        failed = False
+        num_skipped = 0
+
+        for i in TAPParser(io.StringIO(stdo)).parse():
+            if isinstance(i, TAPParser.Bailout):
+                res = TestResult.ERROR
+            elif isinstance(i, TAPParser.Test):
+                if i.result == TestResult.SKIP:
+                    num_skipped += 1
+                elif i.result in (TestResult.FAIL, TestResult.UNEXPECTEDPASS):
+                    failed = True
+                num_tests += 1
+            elif isinstance(i, TAPParser.Error):
+                res = TestResult.ERROR
+                stde += '\nTAP parsing error: ' + i.message
+
+        if returncode != 0:
+            res = TestResult.ERROR
+            stde += '\n(test program exited with status code %d)' % (returncode,)
+
+        if res is None:
+            # Now determine the overall result of the test based on the outcome of the subcases
+            if num_skipped == num_tests:
+                # This includes the case where num_tests is zero
+                res = TestResult.SKIP
+            elif test.should_fail:
+                res = TestResult.EXPECTEDFAIL if failed else TestResult.UNEXPECTEDPASS
+            else:
+                res = TestResult.FAIL if failed else TestResult.OK
+
+        return cls(test, test_env, res, returncode, duration, stdo, stde, cmd)
+
+    def __init__(self, test: 'TestSerialisation', test_env: typing.Dict[str, str],
+                 res: TestResult, returncode: int, duration: float,
+                 stdo: typing.Optional[str], stde: typing.Optional[str],
+                 cmd: typing.Optional[typing.List[str]]):
         assert isinstance(res, TestResult)
         self.res = res
         self.returncode = returncode
@@ -158,10 +382,10 @@
         self.stdo = stdo
         self.stde = stde
         self.cmd = cmd
-        self.env = env
-        self.should_fail = should_fail
+        self.env = test_env
+        self.should_fail = test.should_fail
 
-    def get_log(self):
+    def get_log(self) -> str:
         res = '--- command ---\n'
         if self.cmd is None:
             res += 'NONE\n'
@@ -181,7 +405,7 @@
         res += '-------\n\n'
         return res
 
-def decode(stream):
+def decode(stream: typing.Union[None, bytes]) -> str:
     if stream is None:
         return ''
     try:
@@ -189,57 +413,56 @@
     except UnicodeDecodeError:
         return stream.decode('iso-8859-1', errors='ignore')
 
-def write_json_log(jsonlogfile, test_name, result):
+def write_json_log(jsonlogfile: typing.TextIO, test_name: str, result: TestRun) -> None:
     jresult = {'name': test_name,
                'stdout': result.stdo,
                'result': result.res.value,
                'duration': result.duration,
                'returncode': result.returncode,
-               'command': result.cmd}
-    if isinstance(result.env, dict):
-        jresult['env'] = result.env
-    else:
-        jresult['env'] = result.env.get_env(os.environ)
+               'env': result.env,
+               'command': result.cmd}  # type: typing.Dict[str, typing.Any]
     if result.stde:
         jresult['stderr'] = result.stde
     jsonlogfile.write(json.dumps(jresult) + '\n')
 
-def run_with_mono(fname):
+def run_with_mono(fname: str) -> bool:
     if fname.endswith('.exe') and not (is_windows() or is_cygwin()):
         return True
     return False
 
-def load_benchmarks(build_dir):
-    datafile = os.path.join(build_dir, 'meson-private', 'meson_benchmark_setup.dat')
-    if not os.path.isfile(datafile):
-        raise TestException('Directory ${!r} does not seem to be a Meson build directory.'.format(build_dir))
-    with open(datafile, 'rb') as f:
-        obj = pickle.load(f)
+def load_benchmarks(build_dir: str) -> typing.List['TestSerialisation']:
+    datafile = Path(build_dir) / 'meson-private' / 'meson_benchmark_setup.dat'
+    if not datafile.is_file():
+        raise TestException('Directory {!r} does not seem to be a Meson build directory.'.format(build_dir))
+    with datafile.open('rb') as f:
+        obj = typing.cast(typing.List['TestSerialisation'], pickle.load(f))
     return obj
 
-def load_tests(build_dir):
-    datafile = os.path.join(build_dir, 'meson-private', 'meson_test_setup.dat')
-    if not os.path.isfile(datafile):
-        raise TestException('Directory ${!r} does not seem to be a Meson build directory.'.format(build_dir))
-    with open(datafile, 'rb') as f:
-        obj = pickle.load(f)
+def load_tests(build_dir: str) -> typing.List['TestSerialisation']:
+    datafile = Path(build_dir) / 'meson-private' / 'meson_test_setup.dat'
+    if not datafile.is_file():
+        raise TestException('Directory {!r} does not seem to be a Meson build directory.'.format(build_dir))
+    with datafile.open('rb') as f:
+        obj = typing.cast(typing.List['TestSerialisation'], pickle.load(f))
     return obj
 
 
 class SingleTestRunner:
 
-    def __init__(self, test, env, options):
+    def __init__(self, test: 'TestSerialisation', test_env: typing.Dict[str, str],
+                 env: typing.Dict[str, str], options: argparse.Namespace):
         self.test = test
+        self.test_env = test_env
         self.env = env
         self.options = options
 
-    def _get_cmd(self):
+    def _get_cmd(self) -> typing.Optional[typing.List[str]]:
         if self.test.fname[0].endswith('.jar'):
             return ['java', '-jar'] + self.test.fname
         elif not self.test.is_cross_built and run_with_mono(self.test.fname[0]):
             return ['mono'] + self.test.fname
         else:
-            if self.test.is_cross_built:
+            if self.test.is_cross_built and self.test.needs_exe_wrapper:
                 if self.test.exe_runner is None:
                     # Can not run test on cross compiled executable
                     # because there is no execute wrapper.
@@ -253,33 +476,31 @@
             else:
                 return self.test.fname
 
-    def run(self):
+    def run(self) -> TestRun:
         cmd = self._get_cmd()
         if cmd is None:
             skip_stdout = 'Not run because can not execute cross compiled binaries.'
-            return TestRun(res=TestResult.SKIP, returncode=GNU_SKIP_RETURNCODE,
-                           should_fail=self.test.should_fail, duration=0.0,
-                           stdo=skip_stdout, stde=None, cmd=None, env=self.test.env)
+            return TestRun(self.test, self.test_env, TestResult.SKIP, GNU_SKIP_RETURNCODE, 0.0, skip_stdout, None, None)
         else:
             wrap = TestHarness.get_wrapper(self.options)
             if self.options.gdb:
                 self.test.timeout = None
             return self._run_cmd(wrap + cmd + self.test.cmd_args + self.options.test_args)
 
-    def _run_cmd(self, cmd):
+    def _run_cmd(self, cmd: typing.List[str]) -> TestRun:
         starttime = time.time()
 
         if len(self.test.extra_paths) > 0:
             self.env['PATH'] = os.pathsep.join(self.test.extra_paths + ['']) + self.env['PATH']
-            if substring_is_in_list('wine', cmd):
-                wine_paths = ['Z:' + p for p in self.test.extra_paths]
-                wine_path = ';'.join(wine_paths)
-                # Don't accidentally end with an `;` because that will add the
-                # current directory and might cause unexpected behaviour
-                if 'WINEPATH' in self.env:
-                    self.env['WINEPATH'] = wine_path + ';' + self.env['WINEPATH']
-                else:
-                    self.env['WINEPATH'] = wine_path
+            winecmd = []
+            for c in cmd:
+                winecmd.append(c)
+                if os.path.basename(c).startswith('wine'):
+                    self.env['WINEPATH'] = get_wine_shortpath(
+                        winecmd,
+                        ['Z:' + p for p in self.test.extra_paths] + self.env.get('WINEPATH', '').split(';')
+                    )
+                    break
 
         # If MALLOC_PERTURB_ is not set, or if it is set to an empty value,
         # (i.e., the test or the environment don't explicitly set it), set
@@ -293,7 +514,9 @@
         stderr = None
         if not self.options.verbose:
             stdout = tempfile.TemporaryFile("wb+")
-            stderr = tempfile.TemporaryFile("wb+") if self.options and self.options.split else stdout
+            stderr = tempfile.TemporaryFile("wb+") if self.options.split else stdout
+        if self.test.protocol == 'tap' and stderr is stdout:
+            stdout = tempfile.TemporaryFile("wb+")
 
         # Let gdb handle ^C instead of us
         if self.options.gdb:
@@ -301,7 +524,7 @@
             # Make the meson executable ignore SIGINT while gdb is running.
             signal.signal(signal.SIGINT, signal.SIG_IGN)
 
-        def preexec_fn():
+        def preexec_fn() -> None:
             if self.options.gdb:
                 # Restore the SIGINT handler for the child process to
                 # ensure it can handle it.
@@ -330,7 +553,7 @@
             p.communicate(timeout=timeout)
         except subprocess.TimeoutExpired:
             if self.options.verbose:
-                print('%s time out (After %d seconds)' % (self.test.name, timeout))
+                print('{} time out (After {} seconds)'.format(self.test.name, timeout))
             timed_out = True
         except KeyboardInterrupt:
             mlog.warning('CTRL-C detected while running %s' % (self.test.name))
@@ -367,41 +590,40 @@
                 try:
                     p.communicate(timeout=1)
                 except subprocess.TimeoutExpired:
-                    additional_error = b'Test process could not be killed.'
+                    additional_error = 'Test process could not be killed.'
             except ValueError:
-                additional_error = b'Could not read output. Maybe the process has redirected its stdout/stderr?'
+                additional_error = 'Could not read output. Maybe the process has redirected its stdout/stderr?'
         endtime = time.time()
         duration = endtime - starttime
         if additional_error is None:
-            if stdout is None:  # if stdout is None stderr should be as well
+            if stdout is None:
                 stdo = ''
-                stde = ''
             else:
                 stdout.seek(0)
                 stdo = decode(stdout.read())
-                if stderr != stdout:
-                    stderr.seek(0)
-                    stde = decode(stderr.read())
-                else:
-                    stde = ""
+            if stderr is None or stderr is stdout:
+                stde = ''
+            else:
+                stderr.seek(0)
+                stde = decode(stderr.read())
         else:
             stdo = ""
             stde = additional_error
         if timed_out:
-            res = TestResult.TIMEOUT
-        elif p.returncode == GNU_SKIP_RETURNCODE:
-            res = TestResult.SKIP
-        elif self.test.should_fail:
-            res = TestResult.EXPECTEDFAIL if bool(p.returncode) else TestResult.UNEXPECTEDPASS
+            return TestRun(self.test, self.test_env, TestResult.TIMEOUT, p.returncode, duration, stdo, stde, cmd)
         else:
-            res = TestResult.FAIL if bool(p.returncode) else TestResult.OK
-        return TestRun(res, p.returncode, self.test.should_fail, duration, stdo, stde, cmd, self.test.env)
+            if self.test.protocol == 'exitcode':
+                return TestRun.make_exitcode(self.test, self.test_env, p.returncode, duration, stdo, stde, cmd)
+            else:
+                if self.options.verbose:
+                    print(stdo, end='')
+                return TestRun.make_tap(self.test, self.test_env, p.returncode, duration, stdo, stde, cmd)
 
 
 class TestHarness:
-    def __init__(self, options):
+    def __init__(self, options: argparse.Namespace):
         self.options = options
-        self.collected_logs = []
+        self.collected_logs = []  # type: typing.List[str]
         self.fail_count = 0
         self.expectedfail_count = 0
         self.unexpectedpass_count = 0
@@ -410,23 +632,37 @@
         self.timeout_count = 0
         self.is_run = False
         self.tests = None
-        self.suites = None
-        self.logfilename = None
-        self.logfile = None
-        self.jsonlogfile = None
+        self.logfilename = None   # type: typing.Optional[str]
+        self.logfile = None       # type: typing.Optional[typing.TextIO]
+        self.jsonlogfile = None   # type: typing.Optional[typing.TextIO]
         if self.options.benchmark:
             self.tests = load_benchmarks(options.wd)
         else:
             self.tests = load_tests(options.wd)
-        self.load_suites()
+        ss = set()
+        for t in self.tests:
+            for s in t.suite:
+                ss.add(s)
+        self.suites = list(ss)
+
+    def __del__(self) -> None:
+        self.close_logfiles()
+
+    def __enter__(self):
+        return self
+
+    def __exit__(self, exc_type, exc_value, traceback) -> None:
+        self.close_logfiles()
 
-    def __del__(self):
+    def close_logfiles(self) -> None:
         if self.logfile:
             self.logfile.close()
+            self.logfile = None
         if self.jsonlogfile:
             self.jsonlogfile.close()
+            self.jsonlogfile = None
 
-    def merge_suite_options(self, options, test):
+    def merge_suite_options(self, options: argparse.Namespace, test: 'TestSerialisation') -> typing.Dict[str, str]:
         if ':' in options.setup:
             if options.setup not in self.build_data.test_setups:
                 sys.exit("Unknown test setup '%s'." % options.setup)
@@ -438,6 +674,8 @@
             current = self.build_data.test_setups[full_name]
         if not options.gdb:
             options.gdb = current.gdb
+        if options.gdb:
+            options.verbose = True
         if options.timeout_multiplier is None:
             options.timeout_multiplier = current.timeout_multiplier
     #    if options.env is None:
@@ -448,7 +686,7 @@
             options.wrapper = current.exe_wrapper
         return current.env.get_env(os.environ.copy())
 
-    def get_test_runner(self, test):
+    def get_test_runner(self, test: 'TestSerialisation') -> SingleTestRunner:
         options = deepcopy(self.options)
         if not options.setup:
             options.setup = self.build_data.test_setup_default_name
@@ -456,20 +694,18 @@
             env = self.merge_suite_options(options, test)
         else:
             env = os.environ.copy()
-        if isinstance(test.env, build.EnvironmentVariables):
-            test.env = test.env.get_env(env)
-        env.update(test.env)
-        return SingleTestRunner(test, env, options)
+        test_env = test.env.get_env(env)
+        env.update(test_env)
+        return SingleTestRunner(test, test_env, env, options)
 
-    def process_test_result(self, result):
+    def process_test_result(self, result: TestRun) -> None:
         if result.res is TestResult.TIMEOUT:
             self.timeout_count += 1
-            self.fail_count += 1
         elif result.res is TestResult.SKIP:
             self.skip_count += 1
         elif result.res is TestResult.OK:
             self.success_count += 1
-        elif result.res is TestResult.FAIL:
+        elif result.res is TestResult.FAIL or result.res is TestResult.ERROR:
             self.fail_count += 1
         elif result.res is TestResult.EXPECTEDFAIL:
             self.expectedfail_count += 1
@@ -478,7 +714,8 @@
         else:
             sys.exit('Unknown test result encountered: {}'.format(result.res))
 
-    def print_stats(self, numlen, tests, name, result, i):
+    def print_stats(self, numlen: int, tests: typing.List['TestSerialisation'],
+                    name: str, result: TestRun, i: int) -> None:
         startpad = ' ' * (numlen - len('%d' % (i + 1)))
         num = '%s%d/%d' % (startpad, i + 1, len(tests))
         padding1 = ' ' * (38 - len(name))
@@ -491,9 +728,11 @@
             (num, name, padding1, result.res.value, padding2, result.duration,
              status)
         ok_statuses = (TestResult.OK, TestResult.EXPECTEDFAIL)
+        bad_statuses = (TestResult.FAIL, TestResult.TIMEOUT, TestResult.UNEXPECTEDPASS,
+                        TestResult.ERROR)
         if not self.options.quiet or result.res not in ok_statuses:
             if result.res not in ok_statuses and mlog.colorize_console:
-                if result.res in (TestResult.FAIL, TestResult.TIMEOUT, TestResult.UNEXPECTEDPASS):
+                if result.res in bad_statuses:
                     decorator = mlog.red
                 elif result.res is TestResult.SKIP:
                     decorator = mlog.yellow
@@ -503,8 +742,7 @@
             else:
                 print(result_str)
         result_str += "\n\n" + result.get_log()
-        if (result.returncode != GNU_SKIP_RETURNCODE) \
-                and (result.returncode != 0) != result.should_fail:
+        if result.res in bad_statuses:
             if self.options.print_errorlogs:
                 self.collected_logs.append(result_str)
         if self.logfile:
@@ -512,7 +750,7 @@
         if self.jsonlogfile:
             write_json_log(self.jsonlogfile, name, result)
 
-    def print_summary(self):
+    def print_summary(self) -> None:
         msg = '''
 Ok:                 %4d
 Expected Fail:      %4d
@@ -526,7 +764,7 @@
         if self.logfile:
             self.logfile.write(msg)
 
-    def print_collected_logs(self):
+    def print_collected_logs(self) -> None:
         if len(self.collected_logs) > 0:
             if len(self.collected_logs) > 10:
                 print('\nThe output from 10 first failed tests:\n')
@@ -545,7 +783,10 @@
                         line = line.encode('ascii', errors='replace').decode()
                         print(line)
 
-    def doit(self):
+    def total_failure_count(self) -> int:
+        return self.fail_count + self.unexpectedpass_count + self.timeout_count
+
+    def doit(self) -> int:
         if self.is_run:
             raise RuntimeError('Test harness object can only be used once.')
         self.is_run = True
@@ -553,17 +794,19 @@
         if not tests:
             return 0
         self.run_tests(tests)
-        return self.fail_count
+        return self.total_failure_count()
 
     @staticmethod
-    def split_suite_string(suite):
+    def split_suite_string(suite: str) -> typing.Tuple[str, str]:
         if ':' in suite:
-            return suite.split(':', 1)
+            # mypy can't figure out that str.split(n, 1) will return a list of
+            # length 2, so we have to help it.
+            return typing.cast(typing.Tuple[str, str], tuple(suite.split(':', 1)))
         else:
             return suite, ""
 
     @staticmethod
-    def test_in_suites(test, suites):
+    def test_in_suites(test: 'TestSerialisation', suites: typing.List[str]) -> bool:
         for suite in suites:
             (prj_match, st_match) = TestHarness.split_suite_string(suite)
             for prjst in test.suite:
@@ -594,18 +837,12 @@
                 return True
         return False
 
-    def test_suitable(self, test):
-        return (not self.options.include_suites or TestHarness.test_in_suites(test, self.options.include_suites)) \
-            and not TestHarness.test_in_suites(test, self.options.exclude_suites)
-
-    def load_suites(self):
-        ss = set()
-        for t in self.tests:
-            for s in t.suite:
-                ss.add(s)
-        self.suites = list(ss)
+    def test_suitable(self, test: 'TestSerialisation') -> bool:
+        return ((not self.options.include_suites or
+                TestHarness.test_in_suites(test, self.options.include_suites)) and not
+                TestHarness.test_in_suites(test, self.options.exclude_suites))
 
-    def get_tests(self):
+    def get_tests(self) -> typing.List['TestSerialisation']:
         if not self.tests:
             print('No tests defined.')
             return []
@@ -618,6 +855,7 @@
         else:
             tests = self.tests
 
+        # allow specifying test names like "meson test foo1 foo2", where test('foo1', ...)
         if self.options.args:
             tests = [t for t in tests if t.name in self.options.args]
 
@@ -625,14 +863,11 @@
             print('No suitable tests defined.')
             return []
 
-        for test in tests:
-            test.rebuilt = False
-
         return tests
 
-    def open_log_files(self):
+    def open_log_files(self) -> None:
         if not self.options.logbase or self.options.verbose:
-            return None, None, None, None
+            return
 
         namebase = None
         logfile_base = os.path.join(self.options.wd, 'meson-logs', self.options.logbase)
@@ -647,8 +882,8 @@
         self.logfilename = logfile_base + '.txt'
         self.jsonlogfilename = logfile_base + '.json'
 
-        self.jsonlogfile = open(self.jsonlogfilename, 'w', encoding='utf-8')
-        self.logfile = open(self.logfilename, 'w', encoding='utf-8')
+        self.jsonlogfile = open(self.jsonlogfilename, 'w', encoding='utf-8', errors='replace')
+        self.logfile = open(self.logfilename, 'w', encoding='utf-8', errors='surrogateescape')
 
         self.logfile.write('Log of Meson test suite run on %s\n\n'
                            % datetime.datetime.now().isoformat())
@@ -656,21 +891,20 @@
         self.logfile.write('Inherited environment: {}\n\n'.format(inherit_env))
 
     @staticmethod
-    def get_wrapper(options):
-        wrap = []
+    def get_wrapper(options: argparse.Namespace) -> typing.List[str]:
+        wrap = []  # type: typing.List[str]
         if options.gdb:
-            wrap = ['gdb', '--quiet', '--nh']
+            wrap = [options.gdb_path, '--quiet', '--nh']
             if options.repeat > 1:
                 wrap += ['-ex', 'run', '-ex', 'quit']
             # Signal the end of arguments to gdb
             wrap += ['--args']
         if options.wrapper:
             wrap += options.wrapper
-        assert(isinstance(wrap, list))
         return wrap
 
-    def get_pretty_suite(self, test):
-        if len(self.suites) > 1:
+    def get_pretty_suite(self, test: 'TestSerialisation') -> str:
+        if len(self.suites) > 1 and test.suite:
             rv = TestHarness.split_suite_string(test.suite[0])[0]
             s = "+".join(TestHarness.split_suite_string(s)[1] for s in test.suite)
             if len(s):
@@ -679,9 +913,9 @@
         else:
             return test.name
 
-    def run_tests(self, tests):
+    def run_tests(self, tests: typing.List['TestSerialisation']) -> None:
         executor = None
-        futures = []
+        futures = []  # type: typing.List[typing.Tuple[conc.Future[TestRun], int, typing.List[TestSerialisation], str, int]]
         numlen = len('%d' % len(tests))
         self.open_log_files()
         startdir = os.getcwd()
@@ -693,18 +927,17 @@
             for _ in range(self.options.repeat):
                 for i, test in enumerate(tests):
                     visible_name = self.get_pretty_suite(test)
+                    single_test = self.get_test_runner(test)
 
-                    if not test.is_parallel or self.options.gdb:
+                    if not test.is_parallel or self.options.num_processes == 1 or single_test.options.gdb:
                         self.drain_futures(futures)
                         futures = []
-                        single_test = self.get_test_runner(test)
                         res = single_test.run()
                         self.process_test_result(res)
                         self.print_stats(numlen, tests, visible_name, res, i)
                     else:
                         if not executor:
                             executor = conc.ThreadPoolExecutor(max_workers=self.options.num_processes)
-                        single_test = self.get_test_runner(test)
                         f = executor.submit(single_test.run)
                         futures.append((f, numlen, tests, visible_name, i))
                     if self.options.repeat > 1 and self.fail_count:
@@ -721,9 +954,9 @@
         finally:
             os.chdir(startdir)
 
-    def drain_futures(self, futures):
-        for i in futures:
-            (result, numlen, tests, name, i) = i
+    def drain_futures(self, futures: typing.List[typing.Tuple['conc.Future[TestRun]', int, typing.List['TestSerialisation'], str, int]]) -> None:
+        for x in futures:
+            (result, numlen, tests, name, i) = x
             if self.options.repeat > 1 and self.fail_count:
                 result.cancel()
             if self.options.verbose:
@@ -731,7 +964,7 @@
             self.process_test_result(result.result())
             self.print_stats(numlen, tests, name, result.result(), i)
 
-    def run_special(self):
+    def run_special(self) -> int:
         '''Tests run by the user, usually something like "under gdb 1000 times".'''
         if self.is_run:
             raise RuntimeError('Can not use run_special after a full run.')
@@ -739,16 +972,17 @@
         if not tests:
             return 0
         self.run_tests(tests)
-        return self.fail_count
+        return self.total_failure_count()
 
 
-def list_tests(th):
+def list_tests(th: TestHarness) -> bool:
     tests = th.get_tests()
     for t in tests:
         print(th.get_pretty_suite(t))
+    return not tests
 
-def rebuild_all(wd):
-    if not os.path.isfile(os.path.join(wd, 'build.ninja')):
+def rebuild_all(wd: str) -> bool:
+    if not (Path(wd) / 'build.ninja').is_file():
         print('Only ninja backend is supported to rebuild tests before running them.')
         return True
 
@@ -757,16 +991,14 @@
         print("Can't find ninja, can't rebuild test.")
         return False
 
-    p = subprocess.Popen([ninja, '-C', wd])
-    p.communicate()
-
-    if p.returncode != 0:
-        print('Could not rebuild')
+    ret = subprocess.run([ninja, '-C', wd]).returncode
+    if ret != 0:
+        print('Could not rebuild {}'.format(wd))
         return False
 
     return True
 
-def run(options):
+def run(options: argparse.Namespace) -> int:
     if options.benchmark:
         options.num_processes = 1
 
@@ -794,25 +1026,27 @@
 
     if not options.list and not options.no_rebuild:
         if not rebuild_all(options.wd):
-            return 1
+            # We return 125 here in case the build failed.
+            # The reason is that exit code 125 tells `git bisect run` that the current commit should be skipped.
+            # Thus users can directly use `meson test` to bisect without needing to handle the does-not-build case separately in a wrapper script.
+            return 125
 
-    try:
-        th = TestHarness(options)
-        if options.list:
-            list_tests(th)
-            return 0
-        if not options.args:
-            return th.doit()
-        return th.run_special()
-    except TestException as e:
-        print('Meson test encountered an error:\n')
-        if os.environ.get('MESON_FORCE_BACKTRACE'):
-            raise e
-        else:
-            print(e)
-        return 1
+    with TestHarness(options) as th:
+        try:
+            if options.list:
+                return list_tests(th)
+            if not options.args:
+                return th.doit()
+            return th.run_special()
+        except TestException as e:
+            print('Meson test encountered an error:\n')
+            if os.environ.get('MESON_FORCE_BACKTRACE'):
+                raise e
+            else:
+                print(e)
+            return 1
 
-def run_with_args(args):
+def run_with_args(args: typing.List[str]) -> int:
     parser = argparse.ArgumentParser(prog='meson test')
     add_arguments(parser)
     options = parser.parse_args(args)
diff -Nru meson-0.49.0/mesonbuild/munstable_coredata.py meson-0.52.1/mesonbuild/munstable_coredata.py
--- meson-0.49.0/mesonbuild/munstable_coredata.py	1970-01-01 00:00:00.000000000 +0000
+++ meson-0.52.1/mesonbuild/munstable_coredata.py	2019-11-28 17:37:44.000000000 +0000
@@ -0,0 +1,117 @@
+# Copyright 2019 The Meson development team
+
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+
+#     http://www.apache.org/licenses/LICENSE-2.0
+
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+from . import coredata as cdata
+from .mesonlib import MachineChoice
+
+import os.path
+import pprint
+import textwrap
+
+def add_arguments(parser):
+    parser.add_argument('--all', action='store_true', dest='all', default=False,
+                        help='Show data not used by current backend.')
+
+    parser.add_argument('builddir', nargs='?', default='.', help='The build directory')
+
+
+def dump_compilers(compilers):
+    for lang, compiler in compilers.items():
+        print('  ' + lang + ':')
+        print('      Id: ' + compiler.id)
+        print('      Command: ' + ' '.join(compiler.exelist))
+        if compiler.full_version:
+            print('      Full version: ' + compiler.full_version)
+        if compiler.version:
+            print('      Detected version: ' + compiler.version)
+        if hasattr(compiler, 'compiler_type'):
+            print('      Detected type: ' + repr(compiler.compiler_type))
+        #pprint.pprint(compiler.__dict__)
+
+
+def dump_guids(d):
+    for name, value in d.items():
+        print('  ' + name + ': ' + value)
+
+
+def run(options):
+    datadir = 'meson-private'
+    if options.builddir is not None:
+        datadir = os.path.join(options.builddir, datadir)
+    if not os.path.isdir(datadir):
+        print('Current directory is not a build dir. Please specify it or '
+              'change the working directory to it.')
+        return 1
+
+    all_backends = options.all
+
+    print('This is a dump of the internal unstable cache of meson. This is for debugging only.')
+    print('Do NOT parse, this will change from version to version in incompatible ways')
+    print('')
+
+    coredata = cdata.load(options.builddir)
+    backend = coredata.get_builtin_option('backend')
+    for k, v in sorted(coredata.__dict__.items()):
+        if k in ('backend_options', 'base_options', 'builtins', 'compiler_options', 'user_options'):
+            # use `meson configure` to view these
+            pass
+        elif k in ['install_guid', 'test_guid', 'regen_guid']:
+            if all_backends or backend.startswith('vs'):
+                print(k + ': ' + v)
+        elif k == 'target_guids':
+            if all_backends or backend.startswith('vs'):
+                print(k + ':')
+                dump_guids(v)
+        elif k in ['lang_guids']:
+            if all_backends or backend.startswith('vs') or backend == 'xcode':
+                print(k + ':')
+                dump_guids(v)
+        elif k == 'meson_command':
+            if all_backends or backend.startswith('vs'):
+                print('Meson command used in build file regeneration: ' + ' '.join(v))
+        elif k == 'pkgconf_envvar':
+            print('Last seen PKGCONFIG enviroment variable value: ' + v)
+        elif k == 'version':
+            print('Meson version: ' + v)
+        elif k == 'cross_files':
+            if v:
+                print('Cross File: ' + ' '.join(v))
+        elif k == 'config_files':
+            if v:
+                print('Native File: ' + ' '.join(v))
+        elif k == 'compilers':
+            for for_machine in MachineChoice:
+                print('Cached {} machine compilers:'.format(
+                    for_machine.get_lower_case_name()))
+                dump_compilers(v[for_machine])
+        elif k == 'deps':
+            def print_dep(dep_key, dep):
+                print('  ' + dep_key[0] + ": ")
+                print('      compile args: ' + repr(dep.get_compile_args()))
+                print('      link args: ' + repr(dep.get_link_args()))
+                if dep.get_sources():
+                    print('      sources: ' + repr(dep.get_sources()))
+                print('      version: ' + repr(dep.get_version()))
+
+            for for_machine in iter(MachineChoice):
+                items_list = list(sorted(v[for_machine].items()))
+                if items_list:
+                    print('Cached dependencies for {} machine' % for_machine.get_lower_case_name())
+                    for dep_key, deps in items_list:
+                        for dep in deps:
+                            print_dep(dep_key, dep)
+        else:
+            print(k + ':')
+            print(textwrap.indent(pprint.pformat(v), '  '))
diff -Nru meson-0.49.0/mesonbuild/optinterpreter.py meson-0.52.1/mesonbuild/optinterpreter.py
--- meson-0.49.0/mesonbuild/optinterpreter.py	2018-10-31 09:31:20.000000000 +0000
+++ meson-0.52.1/mesonbuild/optinterpreter.py	2019-08-25 19:17:02.000000000 +0000
@@ -14,21 +14,27 @@
 
 import os, re
 import functools
+import typing
 
 from . import mparser
 from . import coredata
 from . import mesonlib
 from . import compilers
 
-forbidden_option_names = coredata.get_builtin_options()
+forbidden_option_names = set(coredata.builtin_options.keys())
 forbidden_prefixes = [lang + '_' for lang in compilers.all_languages] + ['b_', 'backend_']
+reserved_prefixes = ['cross_']
 
-def is_invalid_name(name):
+def is_invalid_name(name: str, *, log: bool = True) -> bool:
     if name in forbidden_option_names:
         return True
     pref = name.split('_')[0] + '_'
     if pref in forbidden_prefixes:
         return True
+    if pref in reserved_prefixes:
+        if log:
+            from . import mlog
+            mlog.deprecation('Option uses prefix "%s", which is reserved for Meson. This will become an error in the future.' % pref)
     return False
 
 class OptionException(mesonlib.MesonException):
@@ -44,7 +50,7 @@
             if bad:
                 raise OptionException('Invalid kwargs for option "{}": "{}"'.format(
                     name, ' '.join(bad)))
-            return func(name, description, kwargs)
+            return func(description, kwargs)
         return _inner
     return _wraps
 
@@ -52,21 +58,20 @@
 optname_regex = re.compile('[^a-zA-Z0-9_-]')
 
 @permitted_kwargs({'value', 'yield'})
-def StringParser(name, description, kwargs):
-    return coredata.UserStringOption(name,
-                                     description,
+def StringParser(description, kwargs):
+    return coredata.UserStringOption(description,
                                      kwargs.get('value', ''),
                                      kwargs.get('choices', []),
                                      kwargs.get('yield', coredata.default_yielding))
 
 @permitted_kwargs({'value', 'yield'})
-def BooleanParser(name, description, kwargs):
-    return coredata.UserBooleanOption(name, description,
+def BooleanParser(description, kwargs):
+    return coredata.UserBooleanOption(description,
                                       kwargs.get('value', True),
                                       kwargs.get('yield', coredata.default_yielding))
 
 @permitted_kwargs({'value', 'yield', 'choices'})
-def ComboParser(name, description, kwargs):
+def ComboParser(description, kwargs):
     if 'choices' not in kwargs:
         raise OptionException('Combo option missing "choices" keyword.')
     choices = kwargs['choices']
@@ -75,19 +80,17 @@
     for i in choices:
         if not isinstance(i, str):
             raise OptionException('Combo choice elements must be strings.')
-    return coredata.UserComboOption(name,
-                                    description,
+    return coredata.UserComboOption(description,
                                     choices,
                                     kwargs.get('value', choices[0]),
                                     kwargs.get('yield', coredata.default_yielding),)
 
 
 @permitted_kwargs({'value', 'min', 'max', 'yield'})
-def IntegerParser(name, description, kwargs):
+def IntegerParser(description, kwargs):
     if 'value' not in kwargs:
         raise OptionException('Integer option must contain value argument.')
-    return coredata.UserIntegerOption(name,
-                                      description,
+    return coredata.UserIntegerOption(description,
                                       kwargs.get('min', None),
                                       kwargs.get('max', None),
                                       kwargs['value'],
@@ -97,7 +100,7 @@
 # reading options in project(). See func_project() in interpreter.py
 #@FeatureNew('array type option()', '0.44.0')
 @permitted_kwargs({'value', 'yield', 'choices'})
-def string_array_parser(name, description, kwargs):
+def string_array_parser(description, kwargs):
     if 'choices' in kwargs:
         choices = kwargs['choices']
         if not isinstance(choices, list):
@@ -111,16 +114,14 @@
         value = kwargs.get('value', [])
     if not isinstance(value, list):
         raise OptionException('Array choices must be passed as an array.')
-    return coredata.UserArrayOption(name,
-                                    description,
+    return coredata.UserArrayOption(description,
                                     value,
                                     choices=choices,
                                     yielding=kwargs.get('yield', coredata.default_yielding))
 
 @permitted_kwargs({'value', 'yield'})
-def FeatureParser(name, description, kwargs):
-    return coredata.UserFeatureOption(name,
-                                      description,
+def FeatureParser(description, kwargs):
+    return coredata.UserFeatureOption(description,
                                       kwargs.get('value', 'auto'),
                                       yielding=kwargs.get('yield', coredata.default_yielding))
 
@@ -130,7 +131,7 @@
                 'integer': IntegerParser,
                 'array': string_array_parser,
                 'feature': FeatureParser,
-                }
+                } # type: typing.Dict[str, typing.Callable[[str, typing.Dict], coredata.UserOption]]
 
 class OptionInterpreter:
     def __init__(self, subproject):
diff -Nru meson-0.49.0/mesonbuild/rewriter.py meson-0.52.1/mesonbuild/rewriter.py
--- meson-0.49.0/mesonbuild/rewriter.py	2018-12-09 14:27:23.000000000 +0000
+++ meson-0.52.1/mesonbuild/rewriter.py	2019-11-28 17:37:44.000000000 +0000
@@ -23,36 +23,942 @@
 # - move targets
 # - reindent?
 
-import mesonbuild.astinterpreter
+from .ast import IntrospectionInterpreter, build_target_functions, AstConditionLevel, AstIDGenerator, AstIndentationGenerator, AstPrinter
 from mesonbuild.mesonlib import MesonException
-from mesonbuild import mlog
-import sys, traceback
+from . import mlog, environment
+from functools import wraps
+from typing import List, Dict, Optional
+from .mparser import Token, ArrayNode, ArgumentNode, AssignmentNode, BaseNode, BooleanNode, ElementaryNode, IdNode, FunctionNode, StringNode
+import json, os, re, sys
 
-def add_arguments(parser):
-    parser.add_argument('--sourcedir', default='.',
-                        help='Path to source directory.')
-    parser.add_argument('--target', default=None,
-                        help='Name of target to edit.')
-    parser.add_argument('--filename', default=None,
-                        help='Name of source file to add or remove to target.')
-    parser.add_argument('commands', nargs='+')
+class RewriterException(MesonException):
+    pass
+
+def add_arguments(parser, formater=None):
+    parser.add_argument('-s', '--sourcedir', type=str, default='.', metavar='SRCDIR', help='Path to source directory.')
+    parser.add_argument('-V', '--verbose', action='store_true', default=False, help='Enable verbose output')
+    parser.add_argument('-S', '--skip-errors', dest='skip', action='store_true', default=False, help='Skip errors instead of aborting')
+    subparsers = parser.add_subparsers(dest='type', title='Rewriter commands', description='Rewrite command to execute')
+
+    # Target
+    tgt_parser = subparsers.add_parser('target', help='Modify a target', formatter_class=formater)
+    tgt_parser.add_argument('-s', '--subdir', default='', dest='subdir', help='Subdirectory of the new target (only for the "add_target" action)')
+    tgt_parser.add_argument('--type', dest='tgt_type', choices=rewriter_keys['target']['target_type'][2], default='executable',
+                            help='Type of the target to add (only for the "add_target" action)')
+    tgt_parser.add_argument('target', help='Name or ID of the target')
+    tgt_parser.add_argument('operation', choices=['add', 'rm', 'add_target', 'rm_target', 'info'],
+                            help='Action to execute')
+    tgt_parser.add_argument('sources', nargs='*', help='Sources to add/remove')
+
+    # KWARGS
+    kw_parser = subparsers.add_parser('kwargs', help='Modify keyword arguments', formatter_class=formater)
+    kw_parser.add_argument('operation', choices=rewriter_keys['kwargs']['operation'][2],
+                           help='Action to execute')
+    kw_parser.add_argument('function', choices=list(rewriter_func_kwargs.keys()),
+                           help='Function type to modify')
+    kw_parser.add_argument('id', help='ID of the function to modify (can be anything for "project")')
+    kw_parser.add_argument('kwargs', nargs='*', help='Pairs of keyword and value')
+
+    # Default options
+    def_parser = subparsers.add_parser('default-options', help='Modify the project default options', formatter_class=formater)
+    def_parser.add_argument('operation', choices=rewriter_keys['default_options']['operation'][2],
+                            help='Action to execute')
+    def_parser.add_argument('options', nargs='*', help='Key, value pairs of configuration option')
+
+    # JSON file/command
+    cmd_parser = subparsers.add_parser('command', help='Execute a JSON array of commands', formatter_class=formater)
+    cmd_parser.add_argument('json', help='JSON string or file to execute')
+
+class RequiredKeys:
+    def __init__(self, keys):
+        self.keys = keys
+
+    def __call__(self, f):
+        @wraps(f)
+        def wrapped(*wrapped_args, **wrapped_kwargs):
+            assert(len(wrapped_args) >= 2)
+            cmd = wrapped_args[1]
+            for key, val in self.keys.items():
+                typ = val[0] # The type of the value
+                default = val[1] # The default value -- None is required
+                choices = val[2] # Valid choices -- None is for everything
+                if key not in cmd:
+                    if default is not None:
+                        cmd[key] = default
+                    else:
+                        raise RewriterException('Key "{}" is missing in object for {}'
+                                                .format(key, f.__name__))
+                if not isinstance(cmd[key], typ):
+                    raise RewriterException('Invalid type of "{}". Required is {} but provided was {}'
+                                            .format(key, typ.__name__, type(cmd[key]).__name__))
+                if choices is not None:
+                    assert(isinstance(choices, list))
+                    if cmd[key] not in choices:
+                        raise RewriterException('Invalid value of "{}": Possible values are {} but provided was "{}"'
+                                                .format(key, choices, cmd[key]))
+            return f(*wrapped_args, **wrapped_kwargs)
+
+        return wrapped
+
+class MTypeBase:
+    def __init__(self, node: Optional[BaseNode] = None):
+        if node is None:
+            self.node = self._new_node()
+        else:
+            self.node = node
+        self.node_type = None
+        for i in self.supported_nodes():
+            if isinstance(self.node, i):
+                self.node_type = i
+
+    def _new_node(self):
+        # Overwrite in derived class
+        return BaseNode()
+
+    def can_modify(self):
+        return self.node_type is not None
+
+    def get_node(self):
+        return self.node
+
+    def supported_nodes(self):
+        # Overwrite in derived class
+        return []
+
+    def set_value(self, value):
+        # Overwrite in derived class
+        mlog.warning('Cannot set the value of type', mlog.bold(type(self).__name__), '--> skipping')
+
+    def add_value(self, value):
+        # Overwrite in derived class
+        mlog.warning('Cannot add a value of type', mlog.bold(type(self).__name__), '--> skipping')
+
+    def remove_value(self, value):
+        # Overwrite in derived class
+        mlog.warning('Cannot remove a value of type', mlog.bold(type(self).__name__), '--> skipping')
+
+    def remove_regex(self, value):
+        # Overwrite in derived class
+        mlog.warning('Cannot remove a regex in type', mlog.bold(type(self).__name__), '--> skipping')
+
+class MTypeStr(MTypeBase):
+    def __init__(self, node: Optional[BaseNode] = None):
+        super().__init__(node)
+
+    def _new_node(self):
+        return StringNode(Token('', '', 0, 0, 0, None, ''))
+
+    def supported_nodes(self):
+        return [StringNode]
+
+    def set_value(self, value):
+        self.node.value = str(value)
+
+class MTypeBool(MTypeBase):
+    def __init__(self, node: Optional[BaseNode] = None):
+        super().__init__(node)
+
+    def _new_node(self):
+        return StringNode(Token('', '', 0, 0, 0, None, False))
+
+    def supported_nodes(self):
+        return [BooleanNode]
+
+    def set_value(self, value):
+        self.node.value = bool(value)
+
+class MTypeID(MTypeBase):
+    def __init__(self, node: Optional[BaseNode] = None):
+        super().__init__(node)
+
+    def _new_node(self):
+        return StringNode(Token('', '', 0, 0, 0, None, ''))
+
+    def supported_nodes(self):
+        return [IdNode]
+
+    def set_value(self, value):
+        self.node.value = str(value)
+
+class MTypeList(MTypeBase):
+    def __init__(self, node: Optional[BaseNode] = None):
+        super().__init__(node)
+
+    def _new_node(self):
+        return ArrayNode(ArgumentNode(Token('', '', 0, 0, 0, None, '')), 0, 0, 0, 0)
+
+    def _new_element_node(self, value):
+        # Overwrite in derived class
+        return BaseNode()
+
+    def _ensure_array_node(self):
+        if not isinstance(self.node, ArrayNode):
+            tmp = self.node
+            self.node = self._new_node()
+            self.node.args.arguments += [tmp]
+
+    def _check_is_equal(self, node, value) -> bool:
+        # Overwrite in derived class
+        return False
+
+    def _check_regex_matches(self, node, regex: str) -> bool:
+        # Overwrite in derived class
+        return False
+
+    def get_node(self):
+        if isinstance(self.node, ArrayNode):
+            if len(self.node.args.arguments) == 1:
+                return self.node.args.arguments[0]
+        return self.node
+
+    def supported_element_nodes(self):
+        # Overwrite in derived class
+        return []
+
+    def supported_nodes(self):
+        return [ArrayNode] + self.supported_element_nodes()
+
+    def set_value(self, value):
+        if not isinstance(value, list):
+            value = [value]
+        self._ensure_array_node()
+        self.node.args.arguments = [] # Remove all current nodes
+        for i in value:
+            self.node.args.arguments += [self._new_element_node(i)]
+
+    def add_value(self, value):
+        if not isinstance(value, list):
+            value = [value]
+        self._ensure_array_node()
+        for i in value:
+            self.node.args.arguments += [self._new_element_node(i)]
+
+    def _remove_helper(self, value, equal_func):
+        def check_remove_node(node):
+            for j in value:
+                if equal_func(i, j):
+                    return True
+            return False
+
+        if not isinstance(value, list):
+            value = [value]
+        self._ensure_array_node()
+        removed_list = []
+        for i in self.node.args.arguments:
+            if not check_remove_node(i):
+                removed_list += [i]
+        self.node.args.arguments = removed_list
+
+    def remove_value(self, value):
+        self._remove_helper(value, self._check_is_equal)
+
+    def remove_regex(self, regex: str):
+        self._remove_helper(regex, self._check_regex_matches)
+
+class MTypeStrList(MTypeList):
+    def __init__(self, node: Optional[BaseNode] = None):
+        super().__init__(node)
+
+    def _new_element_node(self, value):
+        return StringNode(Token('', '', 0, 0, 0, None, str(value)))
+
+    def _check_is_equal(self, node, value) -> bool:
+        if isinstance(node, StringNode):
+            return node.value == value
+        return False
+
+    def _check_regex_matches(self, node, regex: str) -> bool:
+        if isinstance(node, StringNode):
+            return re.match(regex, node.value) is not None
+        return False
+
+    def supported_element_nodes(self):
+        return [StringNode]
+
+class MTypeIDList(MTypeList):
+    def __init__(self, node: Optional[BaseNode] = None):
+        super().__init__(node)
+
+    def _new_element_node(self, value):
+        return IdNode(Token('', '', 0, 0, 0, None, str(value)))
+
+    def _check_is_equal(self, node, value) -> bool:
+        if isinstance(node, IdNode):
+            return node.value == value
+        return False
+
+    def _check_regex_matches(self, node, regex: str) -> bool:
+        if isinstance(node, StringNode):
+            return re.match(regex, node.value) is not None
+        return False
+
+    def supported_element_nodes(self):
+        return [IdNode]
+
+rewriter_keys = {
+    'default_options': {
+        'operation': (str, None, ['set', 'delete']),
+        'options': (dict, {}, None)
+    },
+    'kwargs': {
+        'function': (str, None, None),
+        'id': (str, None, None),
+        'operation': (str, None, ['set', 'delete', 'add', 'remove', 'remove_regex', 'info']),
+        'kwargs': (dict, {}, None)
+    },
+    'target': {
+        'target': (str, None, None),
+        'operation': (str, None, ['src_add', 'src_rm', 'target_rm', 'target_add', 'info']),
+        'sources': (list, [], None),
+        'subdir': (str, '', None),
+        'target_type': (str, 'executable', ['both_libraries', 'executable', 'jar', 'library', 'shared_library', 'shared_module', 'static_library']),
+    }
+}
+
+rewriter_func_kwargs = {
+    'dependency': {
+        'language': MTypeStr,
+        'method': MTypeStr,
+        'native': MTypeBool,
+        'not_found_message': MTypeStr,
+        'required': MTypeBool,
+        'static': MTypeBool,
+        'version': MTypeStrList,
+        'modules': MTypeStrList
+    },
+    'target': {
+        'build_by_default': MTypeBool,
+        'build_rpath': MTypeStr,
+        'dependencies': MTypeIDList,
+        'gui_app': MTypeBool,
+        'link_with': MTypeIDList,
+        'export_dynamic': MTypeBool,
+        'implib': MTypeBool,
+        'install': MTypeBool,
+        'install_dir': MTypeStr,
+        'install_rpath': MTypeStr,
+        'pie': MTypeBool
+    },
+    'project': {
+        'default_options': MTypeStrList,
+        'meson_version': MTypeStr,
+        'license': MTypeStrList,
+        'subproject_dir': MTypeStr,
+        'version': MTypeStr
+    }
+}
+
+class Rewriter:
+    def __init__(self, sourcedir: str, generator: str = 'ninja', skip_errors: bool = False):
+        self.sourcedir = sourcedir
+        self.interpreter = IntrospectionInterpreter(sourcedir, '', generator, visitors = [AstIDGenerator(), AstIndentationGenerator(), AstConditionLevel()])
+        self.skip_errors = skip_errors
+        self.modefied_nodes = []
+        self.to_remove_nodes = []
+        self.to_add_nodes = []
+        self.functions = {
+            'default_options': self.process_default_options,
+            'kwargs': self.process_kwargs,
+            'target': self.process_target,
+        }
+        self.info_dump = None
+
+    def analyze_meson(self):
+        mlog.log('Analyzing meson file:', mlog.bold(os.path.join(self.sourcedir, environment.build_filename)))
+        self.interpreter.analyze()
+        mlog.log('  -- Project:', mlog.bold(self.interpreter.project_data['descriptive_name']))
+        mlog.log('  -- Version:', mlog.cyan(self.interpreter.project_data['version']))
+
+    def add_info(self, cmd_type: str, cmd_id: str, data: dict):
+        if self.info_dump is None:
+            self.info_dump = {}
+        if cmd_type not in self.info_dump:
+            self.info_dump[cmd_type] = {}
+        self.info_dump[cmd_type][cmd_id] = data
+
+    def print_info(self):
+        if self.info_dump is None:
+            return
+        sys.stderr.write(json.dumps(self.info_dump, indent=2))
+
+    def on_error(self):
+        if self.skip_errors:
+            return mlog.cyan('-->'), mlog.yellow('skipping')
+        return mlog.cyan('-->'), mlog.red('aborting')
+
+    def handle_error(self):
+        if self.skip_errors:
+            return None
+        raise MesonException('Rewriting the meson.build failed')
+
+    def find_target(self, target: str):
+        def check_list(name: str) -> List[BaseNode]:
+            result = []
+            for i in self.interpreter.targets:
+                if name == i['name'] or name == i['id']:
+                    result += [i]
+            return result
+
+        targets = check_list(target)
+        if targets:
+            if len(targets) == 1:
+                return targets[0]
+            else:
+                mlog.error('There are multiple targets matching', mlog.bold(target))
+                for i in targets:
+                    mlog.error('  -- Target name', mlog.bold(i['name']), 'with ID', mlog.bold(i['id']))
+                mlog.error('Please try again with the unique ID of the target', *self.on_error())
+                self.handle_error()
+                return None
+
+        # Check the assignments
+        tgt = None
+        if target in self.interpreter.assignments:
+            node = self.interpreter.assignments[target][0]
+            if isinstance(node, FunctionNode):
+                if node.func_name in ['executable', 'jar', 'library', 'shared_library', 'shared_module', 'static_library', 'both_libraries']:
+                    tgt = self.interpreter.assign_vals[target][0]
+
+        return tgt
+
+    def find_dependency(self, dependency: str):
+        def check_list(name: str):
+            for i in self.interpreter.dependencies:
+                if name == i['name']:
+                    return i
+            return None
+
+        dep = check_list(dependency)
+        if dep is not None:
+            return dep
+
+        # Check the assignments
+        if dependency in self.interpreter.assignments:
+            node = self.interpreter.assignments[dependency][0]
+            if isinstance(node, FunctionNode):
+                if node.func_name in ['dependency']:
+                    name = self.interpreter.flatten_args(node.args)[0]
+                    dep = check_list(name)
+
+        return dep
+
+    @RequiredKeys(rewriter_keys['default_options'])
+    def process_default_options(self, cmd):
+        # First, remove the old values
+        kwargs_cmd = {
+            'function': 'project',
+            'id': "/",
+            'operation': 'remove_regex',
+            'kwargs': {
+                'default_options': ['{}=.*'.format(x) for x in cmd['options'].keys()]
+            }
+        }
+        self.process_kwargs(kwargs_cmd)
+
+        # Then add the new values
+        if cmd['operation'] != 'set':
+            return
+
+        kwargs_cmd['operation'] = 'add'
+        kwargs_cmd['kwargs']['default_options'] = []
+
+        cdata = self.interpreter.coredata
+        options = {
+            **cdata.builtins,
+            **cdata.builtins_per_machine.host,
+            **{'build.' + k: o for k, o in cdata.builtins_per_machine.build.items()},
+            **cdata.backend_options,
+            **cdata.base_options,
+            **cdata.compiler_options.host,
+            **{'build.' + k: o for k, o in cdata.compiler_options.build.items()},
+            **cdata.user_options,
+        }
+
+        for key, val in sorted(cmd['options'].items()):
+            if key not in options:
+                mlog.error('Unknown options', mlog.bold(key), *self.on_error())
+                self.handle_error()
+                continue
+
+            try:
+                val = options[key].validate_value(val)
+            except MesonException as e:
+                mlog.error('Unable to set', mlog.bold(key), mlog.red(str(e)), *self.on_error())
+                self.handle_error()
+                continue
+
+            kwargs_cmd['kwargs']['default_options'] += ['{}={}'.format(key, val)]
+
+        self.process_kwargs(kwargs_cmd)
+
+    @RequiredKeys(rewriter_keys['kwargs'])
+    def process_kwargs(self, cmd):
+        mlog.log('Processing function type', mlog.bold(cmd['function']), 'with id', mlog.cyan("'" + cmd['id'] + "'"))
+        if cmd['function'] not in rewriter_func_kwargs:
+            mlog.error('Unknown function type', cmd['function'], *self.on_error())
+            return self.handle_error()
+        kwargs_def = rewriter_func_kwargs[cmd['function']]
+
+        # Find the function node to modify
+        node = None
+        arg_node = None
+        if cmd['function'] == 'project':
+            if cmd['id'] != '/':
+                mlog.error('The ID for the function type project must be "/"', *self.on_error())
+                return self.handle_error()
+            node = self.interpreter.project_node
+            arg_node = node.args
+        elif cmd['function'] == 'target':
+            tmp = self.find_target(cmd['id'])
+            if tmp:
+                node = tmp['node']
+                arg_node = node.args
+        elif cmd['function'] == 'dependency':
+            tmp = self.find_dependency(cmd['id'])
+            if tmp:
+                node = tmp['node']
+                arg_node = node.args
+        if not node:
+            mlog.error('Unable to find the function node')
+        assert(isinstance(node, FunctionNode))
+        assert(isinstance(arg_node, ArgumentNode))
+
+        # Print kwargs info
+        if cmd['operation'] == 'info':
+            info_data = {}
+            for key, val in sorted(arg_node.kwargs.items()):
+                info_data[key] = None
+                if isinstance(val, ElementaryNode):
+                    info_data[key] = val.value
+                elif isinstance(val, ArrayNode):
+                    data_list = []
+                    for i in val.args.arguments:
+                        element = None
+                        if isinstance(i, ElementaryNode):
+                            element = i.value
+                        data_list += [element]
+                    info_data[key] = data_list
+
+            self.add_info('kwargs', '{}#{}'.format(cmd['function'], cmd['id']), info_data)
+            return # Nothing else to do
+
+        # Modify the kwargs
+        num_changed = 0
+        for key, val in sorted(cmd['kwargs'].items()):
+            if key not in kwargs_def:
+                mlog.error('Cannot modify unknown kwarg', mlog.bold(key), *self.on_error())
+                self.handle_error()
+                continue
+
+            # Remove the key from the kwargs
+            if cmd['operation'] == 'delete':
+                if key in arg_node.kwargs:
+                    mlog.log('  -- Deleting', mlog.bold(key), 'from the kwargs')
+                    del arg_node.kwargs[key]
+                    num_changed += 1
+                else:
+                    mlog.log('  -- Key', mlog.bold(key), 'is already deleted')
+                continue
+
+            if key not in arg_node.kwargs:
+                arg_node.kwargs[key] = None
+            modifyer = kwargs_def[key](arg_node.kwargs[key])
+            if not modifyer.can_modify():
+                mlog.log('  -- Skipping', mlog.bold(key), 'because it is to complex to modify')
+
+            # Apply the operation
+            val_str = str(val)
+            if cmd['operation'] == 'set':
+                mlog.log('  -- Setting', mlog.bold(key), 'to', mlog.yellow(val_str))
+                modifyer.set_value(val)
+            elif cmd['operation'] == 'add':
+                mlog.log('  -- Adding', mlog.yellow(val_str), 'to', mlog.bold(key))
+                modifyer.add_value(val)
+            elif cmd['operation'] == 'remove':
+                mlog.log('  -- Removing', mlog.yellow(val_str), 'from', mlog.bold(key))
+                modifyer.remove_value(val)
+            elif cmd['operation'] == 'remove_regex':
+                mlog.log('  -- Removing all values matching', mlog.yellow(val_str), 'from', mlog.bold(key))
+                modifyer.remove_regex(val)
+
+            # Write back the result
+            arg_node.kwargs[key] = modifyer.get_node()
+            num_changed += 1
+
+        if num_changed > 0 and node not in self.modefied_nodes:
+            self.modefied_nodes += [node]
+
+    def find_assignment_node(self, node: BaseNode) -> AssignmentNode:
+        if hasattr(node, 'ast_id') and node.ast_id in self.interpreter.reverse_assignment:
+            return self.interpreter.reverse_assignment[node.ast_id]
+        return None
+
+    @RequiredKeys(rewriter_keys['target'])
+    def process_target(self, cmd):
+        mlog.log('Processing target', mlog.bold(cmd['target']), 'operation', mlog.cyan(cmd['operation']))
+        target = self.find_target(cmd['target'])
+        if target is None and cmd['operation'] != 'target_add':
+            mlog.error('Unknown target', mlog.bold(cmd['target']), *self.on_error())
+            return self.handle_error()
+
+        # Make source paths relative to the current subdir
+        def rel_source(src: str) -> str:
+            subdir = os.path.abspath(os.path.join(self.sourcedir, target['subdir']))
+            if os.path.isabs(src):
+                return os.path.relpath(src, subdir)
+            elif not os.path.exists(src):
+                return src # Trust the user when the source doesn't exist
+            # Make sure that the path is relative to the subdir
+            return os.path.relpath(os.path.abspath(src), subdir)
+
+        if target is not None:
+            cmd['sources'] = [rel_source(x) for x in cmd['sources']]
+
+        # Utility function to get a list of the sources from a node
+        def arg_list_from_node(n):
+            args = []
+            if isinstance(n, FunctionNode):
+                args = list(n.args.arguments)
+                if n.func_name in build_target_functions:
+                    args.pop(0)
+            elif isinstance(n, ArrayNode):
+                args = n.args.arguments
+            elif isinstance(n, ArgumentNode):
+                args = n.arguments
+            return args
+
+        to_sort_nodes = []
+
+        if cmd['operation'] == 'src_add':
+            node = None
+            if target['sources']:
+                node = target['sources'][0]
+            else:
+                node = target['node']
+            assert(node is not None)
+
+            # Generate the current source list
+            src_list = []
+            for i in target['sources']:
+                for j in arg_list_from_node(i):
+                    if isinstance(j, StringNode):
+                        src_list += [j.value]
+
+            # Generate the new String nodes
+            to_append = []
+            for i in sorted(set(cmd['sources'])):
+                if i in src_list:
+                    mlog.log('  -- Source', mlog.green(i), 'is already defined for the target --> skipping')
+                    continue
+                mlog.log('  -- Adding source', mlog.green(i), 'at',
+                         mlog.yellow('{}:{}'.format(os.path.join(node.subdir, environment.build_filename), node.lineno)))
+                token = Token('string', node.subdir, 0, 0, 0, None, i)
+                to_append += [StringNode(token)]
+
+            # Append to the AST at the right place
+            arg_node = None
+            if isinstance(node, (FunctionNode, ArrayNode)):
+                arg_node = node.args
+            elif isinstance(node, ArgumentNode):
+                arg_node = node
+            assert(arg_node is not None)
+            arg_node.arguments += to_append
+
+            # Mark the node as modified
+            if arg_node not in to_sort_nodes and not isinstance(node, FunctionNode):
+                to_sort_nodes += [arg_node]
+            if node not in self.modefied_nodes:
+                self.modefied_nodes += [node]
+
+        elif cmd['operation'] == 'src_rm':
+            # Helper to find the exact string node and its parent
+            def find_node(src):
+                for i in target['sources']:
+                    for j in arg_list_from_node(i):
+                        if isinstance(j, StringNode):
+                            if j.value == src:
+                                return i, j
+                return None, None
+
+            for i in cmd['sources']:
+                # Try to find the node with the source string
+                root, string_node = find_node(i)
+                if root is None:
+                    mlog.warning('  -- Unable to find source', mlog.green(i), 'in the target')
+                    continue
+
+                # Remove the found string node from the argument list
+                arg_node = None
+                if isinstance(root, (FunctionNode, ArrayNode)):
+                    arg_node = root.args
+                elif isinstance(root, ArgumentNode):
+                    arg_node = root
+                assert(arg_node is not None)
+                mlog.log('  -- Removing source', mlog.green(i), 'from',
+                         mlog.yellow('{}:{}'.format(os.path.join(string_node.subdir, environment.build_filename), string_node.lineno)))
+                arg_node.arguments.remove(string_node)
+
+                # Mark the node as modified
+                if arg_node not in to_sort_nodes and not isinstance(root, FunctionNode):
+                    to_sort_nodes += [arg_node]
+                if root not in self.modefied_nodes:
+                    self.modefied_nodes += [root]
+
+        elif cmd['operation'] == 'target_add':
+            if target is not None:
+                mlog.error('Can not add target', mlog.bold(cmd['target']), 'because it already exists', *self.on_error())
+                return self.handle_error()
+
+            id_base = re.sub(r'[- ]', '_', cmd['target'])
+            target_id = id_base + '_exe' if cmd['target_type'] == 'executable' else '_lib'
+            source_id = id_base + '_sources'
+
+            # Build src list
+            src_arg_node = ArgumentNode(Token('string', cmd['subdir'], 0, 0, 0, None, ''))
+            src_arr_node = ArrayNode(src_arg_node, 0, 0, 0, 0)
+            src_far_node = ArgumentNode(Token('string', cmd['subdir'], 0, 0, 0, None, ''))
+            src_fun_node = FunctionNode(cmd['subdir'], 0, 0, 0, 0, 'files', src_far_node)
+            src_ass_node = AssignmentNode(cmd['subdir'], 0, 0, source_id, src_fun_node)
+            src_arg_node.arguments = [StringNode(Token('string', cmd['subdir'], 0, 0, 0, None, x)) for x in cmd['sources']]
+            src_far_node.arguments = [src_arr_node]
+
+            # Build target
+            tgt_arg_node = ArgumentNode(Token('string', cmd['subdir'], 0, 0, 0, None, ''))
+            tgt_fun_node = FunctionNode(cmd['subdir'], 0, 0, 0, 0, cmd['target_type'], tgt_arg_node)
+            tgt_ass_node = AssignmentNode(cmd['subdir'], 0, 0, target_id, tgt_fun_node)
+            tgt_arg_node.arguments = [
+                StringNode(Token('string', cmd['subdir'], 0, 0, 0, None, cmd['target'])),
+                IdNode(Token('string', cmd['subdir'], 0, 0, 0, None, source_id))
+            ]
+
+            src_ass_node.accept(AstIndentationGenerator())
+            tgt_ass_node.accept(AstIndentationGenerator())
+            self.to_add_nodes += [src_ass_node, tgt_ass_node]
+
+        elif cmd['operation'] == 'target_rm':
+            to_remove = self.find_assignment_node(target['node'])
+            if to_remove is None:
+                to_remove = target['node']
+            self.to_remove_nodes += [to_remove]
+            mlog.log('  -- Removing target', mlog.green(cmd['target']), 'at',
+                     mlog.yellow('{}:{}'.format(os.path.join(to_remove.subdir, environment.build_filename), to_remove.lineno)))
+
+        elif cmd['operation'] == 'info':
+            # List all sources in the target
+            src_list = []
+            for i in target['sources']:
+                for j in arg_list_from_node(i):
+                    if isinstance(j, StringNode):
+                        src_list += [j.value]
+            test_data = {
+                'name': target['name'],
+                'sources': src_list
+            }
+            self.add_info('target', target['id'], test_data)
+
+        # Sort files
+        for i in to_sort_nodes:
+            convert = lambda text: int(text) if text.isdigit() else text.lower()
+            alphanum_key = lambda key: [convert(c) for c in re.split('([0-9]+)', key)]
+            path_sorter = lambda key: ([(key.count('/') <= idx, alphanum_key(x)) for idx, x in enumerate(key.split('/'))])
+
+            unknown = [x for x in i.arguments if not isinstance(x, StringNode)]
+            sources = [x for x in i.arguments if isinstance(x, StringNode)]
+            sources = sorted(sources, key=lambda x: path_sorter(x.value))
+            i.arguments = unknown + sources
+
+    def process(self, cmd):
+        if 'type' not in cmd:
+            raise RewriterException('Command has no key "type"')
+        if cmd['type'] not in self.functions:
+            raise RewriterException('Unknown command "{}". Supported commands are: {}'
+                                    .format(cmd['type'], list(self.functions.keys())))
+        self.functions[cmd['type']](cmd)
+
+    def apply_changes(self):
+        assert(all(hasattr(x, 'lineno') and hasattr(x, 'colno') and hasattr(x, 'subdir') for x in self.modefied_nodes))
+        assert(all(hasattr(x, 'lineno') and hasattr(x, 'colno') and hasattr(x, 'subdir') for x in self.to_remove_nodes))
+        assert(all(isinstance(x, (ArrayNode, FunctionNode)) for x in self.modefied_nodes))
+        assert(all(isinstance(x, (ArrayNode, AssignmentNode, FunctionNode)) for x in self.to_remove_nodes))
+        # Sort based on line and column in reversed order
+        work_nodes = [{'node': x, 'action': 'modify'} for x in self.modefied_nodes]
+        work_nodes += [{'node': x, 'action': 'rm'} for x in self.to_remove_nodes]
+        work_nodes = list(sorted(work_nodes, key=lambda x: (x['node'].lineno, x['node'].colno), reverse=True))
+        work_nodes += [{'node': x, 'action': 'add'} for x in self.to_add_nodes]
+
+        # Generating the new replacement string
+        str_list = []
+        for i in work_nodes:
+            new_data = ''
+            if i['action'] == 'modify' or i['action'] == 'add':
+                printer = AstPrinter()
+                i['node'].accept(printer)
+                printer.post_process()
+                new_data = printer.result.strip()
+            data = {
+                'file': os.path.join(i['node'].subdir, environment.build_filename),
+                'str': new_data,
+                'node': i['node'],
+                'action': i['action']
+            }
+            str_list += [data]
+
+        # Load build files
+        files = {}
+        for i in str_list:
+            if i['file'] in files:
+                continue
+            fpath = os.path.realpath(os.path.join(self.sourcedir, i['file']))
+            fdata = ''
+            # Create an empty file if it does not exist
+            if not os.path.exists(fpath):
+                with open(fpath, 'w'):
+                    pass
+            with open(fpath, 'r') as fp:
+                fdata = fp.read()
+
+            # Generate line offsets numbers
+            m_lines = fdata.splitlines(True)
+            offset = 0
+            line_offsets = []
+            for j in m_lines:
+                line_offsets += [offset]
+                offset += len(j)
+
+            files[i['file']] = {
+                'path': fpath,
+                'raw': fdata,
+                'offsets': line_offsets
+            }
+
+        # Replace in source code
+        def remove_node(i):
+            offsets = files[i['file']]['offsets']
+            raw = files[i['file']]['raw']
+            node = i['node']
+            line = node.lineno - 1
+            col = node.colno
+            start = offsets[line] + col
+            end = start
+            if isinstance(node, (ArrayNode, FunctionNode)):
+                end = offsets[node.end_lineno - 1] + node.end_colno
+
+            # Only removal is supported for assignments
+            elif isinstance(node, AssignmentNode) and i['action'] == 'rm':
+                if isinstance(node.value, (ArrayNode, FunctionNode)):
+                    remove_node({'file': i['file'], 'str': '', 'node': node.value, 'action': 'rm'})
+                    raw = files[i['file']]['raw']
+                while raw[end] != '=':
+                    end += 1
+                end += 1 # Handle the '='
+                while raw[end] in [' ', '\n', '\t']:
+                    end += 1
+
+            raw = files[i['file']]['raw'] = raw[:start] + i['str'] + raw[end:]
+
+        for i in str_list:
+            if i['action'] in ['modify', 'rm']:
+                remove_node(i)
+            elif i['action'] in ['add']:
+                files[i['file']]['raw'] += i['str'] + '\n'
+
+        # Write the files back
+        for key, val in files.items():
+            mlog.log('Rewriting', mlog.yellow(key))
+            with open(val['path'], 'w') as fp:
+                fp.write(val['raw'])
+
+target_operation_map = {
+    'add': 'src_add',
+    'rm': 'src_rm',
+    'add_target': 'target_add',
+    'rm_target': 'target_rm',
+    'info': 'info',
+}
+
+def list_to_dict(in_list: List[str]) -> Dict[str, str]:
+    result = {}
+    it = iter(in_list)
+    try:
+        for i in it:
+            # calling next(it) is not a mistake, we're taking the next element from
+            # the iterator, avoiding te need to preprocess it into a sequence of
+            # key value pairs.
+            result[i] = next(it)
+    except StopIteration:
+        raise TypeError('in_list parameter of list_to_dict must have an even length.')
+    return result
+
+def generate_target(options) -> List[dict]:
+    return [{
+        'type': 'target',
+        'target': options.target,
+        'operation': target_operation_map[options.operation],
+        'sources': options.sources,
+        'subdir': options.subdir,
+        'target_type': options.tgt_type,
+    }]
+
+def generate_kwargs(options) -> List[dict]:
+    return [{
+        'type': 'kwargs',
+        'function': options.function,
+        'id': options.id,
+        'operation': options.operation,
+        'kwargs': list_to_dict(options.kwargs),
+    }]
+
+def generate_def_opts(options) -> List[dict]:
+    return [{
+        'type': 'default_options',
+        'operation': options.operation,
+        'options': list_to_dict(options.options),
+    }]
+
+def genreate_cmd(options) -> List[dict]:
+    if os.path.exists(options.json):
+        with open(options.json, 'r') as fp:
+            return json.load(fp)
+    else:
+        return json.loads(options.json)
+
+# Map options.type to the actual type name
+cli_type_map = {
+    'target': generate_target,
+    'tgt': generate_target,
+    'kwargs': generate_kwargs,
+    'default-options': generate_def_opts,
+    'def': generate_def_opts,
+    'command': genreate_cmd,
+    'cmd': genreate_cmd,
+}
 
 def run(options):
-    if options.target is None or options.filename is None:
-        sys.exit("Must specify both target and filename.")
-    print('This tool is highly experimental, use with care.')
-    rewriter = mesonbuild.astinterpreter.RewriterInterpreter(options.sourcedir, '')
+    if not options.verbose:
+        mlog.set_quiet()
+
     try:
-        if options.commands[0] == 'add':
-            rewriter.add_source(options.target, options.filename)
-        elif options.commands[0] == 'remove':
-            rewriter.remove_source(options.target, options.filename)
-        else:
-            sys.exit('Unknown command: ' + options.commands[0])
+        rewriter = Rewriter(options.sourcedir, skip_errors=options.skip)
+        rewriter.analyze_meson()
+
+        if options.type is None:
+            mlog.error('No command specified')
+            return 1
+
+        commands = cli_type_map[options.type](options)
+
+        if not isinstance(commands, list):
+            raise TypeError('Command is not a list')
+
+        for i in commands:
+            if not isinstance(i, object):
+                raise TypeError('Command is not an object')
+            rewriter.process(i)
+
+        rewriter.apply_changes()
+        rewriter.print_info()
+        return 0
     except Exception as e:
-        if isinstance(e, MesonException):
-            mlog.exception(e)
-        else:
-            traceback.print_exc()
-        return 1
-    return 0
+        raise e
+    finally:
+        mlog.set_verbose()
diff -Nru meson-0.49.0/mesonbuild/scripts/clangformat.py meson-0.52.1/mesonbuild/scripts/clangformat.py
--- meson-0.49.0/mesonbuild/scripts/clangformat.py	1970-01-01 00:00:00.000000000 +0000
+++ meson-0.52.1/mesonbuild/scripts/clangformat.py	2019-10-06 17:01:35.000000000 +0000
@@ -0,0 +1,45 @@
+# Copyright 2018 The Meson development team
+
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+
+#     http://www.apache.org/licenses/LICENSE-2.0
+
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import pathlib
+import subprocess
+from concurrent.futures import ThreadPoolExecutor
+
+from ..environment import detect_clangformat
+from ..compilers import lang_suffixes
+
+def clangformat(exelist, srcdir_name, builddir_name):
+    srcdir = pathlib.Path(srcdir_name)
+    suffixes = set(lang_suffixes['c']).union(set(lang_suffixes['cpp']))
+    suffixes.add('h')
+    futures = []
+    with ThreadPoolExecutor() as e:
+        for f in (x for suff in suffixes for x in srcdir.glob('**/*.' + suff)):
+            strf = str(f)
+            if strf.startswith(builddir_name):
+                continue
+            futures.append(e.submit(subprocess.check_call, exelist + ['-style=file', '-i', strf]))
+        [x.result() for x in futures]
+    return 0
+
+def run(args):
+    srcdir_name = args[0]
+    builddir_name = args[1]
+
+    exelist = detect_clangformat()
+    if not exelist:
+        print('Could not execute clang-format "%s"' % ' '.join(exelist))
+        return 1
+
+    return clangformat(exelist, srcdir_name, builddir_name)
diff -Nru meson-0.49.0/mesonbuild/scripts/clangtidy.py meson-0.52.1/mesonbuild/scripts/clangtidy.py
--- meson-0.49.0/mesonbuild/scripts/clangtidy.py	1970-01-01 00:00:00.000000000 +0000
+++ meson-0.52.1/mesonbuild/scripts/clangtidy.py	2019-11-28 17:37:44.000000000 +0000
@@ -0,0 +1,38 @@
+# Copyright 2019 The Meson development team
+
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+
+#     http://www.apache.org/licenses/LICENSE-2.0
+
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import pathlib
+import subprocess
+from concurrent.futures import ThreadPoolExecutor
+
+from ..compilers import lang_suffixes
+
+def clangformat(srcdir_name, builddir_name):
+    srcdir = pathlib.Path(srcdir_name)
+    suffixes = set(lang_suffixes['c']).union(set(lang_suffixes['cpp']))
+    suffixes.add('h')
+    futures = []
+    with ThreadPoolExecutor() as e:
+        for f in (x for suff in suffixes for x in srcdir.glob('**/*.' + suff)):
+            strf = str(f)
+            if strf.startswith(builddir_name):
+                continue
+            futures.append(e.submit(subprocess.check_call, ['clang-tidy', '-p', builddir_name, strf]))
+        [x.result() for x in futures]
+    return 0
+
+def run(args):
+    srcdir_name = args[0]
+    builddir_name = args[1]
+    return clangformat(srcdir_name, builddir_name)
diff -Nru meson-0.49.0/mesonbuild/scripts/commandrunner.py meson-0.52.1/mesonbuild/scripts/commandrunner.py
--- meson-0.49.0/mesonbuild/scripts/commandrunner.py	2018-08-25 08:05:43.000000000 +0000
+++ meson-0.52.1/mesonbuild/scripts/commandrunner.py	2019-11-28 17:37:44.000000000 +0000
@@ -16,6 +16,7 @@
 what to run, sets up the environment and executes the command."""
 
 import sys, os, subprocess, shutil, shlex
+import re
 
 def run_command(source_dir, build_dir, subdir, meson_command, command, arguments):
     env = {'MESON_SOURCE_ROOT': source_dir,
@@ -49,6 +50,9 @@
         print('Could not execute command "{}": {}'.format(command, err))
         sys.exit(1)
 
+def is_python_command(cmdname):
+    end_py_regex = r'python(3|3\.\d+)?(\.exe)?$'
+    return re.search(end_py_regex, cmdname) is not None
 
 def run(args):
     if len(args) < 4:
@@ -58,7 +62,7 @@
     build_dir = args[1]
     subdir = args[2]
     meson_command = args[3]
-    if 'python' in meson_command: # Hack.
+    if is_python_command(meson_command):
         meson_command = [meson_command, args[4]]
         command = args[5]
         arguments = args[6:]
diff -Nru meson-0.49.0/mesonbuild/scripts/coverage.py meson-0.52.1/mesonbuild/scripts/coverage.py
--- meson-0.49.0/mesonbuild/scripts/coverage.py	2018-12-09 14:27:23.000000000 +0000
+++ meson-0.52.1/mesonbuild/scripts/coverage.py	2019-05-02 18:59:50.000000000 +0000
@@ -22,35 +22,33 @@
 
     (gcovr_exe, gcovr_new_rootdir, lcov_exe, genhtml_exe) = environment.find_coverage_tools()
 
-    # gcovr >= 3.1 interprets rootdir differently
+    # gcovr >= 4.2 requires a different syntax for out of source builds
     if gcovr_new_rootdir:
-        gcovr_rootdir = build_root
+        gcovr_base_cmd = [gcovr_exe, '-r', source_root, build_root]
     else:
-        gcovr_rootdir = source_root
+        gcovr_base_cmd = [gcovr_exe, '-r', build_root]
 
     if not outputs or 'xml' in outputs:
         if gcovr_exe:
-            subprocess.check_call([gcovr_exe,
-                                   '-x',
-                                   '-r', gcovr_rootdir,
+            subprocess.check_call(gcovr_base_cmd +
+                                  ['-x',
                                    '-e', subproject_root,
                                    '-o', os.path.join(log_dir, 'coverage.xml'),
                                    ])
             outfiles.append(('Xml', pathlib.Path(log_dir, 'coverage.xml')))
         elif outputs:
-            print('gcovr needed to generate Xml coverage report')
+            print('gcovr >= 3.3 needed to generate Xml coverage report')
             exitcode = 1
 
     if not outputs or 'text' in outputs:
         if gcovr_exe:
-            subprocess.check_call([gcovr_exe,
-                                   '-r', gcovr_rootdir,
-                                   '-e', subproject_root,
+            subprocess.check_call(gcovr_base_cmd +
+                                  ['-e', subproject_root,
                                    '-o', os.path.join(log_dir, 'coverage.txt'),
                                    ])
             outfiles.append(('Text', pathlib.Path(log_dir, 'coverage.txt')))
         elif outputs:
-            print('gcovr needed to generate text coverage report')
+            print('gcovr >= 3.3 needed to generate text coverage report')
             exitcode = 1
 
     if not outputs or 'html' in outputs:
@@ -93,6 +91,7 @@
                                    '--output-file', covinfo])
             subprocess.check_call([genhtml_exe,
                                    '--prefix', build_root,
+                                   '--prefix', source_root,
                                    '--output-directory', htmloutdir,
                                    '--title', 'Code coverage',
                                    '--legend',
@@ -100,21 +99,20 @@
                                    '--branch-coverage',
                                    covinfo])
             outfiles.append(('Html', pathlib.Path(htmloutdir, 'index.html')))
-        elif gcovr_exe and gcovr_new_rootdir:
+        elif gcovr_exe:
             htmloutdir = os.path.join(log_dir, 'coveragereport')
             if not os.path.isdir(htmloutdir):
                 os.mkdir(htmloutdir)
-            subprocess.check_call([gcovr_exe,
-                                   '--html',
+            subprocess.check_call(gcovr_base_cmd +
+                                  ['--html',
                                    '--html-details',
                                    '--print-summary',
-                                   '-r', build_root,
                                    '-e', subproject_root,
                                    '-o', os.path.join(htmloutdir, 'index.html'),
                                    ])
             outfiles.append(('Html', pathlib.Path(htmloutdir, 'index.html')))
         elif outputs:
-            print('lcov/genhtml or gcovr >= 3.2 needed to generate Html coverage report')
+            print('lcov/genhtml or gcovr >= 3.3 needed to generate Html coverage report')
             exitcode = 1
 
     if not outputs and not outfiles:
diff -Nru meson-0.49.0/mesonbuild/scripts/depfixer.py meson-0.52.1/mesonbuild/scripts/depfixer.py
--- meson-0.49.0/mesonbuild/scripts/depfixer.py	2018-12-09 14:27:16.000000000 +0000
+++ meson-0.52.1/mesonbuild/scripts/depfixer.py	2019-11-28 17:37:44.000000000 +0000
@@ -123,7 +123,7 @@
             self.parse_header()
             self.parse_sections()
             self.parse_dynamic()
-        except:
+        except (struct.error, RuntimeError):
             self.bf.close()
             raise
 
@@ -180,7 +180,7 @@
     def parse_sections(self):
         self.bf.seek(self.e_shoff)
         self.sections = []
-        for i in range(self.e_shnum):
+        for _ in range(self.e_shnum):
             self.sections.append(SectionHeader(self.bf, self.ptrsize, self.is_le))
 
     def read_str(self):
@@ -413,9 +413,8 @@
             subprocess.check_call(['install_name_tool', fname] + args,
                                   stdout=subprocess.DEVNULL,
                                   stderr=subprocess.DEVNULL)
-    except Exception:
-        raise
-        sys.exit(0)
+    except Exception as err:
+        raise SystemExit(err)
 
 def fix_jar(fname):
     subprocess.check_call(['jar', 'xfv', fname, 'META-INF/MANIFEST.MF'])
diff -Nru meson-0.49.0/mesonbuild/scripts/dist.py meson-0.52.1/mesonbuild/scripts/dist.py
--- meson-0.49.0/mesonbuild/scripts/dist.py	2018-12-09 14:27:16.000000000 +0000
+++ meson-0.52.1/mesonbuild/scripts/dist.py	1970-01-01 00:00:00.000000000 +0000
@@ -1,206 +0,0 @@
-# Copyright 2017 The Meson development team
-
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-
-#     http://www.apache.org/licenses/LICENSE-2.0
-
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-import lzma
-import os
-import sys
-import shutil
-import subprocess
-import pickle
-import hashlib
-import tarfile, zipfile
-import tempfile
-from glob import glob
-from mesonbuild.environment import detect_ninja
-from mesonbuild.mesonlib import windows_proof_rmtree
-from mesonbuild import mlog
-
-def create_hash(fname):
-    hashname = fname + '.sha256sum'
-    m = hashlib.sha256()
-    m.update(open(fname, 'rb').read())
-    with open(hashname, 'w') as f:
-        f.write('%s %s\n' % (m.hexdigest(), os.path.basename(fname)))
-
-
-def create_zip(zipfilename, packaging_dir):
-    prefix = os.path.dirname(packaging_dir)
-    removelen = len(prefix) + 1
-    with zipfile.ZipFile(zipfilename,
-                         'w',
-                         compression=zipfile.ZIP_DEFLATED,
-                         allowZip64=True) as zf:
-        zf.write(packaging_dir, packaging_dir[removelen:])
-        for root, dirs, files in os.walk(packaging_dir):
-            for d in dirs:
-                dname = os.path.join(root, d)
-                zf.write(dname, dname[removelen:])
-            for f in files:
-                fname = os.path.join(root, f)
-                zf.write(fname, fname[removelen:])
-
-def del_gitfiles(dirname):
-    for f in glob(os.path.join(dirname, '.git*')):
-        if os.path.isdir(f) and not os.path.islink(f):
-            windows_proof_rmtree(f)
-        else:
-            os.unlink(f)
-
-def process_submodules(dirname):
-    module_file = os.path.join(dirname, '.gitmodules')
-    if not os.path.exists(module_file):
-        return
-    subprocess.check_call(['git', 'submodule', 'update', '--init'], cwd=dirname)
-    for line in open(module_file):
-        line = line.strip()
-        if '=' not in line:
-            continue
-        k, v = line.split('=', 1)
-        k = k.strip()
-        v = v.strip()
-        if k != 'path':
-            continue
-        del_gitfiles(os.path.join(dirname, v))
-
-
-def run_dist_scripts(dist_root, dist_scripts):
-    assert(os.path.isabs(dist_root))
-    env = os.environ.copy()
-    env['MESON_DIST_ROOT'] = dist_root
-    for d in dist_scripts:
-        script = d['exe']
-        args = d['args']
-        name = ' '.join(script + args)
-        print('Running custom dist script {!r}'.format(name))
-        try:
-            rc = subprocess.call(script + args, env=env)
-            if rc != 0:
-                sys.exit('Dist script errored out')
-        except OSError:
-            print('Failed to run dist script {!r}'.format(name))
-            sys.exit(1)
-
-
-def git_have_dirty_index(src_root):
-    '''Check whether there are uncommitted changes in git'''
-    ret = subprocess.call(['git', '-C', src_root, 'diff-index', '--quiet', 'HEAD'])
-    return ret == 1
-
-def create_dist_git(dist_name, src_root, bld_root, dist_sub, dist_scripts):
-    if git_have_dirty_index(src_root):
-        mlog.warning('Repository has uncommitted changes that will not be included in the dist tarball')
-    distdir = os.path.join(dist_sub, dist_name)
-    if os.path.exists(distdir):
-        shutil.rmtree(distdir)
-    os.makedirs(distdir)
-    subprocess.check_call(['git', 'clone', '--shared', src_root, distdir])
-    process_submodules(distdir)
-    del_gitfiles(distdir)
-    run_dist_scripts(distdir, dist_scripts)
-    xzname = distdir + '.tar.xz'
-    # Should use shutil but it got xz support only in 3.5.
-    with tarfile.open(xzname, 'w:xz') as tf:
-        tf.add(distdir, dist_name)
-    # Create only .tar.xz for now.
-    # zipname = distdir + '.zip'
-    # create_zip(zipname, distdir)
-    shutil.rmtree(distdir)
-    return (xzname, )
-
-
-def hg_have_dirty_index(src_root):
-    '''Check whether there are uncommitted changes in hg'''
-    out = subprocess.check_output(['hg', '-R', src_root, 'summary'])
-    return b'commit: (clean)' not in out
-
-def create_dist_hg(dist_name, src_root, bld_root, dist_sub, dist_scripts):
-    if hg_have_dirty_index(src_root):
-        mlog.warning('Repository has uncommitted changes that will not be included in the dist tarball')
-
-    os.makedirs(dist_sub, exist_ok=True)
-    tarname = os.path.join(dist_sub, dist_name + '.tar')
-    xzname = tarname + '.xz'
-    subprocess.check_call(['hg', 'archive', '-R', src_root, '-S', '-t', 'tar', tarname])
-    if len(dist_scripts) > 0:
-        mlog.warning('dist scripts are not supported in Mercurial projects')
-    with lzma.open(xzname, 'wb') as xf, open(tarname, 'rb') as tf:
-        shutil.copyfileobj(tf, xf)
-    os.unlink(tarname)
-    # Create only .tar.xz for now.
-    # zipname = os.path.join(dist_sub, dist_name + '.zip')
-    # subprocess.check_call(['hg', 'archive', '-R', src_root, '-S', '-t', 'zip', zipname])
-    return (xzname, )
-
-
-def check_dist(packagename, meson_command):
-    print('Testing distribution package %s' % packagename)
-    unpackdir = tempfile.mkdtemp()
-    builddir = tempfile.mkdtemp()
-    installdir = tempfile.mkdtemp()
-    ninja_bin = detect_ninja()
-    try:
-        tf = tarfile.open(packagename)
-        tf.extractall(unpackdir)
-        srcdir = glob(os.path.join(unpackdir, '*'))[0]
-        if subprocess.call(meson_command + ['--backend=ninja', srcdir, builddir]) != 0:
-            print('Running Meson on distribution package failed')
-            return 1
-        if subprocess.call([ninja_bin], cwd=builddir) != 0:
-            print('Compiling the distribution package failed')
-            return 1
-        if subprocess.call([ninja_bin, 'test'], cwd=builddir) != 0:
-            print('Running unit tests on the distribution package failed')
-            return 1
-        myenv = os.environ.copy()
-        myenv['DESTDIR'] = installdir
-        if subprocess.call([ninja_bin, 'install'], cwd=builddir, env=myenv) != 0:
-            print('Installing the distribution package failed')
-            return 1
-    finally:
-        shutil.rmtree(unpackdir)
-        shutil.rmtree(builddir)
-        shutil.rmtree(installdir)
-    print('Distribution package %s tested' % packagename)
-    return 0
-
-def run(args):
-    src_root = args[0]
-    bld_root = args[1]
-    meson_command = args[2:]
-    priv_dir = os.path.join(bld_root, 'meson-private')
-    dist_sub = os.path.join(bld_root, 'meson-dist')
-
-    buildfile = os.path.join(priv_dir, 'build.dat')
-
-    build = pickle.load(open(buildfile, 'rb'))
-
-    dist_name = build.project_name + '-' + build.project_version
-
-    if os.path.isdir(os.path.join(src_root, '.git')):
-        names = create_dist_git(dist_name, src_root, bld_root, dist_sub, build.dist_scripts)
-    elif os.path.isdir(os.path.join(src_root, '.hg')):
-        names = create_dist_hg(dist_name, src_root, bld_root, dist_sub, build.dist_scripts)
-    else:
-        print('Dist currently only works with Git or Mercurial repos')
-        return 1
-    if names is None:
-        return 1
-    error_count = 0
-    for name in names:
-        rc = check_dist(name, meson_command) # Check only one.
-        if rc == 0:
-            create_hash(name)
-        error_count += rc
-    return 1 if error_count else 0
diff -Nru meson-0.49.0/mesonbuild/scripts/gettext.py meson-0.52.1/mesonbuild/scripts/gettext.py
--- meson-0.49.0/mesonbuild/scripts/gettext.py	2018-08-25 08:05:43.000000000 +0000
+++ meson-0.52.1/mesonbuild/scripts/gettext.py	2019-04-17 08:08:43.000000000 +0000
@@ -44,9 +44,9 @@
         return []
 
 def run_potgen(src_sub, pkgname, datadirs, args):
-    listfile = os.path.join(src_sub, 'POTFILES')
+    listfile = os.path.join(src_sub, 'POTFILES.in')
     if not os.path.exists(listfile):
-        listfile = os.path.join(src_sub, 'POTFILES.in')
+        listfile = os.path.join(src_sub, 'POTFILES')
         if not os.path.exists(listfile):
             print('Could not find file POTFILES in %s' % src_sub)
             return 1
diff -Nru meson-0.49.0/mesonbuild/scripts/gtkdochelper.py meson-0.52.1/mesonbuild/scripts/gtkdochelper.py
--- meson-0.49.0/mesonbuild/scripts/gtkdochelper.py	2018-12-09 14:27:16.000000000 +0000
+++ meson-0.52.1/mesonbuild/scripts/gtkdochelper.py	2019-09-16 21:20:45.000000000 +0000
@@ -14,10 +14,9 @@
 
 import sys, os
 import subprocess
-import shlex
 import shutil
 import argparse
-from ..mesonlib import MesonException, Popen_safe, is_windows
+from ..mesonlib import MesonException, Popen_safe, is_windows, split_args
 from . import destdir_join
 
 parser = argparse.ArgumentParser()
@@ -47,6 +46,9 @@
 parser.add_argument('--mode', dest='mode', default='')
 parser.add_argument('--installdir', dest='install_dir')
 parser.add_argument('--run', dest='run', default='')
+for tool in ['scan', 'scangobj', 'mkdb', 'mkhtml', 'fixxref']:
+    program_name = 'gtkdoc-' + tool
+    parser.add_argument('--' + program_name, dest=program_name.replace('-', '_'))
 
 def gtkdoc_run_check(cmd, cwd, library_paths=None):
     if library_paths is None:
@@ -78,7 +80,7 @@
                  html_args, scan_args, fixxref_args, mkdb_args,
                  gobject_typesfile, scanobjs_args, run, ld, cc, ldflags, cflags,
                  html_assets, content_files, ignore_headers, namespace,
-                 expand_content_files, mode):
+                 expand_content_files, mode, options):
     print("Building documentation for %s" % module)
 
     src_dir_args = []
@@ -122,7 +124,7 @@
         f_abs = os.path.join(doc_src, f)
         shutil.copyfile(f_abs, os.path.join(htmldir, os.path.basename(f_abs)))
 
-    scan_cmd = ['gtkdoc-scan', '--module=' + module] + src_dir_args
+    scan_cmd = [options.gtkdoc_scan, '--module=' + module] + src_dir_args
     if ignore_headers:
         scan_cmd.append('--ignore-headers=' + ' '.join(ignore_headers))
     # Add user-specified arguments
@@ -135,17 +137,18 @@
         gobject_typesfile = os.path.join(abs_out, module + '.types')
 
     if gobject_typesfile:
-        scanobjs_cmd = ['gtkdoc-scangobj'] + scanobjs_args + ['--types=' + gobject_typesfile,
-                                                              '--module=' + module,
-                                                              '--run=' + run,
-                                                              '--cflags=' + cflags,
-                                                              '--ldflags=' + ldflags,
-                                                              '--cc=' + cc,
-                                                              '--ld=' + ld,
-                                                              '--output-dir=' + abs_out]
+        scanobjs_cmd = [options.gtkdoc_scangobj] + scanobjs_args
+        scanobjs_cmd += ['--types=' + gobject_typesfile,
+                         '--module=' + module,
+                         '--run=' + run,
+                         '--cflags=' + cflags,
+                         '--ldflags=' + ldflags,
+                         '--cc=' + cc,
+                         '--ld=' + ld,
+                         '--output-dir=' + abs_out]
 
         library_paths = []
-        for ldflag in shlex.split(ldflags):
+        for ldflag in split_args(ldflags):
             if ldflag.startswith('-Wl,-rpath,'):
                 library_paths.append(ldflag[11:])
 
@@ -166,7 +169,7 @@
     else: # none
         modeflag = None
 
-    mkdb_cmd = ['gtkdoc-mkdb',
+    mkdb_cmd = [options.gtkdoc_mkdb,
                 '--module=' + module,
                 '--output-format=xml',
                 '--expand-content-files=' + ' '.join(expand_content_files),
@@ -175,7 +178,7 @@
         mkdb_cmd.append('--name-space=' + namespace)
     if modeflag:
         mkdb_cmd.append(modeflag)
-    if len(main_file) > 0:
+    if main_file:
         # Yes, this is the flag even if the file is in xml.
         mkdb_cmd.append('--main-sgml-file=' + main_file)
     # Add user-specified arguments
@@ -183,11 +186,11 @@
     gtkdoc_run_check(mkdb_cmd, abs_out)
 
     # Make HTML documentation
-    mkhtml_cmd = ['gtkdoc-mkhtml',
+    mkhtml_cmd = [options.gtkdoc_mkhtml,
                   '--path=' + ':'.join((doc_src, abs_out)),
                   module,
                   ] + html_args
-    if len(main_file) > 0:
+    if main_file:
         mkhtml_cmd.append('../' + main_file)
     else:
         mkhtml_cmd.append('%s-docs.xml' % module)
@@ -195,7 +198,7 @@
     gtkdoc_run_check(mkhtml_cmd, htmldir)
 
     # Fix cross-references in HTML files
-    fixref_cmd = ['gtkdoc-fixxref',
+    fixref_cmd = [options.gtkdoc_fixxref,
                   '--module=' + module,
                   '--module-dir=html'] + fixxref_args
     gtkdoc_run_check(fixref_cmd, abs_out)
@@ -212,23 +215,23 @@
 
 def run(args):
     options = parser.parse_args(args)
-    if len(options.htmlargs) > 0:
+    if options.htmlargs:
         htmlargs = options.htmlargs.split('@@')
     else:
         htmlargs = []
-    if len(options.scanargs) > 0:
+    if options.scanargs:
         scanargs = options.scanargs.split('@@')
     else:
         scanargs = []
-    if len(options.scanobjsargs) > 0:
+    if options.scanobjsargs:
         scanobjsargs = options.scanobjsargs.split('@@')
     else:
         scanobjsargs = []
-    if len(options.fixxrefargs) > 0:
+    if options.fixxrefargs:
         fixxrefargs = options.fixxrefargs.split('@@')
     else:
         fixxrefargs = []
-    if len(options.mkdbargs) > 0:
+    if options.mkdbargs:
         mkdbargs = options.mkdbargs.split('@@')
     else:
         mkdbargs = []
@@ -256,7 +259,8 @@
         options.ignore_headers.split('@@') if options.ignore_headers else [],
         options.namespace,
         options.expand_content_files.split('@@') if options.expand_content_files else [],
-        options.mode)
+        options.mode,
+        options)
 
     if 'MESON_INSTALL_PREFIX' in os.environ:
         destdir = os.environ.get('DESTDIR', '')
diff -Nru meson-0.49.0/mesonbuild/scripts/meson_exe.py meson-0.52.1/mesonbuild/scripts/meson_exe.py
--- meson-0.49.0/mesonbuild/scripts/meson_exe.py	2018-12-09 14:27:16.000000000 +0000
+++ meson-0.52.1/mesonbuild/scripts/meson_exe.py	2019-09-16 21:20:45.000000000 +0000
@@ -20,12 +20,14 @@
 import subprocess
 
 from .. import mesonlib
+from ..backend.backends import ExecutableSerialisation
 
 options = None
 
 def buildparser():
-    parser = argparse.ArgumentParser()
-    parser.add_argument('args', nargs='+')
+    parser = argparse.ArgumentParser(description='Custom executable wrapper for Meson. Do not run on your own, mmm\'kay?')
+    parser.add_argument('--unpickle')
+    parser.add_argument('--capture')
     return parser
 
 def is_windows():
@@ -36,51 +38,45 @@
     platname = platform.system().lower()
     return 'cygwin' in platname
 
-def run_with_mono(fname):
-    if fname.endswith('.exe') and not (is_windows() or is_cygwin()):
-        return True
-    return False
-
 def run_exe(exe):
-    if exe.fname[0].endswith('.jar'):
-        cmd = ['java', '-jar'] + exe.fname
-    elif not exe.is_cross and run_with_mono(exe.fname[0]):
-        cmd = ['mono'] + exe.fname
+    if exe.exe_runner:
+        if not exe.exe_runner.found():
+            raise AssertionError('BUG: Can\'t run cross-compiled exe {!r} with not-found '
+                                 'wrapper {!r}'.format(exe.cmd_args[0], exe.exe_runner.get_path()))
+        cmd_args = exe.exe_runner.get_command() + exe.cmd_args
     else:
-        if exe.is_cross:
-            if exe.exe_runner is None:
-                raise AssertionError('BUG: Can\'t run cross-compiled exe {!r}'
-                                     'with no wrapper'.format(exe.name))
-            elif not exe.exe_runner.found():
-                raise AssertionError('BUG: Can\'t run cross-compiled exe {!r} with not-found'
-                                     'wrapper {!r}'.format(exe.name, exe.exe_runner.get_path()))
-            else:
-                cmd = exe.exe_runner.get_command() + exe.fname
-        else:
-            cmd = exe.fname
+        cmd_args = exe.cmd_args
     child_env = os.environ.copy()
     child_env.update(exe.env)
-    if len(exe.extra_paths) > 0:
+    if exe.extra_paths:
         child_env['PATH'] = (os.pathsep.join(exe.extra_paths + ['']) +
                              child_env['PATH'])
         if exe.exe_runner and mesonlib.substring_is_in_list('wine', exe.exe_runner.get_command()):
-            wine_paths = ['Z:' + p for p in exe.extra_paths]
-            wine_path = ';'.join(wine_paths)
-            # Don't accidentally end with an `;` because that will add the
-            # current directory and might cause unexpected behaviour
-            if 'WINEPATH' in child_env:
-                child_env['WINEPATH'] = wine_path + ';' + child_env['WINEPATH']
-            else:
-                child_env['WINEPATH'] = wine_path
+            child_env['WINEPATH'] = mesonlib.get_wine_shortpath(
+                exe.exe_runner.get_command(),
+                ['Z:' + p for p in exe.extra_paths] + child_env.get('WINEPATH', '').split(';')
+            )
 
-    p = subprocess.Popen(cmd + exe.cmd_args, env=child_env, cwd=exe.workdir,
+    p = subprocess.Popen(cmd_args, env=child_env, cwd=exe.workdir,
                          close_fds=False,
                          stdout=subprocess.PIPE,
                          stderr=subprocess.PIPE)
     stdout, stderr = p.communicate()
+
+    if p.returncode == 0xc0000135:
+        # STATUS_DLL_NOT_FOUND on Windows indicating a common problem that is otherwise hard to diagnose
+        raise FileNotFoundError('Missing DLLs on calling {!r}'.format(exe.name))
+
     if exe.capture and p.returncode == 0:
-        with open(exe.capture, 'wb') as output:
-            output.write(stdout)
+        skip_write = False
+        try:
+            with open(exe.capture, 'rb') as cur:
+                skip_write = cur.read() == stdout
+        except IOError:
+            pass
+        if not skip_write:
+            with open(exe.capture, 'wb') as output:
+                output.write(stdout)
     else:
         sys.stdout.buffer.write(stdout)
     if stderr:
@@ -89,13 +85,22 @@
 
 def run(args):
     global options
-    options = buildparser().parse_args(args)
-    if len(options.args) != 1:
-        print('Test runner for Meson. Do not run on your own, mmm\'kay?')
-        print(sys.argv[0] + ' [data file]')
-    exe_data_file = options.args[0]
-    with open(exe_data_file, 'rb') as f:
-        exe = pickle.load(f)
+    parser = buildparser()
+    options, cmd_args = parser.parse_known_args(args)
+    # argparse supports double dash to separate options and positional arguments,
+    # but the user has to remove it manually.
+    if cmd_args and cmd_args[0] == '--':
+        cmd_args = cmd_args[1:]
+    if not options.unpickle and not cmd_args:
+        parser.error('either --unpickle or executable and arguments are required')
+    if options.unpickle:
+        if cmd_args or options.capture:
+            parser.error('no other arguments can be used with --unpickle')
+        with open(options.unpickle, 'rb') as f:
+            exe = pickle.load(f)
+    else:
+        exe = ExecutableSerialisation(cmd_args, capture=options.capture)
+
     return run_exe(exe)
 
 if __name__ == '__main__':
diff -Nru meson-0.49.0/mesonbuild/scripts/msgfmthelper.py meson-0.52.1/mesonbuild/scripts/msgfmthelper.py
--- meson-0.49.0/mesonbuild/scripts/msgfmthelper.py	2017-05-03 17:17:06.000000000 +0000
+++ meson-0.52.1/mesonbuild/scripts/msgfmthelper.py	2019-05-02 18:59:50.000000000 +0000
@@ -22,6 +22,7 @@
 parser.add_argument('type')
 parser.add_argument('podir')
 parser.add_argument('--datadirs', default='')
+parser.add_argument('args', default=[], metavar='extra msgfmt argument', nargs='*')
 
 
 def run(args):
@@ -31,5 +32,5 @@
         env = os.environ.copy()
         env.update({'GETTEXTDATADIRS': options.datadirs})
     return subprocess.call(['msgfmt', '--' + options.type, '-d', options.podir,
-                            '--template', options.input,  '-o', options.output],
+                            '--template', options.input,  '-o', options.output] + options.args,
                            env=env)
diff -Nru meson-0.49.0/mesonbuild/scripts/scanbuild.py meson-0.52.1/mesonbuild/scripts/scanbuild.py
--- meson-0.49.0/mesonbuild/scripts/scanbuild.py	2018-12-09 14:27:16.000000000 +0000
+++ meson-0.52.1/mesonbuild/scripts/scanbuild.py	2019-11-28 17:37:44.000000000 +0000
@@ -13,12 +13,12 @@
 # limitations under the License.
 
 import os
-import shlex
 import subprocess
 import shutil
 import tempfile
-from ..environment import detect_ninja
-from ..mesonlib import Popen_safe
+from ..environment import detect_ninja, detect_scanbuild
+from ..mesonlib import Popen_safe, split_args
+
 
 def scanbuild(exelist, srcdir, blddir, privdir, logdir, args):
     with tempfile.TemporaryDirectory(dir=privdir) as scandir:
@@ -29,6 +29,7 @@
             return rc
         return subprocess.call(build_cmd)
 
+
 def run(args):
     srcdir = args[0]
     blddir = args[1]
@@ -36,37 +37,10 @@
     privdir = os.path.join(blddir, 'meson-private')
     logdir = os.path.join(blddir, 'meson-logs/scanbuild')
     shutil.rmtree(logdir, ignore_errors=True)
-    tools = [
-        'scan-build',  # base
-        'scan-build-5.0', 'scan-build50',  # latest stable release
-        'scan-build-4.0', 'scan-build40',  # old stable releases
-        'scan-build-3.9', 'scan-build39',
-        'scan-build-3.8', 'scan-build38',
-        'scan-build-3.7', 'scan-build37',
-        'scan-build-3.6', 'scan-build36',
-        'scan-build-3.5', 'scan-build35',
-        'scan-build-6.0', 'scan-build-devel',  # development snapshot
-    ]
-    toolname = 'scan-build'
-    for tool in tools:
-        try:
-            p, out = Popen_safe([tool, '--help'])[:2]
-        except (FileNotFoundError, PermissionError):
-            continue
-        if p.returncode != 0:
-            continue
-        else:
-            toolname = tool
-            break
-
-    if 'SCANBUILD' in os.environ:
-        exelist = shlex.split(os.environ['SCANBUILD'])
-    else:
-        exelist = [toolname]
-
-    try:
-        Popen_safe(exelist + ['--help'])
-    except OSError:
+
+    exelist = detect_scanbuild()
+    if not exelist:
         print('Could not execute scan-build "%s"' % ' '.join(exelist))
         return 1
+
     return scanbuild(exelist, srcdir, blddir, privdir, logdir, meson_cmd)
diff -Nru meson-0.49.0/mesonbuild/scripts/symbolextractor.py meson-0.52.1/mesonbuild/scripts/symbolextractor.py
--- meson-0.49.0/mesonbuild/scripts/symbolextractor.py	2017-01-03 18:10:13.000000000 +0000
+++ meson-0.52.1/mesonbuild/scripts/symbolextractor.py	2019-05-02 18:59:50.000000000 +0000
@@ -68,7 +68,14 @@
                               libfilename])[0:2]
     if pnm.returncode != 0:
         raise RuntimeError('nm does not work.')
-    result += [' '.join(x.split()[0:2]) for x in output.split('\n') if len(x) > 0]
+    for line in output.split('\n'):
+        if not line:
+            continue
+        line_split = line.split()
+        entry = line_split[0:2]
+        if len(line_split) >= 4:
+            entry += [line_split[3]]
+        result += [' '.join(entry)]
     write_if_changed('\n'.join(result) + '\n', outfilename)
 
 def osx_syms(libfilename, outfilename):
@@ -84,7 +91,7 @@
     pnm, output = Popen_safe(['nm', '-g', '-P', libfilename])[0:2]
     if pnm.returncode != 0:
         raise RuntimeError('nm does not work.')
-    result += [' '.join(x.split()[0:2]) for x in output.split('\n') if len(x) > 0 and not x.endswith('U')]
+    result += [' '.join(x.split()[0:2]) for x in output.split('\n') if x and not x.endswith('U')]
     write_if_changed('\n'.join(result) + '\n', outfilename)
 
 def gen_symbols(libfilename, outfilename, cross_host):
diff -Nru meson-0.49.0/mesonbuild/scripts/vcstagger.py meson-0.52.1/mesonbuild/scripts/vcstagger.py
--- meson-0.49.0/mesonbuild/scripts/vcstagger.py	2017-07-21 20:07:34.000000000 +0000
+++ meson-0.52.1/mesonbuild/scripts/vcstagger.py	2019-04-17 08:08:43.000000000 +0000
@@ -14,6 +14,7 @@
 
 import sys, os, subprocess, re
 
+
 def config_vcs_tag(infile, outfile, fallback, source_dir, replace_string, regex_selector, cmd):
     try:
         output = subprocess.check_output(cmd, cwd=source_dir)
@@ -21,17 +22,18 @@
     except Exception:
         new_string = fallback
 
-    with open(infile) as f:
+    with open(infile, encoding='utf8') as f:
         new_data = f.read().replace(replace_string, new_string)
     if os.path.exists(outfile):
-        with open(outfile) as f:
+        with open(outfile, encoding='utf8') as f:
             needs_update = (f.read() != new_data)
     else:
         needs_update = True
     if needs_update:
-        with open(outfile, 'w') as f:
+        with open(outfile, 'w', encoding='utf8') as f:
             f.write(new_data)
 
+
 def run(args):
     infile, outfile, fallback, source_dir, replace_string, regex_selector = args[0:6]
     command = args[6:]
diff -Nru meson-0.49.0/mesonbuild/scripts/yelphelper.py meson-0.52.1/mesonbuild/scripts/yelphelper.py
--- meson-0.49.0/mesonbuild/scripts/yelphelper.py	2018-08-25 08:05:43.000000000 +0000
+++ meson-0.52.1/mesonbuild/scripts/yelphelper.py	2019-06-16 18:54:18.000000000 +0000
@@ -73,8 +73,9 @@
         for m in media:
             infile = os.path.join(srcdir, lang, m)
             outfile = os.path.join(indir, m)
+            c_infile = os.path.join(srcdir, 'C', m)
             if not os.path.exists(infile):
-                if lang == 'C':
+                if not os.path.exists(c_infile):
                     mlog.warning('Media file "%s" did not exist in C directory' % m)
                     continue
                 elif symlinks:
@@ -91,9 +92,10 @@
                         continue
                     except (NotImplementedError, OSError):
                         mlog.warning('Symlinking not supported, falling back to copying')
+                        infile = c_infile
                 else:
                     # Lang doesn't have media file so copy it over 'C' one
-                    infile = os.path.join(srcdir, 'C', m)
+                    infile = c_infile
             mlog.log('Installing %s to %s' % (infile, outfile))
             if has_path_sep(m):
                 os.makedirs(os.path.dirname(outfile), exist_ok=True)
diff -Nru meson-0.49.0/mesonbuild/wrap/wrap.py meson-0.52.1/mesonbuild/wrap/wrap.py
--- meson-0.49.0/mesonbuild/wrap/wrap.py	2018-12-09 14:27:23.000000000 +0000
+++ meson-0.52.1/mesonbuild/wrap/wrap.py	2019-11-28 17:37:44.000000000 +0000
@@ -18,8 +18,9 @@
 import subprocess
 import sys
 import configparser
+
 from . import WrapMode
-from ..mesonlib import MesonException
+from ..mesonlib import ProgressBar, MesonException
 
 try:
     import ssl
@@ -84,7 +85,7 @@
         try:
             self.config = configparser.ConfigParser(interpolation=None)
             self.config.read(fname)
-        except:
+        except configparser.Error:
             raise WrapException('Failed to parse {}'.format(self.basename))
         if len(self.config.sections()) < 1:
             raise WrapException('Missing sections in {}'.format(self.basename))
@@ -111,7 +112,7 @@
         self.subdir_root = subdir_root
         self.cachedir = os.path.join(self.subdir_root, 'packagecache')
 
-    def resolve(self, packagename):
+    def resolve(self, packagename: str, method: str):
         self.packagename = packagename
         self.directory = packagename
         # We always have to load the wrap file, if it exists, because it could
@@ -123,9 +124,15 @@
                 raise WrapException('Directory key must be a name and not a path')
         self.dirname = os.path.join(self.subdir_root, self.directory)
         meson_file = os.path.join(self.dirname, 'meson.build')
+        cmake_file = os.path.join(self.dirname, 'CMakeLists.txt')
+
+        if method not in ['meson', 'cmake']:
+            raise WrapException('Only the methods "meson" and "cmake" are supported')
 
         # The directory is there and has meson.build? Great, use it.
-        if os.path.exists(meson_file):
+        if method == 'meson' and os.path.exists(meson_file):
+            return self.directory
+        if method == 'cmake' and os.path.exists(cmake_file):
             return self.directory
 
         # Check if the subproject is a git submodule
@@ -153,9 +160,11 @@
                 else:
                     raise WrapException('Unknown wrap type {!r}'.format(self.wrap.type))
 
-        # A meson.build file is required in the directory
-        if not os.path.exists(meson_file):
+        # A meson.build or CMakeLists.txt file is required in the directory
+        if method == 'meson' and not os.path.exists(meson_file):
             raise WrapException('Subproject exists but has no meson.build file')
+        if method == 'cmake' and not os.path.exists(cmake_file):
+            raise WrapException('Subproject exists but has no CMakeLists.txt file')
 
         return self.directory
 
@@ -218,22 +227,59 @@
 
     def get_git(self):
         revno = self.wrap.get('revision')
-        if self.wrap.values.get('clone-recursive', '').lower() == 'true':
-            subprocess.check_call(['git', 'clone', '--recursive', self.wrap.get('url'),
-                                   self.directory], cwd=self.subdir_root)
+        is_shallow = False
+        depth_option = []    # type: typing.List[str]
+        if self.wrap.values.get('depth', '') != '':
+            is_shallow = True
+            depth_option = ['--depth', self.wrap.values.get('depth')]
+        # for some reason git only allows commit ids to be shallowly fetched by fetch not with clone
+        if is_shallow and self.is_git_full_commit_id(revno):
+            # git doesn't support directly cloning shallowly for commits,
+            # so we follow https://stackoverflow.com/a/43136160
+            subprocess.check_call(['git', 'init', self.directory], cwd=self.subdir_root)
+            subprocess.check_call(['git', 'remote', 'add', 'origin', self.wrap.get('url')],
+                                  cwd=self.dirname)
+            revno = self.wrap.get('revision')
+            subprocess.check_call(['git', 'fetch', *depth_option, 'origin', revno],
+                                  cwd=self.dirname)
+            subprocess.check_call(['git', 'checkout', revno], cwd=self.dirname)
+            if self.wrap.values.get('clone-recursive', '').lower() == 'true':
+                subprocess.check_call(['git', 'submodule', 'update',
+                                       '--init', '--checkout', '--recursive', *depth_option],
+                                      cwd=self.dirname)
+            push_url = self.wrap.values.get('push-url')
+            if push_url:
+                subprocess.check_call(['git', 'remote', 'set-url',
+                                       '--push', 'origin', push_url],
+                                      cwd=self.dirname)
         else:
-            subprocess.check_call(['git', 'clone', self.wrap.get('url'),
-                                   self.directory], cwd=self.subdir_root)
-        if revno.lower() != 'head':
-            if subprocess.call(['git', 'checkout', revno], cwd=self.dirname) != 0:
-                subprocess.check_call(['git', 'fetch', self.wrap.get('url'), revno], cwd=self.dirname)
-                subprocess.check_call(['git', 'checkout', revno],
+            if not is_shallow:
+                subprocess.check_call(['git', 'clone', self.wrap.get('url'),
+                                       self.directory], cwd=self.subdir_root)
+                if revno.lower() != 'head':
+                    if subprocess.call(['git', 'checkout', revno], cwd=self.dirname) != 0:
+                        subprocess.check_call(['git', 'fetch', self.wrap.get('url'), revno], cwd=self.dirname)
+                        subprocess.check_call(['git', 'checkout', revno], cwd=self.dirname)
+            else:
+                subprocess.check_call(['git', 'clone', *depth_option,
+                                       '--branch', revno,
+                                       self.wrap.get('url'),
+                                       self.directory], cwd=self.subdir_root)
+            if self.wrap.values.get('clone-recursive', '').lower() == 'true':
+                subprocess.check_call(['git', 'submodule', 'update',
+                                       '--init', '--checkout', '--recursive', *depth_option],
                                       cwd=self.dirname)
-        push_url = self.wrap.values.get('push-url')
-        if push_url:
-            subprocess.check_call(['git', 'remote', 'set-url',
-                                   '--push', 'origin', push_url],
-                                  cwd=self.dirname)
+            push_url = self.wrap.values.get('push-url')
+            if push_url:
+                subprocess.check_call(['git', 'remote', 'set-url',
+                                       '--push', 'origin', push_url],
+                                      cwd=self.dirname)
+
+    def is_git_full_commit_id(self, revno):
+        result = False
+        if len(revno) in (40, 64): # 40 for sha1, 64 for upcoming sha256
+            result = all((ch in '0123456789AaBbCcDdEeFf' for ch in revno))
+        return result
 
     def get_hg(self):
         revno = self.wrap.get('revision')
@@ -271,24 +317,17 @@
                     tmpfile.write(block)
                 hashvalue = h.hexdigest()
                 return hashvalue, tmpfile.name
-            print('Download size:', dlsize)
-            print('Downloading: ', end='')
             sys.stdout.flush()
-            printed_dots = 0
-            downloaded = 0
+            progress_bar = ProgressBar(bar_type='download', total=dlsize,
+                                       desc='Downloading')
             while True:
                 block = resp.read(blocksize)
                 if block == b'':
                     break
-                downloaded += len(block)
                 h.update(block)
                 tmpfile.write(block)
-                ratio = int(downloaded / dlsize * 10)
-                while printed_dots < ratio:
-                    print('.', end='')
-                    sys.stdout.flush()
-                    printed_dots += 1
-            print('')
+                progress_bar.update(len(block))
+            progress_bar.close()
             hashvalue = h.hexdigest()
         return hashvalue, tmpfile.name
 
@@ -339,7 +378,7 @@
         """
         Copy directory tree. Overwrites also read only files.
         """
-        for src_dir, dirs, files in os.walk(root_src_dir):
+        for src_dir, _, files in os.walk(root_src_dir):
             dst_dir = src_dir.replace(root_src_dir, root_dst_dir, 1)
             if not os.path.exists(dst_dir):
                 os.makedirs(dst_dir)
@@ -349,7 +388,7 @@
                 if os.path.exists(dst_file):
                     try:
                         os.remove(dst_file)
-                    except PermissionError as exc:
+                    except PermissionError:
                         os.chmod(dst_file, stat.S_IWUSR)
                         os.remove(dst_file)
                 shutil.copy2(src_file, dst_dir)
diff -Nru meson-0.49.0/mesonbuild/wrap/wraptool.py meson-0.52.1/mesonbuild/wrap/wraptool.py
--- meson-0.49.0/mesonbuild/wrap/wraptool.py	2018-12-09 14:27:23.000000000 +0000
+++ meson-0.52.1/mesonbuild/wrap/wraptool.py	2019-11-28 17:37:44.000000000 +0000
@@ -177,7 +177,7 @@
 
     # check if the argument is a full path to a subproject directory or wrap file
     system_native_path_argument = argument.replace('/', os.sep)
-    for _, matches in sprojs.items():
+    for matches in sprojs.values():
         if system_native_path_argument in matches:
             do_promotion(system_native_path_argument, spdir_name)
             return
diff -Nru meson-0.49.0/meson.egg-info/PKG-INFO meson-0.52.1/meson.egg-info/PKG-INFO
--- meson-0.49.0/meson.egg-info/PKG-INFO	2018-12-09 20:02:22.000000000 +0000
+++ meson-0.52.1/meson.egg-info/PKG-INFO	2019-11-29 13:50:59.000000000 +0000
@@ -1,15 +1,13 @@
-Metadata-Version: 1.2
+Metadata-Version: 2.1
 Name: meson
-Version: 0.49.0
+Version: 0.52.1
 Summary: A high performance build system
-Home-page: http://mesonbuild.com
+Home-page: https://mesonbuild.com
 Author: Jussi Pakkanen
 Author-email: jpakkane@gmail.com
-License:  Apache License, Version 2.0
-Description: Meson is a cross-platform build system designed to be both as
-            fast and as user friendly as possible. It supports many languages and compilers, including
-            GCC, Clang and Visual Studio. Its build definitions are written in a simple non-turing
-            complete DSL.
+License: Apache License, Version 2.0
+Description: Meson is a cross-platform build system designed to be both as fast and as user friendly as possible. It supports many languages and compilers, including GCC, Clang, PGI, Intel, and Visual Studio. Its build definitions are written in a simple non-Turing complete DSL.
+Keywords: meson,mesonbuild,build system,cmake
 Platform: UNKNOWN
 Classifier: Development Status :: 5 - Production/Stable
 Classifier: Environment :: Console
@@ -21,5 +19,10 @@
 Classifier: Operating System :: POSIX :: BSD
 Classifier: Operating System :: POSIX :: Linux
 Classifier: Programming Language :: Python :: 3 :: Only
+Classifier: Programming Language :: Python :: 3.5
+Classifier: Programming Language :: Python :: 3.6
+Classifier: Programming Language :: Python :: 3.7
+Classifier: Programming Language :: Python :: 3.8
 Classifier: Topic :: Software Development :: Build Tools
-Requires-Python: >=3.5
+Requires-Python: >=3.5.2
+Provides-Extra: progress
diff -Nru meson-0.49.0/meson.egg-info/requires.txt meson-0.52.1/meson.egg-info/requires.txt
--- meson-0.49.0/meson.egg-info/requires.txt	1970-01-01 00:00:00.000000000 +0000
+++ meson-0.52.1/meson.egg-info/requires.txt	2019-11-29 13:50:59.000000000 +0000
@@ -0,0 +1,3 @@
+
+[progress]
+tqdm
diff -Nru meson-0.49.0/meson.egg-info/SOURCES.txt meson-0.52.1/meson.egg-info/SOURCES.txt
--- meson-0.49.0/meson.egg-info/SOURCES.txt	2018-12-09 20:02:23.000000000 +0000
+++ meson-0.52.1/meson.egg-info/SOURCES.txt	2019-11-29 13:51:00.000000000 +0000
@@ -12,16 +12,20 @@
 setup.cfg
 setup.py
 cross/armcc.txt
+cross/armclang-linux.txt
 cross/armclang.txt
 cross/ccrx.txt
 cross/iphone.txt
 cross/linux-mingw-w64-32bit.txt
 cross/linux-mingw-w64-64bit.txt
 cross/ownstdlib.txt
+cross/tvos.txt
 cross/ubuntu-armhf.txt
 cross/ubuntu-faketarget.txt
+cross/wasm.txt
 data/com.mesonbuild.install.policy
 data/macros.meson
+data/shell-completions/bash/meson
 data/shell-completions/zsh/_meson
 data/syntax-highlighting/emacs/meson.el
 data/syntax-highlighting/vim/README
@@ -83,16 +87,19 @@
 meson.egg-info/SOURCES.txt
 meson.egg-info/dependency_links.txt
 meson.egg-info/entry_points.txt
+meson.egg-info/requires.txt
 meson.egg-info/top_level.txt
 mesonbuild/__init__.py
-mesonbuild/astinterpreter.py
 mesonbuild/build.py
 mesonbuild/coredata.py
+mesonbuild/depfile.py
+mesonbuild/envconfig.py
 mesonbuild/environment.py
 mesonbuild/interpreter.py
 mesonbuild/interpreterbase.py
 mesonbuild/linkers.py
 mesonbuild/mconf.py
+mesonbuild/mdist.py
 mesonbuild/mesonlib.py
 mesonbuild/mesonmain.py
 mesonbuild/minit.py
@@ -103,21 +110,38 @@
 mesonbuild/msetup.py
 mesonbuild/msubprojects.py
 mesonbuild/mtest.py
+mesonbuild/munstable_coredata.py
 mesonbuild/optinterpreter.py
 mesonbuild/rewriter.py
+mesonbuild/ast/__init__.py
+mesonbuild/ast/interpreter.py
+mesonbuild/ast/introspection.py
+mesonbuild/ast/postprocess.py
+mesonbuild/ast/printer.py
+mesonbuild/ast/visitor.py
 mesonbuild/backend/__init__.py
 mesonbuild/backend/backends.py
 mesonbuild/backend/ninjabackend.py
 mesonbuild/backend/vs2010backend.py
 mesonbuild/backend/vs2015backend.py
 mesonbuild/backend/vs2017backend.py
+mesonbuild/backend/vs2019backend.py
 mesonbuild/backend/xcodebackend.py
+mesonbuild/cmake/__init__.py
+mesonbuild/cmake/client.py
+mesonbuild/cmake/common.py
+mesonbuild/cmake/executor.py
+mesonbuild/cmake/generator.py
+mesonbuild/cmake/interpreter.py
+mesonbuild/cmake/traceparser.py
+mesonbuild/cmake/data/run_ctgt.py
 mesonbuild/compilers/__init__.py
 mesonbuild/compilers/c.py
 mesonbuild/compilers/c_function_attributes.py
 mesonbuild/compilers/compilers.py
 mesonbuild/compilers/cpp.py
 mesonbuild/compilers/cs.py
+mesonbuild/compilers/cuda.py
 mesonbuild/compilers/d.py
 mesonbuild/compilers/fortran.py
 mesonbuild/compilers/java.py
@@ -126,6 +150,17 @@
 mesonbuild/compilers/rust.py
 mesonbuild/compilers/swift.py
 mesonbuild/compilers/vala.py
+mesonbuild/compilers/mixins/__init__.py
+mesonbuild/compilers/mixins/arm.py
+mesonbuild/compilers/mixins/ccrx.py
+mesonbuild/compilers/mixins/clang.py
+mesonbuild/compilers/mixins/clike.py
+mesonbuild/compilers/mixins/elbrus.py
+mesonbuild/compilers/mixins/gnu.py
+mesonbuild/compilers/mixins/intel.py
+mesonbuild/compilers/mixins/islinker.py
+mesonbuild/compilers/mixins/pgi.py
+mesonbuild/compilers/mixins/visualstudio.py
 mesonbuild/dependencies/__init__.py
 mesonbuild/dependencies/base.py
 mesonbuild/dependencies/boost.py
@@ -134,7 +169,10 @@
 mesonbuild/dependencies/platform.py
 mesonbuild/dependencies/ui.py
 mesonbuild/dependencies/data/CMakeLists.txt
+mesonbuild/dependencies/data/CMakeListsLLVM.txt
+mesonbuild/dependencies/data/CMakePathInfo.txt
 mesonbuild/modules/__init__.py
+mesonbuild/modules/cmake.py
 mesonbuild/modules/dlang.py
 mesonbuild/modules/gnome.py
 mesonbuild/modules/hotdoc.py
@@ -147,17 +185,21 @@
 mesonbuild/modules/qt4.py
 mesonbuild/modules/qt5.py
 mesonbuild/modules/rpm.py
+mesonbuild/modules/sourceset.py
+mesonbuild/modules/unstable_cuda.py
 mesonbuild/modules/unstable_icestorm.py
+mesonbuild/modules/unstable_kconfig.py
 mesonbuild/modules/unstable_simd.py
 mesonbuild/modules/windows.py
 mesonbuild/scripts/__init__.py
+mesonbuild/scripts/clangformat.py
+mesonbuild/scripts/clangtidy.py
 mesonbuild/scripts/cleantrees.py
 mesonbuild/scripts/commandrunner.py
 mesonbuild/scripts/coverage.py
 mesonbuild/scripts/delwithsuffix.py
 mesonbuild/scripts/depfixer.py
 mesonbuild/scripts/dirchanger.py
-mesonbuild/scripts/dist.py
 mesonbuild/scripts/gettext.py
 mesonbuild/scripts/gtkdochelper.py
 mesonbuild/scripts/hotdochelper.py
@@ -172,6 +214,74 @@
 mesonbuild/wrap/__init__.py
 mesonbuild/wrap/wrap.py
 mesonbuild/wrap/wraptool.py
+test cases/cmake/1 basic/main.cpp
+test cases/cmake/1 basic/meson.build
+test cases/cmake/1 basic/subprojects/cmMod/CMakeLists.txt
+test cases/cmake/1 basic/subprojects/cmMod/cmMod.cpp
+test cases/cmake/1 basic/subprojects/cmMod/cmMod.hpp
+test cases/cmake/10 header only/main.cpp
+test cases/cmake/10 header only/meson.build
+test cases/cmake/10 header only/subprojects/cmMod/CMakeLists.txt
+test cases/cmake/10 header only/subprojects/cmMod/include/cmMod.hpp
+test cases/cmake/11 cmake_module_path/meson.build
+test cases/cmake/11 cmake_module_path/cmake/FindSomethingLikePython.cmake
+test cases/cmake/12 generator expressions/main.cpp
+test cases/cmake/12 generator expressions/meson.build
+test cases/cmake/12 generator expressions/subprojects/cmMod/CMakeLists.txt
+test cases/cmake/12 generator expressions/subprojects/cmMod/include/cmMod.hpp
+test cases/cmake/13 system includes/main.cpp
+test cases/cmake/13 system includes/meson.build
+test cases/cmake/13 system includes/subprojects/cmMod/CMakeLists.txt
+test cases/cmake/13 system includes/subprojects/cmMod/cmMod.cpp
+test cases/cmake/13 system includes/subprojects/cmMod/cmMod.hpp
+test cases/cmake/13 system includes/subprojects/cmMod/sysInc/triggerWarn.hpp
+test cases/cmake/2 advanced/installed_files.txt
+test cases/cmake/2 advanced/main.cpp
+test cases/cmake/2 advanced/meson.build
+test cases/cmake/2 advanced/subprojects/cmMod/CMakeLists.txt
+test cases/cmake/2 advanced/subprojects/cmMod/config.h.in
+test cases/cmake/2 advanced/subprojects/cmMod/main.cpp
+test cases/cmake/2 advanced/subprojects/cmMod/lib/cmMod.cpp
+test cases/cmake/2 advanced/subprojects/cmMod/lib/cmMod.hpp
+test cases/cmake/3 advanced no dep/installed_files.txt
+test cases/cmake/3 advanced no dep/main.cpp
+test cases/cmake/3 advanced no dep/meson.build
+test cases/cmake/3 advanced no dep/subprojects/cmMod/CMakeLists.txt
+test cases/cmake/3 advanced no dep/subprojects/cmMod/config.h.in
+test cases/cmake/3 advanced no dep/subprojects/cmMod/main.cpp
+test cases/cmake/3 advanced no dep/subprojects/cmMod/lib/cmMod.cpp
+test cases/cmake/3 advanced no dep/subprojects/cmMod/lib/cmMod.hpp
+test cases/cmake/4 code gen/main.cpp
+test cases/cmake/4 code gen/meson.build
+test cases/cmake/4 code gen/test.hpp
+test cases/cmake/4 code gen/subprojects/cmCodeGen/CMakeLists.txt
+test cases/cmake/4 code gen/subprojects/cmCodeGen/main.cpp
+test cases/cmake/5 object library/main.cpp
+test cases/cmake/5 object library/meson.build
+test cases/cmake/5 object library/subprojects/cmObjLib/CMakeLists.txt
+test cases/cmake/5 object library/subprojects/cmObjLib/libA.cpp
+test cases/cmake/5 object library/subprojects/cmObjLib/libA.hpp
+test cases/cmake/5 object library/subprojects/cmObjLib/libB.cpp
+test cases/cmake/5 object library/subprojects/cmObjLib/libB.hpp
+test cases/cmake/6 object library no dep/main.cpp
+test cases/cmake/6 object library no dep/meson.build
+test cases/cmake/6 object library no dep/subprojects/cmObjLib/CMakeLists.txt
+test cases/cmake/6 object library no dep/subprojects/cmObjLib/libA.cpp
+test cases/cmake/6 object library no dep/subprojects/cmObjLib/libA.hpp
+test cases/cmake/6 object library no dep/subprojects/cmObjLib/libB.cpp
+test cases/cmake/6 object library no dep/subprojects/cmObjLib/libB.hpp
+test cases/cmake/7 cmake options/meson.build
+test cases/cmake/7 cmake options/subprojects/cmOpts/CMakeLists.txt
+test cases/cmake/8 custom command/main.cpp
+test cases/cmake/8 custom command/meson.build
+test cases/cmake/8 custom command/subprojects/cmMod/CMakeLists.txt
+test cases/cmake/8 custom command/subprojects/cmMod/cmMod.cpp
+test cases/cmake/8 custom command/subprojects/cmMod/cmMod.hpp
+test cases/cmake/8 custom command/subprojects/cmMod/cp.cpp
+test cases/cmake/8 custom command/subprojects/cmMod/cpyBase.cpp.am
+test cases/cmake/8 custom command/subprojects/cmMod/cpyBase.hpp.am
+test cases/cmake/8 custom command/subprojects/cmMod/main.cpp
+test cases/cmake/9 disabled subproject/meson.build
 test cases/common/1 trivial/meson.build
 test cases/common/1 trivial/trivial.c
 test cases/common/10 man install/bar.2
@@ -182,74 +292,74 @@
 test cases/common/10 man install/vanishing/meson.build
 test cases/common/10 man install/vanishing/vanishing.1
 test cases/common/10 man install/vanishing/vanishing.2
-test cases/common/100 manygen/depuser.c
-test cases/common/100 manygen/meson.build
-test cases/common/100 manygen/subdir/funcinfo.def
-test cases/common/100 manygen/subdir/manygen.py
-test cases/common/100 manygen/subdir/meson.build
-test cases/common/101 stringdef/meson.build
-test cases/common/101 stringdef/stringdef.c
-test cases/common/102 find program path/meson.build
-test cases/common/102 find program path/program.py
-test cases/common/103 subproject subdir/meson.build
-test cases/common/103 subproject subdir/prog.c
-test cases/common/103 subproject subdir/subprojects/sub/meson.build
-test cases/common/103 subproject subdir/subprojects/sub/lib/meson.build
-test cases/common/103 subproject subdir/subprojects/sub/lib/sub.c
-test cases/common/103 subproject subdir/subprojects/sub/lib/sub.h
-test cases/common/104 postconf/meson.build
-test cases/common/104 postconf/postconf.py
-test cases/common/104 postconf/prog.c
-test cases/common/104 postconf/raw.dat
-test cases/common/105 postconf with args/meson.build
-test cases/common/105 postconf with args/postconf.py
-test cases/common/105 postconf with args/prog.c
-test cases/common/105 postconf with args/raw.dat
-test cases/common/106 testframework options/meson.build
-test cases/common/106 testframework options/meson_options.txt
-test cases/common/106 testframework options/test_args.txt
-test cases/common/107 extract same name/lib.c
-test cases/common/107 extract same name/main.c
-test cases/common/107 extract same name/meson.build
-test cases/common/107 extract same name/src/lib.c
-test cases/common/108 has header symbol/meson.build
-test cases/common/109 has arg/meson.build
+test cases/common/100 stringdef/meson.build
+test cases/common/100 stringdef/stringdef.c
+test cases/common/101 find program path/meson.build
+test cases/common/101 find program path/program.py
+test cases/common/102 subproject subdir/meson.build
+test cases/common/102 subproject subdir/prog.c
+test cases/common/102 subproject subdir/subprojects/sub/meson.build
+test cases/common/102 subproject subdir/subprojects/sub/lib/meson.build
+test cases/common/102 subproject subdir/subprojects/sub/lib/sub.c
+test cases/common/102 subproject subdir/subprojects/sub/lib/sub.h
+test cases/common/103 postconf/meson.build
+test cases/common/103 postconf/postconf.py
+test cases/common/103 postconf/prog.c
+test cases/common/103 postconf/raw.dat
+test cases/common/104 postconf with args/meson.build
+test cases/common/104 postconf with args/postconf.py
+test cases/common/104 postconf with args/prog.c
+test cases/common/104 postconf with args/raw.dat
+test cases/common/105 testframework options/meson.build
+test cases/common/105 testframework options/meson_options.txt
+test cases/common/105 testframework options/test_args.txt
+test cases/common/106 extract same name/lib.c
+test cases/common/106 extract same name/main.c
+test cases/common/106 extract same name/meson.build
+test cases/common/106 extract same name/src/lib.c
+test cases/common/107 has header symbol/meson.build
+test cases/common/108 has arg/meson.build
+test cases/common/109 generatorcustom/catter.py
+test cases/common/109 generatorcustom/gen.py
+test cases/common/109 generatorcustom/main.c
+test cases/common/109 generatorcustom/meson.build
+test cases/common/109 generatorcustom/res1.txt
+test cases/common/109 generatorcustom/res2.txt
 test cases/common/11 subdir/meson.build
 test cases/common/11 subdir/subdir/meson.build
 test cases/common/11 subdir/subdir/prog.c
-test cases/common/110 generatorcustom/catter.py
-test cases/common/110 generatorcustom/gen.py
-test cases/common/110 generatorcustom/main.c
-test cases/common/110 generatorcustom/meson.build
-test cases/common/110 generatorcustom/res1.txt
-test cases/common/110 generatorcustom/res2.txt
-test cases/common/111 multiple dir configure file/meson.build
-test cases/common/111 multiple dir configure file/subdir/foo.txt
-test cases/common/111 multiple dir configure file/subdir/meson.build
-test cases/common/111 multiple dir configure file/subdir/someinput.in
-test cases/common/112 spaces backslash/comparer-end-notstring.c
-test cases/common/112 spaces backslash/comparer-end.c
-test cases/common/112 spaces backslash/comparer.c
-test cases/common/112 spaces backslash/meson.build
-test cases/common/112 spaces backslash/asm output/meson.build
-test cases/common/112 spaces backslash/include/comparer.h
-test cases/common/113 ternary/meson.build
-test cases/common/114 custom target capture/data_source.txt
-test cases/common/114 custom target capture/installed_files.txt
-test cases/common/114 custom target capture/meson.build
-test cases/common/114 custom target capture/my_compiler.py
-test cases/common/115 allgenerate/converter.py
-test cases/common/115 allgenerate/foobar.cpp.in
-test cases/common/115 allgenerate/meson.build
-test cases/common/116 pathjoin/meson.build
-test cases/common/117 subdir subproject/meson.build
-test cases/common/117 subdir subproject/prog/meson.build
-test cases/common/117 subdir subproject/prog/prog.c
-test cases/common/117 subdir subproject/subprojects/sub/meson.build
-test cases/common/117 subdir subproject/subprojects/sub/sub.c
-test cases/common/117 subdir subproject/subprojects/sub/sub.h
-test cases/common/118 interpreter copy mutable var on assignment/meson.build
-test cases/common/119 skip/meson.build
+test cases/common/110 multiple dir configure file/meson.build
+test cases/common/110 multiple dir configure file/subdir/foo.txt
+test cases/common/110 multiple dir configure file/subdir/meson.build
+test cases/common/110 multiple dir configure file/subdir/someinput.in
+test cases/common/111 spaces backslash/comparer-end-notstring.c
+test cases/common/111 spaces backslash/comparer-end.c
+test cases/common/111 spaces backslash/comparer.c
+test cases/common/111 spaces backslash/meson.build
+test cases/common/111 spaces backslash/asm output/meson.build
+test cases/common/111 spaces backslash/include/comparer.h
+test cases/common/112 ternary/meson.build
+test cases/common/113 custom target capture/data_source.txt
+test cases/common/113 custom target capture/installed_files.txt
+test cases/common/113 custom target capture/meson.build
+test cases/common/113 custom target capture/my_compiler.py
+test cases/common/114 allgenerate/converter.py
+test cases/common/114 allgenerate/foobar.cpp.in
+test cases/common/114 allgenerate/meson.build
+test cases/common/115 pathjoin/meson.build
+test cases/common/116 subdir subproject/meson.build
+test cases/common/116 subdir subproject/prog/meson.build
+test cases/common/116 subdir subproject/prog/prog.c
+test cases/common/116 subdir subproject/subprojects/sub/meson.build
+test cases/common/116 subdir subproject/subprojects/sub/sub.c
+test cases/common/116 subdir subproject/subprojects/sub/sub.h
+test cases/common/117 interpreter copy mutable var on assignment/meson.build
+test cases/common/118 skip/meson.build
+test cases/common/119 subproject project arguments/exe.c
+test cases/common/119 subproject project arguments/exe.cpp
+test cases/common/119 subproject project arguments/meson.build
+test cases/common/119 subproject project arguments/subprojects/subexe/meson.build
+test cases/common/119 subproject project arguments/subprojects/subexe/subexe.c
 test cases/common/12 data/datafile.dat
 test cases/common/12 data/etcfile.dat
 test cases/common/12 data/fileobject_datafile.dat
@@ -264,140 +374,152 @@
 test cases/common/12 data/vanishing/to_be_renamed_2.txt
 test cases/common/12 data/vanishing/vanishing.dat
 test cases/common/12 data/vanishing/vanishing2.dat
-test cases/common/120 subproject project arguments/exe.c
-test cases/common/120 subproject project arguments/exe.cpp
-test cases/common/120 subproject project arguments/meson.build
-test cases/common/120 subproject project arguments/subprojects/subexe/meson.build
-test cases/common/120 subproject project arguments/subprojects/subexe/subexe.c
-test cases/common/121 test skip/meson.build
-test cases/common/121 test skip/test_skip.c
-test cases/common/122 shared module/installed_files.txt
-test cases/common/122 shared module/meson.build
-test cases/common/122 shared module/module.c
-test cases/common/122 shared module/nosyms.c
-test cases/common/122 shared module/prog.c
-test cases/common/122 shared module/runtime.c
-test cases/common/123 llvm ir and assembly/main.c
-test cases/common/123 llvm ir and assembly/main.cpp
-test cases/common/123 llvm ir and assembly/meson.build
-test cases/common/123 llvm ir and assembly/square-arm.S
-test cases/common/123 llvm ir and assembly/square-x86.S
-test cases/common/123 llvm ir and assembly/square-x86_64.S
-test cases/common/123 llvm ir and assembly/square.ll
-test cases/common/123 llvm ir and assembly/symbol-underscore.h
-test cases/common/124 cpp and asm/meson.build
-test cases/common/124 cpp and asm/retval-arm.S
-test cases/common/124 cpp and asm/retval-x86.S
-test cases/common/124 cpp and asm/retval-x86_64.S
-test cases/common/124 cpp and asm/symbol-underscore.h
-test cases/common/124 cpp and asm/trivial.cc
-test cases/common/125 extract all shared library/extractor.h
-test cases/common/125 extract all shared library/four.c
-test cases/common/125 extract all shared library/func1234.def
-test cases/common/125 extract all shared library/meson.build
-test cases/common/125 extract all shared library/one.c
-test cases/common/125 extract all shared library/prog.c
-test cases/common/125 extract all shared library/three.c
-test cases/common/125 extract all shared library/two.c
-test cases/common/126 object only target/installed_files.txt
-test cases/common/126 object only target/meson.build
-test cases/common/126 object only target/obj_generator.py
-test cases/common/126 object only target/prog.c
-test cases/common/126 object only target/source.c
-test cases/common/126 object only target/source2.c
-test cases/common/126 object only target/source2.def
-test cases/common/126 object only target/source3.c
-test cases/common/127 no buildincdir/meson.build
-test cases/common/127 no buildincdir/prog.c
-test cases/common/127 no buildincdir/include/header.h
-test cases/common/128 custom target directory install/docgen.py
-test cases/common/128 custom target directory install/installed_files.txt
-test cases/common/128 custom target directory install/meson.build
-test cases/common/129 dependency file generation/main .c
-test cases/common/129 dependency file generation/meson.build
+test cases/common/120 test skip/meson.build
+test cases/common/120 test skip/test_skip.c
+test cases/common/121 shared module/installed_files.txt
+test cases/common/121 shared module/meson.build
+test cases/common/121 shared module/module.c
+test cases/common/121 shared module/nosyms.c
+test cases/common/121 shared module/prog.c
+test cases/common/121 shared module/runtime.c
+test cases/common/122 llvm ir and assembly/main.c
+test cases/common/122 llvm ir and assembly/main.cpp
+test cases/common/122 llvm ir and assembly/meson.build
+test cases/common/122 llvm ir and assembly/square-arm.S
+test cases/common/122 llvm ir and assembly/square-x86.S
+test cases/common/122 llvm ir and assembly/square-x86_64.S
+test cases/common/122 llvm ir and assembly/square.ll
+test cases/common/122 llvm ir and assembly/symbol-underscore.h
+test cases/common/123 cpp and asm/meson.build
+test cases/common/123 cpp and asm/retval-arm.S
+test cases/common/123 cpp and asm/retval-x86.S
+test cases/common/123 cpp and asm/retval-x86_64.S
+test cases/common/123 cpp and asm/symbol-underscore.h
+test cases/common/123 cpp and asm/trivial.cc
+test cases/common/124 extract all shared library/extractor.h
+test cases/common/124 extract all shared library/four.c
+test cases/common/124 extract all shared library/func1234.def
+test cases/common/124 extract all shared library/meson.build
+test cases/common/124 extract all shared library/one.c
+test cases/common/124 extract all shared library/prog.c
+test cases/common/124 extract all shared library/three.c
+test cases/common/124 extract all shared library/two.c
+test cases/common/125 object only target/installed_files.txt
+test cases/common/125 object only target/meson.build
+test cases/common/125 object only target/obj_generator.py
+test cases/common/125 object only target/prog.c
+test cases/common/125 object only target/source.c
+test cases/common/125 object only target/source2.c
+test cases/common/125 object only target/source2.def
+test cases/common/125 object only target/source3.c
+test cases/common/126 no buildincdir/meson.build
+test cases/common/126 no buildincdir/prog.c
+test cases/common/126 no buildincdir/include/header.h
+test cases/common/127 custom target directory install/docgen.py
+test cases/common/127 custom target directory install/installed_files.txt
+test cases/common/127 custom target directory install/meson.build
+test cases/common/128 dependency file generation/main .c
+test cases/common/128 dependency file generation/meson.build
+test cases/common/129 configure file in generator/meson.build
+test cases/common/129 configure file in generator/inc/confdata.in
+test cases/common/129 configure file in generator/inc/meson.build
+test cases/common/129 configure file in generator/src/gen.py
+test cases/common/129 configure file in generator/src/main.c
+test cases/common/129 configure file in generator/src/meson.build
+test cases/common/129 configure file in generator/src/source
 test cases/common/13 pch/meson.build
 test cases/common/13 pch/c/meson.build
 test cases/common/13 pch/c/prog.c
 test cases/common/13 pch/c/pch/prog.h
-test cases/common/13 pch/c/pch/prog_pch.c
 test cases/common/13 pch/cpp/meson.build
 test cases/common/13 pch/cpp/prog.cc
 test cases/common/13 pch/cpp/pch/prog.hh
-test cases/common/13 pch/cpp/pch/prog_pch.cc
+test cases/common/13 pch/generated/gen_custom.py
+test cases/common/13 pch/generated/gen_generator.py
+test cases/common/13 pch/generated/generated_generator.in
+test cases/common/13 pch/generated/meson.build
+test cases/common/13 pch/generated/prog.c
+test cases/common/13 pch/generated/pch/prog.h
 test cases/common/13 pch/mixed/func.c
 test cases/common/13 pch/mixed/main.cc
 test cases/common/13 pch/mixed/meson.build
 test cases/common/13 pch/mixed/pch/func.h
-test cases/common/13 pch/mixed/pch/func_pch.c
 test cases/common/13 pch/mixed/pch/main.h
-test cases/common/13 pch/mixed/pch/main_pch.cc
-test cases/common/130 configure file in generator/meson.build
-test cases/common/130 configure file in generator/inc/confdata.in
-test cases/common/130 configure file in generator/inc/meson.build
-test cases/common/130 configure file in generator/src/gen.py
-test cases/common/130 configure file in generator/src/main.c
-test cases/common/130 configure file in generator/src/meson.build
-test cases/common/130 configure file in generator/src/source
-test cases/common/131 generated llvm ir/copyfile.py
-test cases/common/131 generated llvm ir/main.c
-test cases/common/131 generated llvm ir/meson.build
-test cases/common/131 generated llvm ir/square.ll.in
-test cases/common/132 generated assembly/copyfile.py
-test cases/common/132 generated assembly/main.c
-test cases/common/132 generated assembly/meson.build
-test cases/common/132 generated assembly/square-arm.S.in
-test cases/common/132 generated assembly/square-x86.S.in
-test cases/common/132 generated assembly/square-x86_64.S.in
-test cases/common/132 generated assembly/symbol-underscore.h
-test cases/common/133 build by default targets in tests/main.c
-test cases/common/133 build by default targets in tests/meson.build
-test cases/common/133 build by default targets in tests/write_file.py
-test cases/common/134 build by default/checkexists.py
-test cases/common/134 build by default/foo.c
-test cases/common/134 build by default/meson.build
-test cases/common/134 build by default/mygen.py
-test cases/common/134 build by default/source.txt
-test cases/common/135 include order/meson.build
-test cases/common/135 include order/ordertest.c
-test cases/common/135 include order/ctsub/copyfile.py
-test cases/common/135 include order/ctsub/emptyfile.c
-test cases/common/135 include order/ctsub/main.h
-test cases/common/135 include order/ctsub/meson.build
-test cases/common/135 include order/inc1/hdr.h
-test cases/common/135 include order/inc2/hdr.h
-test cases/common/135 include order/sub1/main.h
-test cases/common/135 include order/sub1/meson.build
-test cases/common/135 include order/sub1/some.c
-test cases/common/135 include order/sub1/some.h
-test cases/common/135 include order/sub2/main.h
-test cases/common/135 include order/sub2/meson.build
-test cases/common/135 include order/sub3/main.h
-test cases/common/135 include order/sub3/meson.build
-test cases/common/135 include order/sub4/main.c
-test cases/common/135 include order/sub4/main.h
-test cases/common/135 include order/sub4/meson.build
-test cases/common/136 override options/four.c
-test cases/common/136 override options/meson.build
-test cases/common/136 override options/one.c
-test cases/common/136 override options/three.c
-test cases/common/136 override options/two.c
-test cases/common/137 get define/concat.h
-test cases/common/137 get define/meson.build
-test cases/common/137 get define/meson_options.txt
-test cases/common/138 c cpp and asm/main.c
-test cases/common/138 c cpp and asm/main.cpp
-test cases/common/138 c cpp and asm/meson.build
-test cases/common/138 c cpp and asm/retval-arm.S
-test cases/common/138 c cpp and asm/retval-x86.S
-test cases/common/138 c cpp and asm/retval-x86_64.S
-test cases/common/138 c cpp and asm/somelib.c
-test cases/common/138 c cpp and asm/symbol-underscore.h
-test cases/common/139 compute int/config.h.in
-test cases/common/139 compute int/foobar.h
-test cases/common/139 compute int/meson.build
-test cases/common/139 compute int/prog.c.in
+test cases/common/13 pch/userDefined/meson.build
+test cases/common/13 pch/userDefined/prog.c
+test cases/common/13 pch/userDefined/pch/pch.c
+test cases/common/13 pch/userDefined/pch/pch.h
+test cases/common/13 pch/withIncludeDirectories/meson.build
+test cases/common/13 pch/withIncludeDirectories/prog.c
+test cases/common/13 pch/withIncludeDirectories/include/lib/lib.h
+test cases/common/13 pch/withIncludeDirectories/pch/prog.h
+test cases/common/130 generated llvm ir/copyfile.py
+test cases/common/130 generated llvm ir/main.c
+test cases/common/130 generated llvm ir/meson.build
+test cases/common/130 generated llvm ir/square.ll.in
+test cases/common/131 generated assembly/copyfile.py
+test cases/common/131 generated assembly/main.c
+test cases/common/131 generated assembly/meson.build
+test cases/common/131 generated assembly/square-arm.S.in
+test cases/common/131 generated assembly/square-x86.S.in
+test cases/common/131 generated assembly/square-x86_64.S.in
+test cases/common/131 generated assembly/symbol-underscore.h
+test cases/common/132 build by default targets in tests/main.c
+test cases/common/132 build by default targets in tests/meson.build
+test cases/common/132 build by default targets in tests/write_file.py
+test cases/common/133 build by default/checkexists.py
+test cases/common/133 build by default/foo.c
+test cases/common/133 build by default/meson.build
+test cases/common/133 build by default/mygen.py
+test cases/common/133 build by default/source.txt
+test cases/common/134 include order/meson.build
+test cases/common/134 include order/ordertest.c
+test cases/common/134 include order/ctsub/copyfile.py
+test cases/common/134 include order/ctsub/emptyfile.c
+test cases/common/134 include order/ctsub/main.h
+test cases/common/134 include order/ctsub/meson.build
+test cases/common/134 include order/inc1/hdr.h
+test cases/common/134 include order/inc2/hdr.h
+test cases/common/134 include order/sub1/main.h
+test cases/common/134 include order/sub1/meson.build
+test cases/common/134 include order/sub1/some.c
+test cases/common/134 include order/sub1/some.h
+test cases/common/134 include order/sub2/main.h
+test cases/common/134 include order/sub2/meson.build
+test cases/common/134 include order/sub3/main.h
+test cases/common/134 include order/sub3/meson.build
+test cases/common/134 include order/sub4/main.c
+test cases/common/134 include order/sub4/main.h
+test cases/common/134 include order/sub4/meson.build
+test cases/common/135 override options/four.c
+test cases/common/135 override options/meson.build
+test cases/common/135 override options/one.c
+test cases/common/135 override options/three.c
+test cases/common/135 override options/two.c
+test cases/common/136 get define/concat.h
+test cases/common/136 get define/meson.build
+test cases/common/136 get define/meson_options.txt
+test cases/common/137 c cpp and asm/main.c
+test cases/common/137 c cpp and asm/main.cpp
+test cases/common/137 c cpp and asm/meson.build
+test cases/common/137 c cpp and asm/retval-arm.S
+test cases/common/137 c cpp and asm/retval-x86.S
+test cases/common/137 c cpp and asm/retval-x86_64.S
+test cases/common/137 c cpp and asm/somelib.c
+test cases/common/137 c cpp and asm/symbol-underscore.h
+test cases/common/138 compute int/config.h.in
+test cases/common/138 compute int/foobar.h
+test cases/common/138 compute int/meson.build
+test cases/common/138 compute int/prog.c.in
+test cases/common/139 custom target object output/meson.build
+test cases/common/139 custom target object output/obj_generator.py
+test cases/common/139 custom target object output/objdir/meson.build
+test cases/common/139 custom target object output/objdir/source.c
+test cases/common/139 custom target object output/progdir/meson.build
+test cases/common/139 custom target object output/progdir/prog.c
 test cases/common/14 configure file/basename.py
 test cases/common/14 configure file/check_file.py
+test cases/common/14 configure file/check_inputs.py
 test cases/common/14 configure file/config.h
 test cases/common/14 configure file/config.h.in
 test cases/common/14 configure file/config4a.h.in
@@ -406,11 +528,13 @@
 test cases/common/14 configure file/config6.h.in
 test cases/common/14 configure file/config7.h.in
 test cases/common/14 configure file/config8.h.in
+test cases/common/14 configure file/depfile
 test cases/common/14 configure file/differentafterbasename1.in
 test cases/common/14 configure file/differentafterbasename2.in
 test cases/common/14 configure file/dummy.dat
 test cases/common/14 configure file/dumpprog.c
 test cases/common/14 configure file/file_contains.py
+test cases/common/14 configure file/generator-deps.py
 test cases/common/14 configure file/generator-without-input-file.py
 test cases/common/14 configure file/generator.py
 test cases/common/14 configure file/installed_files.txt
@@ -430,379 +554,460 @@
 test cases/common/14 configure file/test.py.in
 test cases/common/14 configure file/touch.py
 test cases/common/14 configure file/subdir/meson.build
-test cases/common/140 custom target object output/meson.build
-test cases/common/140 custom target object output/obj_generator.py
-test cases/common/140 custom target object output/objdir/meson.build
-test cases/common/140 custom target object output/objdir/source.c
-test cases/common/140 custom target object output/progdir/meson.build
-test cases/common/140 custom target object output/progdir/prog.c
-test cases/common/141 empty build file/meson.build
-test cases/common/141 empty build file/subdir/meson.build
-test cases/common/142 whole archive/func1.c
-test cases/common/142 whole archive/func2.c
-test cases/common/142 whole archive/meson.build
-test cases/common/142 whole archive/mylib.h
-test cases/common/142 whole archive/prog.c
-test cases/common/142 whole archive/exe/meson.build
-test cases/common/142 whole archive/exe2/meson.build
-test cases/common/142 whole archive/exe3/meson.build
-test cases/common/142 whole archive/exe4/meson.build
-test cases/common/142 whole archive/sh_func2_dep_func1/meson.build
-test cases/common/142 whole archive/sh_func2_linked_func1/meson.build
-test cases/common/142 whole archive/sh_func2_transdep_func1/meson.build
-test cases/common/142 whole archive/sh_only_link_whole/meson.build
-test cases/common/142 whole archive/st_func1/meson.build
-test cases/common/142 whole archive/st_func2/meson.build
-test cases/common/143 C and CPP link/dummy.c
-test cases/common/143 C and CPP link/foo.c
-test cases/common/143 C and CPP link/foo.cpp
-test cases/common/143 C and CPP link/foo.h
-test cases/common/143 C and CPP link/foo.hpp
-test cases/common/143 C and CPP link/foobar.c
-test cases/common/143 C and CPP link/foobar.h
-test cases/common/143 C and CPP link/meson.build
-test cases/common/143 C and CPP link/sub.c
-test cases/common/143 C and CPP link/sub.h
-test cases/common/144 mesonintrospect from scripts/check_env.py
-test cases/common/144 mesonintrospect from scripts/meson.build
-test cases/common/145 custom target multiple outputs/generator.py
-test cases/common/145 custom target multiple outputs/installed_files.txt
-test cases/common/145 custom target multiple outputs/meson.build
-test cases/common/146 special characters/check_quoting.py
-test cases/common/146 special characters/installed_files.txt
-test cases/common/146 special characters/meson.build
-test cases/common/147 nested links/meson.build
-test cases/common/147 nested links/xephyr.c
-test cases/common/148 list of file sources/foo
-test cases/common/148 list of file sources/gen.py
-test cases/common/148 list of file sources/meson.build
-test cases/common/149 link depends custom target/foo.c
-test cases/common/149 link depends custom target/make_file.py
-test cases/common/149 link depends custom target/meson.build
+test cases/common/140 empty build file/meson.build
+test cases/common/140 empty build file/subdir/meson.build
+test cases/common/141 whole archive/func1.c
+test cases/common/141 whole archive/func2.c
+test cases/common/141 whole archive/meson.build
+test cases/common/141 whole archive/mylib.h
+test cases/common/141 whole archive/prog.c
+test cases/common/141 whole archive/exe/meson.build
+test cases/common/141 whole archive/exe2/meson.build
+test cases/common/141 whole archive/exe3/meson.build
+test cases/common/141 whole archive/exe4/meson.build
+test cases/common/141 whole archive/sh_func2_dep_func1/meson.build
+test cases/common/141 whole archive/sh_func2_linked_func1/meson.build
+test cases/common/141 whole archive/sh_func2_transdep_func1/meson.build
+test cases/common/141 whole archive/sh_only_link_whole/meson.build
+test cases/common/141 whole archive/st_func1/meson.build
+test cases/common/141 whole archive/st_func2/meson.build
+test cases/common/142 C and CPP link/dummy.c
+test cases/common/142 C and CPP link/foo.c
+test cases/common/142 C and CPP link/foo.cpp
+test cases/common/142 C and CPP link/foo.h
+test cases/common/142 C and CPP link/foo.hpp
+test cases/common/142 C and CPP link/foobar.c
+test cases/common/142 C and CPP link/foobar.h
+test cases/common/142 C and CPP link/meson.build
+test cases/common/142 C and CPP link/sub.c
+test cases/common/142 C and CPP link/sub.h
+test cases/common/143 mesonintrospect from scripts/check_env.py
+test cases/common/143 mesonintrospect from scripts/check_introspection.py
+test cases/common/143 mesonintrospect from scripts/meson.build
+test cases/common/144 custom target multiple outputs/generator.py
+test cases/common/144 custom target multiple outputs/installed_files.txt
+test cases/common/144 custom target multiple outputs/meson.build
+test cases/common/145 special characters/check_quoting.py
+test cases/common/145 special characters/installed_files.txt
+test cases/common/145 special characters/meson.build
+test cases/common/146 nested links/meson.build
+test cases/common/146 nested links/xephyr.c
+test cases/common/147 list of file sources/foo
+test cases/common/147 list of file sources/gen.py
+test cases/common/147 list of file sources/meson.build
+test cases/common/148 link depends custom target/foo.c
+test cases/common/148 link depends custom target/make_file.py
+test cases/common/148 link depends custom target/meson.build
+test cases/common/149 recursive linking/lib.h
+test cases/common/149 recursive linking/main.c
+test cases/common/149 recursive linking/meson.build
+test cases/common/149 recursive linking/3rdorderdeps/lib.c.in
+test cases/common/149 recursive linking/3rdorderdeps/main.c.in
+test cases/common/149 recursive linking/3rdorderdeps/meson.build
+test cases/common/149 recursive linking/circular/lib1.c
+test cases/common/149 recursive linking/circular/lib2.c
+test cases/common/149 recursive linking/circular/lib3.c
+test cases/common/149 recursive linking/circular/main.c
+test cases/common/149 recursive linking/circular/meson.build
+test cases/common/149 recursive linking/circular/prop1.c
+test cases/common/149 recursive linking/circular/prop2.c
+test cases/common/149 recursive linking/circular/prop3.c
+test cases/common/149 recursive linking/edge-cases/libsto.c
+test cases/common/149 recursive linking/edge-cases/meson.build
+test cases/common/149 recursive linking/edge-cases/shstmain.c
+test cases/common/149 recursive linking/edge-cases/stobuilt.c
+test cases/common/149 recursive linking/edge-cases/stomain.c
+test cases/common/149 recursive linking/shnodep/lib.c
+test cases/common/149 recursive linking/shnodep/meson.build
+test cases/common/149 recursive linking/shshdep/lib.c
+test cases/common/149 recursive linking/shshdep/meson.build
+test cases/common/149 recursive linking/shstdep/lib.c
+test cases/common/149 recursive linking/shstdep/meson.build
+test cases/common/149 recursive linking/stnodep/lib.c
+test cases/common/149 recursive linking/stnodep/meson.build
+test cases/common/149 recursive linking/stshdep/lib.c
+test cases/common/149 recursive linking/stshdep/meson.build
+test cases/common/149 recursive linking/ststdep/lib.c
+test cases/common/149 recursive linking/ststdep/meson.build
 test cases/common/15 if/meson.build
 test cases/common/15 if/prog.c
-test cases/common/150 recursive linking/lib.h
-test cases/common/150 recursive linking/main.c
-test cases/common/150 recursive linking/meson.build
-test cases/common/150 recursive linking/3rdorderdeps/lib.c.in
-test cases/common/150 recursive linking/3rdorderdeps/main.c.in
-test cases/common/150 recursive linking/3rdorderdeps/meson.build
-test cases/common/150 recursive linking/circular/lib1.c
-test cases/common/150 recursive linking/circular/lib2.c
-test cases/common/150 recursive linking/circular/lib3.c
-test cases/common/150 recursive linking/circular/main.c
-test cases/common/150 recursive linking/circular/meson.build
-test cases/common/150 recursive linking/circular/prop1.c
-test cases/common/150 recursive linking/circular/prop2.c
-test cases/common/150 recursive linking/circular/prop3.c
-test cases/common/150 recursive linking/edge-cases/libsto.c
-test cases/common/150 recursive linking/edge-cases/meson.build
-test cases/common/150 recursive linking/edge-cases/shstmain.c
-test cases/common/150 recursive linking/edge-cases/stobuilt.c
-test cases/common/150 recursive linking/edge-cases/stomain.c
-test cases/common/150 recursive linking/shnodep/lib.c
-test cases/common/150 recursive linking/shnodep/meson.build
-test cases/common/150 recursive linking/shshdep/lib.c
-test cases/common/150 recursive linking/shshdep/meson.build
-test cases/common/150 recursive linking/shstdep/lib.c
-test cases/common/150 recursive linking/shstdep/meson.build
-test cases/common/150 recursive linking/stnodep/lib.c
-test cases/common/150 recursive linking/stnodep/meson.build
-test cases/common/150 recursive linking/stshdep/lib.c
-test cases/common/150 recursive linking/stshdep/meson.build
-test cases/common/150 recursive linking/ststdep/lib.c
-test cases/common/150 recursive linking/ststdep/meson.build
-test cases/common/151 library at root/lib.c
-test cases/common/151 library at root/meson.build
-test cases/common/151 library at root/main/main.c
-test cases/common/151 library at root/main/meson.build
-test cases/common/152 simd/fallback.c
-test cases/common/152 simd/meson.build
-test cases/common/152 simd/simd_avx.c
-test cases/common/152 simd/simd_avx2.c
-test cases/common/152 simd/simd_mmx.c
-test cases/common/152 simd/simd_neon.c
-test cases/common/152 simd/simd_sse.c
-test cases/common/152 simd/simd_sse2.c
-test cases/common/152 simd/simd_sse3.c
-test cases/common/152 simd/simd_sse41.c
-test cases/common/152 simd/simd_sse42.c
-test cases/common/152 simd/simd_ssse3.c
-test cases/common/152 simd/simdchecker.c
-test cases/common/152 simd/simdfuncs.h
-test cases/common/152 simd/include/simdheader.h
-test cases/common/153 shared module resolving symbol in executable/meson.build
-test cases/common/153 shared module resolving symbol in executable/module.c
-test cases/common/153 shared module resolving symbol in executable/prog.c
-test cases/common/154 dotinclude/dotproc.c
-test cases/common/154 dotinclude/meson.build
-test cases/common/154 dotinclude/stdio.h
-test cases/common/155 reserved targets/meson.build
-test cases/common/155 reserved targets/test.c
-test cases/common/155 reserved targets/all/meson.build
-test cases/common/155 reserved targets/benchmark/meson.build
-test cases/common/155 reserved targets/clean/meson.build
-test cases/common/155 reserved targets/clean-ctlist/meson.build
-test cases/common/155 reserved targets/clean-gcda/meson.build
-test cases/common/155 reserved targets/clean-gcno/meson.build
-test cases/common/155 reserved targets/coverage/meson.build
-test cases/common/155 reserved targets/coverage-html/meson.build
-test cases/common/155 reserved targets/coverage-text/meson.build
-test cases/common/155 reserved targets/coverage-xml/meson.build
-test cases/common/155 reserved targets/dist/meson.build
-test cases/common/155 reserved targets/distcheck/meson.build
-test cases/common/155 reserved targets/install/meson.build
-test cases/common/155 reserved targets/phony/meson.build
-test cases/common/155 reserved targets/reconfigure/meson.build
-test cases/common/155 reserved targets/runtarget/meson.build
-test cases/common/155 reserved targets/scan-build/meson.build
-test cases/common/155 reserved targets/test/meson.build
-test cases/common/155 reserved targets/uninstall/meson.build
-test cases/common/156 duplicate source names/meson.build
-test cases/common/156 duplicate source names/dir1/file.c
-test cases/common/156 duplicate source names/dir1/meson.build
-test cases/common/156 duplicate source names/dir2/file.c
-test cases/common/156 duplicate source names/dir2/meson.build
-test cases/common/156 duplicate source names/dir2/dir1/file.c
-test cases/common/156 duplicate source names/dir3/file.c
-test cases/common/156 duplicate source names/dir3/meson.build
-test cases/common/156 duplicate source names/dir3/dir1/file.c
-test cases/common/157 index customtarget/check_args.py
-test cases/common/157 index customtarget/gen_sources.py
-test cases/common/157 index customtarget/lib.c
-test cases/common/157 index customtarget/meson.build
-test cases/common/157 index customtarget/subdir/foo.c
-test cases/common/157 index customtarget/subdir/meson.build
-test cases/common/158 wrap file should not failed/meson.build
-test cases/common/158 wrap file should not failed/src/meson.build
-test cases/common/158 wrap file should not failed/src/subprojects/prog.c
-test cases/common/158 wrap file should not failed/src/subprojects/foo/prog2.c
-test cases/common/158 wrap file should not failed/subprojects/foo.wrap
-test cases/common/158 wrap file should not failed/subprojects/zlib.wrap
-test cases/common/158 wrap file should not failed/subprojects/foo-1.0/foo.c
-test cases/common/158 wrap file should not failed/subprojects/foo-1.0/meson.build
-test cases/common/158 wrap file should not failed/subprojects/packagecache/foo-1.0-patch.tar.xz
-test cases/common/158 wrap file should not failed/subprojects/packagecache/foo-1.0.tar.xz
-test cases/common/158 wrap file should not failed/subprojects/packagecache/zlib-1.2.8-8-wrap.zip
-test cases/common/158 wrap file should not failed/subprojects/packagecache/zlib-1.2.8.tar.gz
-test cases/common/158 wrap file should not failed/subprojects/zlib-1.2.8/foo.c
-test cases/common/158 wrap file should not failed/subprojects/zlib-1.2.8/meson.build
-test cases/common/159 includedir subproj/meson.build
-test cases/common/159 includedir subproj/prog.c
-test cases/common/159 includedir subproj/subprojects/inctest/meson.build
-test cases/common/159 includedir subproj/subprojects/inctest/include/incfile.h
+test cases/common/150 library at root/lib.c
+test cases/common/150 library at root/meson.build
+test cases/common/150 library at root/main/main.c
+test cases/common/150 library at root/main/meson.build
+test cases/common/151 simd/fallback.c
+test cases/common/151 simd/meson.build
+test cases/common/151 simd/simd_avx.c
+test cases/common/151 simd/simd_avx2.c
+test cases/common/151 simd/simd_mmx.c
+test cases/common/151 simd/simd_neon.c
+test cases/common/151 simd/simd_sse.c
+test cases/common/151 simd/simd_sse2.c
+test cases/common/151 simd/simd_sse3.c
+test cases/common/151 simd/simd_sse41.c
+test cases/common/151 simd/simd_sse42.c
+test cases/common/151 simd/simd_ssse3.c
+test cases/common/151 simd/simdchecker.c
+test cases/common/151 simd/simdfuncs.h
+test cases/common/151 simd/include/simdheader.h
+test cases/common/152 shared module resolving symbol in executable/meson.build
+test cases/common/152 shared module resolving symbol in executable/module.c
+test cases/common/152 shared module resolving symbol in executable/prog.c
+test cases/common/153 dotinclude/dotproc.c
+test cases/common/153 dotinclude/meson.build
+test cases/common/153 dotinclude/stdio.h
+test cases/common/154 reserved targets/meson.build
+test cases/common/154 reserved targets/test.c
+test cases/common/154 reserved targets/all/meson.build
+test cases/common/154 reserved targets/benchmark/meson.build
+test cases/common/154 reserved targets/clean/meson.build
+test cases/common/154 reserved targets/clean-ctlist/meson.build
+test cases/common/154 reserved targets/clean-gcda/meson.build
+test cases/common/154 reserved targets/clean-gcno/meson.build
+test cases/common/154 reserved targets/coverage/meson.build
+test cases/common/154 reserved targets/coverage-html/meson.build
+test cases/common/154 reserved targets/coverage-text/meson.build
+test cases/common/154 reserved targets/coverage-xml/meson.build
+test cases/common/154 reserved targets/dist/meson.build
+test cases/common/154 reserved targets/distcheck/meson.build
+test cases/common/154 reserved targets/install/meson.build
+test cases/common/154 reserved targets/phony/meson.build
+test cases/common/154 reserved targets/reconfigure/meson.build
+test cases/common/154 reserved targets/runtarget/meson.build
+test cases/common/154 reserved targets/scan-build/meson.build
+test cases/common/154 reserved targets/test/meson.build
+test cases/common/154 reserved targets/uninstall/meson.build
+test cases/common/155 duplicate source names/meson.build
+test cases/common/155 duplicate source names/dir1/file.c
+test cases/common/155 duplicate source names/dir1/meson.build
+test cases/common/155 duplicate source names/dir2/file.c
+test cases/common/155 duplicate source names/dir2/meson.build
+test cases/common/155 duplicate source names/dir2/dir1/file.c
+test cases/common/155 duplicate source names/dir3/file.c
+test cases/common/155 duplicate source names/dir3/meson.build
+test cases/common/155 duplicate source names/dir3/dir1/file.c
+test cases/common/156 index customtarget/check_args.py
+test cases/common/156 index customtarget/gen_sources.py
+test cases/common/156 index customtarget/lib.c
+test cases/common/156 index customtarget/meson.build
+test cases/common/156 index customtarget/subdir/foo.c
+test cases/common/156 index customtarget/subdir/meson.build
+test cases/common/157 wrap file should not failed/meson.build
+test cases/common/157 wrap file should not failed/src/meson.build
+test cases/common/157 wrap file should not failed/src/subprojects/prog.c
+test cases/common/157 wrap file should not failed/src/subprojects/foo/prog2.c
+test cases/common/157 wrap file should not failed/subprojects/foo.wrap
+test cases/common/157 wrap file should not failed/subprojects/zlib.wrap
+test cases/common/157 wrap file should not failed/subprojects/foo-1.0/foo.c
+test cases/common/157 wrap file should not failed/subprojects/foo-1.0/meson.build
+test cases/common/157 wrap file should not failed/subprojects/packagecache/foo-1.0-patch.tar.xz
+test cases/common/157 wrap file should not failed/subprojects/packagecache/foo-1.0.tar.xz
+test cases/common/157 wrap file should not failed/subprojects/packagecache/zlib-1.2.8-8-wrap.zip
+test cases/common/157 wrap file should not failed/subprojects/packagecache/zlib-1.2.8.tar.gz
+test cases/common/157 wrap file should not failed/subprojects/zlib-1.2.8/foo.c
+test cases/common/157 wrap file should not failed/subprojects/zlib-1.2.8/meson.build
+test cases/common/158 includedir subproj/meson.build
+test cases/common/158 includedir subproj/prog.c
+test cases/common/158 includedir subproj/subprojects/inctest/meson.build
+test cases/common/158 includedir subproj/subprojects/inctest/include/incfile.h
+test cases/common/159 subproject dir name collision/a.c
+test cases/common/159 subproject dir name collision/meson.build
+test cases/common/159 subproject dir name collision/custom_subproject_dir/B/b.c
+test cases/common/159 subproject dir name collision/custom_subproject_dir/B/meson.build
+test cases/common/159 subproject dir name collision/custom_subproject_dir/C/c.c
+test cases/common/159 subproject dir name collision/custom_subproject_dir/C/meson.build
+test cases/common/159 subproject dir name collision/other_subdir/meson.build
+test cases/common/159 subproject dir name collision/other_subdir/custom_subproject_dir/other.c
 test cases/common/16 else/meson.build
 test cases/common/16 else/prog.c
-test cases/common/160 subproject dir name collision/a.c
-test cases/common/160 subproject dir name collision/meson.build
-test cases/common/160 subproject dir name collision/custom_subproject_dir/B/b.c
-test cases/common/160 subproject dir name collision/custom_subproject_dir/B/meson.build
-test cases/common/160 subproject dir name collision/custom_subproject_dir/C/c.c
-test cases/common/160 subproject dir name collision/custom_subproject_dir/C/meson.build
-test cases/common/160 subproject dir name collision/other_subdir/meson.build
-test cases/common/160 subproject dir name collision/other_subdir/custom_subproject_dir/other.c
-test cases/common/161 config tool variable/meson.build
-test cases/common/162 custom target subdir depend files/copyfile.py
-test cases/common/162 custom target subdir depend files/meson.build
-test cases/common/162 custom target subdir depend files/subdir/dep.dat
-test cases/common/162 custom target subdir depend files/subdir/foo.c.in
-test cases/common/162 custom target subdir depend files/subdir/meson.build
-test cases/common/163 external program shebang parsing/input.txt
-test cases/common/163 external program shebang parsing/main.c
-test cases/common/163 external program shebang parsing/meson.build
-test cases/common/163 external program shebang parsing/script.int.in
-test cases/common/164 disabler/meson.build
-test cases/common/165 array option/meson.build
-test cases/common/165 array option/meson_options.txt
-test cases/common/166 custom target template substitution/checkcopy.py
-test cases/common/166 custom target template substitution/foo.c.in
-test cases/common/166 custom target template substitution/meson.build
-test cases/common/167 not-found dependency/meson.build
-test cases/common/167 not-found dependency/testlib.c
-test cases/common/167 not-found dependency/sub/meson.build
-test cases/common/167 not-found dependency/subprojects/trivial/meson.build
-test cases/common/167 not-found dependency/subprojects/trivial/trivial.c
-test cases/common/168 subdir if_found/meson.build
-test cases/common/168 subdir if_found/subdir/meson.build
-test cases/common/169 default options prefix dependent defaults/meson.build
+test cases/common/160 config tool variable/meson.build
+test cases/common/161 custom target subdir depend files/copyfile.py
+test cases/common/161 custom target subdir depend files/meson.build
+test cases/common/161 custom target subdir depend files/subdir/dep.dat
+test cases/common/161 custom target subdir depend files/subdir/foo.c.in
+test cases/common/161 custom target subdir depend files/subdir/meson.build
+test cases/common/162 external program shebang parsing/input.txt
+test cases/common/162 external program shebang parsing/main.c
+test cases/common/162 external program shebang parsing/meson.build
+test cases/common/162 external program shebang parsing/script.int.in
+test cases/common/163 disabler/meson.build
+test cases/common/164 array option/meson.build
+test cases/common/164 array option/meson_options.txt
+test cases/common/165 custom target template substitution/checkcopy.py
+test cases/common/165 custom target template substitution/foo.c.in
+test cases/common/165 custom target template substitution/meson.build
+test cases/common/166 not-found dependency/meson.build
+test cases/common/166 not-found dependency/testlib.c
+test cases/common/166 not-found dependency/sub/meson.build
+test cases/common/166 not-found dependency/subprojects/trivial/meson.build
+test cases/common/166 not-found dependency/subprojects/trivial/trivial.c
+test cases/common/167 subdir if_found/meson.build
+test cases/common/167 subdir if_found/subdir/meson.build
+test cases/common/168 default options prefix dependent defaults/meson.build
+test cases/common/169 dependency factory/meson.build
 test cases/common/17 comparison/meson.build
 test cases/common/17 comparison/prog.c
-test cases/common/170 dependency factory/meson.build
-test cases/common/171 get project license/bar.c
-test cases/common/171 get project license/meson.build
-test cases/common/172 yield/meson.build
-test cases/common/172 yield/meson_options.txt
-test cases/common/172 yield/subprojects/sub/meson.build
-test cases/common/172 yield/subprojects/sub/meson_options.txt
-test cases/common/173 subproject nested subproject dirs/meson.build
-test cases/common/173 subproject nested subproject dirs/prog.c
-test cases/common/173 subproject nested subproject dirs/contrib/subprojects/alpha/a.c
-test cases/common/173 subproject nested subproject dirs/contrib/subprojects/alpha/meson.build
-test cases/common/173 subproject nested subproject dirs/contrib/subprojects/alpha/var/subprojects/wrap_files_might_be_here
-test cases/common/173 subproject nested subproject dirs/contrib/subprojects/beta/b.c
-test cases/common/173 subproject nested subproject dirs/contrib/subprojects/beta/meson.build
-test cases/common/174 preserve gendir/base.inp
-test cases/common/174 preserve gendir/genprog.py
-test cases/common/174 preserve gendir/meson.build
-test cases/common/174 preserve gendir/testprog.c
-test cases/common/174 preserve gendir/com/mesonbuild/subbie.inp
-test cases/common/175 source in dep/bar.cpp
-test cases/common/175 source in dep/foo.c
-test cases/common/175 source in dep/meson.build
-test cases/common/175 source in dep/generated/funname
-test cases/common/175 source in dep/generated/genheader.py
-test cases/common/175 source in dep/generated/main.c
-test cases/common/175 source in dep/generated/meson.build
-test cases/common/176 generator link whole/export.h
-test cases/common/176 generator link whole/generator.py
-test cases/common/176 generator link whole/main.c
-test cases/common/176 generator link whole/meson.build
-test cases/common/176 generator link whole/meson_test_function.tmpl
-test cases/common/176 generator link whole/pull_meson_test_function.c
-test cases/common/177 initial c_args/meson.build
-test cases/common/177 initial c_args/test_args.txt
-test cases/common/178 identical target name in subproject flat layout/foo.c
-test cases/common/178 identical target name in subproject flat layout/main.c
-test cases/common/178 identical target name in subproject flat layout/meson.build
-test cases/common/178 identical target name in subproject flat layout/subprojects/subproj/foo.c
-test cases/common/178 identical target name in subproject flat layout/subprojects/subproj/meson.build
-test cases/common/179 as-needed/config.h
-test cases/common/179 as-needed/libA.cpp
-test cases/common/179 as-needed/libA.h
-test cases/common/179 as-needed/libB.cpp
-test cases/common/179 as-needed/main.cpp
-test cases/common/179 as-needed/meson.build
+test cases/common/170 get project license/bar.c
+test cases/common/170 get project license/meson.build
+test cases/common/171 yield/meson.build
+test cases/common/171 yield/meson_options.txt
+test cases/common/171 yield/subprojects/sub/meson.build
+test cases/common/171 yield/subprojects/sub/meson_options.txt
+test cases/common/172 subproject nested subproject dirs/meson.build
+test cases/common/172 subproject nested subproject dirs/prog.c
+test cases/common/172 subproject nested subproject dirs/contrib/subprojects/alpha/a.c
+test cases/common/172 subproject nested subproject dirs/contrib/subprojects/alpha/meson.build
+test cases/common/172 subproject nested subproject dirs/contrib/subprojects/alpha/var/subprojects/wrap_files_might_be_here
+test cases/common/172 subproject nested subproject dirs/contrib/subprojects/beta/b.c
+test cases/common/172 subproject nested subproject dirs/contrib/subprojects/beta/meson.build
+test cases/common/173 preserve gendir/base.inp
+test cases/common/173 preserve gendir/genprog.py
+test cases/common/173 preserve gendir/meson.build
+test cases/common/173 preserve gendir/testprog.c
+test cases/common/173 preserve gendir/com/mesonbuild/subbie.inp
+test cases/common/174 source in dep/bar.cpp
+test cases/common/174 source in dep/foo.c
+test cases/common/174 source in dep/meson.build
+test cases/common/174 source in dep/generated/funname
+test cases/common/174 source in dep/generated/genheader.py
+test cases/common/174 source in dep/generated/main.c
+test cases/common/174 source in dep/generated/meson.build
+test cases/common/175 generator link whole/export.h
+test cases/common/175 generator link whole/generator.py
+test cases/common/175 generator link whole/main.c
+test cases/common/175 generator link whole/meson.build
+test cases/common/175 generator link whole/meson_test_function.tmpl
+test cases/common/175 generator link whole/pull_meson_test_function.c
+test cases/common/176 initial c_args/meson.build
+test cases/common/176 initial c_args/test_args.txt
+test cases/common/177 identical target name in subproject flat layout/foo.c
+test cases/common/177 identical target name in subproject flat layout/main.c
+test cases/common/177 identical target name in subproject flat layout/meson.build
+test cases/common/177 identical target name in subproject flat layout/subprojects/subproj/foo.c
+test cases/common/177 identical target name in subproject flat layout/subprojects/subproj/meson.build
+test cases/common/178 as-needed/config.h
+test cases/common/178 as-needed/libA.cpp
+test cases/common/178 as-needed/libA.h
+test cases/common/178 as-needed/libB.cpp
+test cases/common/178 as-needed/main.cpp
+test cases/common/178 as-needed/meson.build
+test cases/common/179 ndebug if-release enabled/main.c
+test cases/common/179 ndebug if-release enabled/meson.build
 test cases/common/18 array/func.c
 test cases/common/18 array/meson.build
 test cases/common/18 array/prog.c
-test cases/common/180 ndebug if-release enabled/main.c
-test cases/common/180 ndebug if-release enabled/meson.build
-test cases/common/181 ndebug if-release disabled/main.c
-test cases/common/181 ndebug if-release disabled/meson.build
-test cases/common/182 subproject version/meson.build
-test cases/common/182 subproject version/subprojects/a/meson.build
-test cases/common/183 subdir_done/meson.build
-test cases/common/184 bothlibraries/libfile.c
-test cases/common/184 bothlibraries/main.c
-test cases/common/184 bothlibraries/meson.build
-test cases/common/184 bothlibraries/mylib.h
-test cases/common/185 escape and unicode/file.c.in
-test cases/common/185 escape and unicode/file.py
-test cases/common/185 escape and unicode/find.py
-test cases/common/185 escape and unicode/fun.c
-test cases/common/185 escape and unicode/main.c
-test cases/common/185 escape and unicode/meson.build
-test cases/common/186 has link arg/meson.build
-test cases/common/187 same target name flat layout/foo.c
-test cases/common/187 same target name flat layout/main.c
-test cases/common/187 same target name flat layout/meson.build
-test cases/common/187 same target name flat layout/subdir/foo.c
-test cases/common/187 same target name flat layout/subdir/meson.build
-test cases/common/188 find override/meson.build
-test cases/common/188 find override/otherdir/main.c
-test cases/common/188 find override/otherdir/main2.c
-test cases/common/188 find override/otherdir/meson.build
-test cases/common/188 find override/otherdir/source.desc
-test cases/common/188 find override/otherdir/source2.desc
-test cases/common/188 find override/subdir/converter.py
-test cases/common/188 find override/subdir/gencodegen.py.in
-test cases/common/188 find override/subdir/meson.build
-test cases/common/189 partial dependency/meson.build
-test cases/common/189 partial dependency/declare_dependency/main.c
-test cases/common/189 partial dependency/declare_dependency/meson.build
-test cases/common/189 partial dependency/declare_dependency/other.c
-test cases/common/189 partial dependency/declare_dependency/headers/foo.c
-test cases/common/189 partial dependency/declare_dependency/headers/foo.h
+test cases/common/180 ndebug if-release disabled/main.c
+test cases/common/180 ndebug if-release disabled/meson.build
+test cases/common/181 subproject version/meson.build
+test cases/common/181 subproject version/subprojects/a/meson.build
+test cases/common/182 subdir_done/meson.build
+test cases/common/183 bothlibraries/libfile.c
+test cases/common/183 bothlibraries/main.c
+test cases/common/183 bothlibraries/meson.build
+test cases/common/183 bothlibraries/mylib.h
+test cases/common/184 escape and unicode/file.c.in
+test cases/common/184 escape and unicode/file.py
+test cases/common/184 escape and unicode/find.py
+test cases/common/184 escape and unicode/fun.c
+test cases/common/184 escape and unicode/main.c
+test cases/common/184 escape and unicode/meson.build
+test cases/common/185 has link arg/meson.build
+test cases/common/186 same target name flat layout/foo.c
+test cases/common/186 same target name flat layout/main.c
+test cases/common/186 same target name flat layout/meson.build
+test cases/common/186 same target name flat layout/subdir/foo.c
+test cases/common/186 same target name flat layout/subdir/meson.build
+test cases/common/187 find override/meson.build
+test cases/common/187 find override/otherdir/main.c
+test cases/common/187 find override/otherdir/main2.c
+test cases/common/187 find override/otherdir/meson.build
+test cases/common/187 find override/otherdir/source.desc
+test cases/common/187 find override/otherdir/source2.desc
+test cases/common/187 find override/subdir/converter.py
+test cases/common/187 find override/subdir/gencodegen.py.in
+test cases/common/187 find override/subdir/meson.build
+test cases/common/188 partial dependency/meson.build
+test cases/common/188 partial dependency/declare_dependency/main.c
+test cases/common/188 partial dependency/declare_dependency/meson.build
+test cases/common/188 partial dependency/declare_dependency/other.c
+test cases/common/188 partial dependency/declare_dependency/headers/foo.c
+test cases/common/188 partial dependency/declare_dependency/headers/foo.h
+test cases/common/189 openmp/main.c
+test cases/common/189 openmp/main.cpp
+test cases/common/189 openmp/main.f90
+test cases/common/189 openmp/meson.build
 test cases/common/19 includedir/meson.build
 test cases/common/19 includedir/include/func.h
 test cases/common/19 includedir/src/func.c
 test cases/common/19 includedir/src/meson.build
 test cases/common/19 includedir/src/prog.c
-test cases/common/190 openmp/main.c
-test cases/common/190 openmp/main.cpp
-test cases/common/190 openmp/main.f90
-test cases/common/190 openmp/meson.build
-test cases/common/191 same target name/file.c
-test cases/common/191 same target name/meson.build
-test cases/common/191 same target name/sub/file2.c
-test cases/common/191 same target name/sub/meson.build
-test cases/common/192 test depends/gen.py
-test cases/common/192 test depends/main.c
-test cases/common/192 test depends/meson.build
-test cases/common/192 test depends/test.py
-test cases/common/193 args flattening/meson.build
-test cases/common/194 dict/meson.build
-test cases/common/194 dict/prog.c
-test cases/common/195 check header/meson.build
-test cases/common/195 check header/ouagadougou.h
-test cases/common/196 install_mode/config.h.in
-test cases/common/196 install_mode/data_source.txt
-test cases/common/196 install_mode/foo.1
-test cases/common/196 install_mode/installed_files.txt
-test cases/common/196 install_mode/meson.build
-test cases/common/196 install_mode/rootdir.h
-test cases/common/196 install_mode/runscript.sh
-test cases/common/196 install_mode/stat.c
-test cases/common/196 install_mode/trivial.c
-test cases/common/196 install_mode/sub1/second.dat
-test cases/common/196 install_mode/sub2/stub
-test cases/common/197 subproject array version/meson.build
-test cases/common/197 subproject array version/subprojects/foo/meson.build
-test cases/common/198 feature option/meson.build
-test cases/common/198 feature option/meson_options.txt
-test cases/common/199 feature option disabled/meson.build
-test cases/common/199 feature option disabled/meson_options.txt
+test cases/common/190 same target name/file.c
+test cases/common/190 same target name/meson.build
+test cases/common/190 same target name/sub/file2.c
+test cases/common/190 same target name/sub/meson.build
+test cases/common/191 test depends/gen.py
+test cases/common/191 test depends/main.c
+test cases/common/191 test depends/meson.build
+test cases/common/191 test depends/test.py
+test cases/common/192 args flattening/meson.build
+test cases/common/193 dict/meson.build
+test cases/common/193 dict/prog.c
+test cases/common/194 check header/meson.build
+test cases/common/194 check header/ouagadougou.h
+test cases/common/195 install_mode/config.h.in
+test cases/common/195 install_mode/data_source.txt
+test cases/common/195 install_mode/foo.1
+test cases/common/195 install_mode/installed_files.txt
+test cases/common/195 install_mode/meson.build
+test cases/common/195 install_mode/rootdir.h
+test cases/common/195 install_mode/runscript.sh
+test cases/common/195 install_mode/stat.c
+test cases/common/195 install_mode/trivial.c
+test cases/common/195 install_mode/sub1/second.dat
+test cases/common/195 install_mode/sub2/stub
+test cases/common/196 subproject array version/meson.build
+test cases/common/196 subproject array version/subprojects/foo/meson.build
+test cases/common/197 feature option/meson.build
+test cases/common/197 feature option/meson_options.txt
+test cases/common/198 feature option disabled/meson.build
+test cases/common/198 feature option disabled/meson_options.txt
+test cases/common/199 static threads/lib1.c
+test cases/common/199 static threads/lib2.c
+test cases/common/199 static threads/meson.build
+test cases/common/199 static threads/prog.c
 test cases/common/2 cpp/meson.build
 test cases/common/2 cpp/something.txt
 test cases/common/2 cpp/trivial.cc
 test cases/common/20 header in file list/header.h
 test cases/common/20 header in file list/meson.build
 test cases/common/20 header in file list/prog.c
-test cases/common/200 static threads/lib1.c
-test cases/common/200 static threads/lib2.c
-test cases/common/200 static threads/meson.build
-test cases/common/200 static threads/prog.c
-test cases/common/201 generator in subdir/meson.build
-test cases/common/201 generator in subdir/com/mesonbuild/genprog.py
-test cases/common/201 generator in subdir/com/mesonbuild/meson.build
-test cases/common/201 generator in subdir/com/mesonbuild/subbie.inp
-test cases/common/201 generator in subdir/com/mesonbuild/testprog.c
-test cases/common/202 override with exe/main2.input
-test cases/common/202 override with exe/meson.build
-test cases/common/202 override with exe/subprojects/sub/foobar.c
-test cases/common/202 override with exe/subprojects/sub/meson.build
-test cases/common/203 subproject with features/meson.build
-test cases/common/203 subproject with features/meson_options.txt
-test cases/common/203 subproject with features/nothing.c
-test cases/common/203 subproject with features/subprojects/auto_sub_with_missing_dep/meson.build
-test cases/common/203 subproject with features/subprojects/disabled_sub/meson.build
-test cases/common/203 subproject with features/subprojects/disabled_sub/lib/meson.build
-test cases/common/203 subproject with features/subprojects/disabled_sub/lib/sub.c
-test cases/common/203 subproject with features/subprojects/disabled_sub/lib/sub.h
-test cases/common/203 subproject with features/subprojects/sub/meson.build
-test cases/common/203 subproject with features/subprojects/sub/lib/meson.build
-test cases/common/203 subproject with features/subprojects/sub/lib/sub.c
-test cases/common/203 subproject with features/subprojects/sub/lib/sub.h
-test cases/common/204 function attributes/meson.build
-test cases/common/205 broken subproject/meson.build
-test cases/common/205 broken subproject/subprojects/broken/broken.c
-test cases/common/205 broken subproject/subprojects/broken/meson.build
-test cases/common/206 argument syntax/meson.build
-test cases/common/207 install name_prefix name_suffix/installed_files.txt
-test cases/common/207 install name_prefix name_suffix/libfile.c
-test cases/common/207 install name_prefix name_suffix/meson.build
-test cases/common/208 kwarg entry/installed_files.txt
-test cases/common/208 kwarg entry/meson.build
-test cases/common/208 kwarg entry/prog.c
-test cases/common/208 kwarg entry/inc/prog.h
+test cases/common/200 generator in subdir/meson.build
+test cases/common/200 generator in subdir/com/mesonbuild/genprog.py
+test cases/common/200 generator in subdir/com/mesonbuild/meson.build
+test cases/common/200 generator in subdir/com/mesonbuild/subbie.inp
+test cases/common/200 generator in subdir/com/mesonbuild/testprog.c
+test cases/common/201 override with exe/main2.input
+test cases/common/201 override with exe/meson.build
+test cases/common/201 override with exe/subprojects/sub/foobar.c
+test cases/common/201 override with exe/subprojects/sub/meson.build
+test cases/common/202 subproject with features/meson.build
+test cases/common/202 subproject with features/meson_options.txt
+test cases/common/202 subproject with features/nothing.c
+test cases/common/202 subproject with features/subprojects/auto_sub_with_missing_dep/meson.build
+test cases/common/202 subproject with features/subprojects/disabled_sub/meson.build
+test cases/common/202 subproject with features/subprojects/disabled_sub/lib/meson.build
+test cases/common/202 subproject with features/subprojects/disabled_sub/lib/sub.c
+test cases/common/202 subproject with features/subprojects/disabled_sub/lib/sub.h
+test cases/common/202 subproject with features/subprojects/sub/meson.build
+test cases/common/202 subproject with features/subprojects/sub/lib/meson.build
+test cases/common/202 subproject with features/subprojects/sub/lib/sub.c
+test cases/common/202 subproject with features/subprojects/sub/lib/sub.h
+test cases/common/203 function attributes/meson.build
+test cases/common/204 broken subproject/meson.build
+test cases/common/204 broken subproject/subprojects/broken/broken.c
+test cases/common/204 broken subproject/subprojects/broken/meson.build
+test cases/common/205 argument syntax/meson.build
+test cases/common/206 install name_prefix name_suffix/installed_files.txt
+test cases/common/206 install name_prefix name_suffix/libfile.c
+test cases/common/206 install name_prefix name_suffix/meson.build
+test cases/common/207 kwarg entry/installed_files.txt
+test cases/common/207 kwarg entry/meson.build
+test cases/common/207 kwarg entry/prog.c
+test cases/common/207 kwarg entry/inc/prog.h
+test cases/common/208 custom target build by default/docgen.py
+test cases/common/208 custom target build by default/installed_files.txt
+test cases/common/208 custom target build by default/meson.build
+test cases/common/209 find_library and headers/foo.h
+test cases/common/209 find_library and headers/meson.build
 test cases/common/21 global arg/meson.build
 test cases/common/21 global arg/prog.c
 test cases/common/21 global arg/prog.cc
+test cases/common/210 line continuation/meson.build
+test cases/common/211 cmake module/installed_files.txt
+test cases/common/211 cmake module/meson.build
+test cases/common/211 cmake module/projectConfig.cmake.in
+test cases/common/211 cmake module/cmake_project/CMakeLists.txt
+test cases/common/212 native file path override/installed_files.txt
+test cases/common/212 native file path override/main.cpp
+test cases/common/212 native file path override/meson.build
+test cases/common/212 native file path override/nativefile.ini
+test cases/common/213 tap tests/meson.build
+test cases/common/213 tap tests/tester.c
+test cases/common/214 warning level 0/main.cpp
+test cases/common/214 warning level 0/meson.build
+test cases/common/215 link custom/custom_stlib.py
+test cases/common/215 link custom/meson.build
+test cases/common/215 link custom/prog.c
+test cases/common/216 link custom_i single from multiple/generate_conflicting_stlibs.py
+test cases/common/216 link custom_i single from multiple/meson.build
+test cases/common/216 link custom_i single from multiple/prog.c
+test cases/common/217 link custom_i multiple from multiple/generate_stlibs.py
+test cases/common/217 link custom_i multiple from multiple/meson.build
+test cases/common/217 link custom_i multiple from multiple/prog.c
+test cases/common/218 dependency get_variable method/meson.build
+test cases/common/219 source set configuration_data/a.c
+test cases/common/219 source set configuration_data/all.h
+test cases/common/219 source set configuration_data/f.c
+test cases/common/219 source set configuration_data/g.c
+test cases/common/219 source set configuration_data/meson.build
+test cases/common/219 source set configuration_data/nope.c
+test cases/common/219 source set configuration_data/subdir/b.c
+test cases/common/219 source set configuration_data/subdir/meson.build
 test cases/common/22 target arg/func.c
 test cases/common/22 target arg/func2.c
 test cases/common/22 target arg/meson.build
 test cases/common/22 target arg/prog.cc
 test cases/common/22 target arg/prog2.cc
+test cases/common/220 source set dictionary/a.c
+test cases/common/220 source set dictionary/all.h
+test cases/common/220 source set dictionary/f.c
+test cases/common/220 source set dictionary/g.c
+test cases/common/220 source set dictionary/meson.build
+test cases/common/220 source set dictionary/nope.c
+test cases/common/220 source set dictionary/subdir/b.c
+test cases/common/220 source set dictionary/subdir/meson.build
+test cases/common/221 source set custom target/a.c
+test cases/common/221 source set custom target/all.h
+test cases/common/221 source set custom target/cp.py
+test cases/common/221 source set custom target/f.c
+test cases/common/221 source set custom target/g.c
+test cases/common/221 source set custom target/meson.build
+test cases/common/222 source set realistic example/common.h
+test cases/common/222 source set realistic example/main.cc
+test cases/common/222 source set realistic example/meson.build
+test cases/common/222 source set realistic example/not-found.cc
+test cases/common/222 source set realistic example/was-found.cc
+test cases/common/222 source set realistic example/zlib.cc
+test cases/common/222 source set realistic example/boards/meson.build
+test cases/common/222 source set realistic example/boards/arm/aarch64.cc
+test cases/common/222 source set realistic example/boards/arm/arm.cc
+test cases/common/222 source set realistic example/boards/arm/arm.h
+test cases/common/222 source set realistic example/boards/arm/arm32.cc
+test cases/common/222 source set realistic example/boards/arm/versatilepb.cc
+test cases/common/222 source set realistic example/boards/arm/virt.cc
+test cases/common/222 source set realistic example/boards/arm/xlnx_zcu102.cc
+test cases/common/222 source set realistic example/boards/x86/pc.cc
+test cases/common/222 source set realistic example/config/aarch64
+test cases/common/222 source set realistic example/config/arm
+test cases/common/222 source set realistic example/config/x86
+test cases/common/222 source set realistic example/devices/meson.build
+test cases/common/222 source set realistic example/devices/virtio-mmio.cc
+test cases/common/222 source set realistic example/devices/virtio-pci.cc
+test cases/common/222 source set realistic example/devices/virtio.cc
+test cases/common/222 source set realistic example/devices/virtio.h
+test cases/common/223 custom target input extracted objects/check_object.py
+test cases/common/223 custom target input extracted objects/meson.build
+test cases/common/223 custom target input extracted objects/libdir/meson.build
+test cases/common/223 custom target input extracted objects/libdir/source.c
+test cases/common/224 test priorities/meson.build
+test cases/common/224 test priorities/testprog.py
+test cases/common/225 include_dir dot/meson.build
+test cases/common/225 include_dir dot/rone.h
+test cases/common/225 include_dir dot/src/main.c
+test cases/common/225 include_dir dot/src/meson.build
+test cases/common/225 include_dir dot/src/rone.c
+test cases/common/226 include_type dependency/meson.build
+test cases/common/226 include_type dependency/subprojects/subDep/meson.build
 test cases/common/23 object extraction/lib.c
 test cases/common/23 object extraction/lib2.c
 test cases/common/23 object extraction/main.c
@@ -823,311 +1028,323 @@
 test cases/common/27 pipeline/meson.build
 test cases/common/27 pipeline/prog.c
 test cases/common/27 pipeline/srcgen.c
-test cases/common/28 pipeline/meson.build
-test cases/common/28 pipeline/src/input_src.dat
-test cases/common/28 pipeline/src/meson.build
-test cases/common/28 pipeline/src/prog.c
-test cases/common/28 pipeline/src/srcgen.c
-test cases/common/29 find program/meson.build
-test cases/common/29 find program/source.in
+test cases/common/27 pipeline/depends/copyrunner.py
+test cases/common/27 pipeline/depends/filecopier.c
+test cases/common/27 pipeline/depends/libsrc.c.in
+test cases/common/27 pipeline/depends/meson.build
+test cases/common/27 pipeline/depends/prog.c
+test cases/common/27 pipeline/src/input_src.dat
+test cases/common/27 pipeline/src/meson.build
+test cases/common/27 pipeline/src/prog.c
+test cases/common/27 pipeline/src/srcgen.c
+test cases/common/28 find program/meson.build
+test cases/common/28 find program/print-version-with-prefix.py
+test cases/common/28 find program/print-version.py
+test cases/common/28 find program/source.in
+test cases/common/29 multiline string/meson.build
 test cases/common/3 static/libfile.c
 test cases/common/3 static/libfile2.c
 test cases/common/3 static/meson.build
 test cases/common/3 static/meson_options.txt
-test cases/common/30 multiline string/meson.build
-test cases/common/31 try compile/invalid.c
-test cases/common/31 try compile/meson.build
-test cases/common/31 try compile/valid.c
-test cases/common/32 compiler id/meson.build
-test cases/common/33 sizeof/config.h.in
-test cases/common/33 sizeof/meson.build
-test cases/common/33 sizeof/prog.c.in
-test cases/common/34 define10/config.h.in
-test cases/common/34 define10/meson.build
-test cases/common/34 define10/prog.c
-test cases/common/35 has header/meson.build
-test cases/common/35 has header/ouagadougou.h
-test cases/common/36 run program/get-version.py
-test cases/common/36 run program/meson.build
-test cases/common/36 run program/scripts/hello.bat
-test cases/common/36 run program/scripts/hello.sh
-test cases/common/37 tryrun/error.c
-test cases/common/37 tryrun/meson.build
-test cases/common/37 tryrun/no_compile.c
-test cases/common/37 tryrun/ok.c
-test cases/common/38 logic ops/meson.build
-test cases/common/39 string operations/meson.build
+test cases/common/30 try compile/invalid.c
+test cases/common/30 try compile/meson.build
+test cases/common/30 try compile/valid.c
+test cases/common/31 compiler id/meson.build
+test cases/common/32 sizeof/config.h.in
+test cases/common/32 sizeof/meson.build
+test cases/common/32 sizeof/prog.c.in
+test cases/common/33 define10/config.h.in
+test cases/common/33 define10/meson.build
+test cases/common/33 define10/prog.c
+test cases/common/34 has header/meson.build
+test cases/common/34 has header/ouagadougou.h
+test cases/common/35 run program/get-version.py
+test cases/common/35 run program/meson.build
+test cases/common/35 run program/scripts/hello.bat
+test cases/common/35 run program/scripts/hello.sh
+test cases/common/36 tryrun/error.c
+test cases/common/36 tryrun/meson.build
+test cases/common/36 tryrun/no_compile.c
+test cases/common/36 tryrun/ok.c
+test cases/common/37 logic ops/meson.build
+test cases/common/38 string operations/meson.build
+test cases/common/39 has function/meson.build
 test cases/common/4 shared/libfile.c
 test cases/common/4 shared/meson.build
-test cases/common/40 has function/meson.build
-test cases/common/41 has member/meson.build
-test cases/common/42 alignment/meson.build
-test cases/common/43 library chain/installed_files.txt
-test cases/common/43 library chain/main.c
-test cases/common/43 library chain/meson.build
-test cases/common/43 library chain/subdir/lib1.c
-test cases/common/43 library chain/subdir/meson.build
-test cases/common/43 library chain/subdir/subdir2/lib2.c
-test cases/common/43 library chain/subdir/subdir2/meson.build
-test cases/common/43 library chain/subdir/subdir3/lib3.c
-test cases/common/43 library chain/subdir/subdir3/meson.build
-test cases/common/44 options/meson.build
-test cases/common/44 options/meson_options.txt
-test cases/common/45 test args/cmd_args.c
-test cases/common/45 test args/copyfile.py
-test cases/common/45 test args/env2vars.c
-test cases/common/45 test args/envvars.c
-test cases/common/45 test args/meson.build
-test cases/common/45 test args/tester.c
-test cases/common/45 test args/tester.py
-test cases/common/45 test args/testfile.txt
-test cases/common/46 subproject/installed_files.txt
-test cases/common/46 subproject/meson.build
-test cases/common/46 subproject/user.c
-test cases/common/46 subproject/subprojects/sublib/meson.build
-test cases/common/46 subproject/subprojects/sublib/simpletest.c
-test cases/common/46 subproject/subprojects/sublib/sublib.c
-test cases/common/46 subproject/subprojects/sublib/include/subdefs.h
-test cases/common/47 subproject options/meson.build
-test cases/common/47 subproject options/meson_options.txt
-test cases/common/47 subproject options/subprojects/subproject/meson.build
-test cases/common/47 subproject options/subprojects/subproject/meson_options.txt
-test cases/common/48 pkgconfig-gen/installed_files.txt
-test cases/common/48 pkgconfig-gen/meson.build
-test cases/common/48 pkgconfig-gen/simple.c
-test cases/common/48 pkgconfig-gen/simple.h
-test cases/common/48 pkgconfig-gen/dependencies/custom.c
-test cases/common/48 pkgconfig-gen/dependencies/exposed.c
-test cases/common/48 pkgconfig-gen/dependencies/internal.c
-test cases/common/48 pkgconfig-gen/dependencies/meson.build
-test cases/common/49 custom install dirs/datafile.cat
-test cases/common/49 custom install dirs/installed_files.txt
-test cases/common/49 custom install dirs/meson.build
-test cases/common/49 custom install dirs/prog.1
-test cases/common/49 custom install dirs/prog.c
-test cases/common/49 custom install dirs/sample.h
-test cases/common/49 custom install dirs/subdir/datafile.dog
+test cases/common/40 has member/meson.build
+test cases/common/41 alignment/meson.build
+test cases/common/42 library chain/installed_files.txt
+test cases/common/42 library chain/main.c
+test cases/common/42 library chain/meson.build
+test cases/common/42 library chain/subdir/lib1.c
+test cases/common/42 library chain/subdir/meson.build
+test cases/common/42 library chain/subdir/subdir2/lib2.c
+test cases/common/42 library chain/subdir/subdir2/meson.build
+test cases/common/42 library chain/subdir/subdir3/lib3.c
+test cases/common/42 library chain/subdir/subdir3/meson.build
+test cases/common/43 options/meson.build
+test cases/common/43 options/meson_options.txt
+test cases/common/44 test args/cmd_args.c
+test cases/common/44 test args/copyfile.py
+test cases/common/44 test args/env2vars.c
+test cases/common/44 test args/envvars.c
+test cases/common/44 test args/meson.build
+test cases/common/44 test args/tester.c
+test cases/common/44 test args/tester.py
+test cases/common/44 test args/testfile.txt
+test cases/common/45 subproject/installed_files.txt
+test cases/common/45 subproject/meson.build
+test cases/common/45 subproject/user.c
+test cases/common/45 subproject/subprojects/sublib/meson.build
+test cases/common/45 subproject/subprojects/sublib/simpletest.c
+test cases/common/45 subproject/subprojects/sublib/sublib.c
+test cases/common/45 subproject/subprojects/sublib/include/subdefs.h
+test cases/common/46 subproject options/meson.build
+test cases/common/46 subproject options/meson_options.txt
+test cases/common/46 subproject options/subprojects/subproject/meson.build
+test cases/common/46 subproject options/subprojects/subproject/meson_options.txt
+test cases/common/47 pkgconfig-gen/installed_files.txt
+test cases/common/47 pkgconfig-gen/meson.build
+test cases/common/47 pkgconfig-gen/simple.c
+test cases/common/47 pkgconfig-gen/simple.h
+test cases/common/47 pkgconfig-gen/dependencies/custom.c
+test cases/common/47 pkgconfig-gen/dependencies/exposed.c
+test cases/common/47 pkgconfig-gen/dependencies/internal.c
+test cases/common/47 pkgconfig-gen/dependencies/meson.build
+test cases/common/48 custom install dirs/datafile.cat
+test cases/common/48 custom install dirs/installed_files.txt
+test cases/common/48 custom install dirs/meson.build
+test cases/common/48 custom install dirs/prog.1
+test cases/common/48 custom install dirs/prog.c
+test cases/common/48 custom install dirs/sample.h
+test cases/common/48 custom install dirs/subdir/datafile.dog
+test cases/common/49 subproject subproject/meson.build
+test cases/common/49 subproject subproject/prog.c
+test cases/common/49 subproject subproject/subprojects/a/a.c
+test cases/common/49 subproject subproject/subprojects/a/meson.build
+test cases/common/49 subproject subproject/subprojects/b/b.c
+test cases/common/49 subproject subproject/subprojects/b/meson.build
+test cases/common/49 subproject subproject/subprojects/c/meson.build
 test cases/common/5 linkstatic/libfile.c
 test cases/common/5 linkstatic/libfile2.c
 test cases/common/5 linkstatic/libfile3.c
 test cases/common/5 linkstatic/libfile4.c
 test cases/common/5 linkstatic/main.c
 test cases/common/5 linkstatic/meson.build
-test cases/common/50 subproject subproject/meson.build
-test cases/common/50 subproject subproject/prog.c
-test cases/common/50 subproject subproject/subprojects/a/a.c
-test cases/common/50 subproject subproject/subprojects/a/meson.build
-test cases/common/50 subproject subproject/subprojects/b/b.c
-test cases/common/50 subproject subproject/subprojects/b/meson.build
-test cases/common/50 subproject subproject/subprojects/c/meson.build
-test cases/common/51 same file name/meson.build
-test cases/common/51 same file name/prog.c
-test cases/common/51 same file name/d1/file.c
-test cases/common/51 same file name/d2/file.c
-test cases/common/52 file grabber/a.c
-test cases/common/52 file grabber/b.c
-test cases/common/52 file grabber/c.c
-test cases/common/52 file grabber/grabber.bat
-test cases/common/52 file grabber/grabber.sh
-test cases/common/52 file grabber/grabber2.bat
-test cases/common/52 file grabber/meson.build
-test cases/common/52 file grabber/prog.c
-test cases/common/52 file grabber/subdir/meson.build
-test cases/common/52 file grabber/subdir/suba.c
-test cases/common/52 file grabber/subdir/subb.c
-test cases/common/52 file grabber/subdir/subc.c
-test cases/common/52 file grabber/subdir/subprog.c
-test cases/common/53 custom target/data_source.txt
-test cases/common/53 custom target/installed_files.txt
-test cases/common/53 custom target/meson.build
-test cases/common/53 custom target/my_compiler.py
-test cases/common/53 custom target/depfile/dep.py
-test cases/common/53 custom target/depfile/meson.build
-test cases/common/54 custom target chain/data_source.txt
-test cases/common/54 custom target chain/installed_files.txt
-test cases/common/54 custom target chain/meson.build
-test cases/common/54 custom target chain/my_compiler.py
-test cases/common/54 custom target chain/my_compiler2.py
-test cases/common/54 custom target chain/usetarget/meson.build
-test cases/common/54 custom target chain/usetarget/myexe.c
-test cases/common/54 custom target chain/usetarget/subcomp.py
-test cases/common/55 run target/check_exists.py
-test cases/common/55 run target/configure.in
-test cases/common/55 run target/converter.py
-test cases/common/55 run target/fakeburner.py
-test cases/common/55 run target/helloprinter.c
-test cases/common/55 run target/meson.build
-test cases/common/55 run target/scripts/script.sh
-test cases/common/56 object generator/meson.build
-test cases/common/56 object generator/obj_generator.py
-test cases/common/56 object generator/prog.c
-test cases/common/56 object generator/source.c
-test cases/common/56 object generator/source2.c
-test cases/common/56 object generator/source3.c
-test cases/common/57 install script/installed_files.txt
-test cases/common/57 install script/meson.build
-test cases/common/57 install script/myinstall.py
-test cases/common/57 install script/no-installed-files
-test cases/common/57 install script/prog.c
-test cases/common/57 install script/src/meson.build
-test cases/common/57 install script/src/myinstall.py
-test cases/common/58 custom target source output/generator.py
-test cases/common/58 custom target source output/main.c
-test cases/common/58 custom target source output/meson.build
-test cases/common/59 exe static shared/meson.build
-test cases/common/59 exe static shared/prog.c
-test cases/common/59 exe static shared/shlib2.c
-test cases/common/59 exe static shared/stat.c
-test cases/common/59 exe static shared/stat2.c
-test cases/common/59 exe static shared/subdir/exports.h
-test cases/common/59 exe static shared/subdir/meson.build
-test cases/common/59 exe static shared/subdir/shlib.c
+test cases/common/50 same file name/meson.build
+test cases/common/50 same file name/prog.c
+test cases/common/50 same file name/d1/file.c
+test cases/common/50 same file name/d2/file.c
+test cases/common/51 file grabber/a.c
+test cases/common/51 file grabber/b.c
+test cases/common/51 file grabber/c.c
+test cases/common/51 file grabber/grabber.bat
+test cases/common/51 file grabber/grabber.sh
+test cases/common/51 file grabber/grabber2.bat
+test cases/common/51 file grabber/meson.build
+test cases/common/51 file grabber/prog.c
+test cases/common/51 file grabber/subdir/meson.build
+test cases/common/51 file grabber/subdir/suba.c
+test cases/common/51 file grabber/subdir/subb.c
+test cases/common/51 file grabber/subdir/subc.c
+test cases/common/51 file grabber/subdir/subprog.c
+test cases/common/52 custom target/data_source.txt
+test cases/common/52 custom target/installed_files.txt
+test cases/common/52 custom target/meson.build
+test cases/common/52 custom target/my_compiler.py
+test cases/common/52 custom target/depfile/dep.py
+test cases/common/52 custom target/depfile/meson.build
+test cases/common/53 custom target chain/data_source.txt
+test cases/common/53 custom target chain/installed_files.txt
+test cases/common/53 custom target chain/meson.build
+test cases/common/53 custom target chain/my_compiler.py
+test cases/common/53 custom target chain/my_compiler2.py
+test cases/common/53 custom target chain/usetarget/meson.build
+test cases/common/53 custom target chain/usetarget/myexe.c
+test cases/common/53 custom target chain/usetarget/subcomp.py
+test cases/common/54 run target/check_exists.py
+test cases/common/54 run target/configure.in
+test cases/common/54 run target/converter.py
+test cases/common/54 run target/fakeburner.py
+test cases/common/54 run target/helloprinter.c
+test cases/common/54 run target/meson.build
+test cases/common/55 object generator/meson.build
+test cases/common/55 object generator/obj_generator.py
+test cases/common/55 object generator/prog.c
+test cases/common/55 object generator/source.c
+test cases/common/55 object generator/source2.c
+test cases/common/55 object generator/source3.c
+test cases/common/56 install script/installed_files.txt
+test cases/common/56 install script/meson.build
+test cases/common/56 install script/myinstall.py
+test cases/common/56 install script/no-installed-files
+test cases/common/56 install script/prog.c
+test cases/common/56 install script/src/meson.build
+test cases/common/56 install script/src/myinstall.py
+test cases/common/57 custom target source output/generator.py
+test cases/common/57 custom target source output/main.c
+test cases/common/57 custom target source output/meson.build
+test cases/common/58 exe static shared/meson.build
+test cases/common/58 exe static shared/prog.c
+test cases/common/58 exe static shared/shlib2.c
+test cases/common/58 exe static shared/stat.c
+test cases/common/58 exe static shared/stat2.c
+test cases/common/58 exe static shared/subdir/exports.h
+test cases/common/58 exe static shared/subdir/meson.build
+test cases/common/58 exe static shared/subdir/shlib.c
+test cases/common/59 array methods/meson.build
 test cases/common/6 linkshared/cpplib.cpp
 test cases/common/6 linkshared/cppmain.cpp
 test cases/common/6 linkshared/installed_files.txt
 test cases/common/6 linkshared/libfile.c
 test cases/common/6 linkshared/main.c
 test cases/common/6 linkshared/meson.build
-test cases/common/60 array methods/meson.build
-test cases/common/61 custom header generator/input.def
-test cases/common/61 custom header generator/makeheader.py
-test cases/common/61 custom header generator/meson.build
-test cases/common/61 custom header generator/prog.c
-test cases/common/61 custom header generator/somefile.txt
-test cases/common/62 multiple generators/data2.dat
-test cases/common/62 multiple generators/main.cpp
-test cases/common/62 multiple generators/meson.build
-test cases/common/62 multiple generators/mygen.py
-test cases/common/62 multiple generators/subdir/data.dat
-test cases/common/62 multiple generators/subdir/meson.build
-test cases/common/63 install subdir/installed_files.txt
-test cases/common/63 install subdir/meson.build
-test cases/common/63 install subdir/nested_elided/sub/eighth.dat
-test cases/common/63 install subdir/nested_elided/sub/dircheck/nineth.dat
-test cases/common/63 install subdir/sub/sub1/third.dat
-test cases/common/63 install subdir/sub1/second.dat
-test cases/common/63 install subdir/sub2/excluded-three.dat
-test cases/common/63 install subdir/sub2/one.dat
-test cases/common/63 install subdir/sub2/dircheck/excluded-three.dat
-test cases/common/63 install subdir/sub2/excluded/two.dat
-test cases/common/63 install subdir/sub_elided/fourth.dat
-test cases/common/63 install subdir/sub_elided/dircheck/fifth.dat
-test cases/common/63 install subdir/subdir/meson.build
-test cases/common/63 install subdir/subdir/sub1/data1.dat
-test cases/common/63 install subdir/subdir/sub1/sub2/data2.dat
-test cases/common/63 install subdir/subdir/sub_elided/sixth.dat
-test cases/common/63 install subdir/subdir/sub_elided/dircheck/seventh.dat
-test cases/common/64 foreach/installed_files.txt
-test cases/common/64 foreach/meson.build
-test cases/common/64 foreach/prog1.c
-test cases/common/64 foreach/prog2.c
-test cases/common/64 foreach/prog3.c
-test cases/common/65 number arithmetic/meson.build
-test cases/common/66 string arithmetic/meson.build
-test cases/common/67 array arithmetic/meson.build
-test cases/common/68 arithmetic bidmas/meson.build
-test cases/common/69 build always/main.c
-test cases/common/69 build always/meson.build
-test cases/common/69 build always/version.c.in
-test cases/common/69 build always/version.h
-test cases/common/69 build always/version_gen.py
+test cases/common/60 custom header generator/input.def
+test cases/common/60 custom header generator/makeheader.py
+test cases/common/60 custom header generator/meson.build
+test cases/common/60 custom header generator/prog.c
+test cases/common/60 custom header generator/somefile.txt
+test cases/common/61 multiple generators/data2.dat
+test cases/common/61 multiple generators/main.cpp
+test cases/common/61 multiple generators/meson.build
+test cases/common/61 multiple generators/mygen.py
+test cases/common/61 multiple generators/subdir/data.dat
+test cases/common/61 multiple generators/subdir/meson.build
+test cases/common/62 install subdir/installed_files.txt
+test cases/common/62 install subdir/meson.build
+test cases/common/62 install subdir/nested_elided/sub/eighth.dat
+test cases/common/62 install subdir/nested_elided/sub/dircheck/nineth.dat
+test cases/common/62 install subdir/sub/sub1/third.dat
+test cases/common/62 install subdir/sub1/second.dat
+test cases/common/62 install subdir/sub2/excluded-three.dat
+test cases/common/62 install subdir/sub2/one.dat
+test cases/common/62 install subdir/sub2/dircheck/excluded-three.dat
+test cases/common/62 install subdir/sub2/excluded/two.dat
+test cases/common/62 install subdir/sub_elided/fourth.dat
+test cases/common/62 install subdir/sub_elided/dircheck/fifth.dat
+test cases/common/62 install subdir/subdir/meson.build
+test cases/common/62 install subdir/subdir/sub1/data1.dat
+test cases/common/62 install subdir/subdir/sub1/sub2/data2.dat
+test cases/common/62 install subdir/subdir/sub_elided/sixth.dat
+test cases/common/62 install subdir/subdir/sub_elided/dircheck/seventh.dat
+test cases/common/63 foreach/installed_files.txt
+test cases/common/63 foreach/meson.build
+test cases/common/63 foreach/prog1.c
+test cases/common/63 foreach/prog2.c
+test cases/common/63 foreach/prog3.c
+test cases/common/64 number arithmetic/meson.build
+test cases/common/65 string arithmetic/meson.build
+test cases/common/66 array arithmetic/meson.build
+test cases/common/67 arithmetic bidmas/meson.build
+test cases/common/68 build always/main.c
+test cases/common/68 build always/meson.build
+test cases/common/68 build always/version.c.in
+test cases/common/68 build always/version.h
+test cases/common/68 build always/version_gen.py
+test cases/common/69 vcstag/meson.build
+test cases/common/69 vcstag/tagprog.c
+test cases/common/69 vcstag/vcstag.c.in
 test cases/common/7 mixed/func.c
 test cases/common/7 mixed/main.cc
 test cases/common/7 mixed/meson.build
-test cases/common/70 vcstag/meson.build
-test cases/common/70 vcstag/tagprog.c
-test cases/common/70 vcstag/vcstag.c.in
-test cases/common/71 modules/meson.build
-test cases/common/72 should fail/failing.c
-test cases/common/72 should fail/meson.build
-test cases/common/73 configure file in custom target/meson.build
-test cases/common/73 configure file in custom target/inc/confdata.in
-test cases/common/73 configure file in custom target/inc/meson.build
-test cases/common/73 configure file in custom target/src/meson.build
-test cases/common/73 configure file in custom target/src/mycompiler.py
-test cases/common/74 external test program/meson.build
-test cases/common/74 external test program/mytest.py
-test cases/common/75 ctarget dependency/gen1.py
-test cases/common/75 ctarget dependency/gen2.py
-test cases/common/75 ctarget dependency/input.dat
-test cases/common/75 ctarget dependency/meson.build
-test cases/common/76 shared subproject/a.c
-test cases/common/76 shared subproject/meson.build
-test cases/common/76 shared subproject/subprojects/B/b.c
-test cases/common/76 shared subproject/subprojects/B/meson.build
-test cases/common/76 shared subproject/subprojects/C/c.c
-test cases/common/76 shared subproject/subprojects/C/meson.build
-test cases/common/77 shared subproject 2/a.c
-test cases/common/77 shared subproject 2/meson.build
-test cases/common/77 shared subproject 2/subprojects/B/b.c
-test cases/common/77 shared subproject 2/subprojects/B/meson.build
-test cases/common/77 shared subproject 2/subprojects/C/c.c
-test cases/common/77 shared subproject 2/subprojects/C/meson.build
-test cases/common/78 file object/lib.c
-test cases/common/78 file object/meson.build
-test cases/common/78 file object/prog.c
-test cases/common/78 file object/subdir1/lib.c
-test cases/common/78 file object/subdir1/meson.build
-test cases/common/78 file object/subdir1/prog.c
-test cases/common/78 file object/subdir2/lib.c
-test cases/common/78 file object/subdir2/meson.build
-test cases/common/78 file object/subdir2/prog.c
-test cases/common/79 custom subproject dir/a.c
-test cases/common/79 custom subproject dir/meson.build
-test cases/common/79 custom subproject dir/custom_subproject_dir/B/b.c
-test cases/common/79 custom subproject dir/custom_subproject_dir/B/meson.build
-test cases/common/79 custom subproject dir/custom_subproject_dir/C/c.c
-test cases/common/79 custom subproject dir/custom_subproject_dir/C/meson.build
+test cases/common/70 modules/meson.build
+test cases/common/71 should fail/failing.c
+test cases/common/71 should fail/meson.build
+test cases/common/72 configure file in custom target/meson.build
+test cases/common/72 configure file in custom target/inc/confdata.in
+test cases/common/72 configure file in custom target/inc/meson.build
+test cases/common/72 configure file in custom target/src/meson.build
+test cases/common/72 configure file in custom target/src/mycompiler.py
+test cases/common/73 external test program/meson.build
+test cases/common/73 external test program/mytest.py
+test cases/common/74 ctarget dependency/gen1.py
+test cases/common/74 ctarget dependency/gen2.py
+test cases/common/74 ctarget dependency/input.dat
+test cases/common/74 ctarget dependency/meson.build
+test cases/common/75 shared subproject/a.c
+test cases/common/75 shared subproject/meson.build
+test cases/common/75 shared subproject/subprojects/B/b.c
+test cases/common/75 shared subproject/subprojects/B/meson.build
+test cases/common/75 shared subproject/subprojects/C/c.c
+test cases/common/75 shared subproject/subprojects/C/meson.build
+test cases/common/76 shared subproject 2/a.c
+test cases/common/76 shared subproject 2/meson.build
+test cases/common/76 shared subproject 2/subprojects/B/b.c
+test cases/common/76 shared subproject 2/subprojects/B/meson.build
+test cases/common/76 shared subproject 2/subprojects/C/c.c
+test cases/common/76 shared subproject 2/subprojects/C/meson.build
+test cases/common/77 file object/lib.c
+test cases/common/77 file object/meson.build
+test cases/common/77 file object/prog.c
+test cases/common/77 file object/subdir1/lib.c
+test cases/common/77 file object/subdir1/meson.build
+test cases/common/77 file object/subdir1/prog.c
+test cases/common/77 file object/subdir2/lib.c
+test cases/common/77 file object/subdir2/meson.build
+test cases/common/77 file object/subdir2/prog.c
+test cases/common/78 custom subproject dir/a.c
+test cases/common/78 custom subproject dir/meson.build
+test cases/common/78 custom subproject dir/custom_subproject_dir/B/b.c
+test cases/common/78 custom subproject dir/custom_subproject_dir/B/meson.build
+test cases/common/78 custom subproject dir/custom_subproject_dir/C/c.c
+test cases/common/78 custom subproject dir/custom_subproject_dir/C/meson.build
+test cases/common/79 has type/meson.build
 test cases/common/8 install/installed_files.txt
 test cases/common/8 install/meson.build
 test cases/common/8 install/prog.c
 test cases/common/8 install/stat.c
-test cases/common/80 has type/meson.build
-test cases/common/81 extract from nested subdir/meson.build
-test cases/common/81 extract from nested subdir/src/meson.build
-test cases/common/81 extract from nested subdir/src/first/lib_first.c
-test cases/common/81 extract from nested subdir/src/first/meson.build
-test cases/common/81 extract from nested subdir/tst/meson.build
-test cases/common/81 extract from nested subdir/tst/first/exe_first.c
-test cases/common/81 extract from nested subdir/tst/first/meson.build
-test cases/common/82 internal dependency/meson.build
-test cases/common/82 internal dependency/proj1/meson.build
-test cases/common/82 internal dependency/proj1/proj1f1.c
-test cases/common/82 internal dependency/proj1/proj1f2.c
-test cases/common/82 internal dependency/proj1/proj1f3.c
-test cases/common/82 internal dependency/proj1/include/proj1.h
-test cases/common/82 internal dependency/src/main.c
-test cases/common/82 internal dependency/src/meson.build
-test cases/common/83 same basename/exe1.c
-test cases/common/83 same basename/exe2.c
-test cases/common/83 same basename/lib.c
-test cases/common/83 same basename/meson.build
-test cases/common/83 same basename/sharedsub/meson.build
-test cases/common/83 same basename/staticsub/meson.build
-test cases/common/84 declare dep/main.c
-test cases/common/84 declare dep/meson.build
-test cases/common/84 declare dep/entity/entity.h
-test cases/common/84 declare dep/entity/entity1.c
-test cases/common/84 declare dep/entity/entity2.c
-test cases/common/84 declare dep/entity/meson.build
-test cases/common/85 extract all/extractor.h
-test cases/common/85 extract all/four.c
-test cases/common/85 extract all/meson.build
-test cases/common/85 extract all/one.c
-test cases/common/85 extract all/prog.c
-test cases/common/85 extract all/three.c
-test cases/common/85 extract all/two.c
-test cases/common/86 add language/meson.build
-test cases/common/86 add language/prog.c
-test cases/common/86 add language/prog.cc
-test cases/common/87 identical target name in subproject/bar.c
-test cases/common/87 identical target name in subproject/meson.build
-test cases/common/87 identical target name in subproject/subprojects/foo/bar.c
-test cases/common/87 identical target name in subproject/subprojects/foo/meson.build
-test cases/common/88 plusassign/meson.build
-test cases/common/89 skip subdir/meson.build
-test cases/common/89 skip subdir/subdir1/meson.build
-test cases/common/89 skip subdir/subdir1/subdir2/meson.build
+test cases/common/80 extract from nested subdir/meson.build
+test cases/common/80 extract from nested subdir/src/meson.build
+test cases/common/80 extract from nested subdir/src/first/lib_first.c
+test cases/common/80 extract from nested subdir/src/first/meson.build
+test cases/common/80 extract from nested subdir/tst/meson.build
+test cases/common/80 extract from nested subdir/tst/first/exe_first.c
+test cases/common/80 extract from nested subdir/tst/first/meson.build
+test cases/common/81 internal dependency/meson.build
+test cases/common/81 internal dependency/proj1/meson.build
+test cases/common/81 internal dependency/proj1/proj1f1.c
+test cases/common/81 internal dependency/proj1/proj1f2.c
+test cases/common/81 internal dependency/proj1/proj1f3.c
+test cases/common/81 internal dependency/proj1/include/proj1.h
+test cases/common/81 internal dependency/src/main.c
+test cases/common/81 internal dependency/src/meson.build
+test cases/common/82 same basename/exe1.c
+test cases/common/82 same basename/exe2.c
+test cases/common/82 same basename/lib.c
+test cases/common/82 same basename/meson.build
+test cases/common/82 same basename/sharedsub/meson.build
+test cases/common/82 same basename/staticsub/meson.build
+test cases/common/83 declare dep/main.c
+test cases/common/83 declare dep/meson.build
+test cases/common/83 declare dep/entity/entity.h
+test cases/common/83 declare dep/entity/entity1.c
+test cases/common/83 declare dep/entity/entity2.c
+test cases/common/83 declare dep/entity/meson.build
+test cases/common/84 extract all/extractor.h
+test cases/common/84 extract all/four.c
+test cases/common/84 extract all/meson.build
+test cases/common/84 extract all/one.c
+test cases/common/84 extract all/prog.c
+test cases/common/84 extract all/three.c
+test cases/common/84 extract all/two.c
+test cases/common/85 add language/meson.build
+test cases/common/85 add language/prog.c
+test cases/common/85 add language/prog.cc
+test cases/common/86 identical target name in subproject/bar.c
+test cases/common/86 identical target name in subproject/meson.build
+test cases/common/86 identical target name in subproject/subprojects/foo/bar.c
+test cases/common/86 identical target name in subproject/subprojects/foo/meson.build
+test cases/common/87 plusassign/meson.build
+test cases/common/88 skip subdir/meson.build
+test cases/common/88 skip subdir/subdir1/meson.build
+test cases/common/88 skip subdir/subdir1/subdir2/meson.build
+test cases/common/89 private include/meson.build
+test cases/common/89 private include/stlib/compiler.py
+test cases/common/89 private include/stlib/foo1.def
+test cases/common/89 private include/stlib/foo2.def
+test cases/common/89 private include/stlib/meson.build
+test cases/common/89 private include/user/libuser.c
+test cases/common/89 private include/user/meson.build
 test cases/common/9 header install/installed_files.txt
 test cases/common/9 header install/meson.build
 test cases/common/9 header install/rootdir.h
@@ -1136,51 +1353,51 @@
 test cases/common/9 header install/sub/meson.build
 test cases/common/9 header install/vanishing_subdir/meson.build
 test cases/common/9 header install/vanishing_subdir/vanished.h
-test cases/common/90 private include/meson.build
-test cases/common/90 private include/stlib/compiler.py
-test cases/common/90 private include/stlib/foo1.def
-test cases/common/90 private include/stlib/foo2.def
-test cases/common/90 private include/stlib/meson.build
-test cases/common/90 private include/user/libuser.c
-test cases/common/90 private include/user/meson.build
-test cases/common/91 default options/meson.build
-test cases/common/92 dep fallback/gensrc.py
-test cases/common/92 dep fallback/meson.build
-test cases/common/92 dep fallback/tester.c
-test cases/common/92 dep fallback/subprojects/boblib/bob.c
-test cases/common/92 dep fallback/subprojects/boblib/bob.h
-test cases/common/92 dep fallback/subprojects/boblib/genbob.py
-test cases/common/92 dep fallback/subprojects/boblib/meson.build
-test cases/common/92 dep fallback/subprojects/dummylib/meson.build
-test cases/common/93 default library/ef.cpp
-test cases/common/93 default library/ef.h
-test cases/common/93 default library/eftest.cpp
-test cases/common/93 default library/meson.build
-test cases/common/94 selfbuilt custom/data.dat
-test cases/common/94 selfbuilt custom/mainprog.cpp
-test cases/common/94 selfbuilt custom/meson.build
-test cases/common/94 selfbuilt custom/tool.cpp
-test cases/common/95 gen extra/meson.build
-test cases/common/95 gen extra/name.dat
-test cases/common/95 gen extra/name.l
-test cases/common/95 gen extra/plain.c
-test cases/common/95 gen extra/srcgen.py
-test cases/common/95 gen extra/srcgen2.py
-test cases/common/95 gen extra/srcgen3.py
-test cases/common/95 gen extra/upper.c
-test cases/common/96 benchmark/delayer.c
-test cases/common/96 benchmark/meson.build
-test cases/common/97 test workdir/meson.build
-test cases/common/97 test workdir/opener.c
-test cases/common/98 suites/exe1.c
-test cases/common/98 suites/exe2.c
-test cases/common/98 suites/meson.build
-test cases/common/98 suites/subprojects/sub/meson.build
-test cases/common/98 suites/subprojects/sub/sub1.c
-test cases/common/98 suites/subprojects/sub/sub2.c
-test cases/common/99 threads/meson.build
-test cases/common/99 threads/threadprog.c
-test cases/common/99 threads/threadprog.cpp
+test cases/common/90 default options/meson.build
+test cases/common/91 dep fallback/gensrc.py
+test cases/common/91 dep fallback/meson.build
+test cases/common/91 dep fallback/tester.c
+test cases/common/91 dep fallback/subprojects/boblib/bob.c
+test cases/common/91 dep fallback/subprojects/boblib/bob.h
+test cases/common/91 dep fallback/subprojects/boblib/genbob.py
+test cases/common/91 dep fallback/subprojects/boblib/meson.build
+test cases/common/91 dep fallback/subprojects/dummylib/meson.build
+test cases/common/92 default library/ef.cpp
+test cases/common/92 default library/ef.h
+test cases/common/92 default library/eftest.cpp
+test cases/common/92 default library/meson.build
+test cases/common/93 selfbuilt custom/data.dat
+test cases/common/93 selfbuilt custom/mainprog.cpp
+test cases/common/93 selfbuilt custom/meson.build
+test cases/common/93 selfbuilt custom/tool.cpp
+test cases/common/94 gen extra/meson.build
+test cases/common/94 gen extra/name.dat
+test cases/common/94 gen extra/name.l
+test cases/common/94 gen extra/plain.c
+test cases/common/94 gen extra/srcgen.py
+test cases/common/94 gen extra/srcgen2.py
+test cases/common/94 gen extra/srcgen3.py
+test cases/common/94 gen extra/upper.c
+test cases/common/95 benchmark/delayer.c
+test cases/common/95 benchmark/meson.build
+test cases/common/96 test workdir/meson.build
+test cases/common/96 test workdir/opener.c
+test cases/common/96 test workdir/subdir/checker.py
+test cases/common/96 test workdir/subdir/meson.build
+test cases/common/97 suites/exe1.c
+test cases/common/97 suites/exe2.c
+test cases/common/97 suites/meson.build
+test cases/common/97 suites/subprojects/sub/meson.build
+test cases/common/97 suites/subprojects/sub/sub1.c
+test cases/common/97 suites/subprojects/sub/sub2.c
+test cases/common/98 threads/meson.build
+test cases/common/98 threads/threadprog.c
+test cases/common/98 threads/threadprog.cpp
+test cases/common/99 manygen/depuser.c
+test cases/common/99 manygen/meson.build
+test cases/common/99 manygen/subdir/funcinfo.def
+test cases/common/99 manygen/subdir/manygen.py
+test cases/common/99 manygen/subdir/meson.build
 test cases/csharp/1 basic/installed_files.txt
 test cases/csharp/1 basic/meson.build
 test cases/csharp/1 basic/prog.cs
@@ -1196,6 +1413,35 @@
 test cases/csharp/4 external dep/installed_files.txt
 test cases/csharp/4 external dep/meson.build
 test cases/csharp/4 external dep/prog.cs
+test cases/cuda/1 simple/meson.build
+test cases/cuda/1 simple/prog.cu
+test cases/cuda/2 split/lib.cu
+test cases/cuda/2 split/main.cpp
+test cases/cuda/2 split/meson.build
+test cases/cuda/2 split/static/lib.cu
+test cases/cuda/2 split/static/libsta.cu
+test cases/cuda/2 split/static/main_static.cpp
+test cases/cuda/2 split/static/meson.build
+test cases/cuda/3 cudamodule/meson.build
+test cases/cuda/3 cudamodule/prog.cu
+test cases/cuda/4 shared/main.cu
+test cases/cuda/4 shared/meson.build
+test cases/cuda/4 shared/shared/kernels.cu
+test cases/cuda/4 shared/shared/kernels.h
+test cases/cuda/4 shared/shared/meson.build
+test cases/cuda/5 threads/main.cu
+test cases/cuda/5 threads/meson.build
+test cases/cuda/5 threads/shared/kernels.cu
+test cases/cuda/5 threads/shared/kernels.h
+test cases/cuda/5 threads/shared/meson.build
+test cases/cuda/6 std/main.cu
+test cases/cuda/6 std/meson.build
+test cases/cuda/7 static vs runtime/main.cu
+test cases/cuda/7 static vs runtime/meson.build
+test cases/cuda/8 release/main.cu
+test cases/cuda/8 release/meson.build
+test cases/cuda/9 optimize for space/main.cu
+test cases/cuda/9 optimize for space/meson.build
 test cases/d/1 simple/app.d
 test cases/d/1 simple/installed_files.txt
 test cases/d/1 simple/meson.build
@@ -1247,6 +1493,11 @@
 test cases/failing build/2 hidden symbol/bob.h
 test cases/failing build/2 hidden symbol/bobuser.c
 test cases/failing build/2 hidden symbol/meson.build
+test cases/failing build/3 pch disabled/meson.build
+test cases/failing build/3 pch disabled/c/meson.build
+test cases/failing build/3 pch disabled/c/prog.c
+test cases/failing build/3 pch disabled/c/pch/prog.h
+test cases/failing build/3 pch disabled/c/pch/prog_pch.c
 test cases/failing test/1 trivial/main.c
 test cases/failing test/1 trivial/meson.build
 test cases/failing test/2 signal/main.c
@@ -1254,6 +1505,12 @@
 test cases/failing test/3 ambiguous/main.c
 test cases/failing test/3 ambiguous/meson.build
 test cases/failing test/3 ambiguous/test_runner.sh
+test cases/failing test/4 hard error/main.c
+test cases/failing test/4 hard error/meson.build
+test cases/failing test/5 tap tests/meson.build
+test cases/failing test/5 tap tests/tester.c
+test cases/failing test/6 xpass/meson.build
+test cases/failing test/6 xpass/xpass.c
 test cases/failing/1 project not first/meson.build
 test cases/failing/1 project not first/prog.c
 test cases/failing/10 out of bounds/meson.build
@@ -1420,28 +1677,63 @@
 test cases/failing/86 dub libray/meson.build
 test cases/failing/87 dub executable/meson.build
 test cases/failing/88 dub compiler/meson.build
-test cases/failing/89 link_with custom target/demo.c
-test cases/failing/89 link_with custom target/foo.c
-test cases/failing/89 link_with custom target/lib_generator.py
-test cases/failing/89 link_with custom target/meson.build
+test cases/failing/89 subproj not-found dep/meson.build
+test cases/failing/89 subproj not-found dep/subprojects/somesubproj/meson.build
 test cases/failing/9 missing extra file/meson.build
 test cases/failing/9 missing extra file/prog.c
-test cases/failing/90 subproj not-found dep/meson.build
-test cases/failing/90 subproj not-found dep/subprojects/somesubproj/meson.build
+test cases/failing/90 invalid configure file/input
+test cases/failing/90 invalid configure file/meson.build
 test cases/failing/91 kwarg dupe/meson.build
 test cases/failing/91 kwarg dupe/prog.c
+test cases/failing/92 missing pch file/meson.build
+test cases/failing/92 missing pch file/prog.c
+test cases/failing/93 pch source different folder/meson.build
+test cases/failing/93 pch source different folder/prog.c
+test cases/failing/93 pch source different folder/include/pch.h
+test cases/failing/93 pch source different folder/src/pch.c
+test cases/failing/94 vala without c/meson.build
+test cases/failing/95 unknown config tool/meson.build
+test cases/failing/96 custom target install data/Info.plist.cpp
+test cases/failing/96 custom target install data/meson.build
+test cases/failing/96 custom target install data/preproc.py
 test cases/fortran/1 basic/meson.build
 test cases/fortran/1 basic/simple.f90
 test cases/fortran/10 find library/gzip.f90
 test cases/fortran/10 find library/main.f90
 test cases/fortran/10 find library/meson.build
+test cases/fortran/11 compiles links runs/meson.build
+test cases/fortran/12 submodule/a1.f90
+test cases/fortran/12 submodule/a2.f90
+test cases/fortran/12 submodule/a3.f90
+test cases/fortran/12 submodule/child.f90
+test cases/fortran/12 submodule/meson.build
+test cases/fortran/12 submodule/parent.f90
+test cases/fortran/13 coarray/main.f90
+test cases/fortran/13 coarray/meson.build
+test cases/fortran/14 fortran links c/clib.c
+test cases/fortran/14 fortran links c/clib.def
+test cases/fortran/14 fortran links c/f_call_c.f90
+test cases/fortran/14 fortran links c/meson.build
+test cases/fortran/15 include/inc1.f90
+test cases/fortran/15 include/inc2.f90
+test cases/fortran/15 include/include_hierarchy.f90
+test cases/fortran/15 include/include_syntax.f90
+test cases/fortran/15 include/include_tests.f90
+test cases/fortran/15 include/meson.build
+test cases/fortran/15 include/timestwo.f90
+test cases/fortran/16 openmp/main.f90
+test cases/fortran/16 openmp/meson.build
+test cases/fortran/2 modules/comment_mod.f90
 test cases/fortran/2 modules/meson.build
+test cases/fortran/2 modules/mymod.f90
 test cases/fortran/2 modules/prog.f90
-test cases/fortran/2 modules/stuff.f90
 test cases/fortran/3 module procedure/meson.build
-test cases/fortran/3 module procedure/prog.f90
+test cases/fortran/3 module procedure/use_syntax.f90
 test cases/fortran/4 self dependency/meson.build
 test cases/fortran/4 self dependency/selfdep.f90
+test cases/fortran/4 self dependency/src/selfdep_mod.f90
+test cases/fortran/4 self dependency/subprojects/sub1/main.f90
+test cases/fortran/4 self dependency/subprojects/sub1/meson.build
 test cases/fortran/5 static/main.f90
 test cases/fortran/5 static/meson.build
 test cases/fortran/5 static/static_hello.f90
@@ -1466,6 +1758,8 @@
 test cases/frameworks/1 boost/linkexe.cc
 test cases/frameworks/1 boost/meson.build
 test cases/frameworks/1 boost/nomod.cpp
+test cases/frameworks/1 boost/python_module.cpp
+test cases/frameworks/1 boost/test_python_module.py
 test cases/frameworks/1 boost/unit_test.cpp
 test cases/frameworks/1 boost/partial_dep/foo.cpp
 test cases/frameworks/1 boost/partial_dep/foo.hpp
@@ -1476,6 +1770,14 @@
 test cases/frameworks/10 gtk-doc/doc/foobar-docs.sgml
 test cases/frameworks/10 gtk-doc/doc/meson.build
 test cases/frameworks/10 gtk-doc/doc/version.xml.in
+test cases/frameworks/10 gtk-doc/doc/foobar1/foobar-docs.sgml
+test cases/frameworks/10 gtk-doc/doc/foobar1/meson.build
+test cases/frameworks/10 gtk-doc/doc/foobar2/foobar-docs.sgml
+test cases/frameworks/10 gtk-doc/doc/foobar2/meson.build
+test cases/frameworks/10 gtk-doc/doc/foobar3/foobar-docs.sgml
+test cases/frameworks/10 gtk-doc/doc/foobar3/meson.build
+test cases/frameworks/10 gtk-doc/doc/foobar4/foobar-docs.sgml
+test cases/frameworks/10 gtk-doc/doc/foobar4/meson.build
 test cases/frameworks/10 gtk-doc/include/foo-version.h.in
 test cases/frameworks/10 gtk-doc/include/foo.h
 test cases/frameworks/10 gtk-doc/include/generate-enums-docbook.py
@@ -1519,12 +1821,10 @@
 test cases/frameworks/15 llvm/sum.c
 test cases/frameworks/16 sdl2/meson.build
 test cases/frameworks/16 sdl2/sdl2prog.c
-test cases/frameworks/17 mpi/is_broken_ubuntu.py
 test cases/frameworks/17 mpi/main.c
 test cases/frameworks/17 mpi/main.cpp
 test cases/frameworks/17 mpi/main.f90
 test cases/frameworks/17 mpi/meson.build
-test cases/frameworks/17 mpi/meson.build.orig
 test cases/frameworks/18 vulkan/meson.build
 test cases/frameworks/18 vulkan/vulkanprog.c
 test cases/frameworks/19 pcap/meson.build
@@ -1552,6 +1852,22 @@
 test cases/frameworks/23 hotdoc/doc/sitemap.txt
 test cases/frameworks/24 libgcrypt/libgcrypt_prog.c
 test cases/frameworks/24 libgcrypt/meson.build
+test cases/frameworks/25 hdf5/main.c
+test cases/frameworks/25 hdf5/main.cpp
+test cases/frameworks/25 hdf5/main.f90
+test cases/frameworks/25 hdf5/meson.build
+test cases/frameworks/26 netcdf/main.c
+test cases/frameworks/26 netcdf/main.cpp
+test cases/frameworks/26 netcdf/main.f90
+test cases/frameworks/26 netcdf/meson.build
+test cases/frameworks/27 gpgme/gpgme_prog.c
+test cases/frameworks/27 gpgme/meson.build
+test cases/frameworks/28 gir link order 2/meson-sample.c
+test cases/frameworks/28 gir link order 2/meson-sample.h
+test cases/frameworks/28 gir link order 2/meson.build
+test cases/frameworks/28 gir link order 2/samelibname/meson.build
+test cases/frameworks/29 blocks/main.c
+test cases/frameworks/29 blocks/meson.build
 test cases/frameworks/3 gmock/gmocktest.cc
 test cases/frameworks/3 gmock/meson.build
 test cases/frameworks/4 qt/main.cpp
@@ -1610,6 +1926,7 @@
 test cases/frameworks/6 gettext/po/fi.po
 test cases/frameworks/6 gettext/po/intltest.pot
 test cases/frameworks/6 gettext/po/meson.build
+test cases/frameworks/6 gettext/po/ru.po
 test cases/frameworks/6 gettext/src/intlmain.c
 test cases/frameworks/6 gettext/src/meson.build
 test cases/frameworks/7 gnome/installed_files.txt
@@ -1698,6 +2015,16 @@
 test cases/java/8 codegen custom target/com/mesonbuild/Simple.java
 test cases/java/8 codegen custom target/com/mesonbuild/TextPrinter.java
 test cases/java/8 codegen custom target/com/mesonbuild/meson.build
+test cases/kconfig/1 basic/.config
+test cases/kconfig/1 basic/meson.build
+test cases/kconfig/2 subdir/.config
+test cases/kconfig/2 subdir/meson.build
+test cases/kconfig/2 subdir/dir/meson.build
+test cases/kconfig/3 load_config files/meson.build
+test cases/kconfig/3 load_config files/dir/config
+test cases/kconfig/3 load_config files/dir/meson.build
+test cases/kconfig/4 load_config builddir/config
+test cases/kconfig/4 load_config builddir/meson.build
 test cases/linuxlike/1 pkg-config/meson.build
 test cases/linuxlike/1 pkg-config/prog-checkver.c
 test cases/linuxlike/1 pkg-config/prog.c
@@ -1721,7 +2048,15 @@
 test cases/linuxlike/13 cmake dependency/meson.build
 test cases/linuxlike/13 cmake dependency/prog-checkver.c
 test cases/linuxlike/13 cmake dependency/prog.c
+test cases/linuxlike/13 cmake dependency/setup_env.json
+test cases/linuxlike/13 cmake dependency/testFlagSet.c
+test cases/linuxlike/13 cmake dependency/cmake/FindImportedTarget.cmake
+test cases/linuxlike/13 cmake dependency/cmake/FindSomethingLikeZLIB.cmake
+test cases/linuxlike/13 cmake dependency/cmake_pref_env/lib/cmake/cmMesonTestDep/cmMesonTestDepConfig.cmake
 test cases/linuxlike/13 cmake dependency/incdir/myinc.h
+test cases/linuxlike/14 static dynamic linkage/main.c
+test cases/linuxlike/14 static dynamic linkage/meson.build
+test cases/linuxlike/14 static dynamic linkage/verify_static.py
 test cases/linuxlike/2 external library/meson.build
 test cases/linuxlike/2 external library/prog.c
 test cases/linuxlike/3 linker script/bob.c
@@ -1779,12 +2114,49 @@
 test cases/osx/2 library versions/installed_files.txt
 test cases/osx/2 library versions/lib.c
 test cases/osx/2 library versions/meson.build
+test cases/osx/2 library versions/require_pkgconfig.py
 test cases/osx/3 has function xcode8/meson.build
 test cases/osx/4 framework/installed_files.txt
 test cases/osx/4 framework/meson.build
 test cases/osx/4 framework/prog.c
 test cases/osx/4 framework/stat.c
 test cases/osx/4 framework/xcode-frameworks.png
+test cases/osx/5 extra frameworks/installed_files.txt
+test cases/osx/5 extra frameworks/meson.build
+test cases/osx/5 extra frameworks/prog.c
+test cases/osx/5 extra frameworks/stat.c
+test cases/osx/6 multiframework/main.m
+test cases/osx/6 multiframework/meson.build
+test cases/osx/7 bitcode/libbar.mm
+test cases/osx/7 bitcode/libfile.c
+test cases/osx/7 bitcode/libfoo.m
+test cases/osx/7 bitcode/meson.build
+test cases/osx/7 bitcode/vis.h
+test cases/python/1 basic/meson.build
+test cases/python/1 basic/prog.py
+test cases/python/1 basic/gluon/__init__.py
+test cases/python/1 basic/gluon/gluonator.py
+test cases/python/1 basic/subdir/meson.build
+test cases/python/1 basic/subdir/subprog.py
+test cases/python/2 extmodule/blaster.py
+test cases/python/2 extmodule/meson.build
+test cases/python/2 extmodule/ext/meson.build
+test cases/python/2 extmodule/ext/tachyon_module.c
+test cases/python/3 cython/cytest.py
+test cases/python/3 cython/meson.build
+test cases/python/3 cython/libdir/cstorer.pxd
+test cases/python/3 cython/libdir/meson.build
+test cases/python/3 cython/libdir/storer.c
+test cases/python/3 cython/libdir/storer.h
+test cases/python/3 cython/libdir/storer.pyx
+test cases/python/4 custom target depends extmodule/blaster.py
+test cases/python/4 custom target depends extmodule/meson.build
+test cases/python/4 custom target depends extmodule/ext/meson.build
+test cases/python/4 custom target depends extmodule/ext/tachyon_module.c
+test cases/python/4 custom target depends extmodule/ext/lib/meson-tachyonlib.c
+test cases/python/4 custom target depends extmodule/ext/lib/meson-tachyonlib.h
+test cases/python/4 custom target depends extmodule/ext/lib/meson.build
+test cases/python/5 modules kwarg/meson.build
 test cases/python3/1 basic/meson.build
 test cases/python3/1 basic/prog.py
 test cases/python3/1 basic/gluon/__init__.py
@@ -1809,13 +2181,33 @@
 test cases/python3/4 custom target depends extmodule/ext/lib/meson-tachyonlib.c
 test cases/python3/4 custom target depends extmodule/ext/lib/meson-tachyonlib.h
 test cases/python3/4 custom target depends extmodule/ext/lib/meson.build
-test cases/rewrite/1 basic/added.txt
+test cases/rewrite/1 basic/addSrc.json
+test cases/rewrite/1 basic/addTgt.json
+test cases/rewrite/1 basic/info.json
 test cases/rewrite/1 basic/meson.build
-test cases/rewrite/1 basic/removed.txt
+test cases/rewrite/1 basic/rmSrc.json
+test cases/rewrite/1 basic/rmTgt.json
+test cases/rewrite/2 subdirs/addSrc.json
+test cases/rewrite/2 subdirs/addTgt.json
+test cases/rewrite/2 subdirs/info.json
 test cases/rewrite/2 subdirs/meson.build
-test cases/rewrite/2 subdirs/sub1/after.txt
+test cases/rewrite/2 subdirs/rmTgt.json
 test cases/rewrite/2 subdirs/sub1/meson.build
 test cases/rewrite/2 subdirs/sub2/meson.build
+test cases/rewrite/3 kwargs/add.json
+test cases/rewrite/3 kwargs/defopts_delete.json
+test cases/rewrite/3 kwargs/defopts_set.json
+test cases/rewrite/3 kwargs/delete.json
+test cases/rewrite/3 kwargs/info.json
+test cases/rewrite/3 kwargs/meson.build
+test cases/rewrite/3 kwargs/remove.json
+test cases/rewrite/3 kwargs/remove_regex.json
+test cases/rewrite/3 kwargs/set.json
+test cases/rewrite/4 same name targets/addSrc.json
+test cases/rewrite/4 same name targets/info.json
+test cases/rewrite/4 same name targets/meson.build
+test cases/rewrite/4 same name targets/sub1/meson.build
+test cases/rewrite/5 sorting/meson.build
 test cases/rust/1 basic/installed_files.txt
 test cases/rust/1 basic/meson.build
 test cases/rust/1 basic/prog.rs
@@ -1936,6 +2328,8 @@
 test cases/unit/2 testsetups/meson.build
 test cases/unit/20 subproj dep variables/meson.build
 test cases/unit/20 subproj dep variables/subprojects/failingsubproj/meson.build
+test cases/unit/20 subproj dep variables/subprojects/nestedsubproj/meson.build
+test cases/unit/20 subproj dep variables/subprojects/nestedsubproj/subprojects/subsubproject.wrap
 test cases/unit/20 subproj dep variables/subprojects/somesubproj/meson.build
 test cases/unit/21 exit status/meson.build
 test cases/unit/22 warning location/a.c
@@ -2057,32 +2451,132 @@
 test cases/unit/46 native dep pkgconfig var/meson_options.txt
 test cases/unit/46 native dep pkgconfig var/cross_pkgconfig/dep_tester.pc
 test cases/unit/46 native dep pkgconfig var/native_pkgconfig/dep_tester.pc
-test cases/unit/46 native file binary/meson.build
-test cases/unit/46 native file binary/meson_options.txt
-test cases/unit/46 reconfigure/main.c
-test cases/unit/46 reconfigure/meson.build
-test cases/unit/46 reconfigure/meson_options.txt
-test cases/unit/47 testsetup default/envcheck.py
-test cases/unit/47 testsetup default/meson.build
-test cases/unit/48 pkgconfig csharp library/meson.build
-test cases/unit/48 pkgconfig csharp library/somelib.cs
-test cases/unit/49 ldflagdedup/bob.c
-test cases/unit/49 ldflagdedup/meson.build
-test cases/unit/49 ldflagdedup/prog.c
+test cases/unit/47 native file binary/meson.build
+test cases/unit/47 native file binary/meson_options.txt
+test cases/unit/48 reconfigure/main.c
+test cases/unit/48 reconfigure/meson.build
+test cases/unit/48 reconfigure/meson_options.txt
+test cases/unit/49 testsetup default/envcheck.py
+test cases/unit/49 testsetup default/meson.build
 test cases/unit/5 compiler detection/compiler wrapper.py
 test cases/unit/5 compiler detection/meson.build
 test cases/unit/5 compiler detection/trivial.c
 test cases/unit/5 compiler detection/trivial.cc
 test cases/unit/5 compiler detection/trivial.m
 test cases/unit/5 compiler detection/trivial.mm
+test cases/unit/50 pkgconfig csharp library/meson.build
+test cases/unit/50 pkgconfig csharp library/somelib.cs
+test cases/unit/51 noncross options/meson.build
+test cases/unit/51 noncross options/prog.c
+test cases/unit/51 noncross options/ylib.pc
+test cases/unit/52 ldflagdedup/bob.c
+test cases/unit/52 ldflagdedup/meson.build
+test cases/unit/52 ldflagdedup/prog.c
+test cases/unit/53 pkgconfig static link order/meson.build
+test cases/unit/54 clang-format/.clang-format
+test cases/unit/54 clang-format/header_expected_h
+test cases/unit/54 clang-format/header_orig_h
+test cases/unit/54 clang-format/meson.build
+test cases/unit/54 clang-format/prog_expected_c
+test cases/unit/54 clang-format/prog_orig_c
+test cases/unit/55 introspect buildoptions/subprojects/projectBad/meson.build
+test cases/unit/55 introspect buildoptions/subprojects/projectBad/meson_options.txt
+test cases/unit/56 dedup compiler libs/meson.build
+test cases/unit/56 dedup compiler libs/app/app.c
+test cases/unit/56 dedup compiler libs/app/meson.build
+test cases/unit/56 dedup compiler libs/liba/liba.c
+test cases/unit/56 dedup compiler libs/liba/liba.h
+test cases/unit/56 dedup compiler libs/liba/meson.build
+test cases/unit/56 dedup compiler libs/libb/libb.c
+test cases/unit/56 dedup compiler libs/libb/libb.h
+test cases/unit/56 dedup compiler libs/libb/meson.build
+test cases/unit/57 introspection/meson.build
+test cases/unit/57 introspection/meson_options.txt
+test cases/unit/57 introspection/t1.cpp
+test cases/unit/57 introspection/t2.cpp
+test cases/unit/57 introspection/t3.cpp
+test cases/unit/57 introspection/sharedlib/meson.build
+test cases/unit/57 introspection/sharedlib/shared.cpp
+test cases/unit/57 introspection/sharedlib/shared.hpp
+test cases/unit/57 introspection/staticlib/meson.build
+test cases/unit/57 introspection/staticlib/static.c
+test cases/unit/57 introspection/staticlib/static.h
+test cases/unit/58 pkg_config_path option/meson.build
+test cases/unit/58 pkg_config_path option/build_extra_path/totally_made_up_dep.pc
+test cases/unit/58 pkg_config_path option/host_extra_path/totally_made_up_dep.pc
+test cases/unit/59 introspect buildoptions/c_compiler.py
+test cases/unit/59 introspect buildoptions/main.c
+test cases/unit/59 introspect buildoptions/meson.build
+test cases/unit/59 introspect buildoptions/meson_options.txt
+test cases/unit/59 introspect buildoptions/subprojects/evilFile.txt
+test cases/unit/59 introspect buildoptions/subprojects/projectA/meson.build
+test cases/unit/59 introspect buildoptions/subprojects/projectA/meson_options.txt
+test cases/unit/59 introspect buildoptions/subprojects/projectBad/meson.build
+test cases/unit/59 introspect buildoptions/subprojects/projectBad/meson_options.txt
 test cases/unit/6 std override/meson.build
 test cases/unit/6 std override/prog11.cpp
 test cases/unit/6 std override/prog98.cpp
 test cases/unit/6 std override/progp.cpp
+test cases/unit/60 native file override/crossfile
+test cases/unit/60 native file override/crossfile2
+test cases/unit/60 native file override/meson.build
+test cases/unit/60 native file override/meson_options.txt
+test cases/unit/60 native file override/nativefile
+test cases/unit/61 identity cross/build_wrapper.py
+test cases/unit/61 identity cross/host_wrapper.py
+test cases/unit/61 identity cross/meson.build
+test cases/unit/61 identity cross/stuff.h
+test cases/unit/62 pkgconfig relative paths/pkgconfig/librelativepath.pc
+test cases/unit/63 test env does not stack/meson.build
+test cases/unit/63 test env does not stack/script.py
+test cases/unit/64 cmake_prefix_path/meson.build
+test cases/unit/64 cmake_prefix_path/prefix/lib/cmake/mesontest/mesontest-config.cmake
+test cases/unit/65 cmake parser/meson.build
+test cases/unit/65 cmake parser/prefix/lib/cmake/mesontest/mesontest-config.cmake
+test cases/unit/66 alias target/main.c
+test cases/unit/66 alias target/meson.build
+test cases/unit/68 static archive stripping/app/appA.c
+test cases/unit/68 static archive stripping/app/appB.c
+test cases/unit/68 static archive stripping/app/meson.build
+test cases/unit/68 static archive stripping/lib/libA.c
+test cases/unit/68 static archive stripping/lib/libA.h
+test cases/unit/68 static archive stripping/lib/libB.c
+test cases/unit/68 static archive stripping/lib/libB.h
+test cases/unit/68 static archive stripping/lib/meson.build
+test cases/unit/69 static link/meson.build
+test cases/unit/69 static link/test1.c
+test cases/unit/69 static link/test2.c
+test cases/unit/69 static link/test3.c
+test cases/unit/69 static link/test4.c
+test cases/unit/69 static link/test5.c
+test cases/unit/69 static link/lib/func1.c
+test cases/unit/69 static link/lib/func10.c
+test cases/unit/69 static link/lib/func11.c
+test cases/unit/69 static link/lib/func12.c
+test cases/unit/69 static link/lib/func14.c
+test cases/unit/69 static link/lib/func15.c
+test cases/unit/69 static link/lib/func16.c
+test cases/unit/69 static link/lib/func17.c
+test cases/unit/69 static link/lib/func18.c
+test cases/unit/69 static link/lib/func19.c
+test cases/unit/69 static link/lib/func2.c
+test cases/unit/69 static link/lib/func3.c
+test cases/unit/69 static link/lib/func4.c
+test cases/unit/69 static link/lib/func5.c
+test cases/unit/69 static link/lib/func6.c
+test cases/unit/69 static link/lib/func7.c
+test cases/unit/69 static link/lib/func8.c
+test cases/unit/69 static link/lib/func9.c
+test cases/unit/69 static link/lib/meson.build
+test cases/unit/69 test env value/meson.build
+test cases/unit/69 test env value/test.py
 test cases/unit/7 run installed/meson.build
 test cases/unit/7 run installed/prog.c
 test cases/unit/7 run installed/foo/foo.c
 test cases/unit/7 run installed/foo/meson.build
+test cases/unit/70 clang-tidy/.clang-tidy
+test cases/unit/70 clang-tidy/cttest.cpp
+test cases/unit/70 clang-tidy/meson.build
 test cases/unit/8 -L -l order/first.pc
 test cases/unit/8 -L -l order/meson.build
 test cases/unit/8 -L -l order/prog.c
@@ -2207,6 +2701,11 @@
 test cases/vala/9 gir/foo.vala
 test cases/vala/9 gir/installed_files.txt
 test cases/vala/9 gir/meson.build
+test cases/warning/1 version for string div/meson.build
+test cases/warning/1 version for string div/a/b.c
+test cases/wasm/1 basic/hello.cpp
+test cases/wasm/1 basic/hello.html
+test cases/wasm/1 basic/meson.build
 test cases/windows/1 basic/installed_files.txt
 test cases/windows/1 basic/meson.build
 test cases/windows/1 basic/prog.c
@@ -2275,6 +2774,7 @@
 test cases/windows/5 resources/prog.c
 test cases/windows/5 resources/inc/meson.build
 test cases/windows/5 resources/inc/resource/resource.h
+test cases/windows/5 resources/res/dummy.c
 test cases/windows/5 resources/res/meson.build
 test cases/windows/5 resources/res/myres.rc
 test cases/windows/5 resources/res/sample.ico
diff -Nru meson-0.49.0/PKG-INFO meson-0.52.1/PKG-INFO
--- meson-0.49.0/PKG-INFO	2018-12-09 20:02:29.000000000 +0000
+++ meson-0.52.1/PKG-INFO	2019-11-29 13:51:14.000000000 +0000
@@ -1,15 +1,13 @@
-Metadata-Version: 1.2
+Metadata-Version: 2.1
 Name: meson
-Version: 0.49.0
+Version: 0.52.1
 Summary: A high performance build system
-Home-page: http://mesonbuild.com
+Home-page: https://mesonbuild.com
 Author: Jussi Pakkanen
 Author-email: jpakkane@gmail.com
-License:  Apache License, Version 2.0
-Description: Meson is a cross-platform build system designed to be both as
-            fast and as user friendly as possible. It supports many languages and compilers, including
-            GCC, Clang and Visual Studio. Its build definitions are written in a simple non-turing
-            complete DSL.
+License: Apache License, Version 2.0
+Description: Meson is a cross-platform build system designed to be both as fast and as user friendly as possible. It supports many languages and compilers, including GCC, Clang, PGI, Intel, and Visual Studio. Its build definitions are written in a simple non-Turing complete DSL.
+Keywords: meson,mesonbuild,build system,cmake
 Platform: UNKNOWN
 Classifier: Development Status :: 5 - Production/Stable
 Classifier: Environment :: Console
@@ -21,5 +19,10 @@
 Classifier: Operating System :: POSIX :: BSD
 Classifier: Operating System :: POSIX :: Linux
 Classifier: Programming Language :: Python :: 3 :: Only
+Classifier: Programming Language :: Python :: 3.5
+Classifier: Programming Language :: Python :: 3.6
+Classifier: Programming Language :: Python :: 3.7
+Classifier: Programming Language :: Python :: 3.8
 Classifier: Topic :: Software Development :: Build Tools
-Requires-Python: >=3.5
+Requires-Python: >=3.5.2
+Provides-Extra: progress
diff -Nru meson-0.49.0/README.md meson-0.52.1/README.md
--- meson-0.49.0/README.md	2018-12-09 14:27:23.000000000 +0000
+++ meson-0.52.1/README.md	2019-11-28 17:37:44.000000000 +0000
@@ -1,5 +1,5 @@
 

- +

Meson® is a project to create the best possible next-generation build system. @@ -8,7 +8,6 @@ [![PyPI](https://img.shields.io/pypi/v/meson.svg)](https://pypi.python.org/pypi/meson) [![Travis](https://travis-ci.org/mesonbuild/meson.svg?branch=master)](https://travis-ci.org/mesonbuild/meson) -[![Appveyor](https://ci.appveyor.com/api/projects/status/7jfaotriu8d8ncov?svg=true)](https://ci.appveyor.com/project/mesonbuild/meson) [![Build Status](https://dev.azure.com/jussi0947/jussi/_apis/build/status/mesonbuild.meson)](https://dev.azure.com/jussi0947/jussi/_build/latest?definitionId=1) [![Codecov](https://codecov.io/gh/mesonbuild/meson/coverage.svg?branch=master)](https://codecov.io/gh/mesonbuild/meson/branch/master) [![Code Quality: Python](https://img.shields.io/lgtm/grade/python/g/mesonbuild/meson.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/mesonbuild/meson/context:python) @@ -16,7 +15,7 @@ #### Dependencies - - [Python](http://python.org) (version 3.5 or newer) + - [Python](https://python.org) (version 3.5 or newer) - [Ninja](https://ninja-build.org) (version 1.5 or newer) #### Installing from source @@ -30,14 +29,15 @@ [PyPi](https://pypi.python.org/pypi/meson), so it can be installed with `pip3 install meson` (this does not require a source checkout, pip will download the package automatically). The exact command to -type to install with pip can vary between systems, be sure to use the -Python 3 version of pip. +type to install with Pip can vary between systems, be sure to use the +Python 3 version of Pip. #### Running Meson requires that you have a source directory and a build directory -and that these two are different. In your source root must exist a file -called 'meson.build'. To generate the build system run this command: +and that these two are different. In your source root must exist a +file called `meson.build`. To generate the build system run this +command: `meson ` @@ -68,7 +68,8 @@ #### Contributing -We love code contributions. See the [contributing.md](contributing.md) file for +We love code contributions. See the [contribution +page](https://mesonbuild.com/Contributing.html) on the web site for details. @@ -84,6 +85,6 @@ #### Further info More information about the Meson build system can be found at the -[project's home page](http://mesonbuild.com). +[project's home page](https://mesonbuild.com). Meson is a registered trademark of Jussi Pakkanen. diff -Nru meson-0.49.0/run_cross_test.py meson-0.52.1/run_cross_test.py --- meson-0.49.0/run_cross_test.py 2018-12-09 14:27:16.000000000 +0000 +++ meson-0.52.1/run_cross_test.py 2019-04-17 08:08:43.000000000 +0000 @@ -34,7 +34,7 @@ commontests = [('common', gather_tests(Path('test cases', 'common')), False)] try: (passing_tests, failing_tests, skipped_tests) = \ - run_tests(commontests, 'meson-cross-test-run', failfast, ['--cross', cross_file]) + run_tests(commontests, 'meson-cross-test-run', failfast, ['--cross-file', cross_file]) except StopException: pass print('\nTotal passed cross tests:', passing_tests) diff -Nru meson-0.49.0/run_meson_command_tests.py meson-0.52.1/run_meson_command_tests.py --- meson-0.49.0/run_meson_command_tests.py 2018-12-09 14:27:16.000000000 +0000 +++ meson-0.52.1/run_meson_command_tests.py 2019-08-28 17:15:39.000000000 +0000 @@ -142,6 +142,8 @@ s = p.as_posix() if 'mesonbuild' not in s: continue + if '/data/' in s: + continue have.add(s[s.rfind('mesonbuild'):]) self.assertEqual(have, expect) # Run `meson` diff -Nru meson-0.49.0/run_project_tests.py meson-0.52.1/run_project_tests.py --- meson-0.49.0/run_project_tests.py 2018-12-09 14:27:16.000000000 +0000 +++ meson-0.52.1/run_project_tests.py 2019-11-28 17:37:44.000000000 +0000 @@ -14,6 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +import typing import itertools import os import subprocess @@ -27,12 +28,14 @@ from pathlib import Path, PurePath from mesonbuild import build from mesonbuild import environment +from mesonbuild import compilers from mesonbuild import mesonlib from mesonbuild import mlog from mesonbuild import mtest -from mesonbuild.mesonlib import stringlistify, Popen_safe +from mesonbuild.mesonlib import MachineChoice, stringlistify, Popen_safe from mesonbuild.coredata import backendlist import argparse +import json import xml.etree.ElementTree as ET import time import multiprocessing @@ -106,33 +109,26 @@ compile_commands, clean_commands, test_commands, install_commands, \ uninstall_commands = get_backend_commands(backend, do_debug) -def get_relative_files_list_from_dir(fromdir): - paths = [] - for (root, _, files) in os.walk(fromdir): - reldir = os.path.relpath(root, start=fromdir) - for f in files: - path = os.path.join(reldir, f).replace('\\', '/') - if path.startswith('./'): - path = path[2:] - paths.append(path) - return paths +def get_relative_files_list_from_dir(fromdir: Path) -> typing.List[Path]: + return [file.relative_to(fromdir) for file in fromdir.rglob('*') if file.is_file()] -def platform_fix_name(fname, compiler, env): +def platform_fix_name(fname: str, compiler, env) -> str: # canonicalize compiler - if compiler == 'clang-cl': + if (compiler in {'clang-cl', 'intel-cl'} or + (env.machines.host.is_windows() and compiler == 'pgi')): canonical_compiler = 'msvc' else: canonical_compiler = compiler if '?lib' in fname: - if mesonlib.for_windows(env.is_cross_build(), env) and canonical_compiler == 'msvc': + if env.machines.host.is_windows() and canonical_compiler == 'msvc': fname = re.sub(r'lib/\?lib(.*)\.', r'bin/\1.', fname) fname = re.sub(r'/\?lib/', r'/bin/', fname) - elif mesonlib.for_windows(env.is_cross_build(), env): + elif env.machines.host.is_windows(): fname = re.sub(r'lib/\?lib(.*)\.', r'bin/lib\1.', fname) fname = re.sub(r'\?lib(.*)\.dll$', r'lib\1.dll', fname) fname = re.sub(r'/\?lib/', r'/bin/', fname) - elif mesonlib.for_cygwin(env.is_cross_build(), env): + elif env.machines.host.is_cygwin(): fname = re.sub(r'lib/\?lib(.*)\.so$', r'bin/cyg\1.dll', fname) fname = re.sub(r'lib/\?lib(.*)\.', r'bin/cyg\1.', fname) fname = re.sub(r'\?lib(.*)\.dll$', r'cyg\1.dll', fname) @@ -142,7 +138,7 @@ if fname.endswith('?exe'): fname = fname[:-4] - if mesonlib.for_windows(env.is_cross_build(), env) or mesonlib.for_cygwin(env.is_cross_build(), env): + if env.machines.host.is_windows() or env.machines.host.is_cygwin(): return fname + '.exe' if fname.startswith('?msvc:'): @@ -157,70 +153,80 @@ if fname.startswith('?cygwin:'): fname = fname[8:] - if not mesonlib.for_cygwin(env.is_cross_build(), env): + if not env.machines.host.is_cygwin(): + return None + + if fname.startswith('?!cygwin:'): + fname = fname[9:] + if env.machines.host.is_cygwin(): return None if fname.endswith('?so'): - if mesonlib.for_windows(env.is_cross_build(), env) and canonical_compiler == 'msvc': + if env.machines.host.is_windows() and canonical_compiler == 'msvc': fname = re.sub(r'lib/([^/]*)\?so$', r'bin/\1.dll', fname) fname = re.sub(r'/(?:lib|)([^/]*?)\?so$', r'/\1.dll', fname) return fname - elif mesonlib.for_windows(env.is_cross_build(), env): + elif env.machines.host.is_windows(): fname = re.sub(r'lib/([^/]*)\?so$', r'bin/\1.dll', fname) fname = re.sub(r'/([^/]*?)\?so$', r'/\1.dll', fname) return fname - elif mesonlib.for_cygwin(env.is_cross_build(), env): + elif env.machines.host.is_cygwin(): fname = re.sub(r'lib/([^/]*)\?so$', r'bin/\1.dll', fname) fname = re.sub(r'/lib([^/]*?)\?so$', r'/cyg\1.dll', fname) fname = re.sub(r'/([^/]*?)\?so$', r'/\1.dll', fname) return fname - elif mesonlib.for_darwin(env.is_cross_build(), env): + elif env.machines.host.is_darwin(): return fname[:-3] + '.dylib' else: return fname[:-3] + '.so' if fname.endswith('?implib') or fname.endswith('?implibempty'): - if mesonlib.for_windows(env.is_cross_build(), env) and canonical_compiler == 'msvc': + if env.machines.host.is_windows() and canonical_compiler == 'msvc': # only MSVC doesn't generate empty implibs if fname.endswith('?implibempty') and compiler == 'msvc': return None return re.sub(r'/(?:lib|)([^/]*?)\?implib(?:empty|)$', r'/\1.lib', fname) - elif mesonlib.for_windows(env.is_cross_build(), env) or mesonlib.for_cygwin(env.is_cross_build(), env): + elif env.machines.host.is_windows() or env.machines.host.is_cygwin(): return re.sub(r'\?implib(?:empty|)$', r'.dll.a', fname) else: return None return fname -def validate_install(srcdir, installdir, compiler, env): +def validate_install(srcdir: str, installdir: Path, compiler, env) -> str: # List of installed files - info_file = os.path.join(srcdir, 'installed_files.txt') + info_file = Path(srcdir) / 'installed_files.txt' + installdir = Path(installdir) # If this exists, the test does not install any other files - noinst_file = 'usr/no-installed-files' - expected = {} + noinst_file = Path('usr/no-installed-files') + expected = {} # type: typing.Dict[Path, bool] ret_msg = '' # Generate list of expected files - if os.path.exists(os.path.join(installdir, noinst_file)): + if (installdir / noinst_file).is_file(): expected[noinst_file] = False - elif os.path.exists(info_file): - with open(info_file) as f: + elif info_file.is_file(): + with info_file.open() as f: for line in f: line = platform_fix_name(line.strip(), compiler, env) if line: - expected[line] = False + expected[Path(line)] = False # Check if expected files were found for fname in expected: - file_path = os.path.join(installdir, fname) - if os.path.exists(file_path) or os.path.islink(file_path): + file_path = installdir / fname + if file_path.is_file() or file_path.is_symlink(): expected[fname] = True for (fname, found) in expected.items(): if not found: - ret_msg += 'Expected file {0} missing.\n'.format(fname) + ret_msg += 'Expected file {} missing.\n'.format(fname) # Check if there are any unexpected files found = get_relative_files_list_from_dir(installdir) for fname in found: if fname not in expected: - ret_msg += 'Extra file {0} found.\n'.format(fname) + ret_msg += 'Extra file {} found.\n'.format(fname) + if ret_msg != '': + ret_msg += '\nInstall dir contents:\n' + for i in found: + ret_msg += ' - {}'.format(i) return ret_msg def log_text_file(logfile, testdir, stdo, stde): @@ -300,7 +306,7 @@ pass return args -# Build directory name must be the same so CCache works over +# Build directory name must be the same so Ccache works over # consecutive invocations. def create_deterministic_builddir(src_dir): import hashlib @@ -329,7 +335,7 @@ return False if '38 libdir must be inside prefix' in dirname: return False - if '196 install_mode' in dirname: + if '195 install_mode' in dirname: return False return True @@ -337,6 +343,7 @@ compile_commands, clean_commands, install_commands, uninstall_commands = commands test_args = parse_test_args(testdir) gen_start = time.time() + setup_env = None # Configure in-process if pass_prefix_to_test(testdir): gen_args = ['--prefix', '/usr'] @@ -345,7 +352,21 @@ if pass_libdir_to_test(testdir): gen_args += ['--libdir', 'lib'] gen_args += [testdir, test_build_dir] + flags + test_args + extra_args - (returncode, stdo, stde) = run_configure(gen_args) + nativefile = os.path.join(testdir, 'nativefile.ini') + if os.path.exists(nativefile): + gen_args.extend(['--native-file', nativefile]) + crossfile = os.path.join(testdir, 'crossfile.ini') + if os.path.exists(crossfile): + gen_args.extend(['--cross-file', crossfile]) + setup_env_file = os.path.join(testdir, 'setup_env.json') + if os.path.exists(setup_env_file): + setup_env = os.environ.copy() + with open(setup_env_file, 'r') as fp: + data = json.load(fp) + for key, val in data.items(): + val = val.replace('@ROOT@', os.path.abspath(testdir)) + setup_env[key] = val + (returncode, stdo, stde) = run_configure(gen_args, env=setup_env) try: logfile = Path(test_build_dir, 'meson-logs', 'meson-log.txt') mesonlog = logfile.open(errors='ignore', encoding='utf-8').read() @@ -418,12 +439,12 @@ return TestResult(validate_install(testdir, install_dir, compiler, builddata.environment), BuildStep.validate, stdo, stde, mesonlog, gen_time, build_time, test_time) -def gather_tests(testdir: Path): - tests = [t.name for t in testdir.glob('*')] - tests = [t for t in tests if not t.startswith('.')] # Filter non-tests files (dot files, etc) - testlist = [(int(t.split()[0]), t) for t in tests] - testlist.sort() - tests = [testdir / t[1] for t in testlist] +def gather_tests(testdir: Path) -> typing.List[Path]: + test_names = [t.name for t in testdir.glob('*') if t.is_dir()] + test_names = [t for t in test_names if not t.startswith('.')] # Filter non-tests files (dot files, etc) + test_nums = [(int(t.split()[0]), t) for t in test_names] + test_nums.sort() + tests = [testdir / t[1] for t in test_nums] return tests def have_d_compiler(): @@ -434,6 +455,14 @@ elif shutil.which("gdc"): return True elif shutil.which("dmd"): + # The Windows installer sometimes produces a DMD install + # that exists but segfaults every time the compiler is run. + # Don't know why. Don't know how to fix. Skip in this case. + cp = subprocess.run(['dmd', '--version'], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + if cp.stdout == b'': + return False return True return False @@ -441,11 +470,12 @@ with AutoDeletedDir(tempfile.mkdtemp(prefix='b ', dir='.')) as build_dir: env = environment.Environment(None, build_dir, get_fake_options('/')) try: - objc_comp = env.detect_objc_compiler(False) + objc_comp = env.detect_objc_compiler(MachineChoice.HOST) except mesonlib.MesonException: return False if not objc_comp: return False + env.coredata.process_new_compiler('objc', objc_comp, env) try: objc_comp.sanity_check(env.get_scratch_dir(), env) except mesonlib.MesonException: @@ -456,11 +486,12 @@ with AutoDeletedDir(tempfile.mkdtemp(prefix='b ', dir='.')) as build_dir: env = environment.Environment(None, build_dir, get_fake_options('/')) try: - objcpp_comp = env.detect_objcpp_compiler(False) + objcpp_comp = env.detect_objcpp_compiler(MachineChoice.HOST) except mesonlib.MesonException: return False if not objcpp_comp: return False + env.coredata.process_new_compiler('objcpp', objcpp_comp, env) try: objcpp_comp.sanity_check(env.get_scratch_dir(), env) except mesonlib.MesonException: @@ -484,6 +515,18 @@ if test.endswith('10 gtk-doc'): return True + # NetCDF is not in the CI image + if test.endswith('netcdf'): + return True + + # MSVC doesn't link with GFortran + if test.endswith('14 fortran links c'): + return True + + # Blocks are not supported on all compilers + if test.endswith('29 blocks'): + return True + # No frameworks test should be skipped on linux CI, as we expect all # prerequisites to be installed if mesonlib.is_linux(): @@ -496,6 +539,10 @@ return 'BOOST_ROOT' not in os.environ return False + # Qt is provided on macOS by Homebrew + if test.endswith('4 qt') and mesonlib.is_osx(): + return False + # Other framework tests are allowed to be skipped on other platforms return True @@ -521,13 +568,59 @@ return not stdo.startswith(b'2.') return True -def detect_tests_to_run(): +# In Azure some setups have a broken rustc that will error out +# on all compilation attempts. + +def has_broken_rustc() -> bool: + dirname = 'brokenrusttest' + if os.path.exists(dirname): + mesonlib.windows_proof_rmtree(dirname) + os.mkdir(dirname) + open(dirname + '/sanity.rs', 'w').write('''fn main() { +} +''') + pc = subprocess.run(['rustc', '-o', 'sanity.exe', 'sanity.rs'], + cwd=dirname, + stdout = subprocess.DEVNULL, + stderr = subprocess.DEVNULL) + mesonlib.windows_proof_rmtree(dirname) + return pc.returncode != 0 + +def should_skip_rust() -> bool: + if not shutil.which('rustc'): + return True + if backend is not Backend.ninja: + return True + if mesonlib.is_windows(): + if has_broken_rustc(): + return True + return False + +def detect_tests_to_run(only: typing.List[str]) -> typing.List[typing.Tuple[str, typing.List[Path], bool]]: + """ + Parameters + ---------- + only: list of str, optional + specify names of tests to run + + Returns + ------- + gathered_tests: list of tuple of str, list of pathlib.Path, bool + tests to run + """ + + skip_fortran = not(shutil.which('gfortran') or shutil.which('flang') or + shutil.which('pgfortran') or shutil.which('ifort')) + # Name, subdirectory, skip condition. all_tests = [ + ('cmake', 'cmake', not shutil.which('cmake') or (os.environ.get('compiler') == 'msvc2015' and under_ci)), ('common', 'common', False), + ('warning-meson', 'warning', False), ('failing-meson', 'failing', False), ('failing-build', 'failing build', False), ('failing-test', 'failing test', False), + ('kconfig', 'kconfig', False), ('platform-osx', 'osx', not mesonlib.is_osx()), ('platform-windows', 'windows', not mesonlib.is_windows() and not mesonlib.is_cygwin()), @@ -536,28 +629,36 @@ ('java', 'java', backend is not Backend.ninja or mesonlib.is_osx() or not have_java()), ('C#', 'csharp', skip_csharp(backend)), ('vala', 'vala', backend is not Backend.ninja or not shutil.which('valac')), - ('rust', 'rust', backend is not Backend.ninja or not shutil.which('rustc')), + ('rust', 'rust', should_skip_rust()), ('d', 'd', backend is not Backend.ninja or not have_d_compiler()), - ('objective c', 'objc', backend not in (Backend.ninja, Backend.xcode) or mesonlib.is_windows() or not have_objc_compiler()), - ('objective c++', 'objcpp', backend not in (Backend.ninja, Backend.xcode) or mesonlib.is_windows() or not have_objcpp_compiler()), - ('fortran', 'fortran', backend is not Backend.ninja or not shutil.which('gfortran')), + ('objective c', 'objc', backend not in (Backend.ninja, Backend.xcode) or not have_objc_compiler()), + ('objective c++', 'objcpp', backend not in (Backend.ninja, Backend.xcode) or not have_objcpp_compiler()), + ('fortran', 'fortran', skip_fortran or backend != Backend.ninja), ('swift', 'swift', backend not in (Backend.ninja, Backend.xcode) or not shutil.which('swiftc')), + ('cuda', 'cuda', backend not in (Backend.ninja, Backend.xcode) or not shutil.which('nvcc')), ('python3', 'python3', backend is not Backend.ninja), + ('python', 'python', backend is not Backend.ninja), ('fpga', 'fpga', shutil.which('yosys') is None), ('frameworks', 'frameworks', False), ('nasm', 'nasm', False), + ('wasm', 'wasm', shutil.which('emcc') is None or backend is not Backend.ninja), ] + + if only: + names = [t[0] for t in all_tests] + ind = [names.index(o) for o in only] + all_tests = [all_tests[i] for i in ind] gathered_tests = [(name, gather_tests(Path('test cases', subdir)), skip) for name, subdir, skip in all_tests] return gathered_tests -def run_tests(all_tests, log_name_base, failfast, extra_args): +def run_tests(all_tests, log_name_base, failfast: bool, extra_args): global logfile txtname = log_name_base + '.txt' with open(txtname, 'w', encoding='utf-8', errors='ignore') as lf: logfile = lf return _run_tests(all_tests, log_name_base, failfast, extra_args) -def _run_tests(all_tests, log_name_base, failfast, extra_args): +def _run_tests(all_tests, log_name_base, failfast: bool, extra_args): global stop, executor, futures, system_compiler xmlname = log_name_base + '.xml' junit_root = ET.Element('testsuites') @@ -581,7 +682,8 @@ # # Remove this once the following issue has been resolved: # https://github.com/mesonbuild/meson/pull/2082 - num_workers *= 2 + if not mesonlib.is_windows(): # twice as fast on Windows by *not* multiplying by 2. + num_workers *= 2 executor = ProcessPoolExecutor(max_workers=num_workers) for name, test_cases, skipped in all_tests: @@ -599,9 +701,14 @@ (testnum, testbase) = t.name.split(' ', 1) testname = '%.3d %s' % (int(testnum), testbase) should_fail = False + suite_args = [] if name.startswith('failing'): should_fail = name.split('failing-')[1] - result = executor.submit(run_test, skipped, t.as_posix(), extra_args, system_compiler, backend, backend_flags, commands, should_fail) + if name.startswith('warning'): + suite_args = ['--fatal-meson-warnings'] + should_fail = name.split('warning-')[1] + result = executor.submit(run_test, skipped, t.as_posix(), extra_args + suite_args, + system_compiler, backend, backend_flags, commands, should_fail) futures.append((testname, t, result)) for (testname, t, result) in futures: sys.stdout.flush() @@ -626,6 +733,12 @@ # print the meson log if available since it's a superset # of stdout and often has very useful information. failing_logs.append(result.mlog) + elif under_ci: + # Always print the complete meson log when running in + # a CI. This helps debugging issues that only occur in + # a hard to reproduce environment + failing_logs.append(result.mlog) + failing_logs.append(result.stdo) else: failing_logs.append(result.stdo) failing_logs.append(result.stde) @@ -651,8 +764,8 @@ stdeel = ET.SubElement(current_test, 'system-err') stdeel.text = result.stde - if failfast and failing_tests > 0: - break + if failfast and failing_tests > 0: + break print("\nTotal configuration time: %.2fs" % conf_time) print("Total build time: %.2fs" % build_time) @@ -660,18 +773,14 @@ ET.ElementTree(element=junit_root).write(xmlname, xml_declaration=True, encoding='UTF-8') return passing_tests, failing_tests, skipped_tests -def check_file(fname): - linenum = 1 - with open(fname, 'rb') as f: - lines = f.readlines() - for line in lines: - if line.startswith(b'\t'): - print("File %s contains a literal tab on line %d. Only spaces are permitted." % (fname, linenum)) - sys.exit(1) - if b'\r' in line: - print("File %s contains DOS line ending on line %d. Only unix-style line endings are permitted." % (fname, linenum)) - sys.exit(1) - linenum += 1 +def check_file(file: Path): + lines = file.read_bytes().split(b'\n') + tabdetector = re.compile(br' *\t') + for i, line in enumerate(lines): + if re.match(tabdetector, line): + raise SystemExit("File {} contains a tab indent on line {:d}. Only spaces are permitted.".format(file, i + 1)) + if line.endswith(b'\r'): + raise SystemExit("File {} contains DOS line ending on line {:d}. Only unix-style line endings are permitted.".format(file, i + 1)) def check_format(): check_suffixes = {'.c', @@ -693,16 +802,21 @@ '.build', '.md', } - for (root, _, files) in os.walk('.'): + for (root, _, filenames) in os.walk('.'): if '.dub' in root: # external deps are here continue - for fname in files: - if os.path.splitext(fname)[1].lower() in check_suffixes: - bn = os.path.basename(fname) - if bn == 'sitemap.txt' or bn == 'meson-test-run.txt': + if '.pytest_cache' in root: + continue + if 'meson-logs' in root or 'meson-private' in root: + continue + if '.eggs' in root or '_cache' in root: # e.g. .mypy_cache + continue + for fname in filenames: + file = Path(fname) + if file.suffix.lower() in check_suffixes: + if file.name in ('sitemap.txt', 'meson-test-run.txt'): continue - fullname = os.path.join(root, fname) - check_file(fullname) + check_file(root / file) def check_meson_commands_work(): global backend, compile_commands, test_commands, install_commands @@ -735,11 +849,23 @@ with AutoDeletedDir(tempfile.mkdtemp(prefix='b ', dir='.')) as build_dir: env = environment.Environment(None, build_dir, get_fake_options('/')) - try: - comp = env.detect_c_compiler(env.is_cross_build()) - except: - raise RuntimeError("Could not find C compiler.") - system_compiler = comp.get_id() + print() + for lang in sorted(compilers.all_languages): + try: + comp = env.compiler_from_language(lang, MachineChoice.HOST) + details = '%s %s' % (' '.join(comp.get_exelist()), comp.get_version_string()) + except mesonlib.MesonException: + comp = None + details = 'not found' + print('%-7s: %s' % (lang, details)) + + # note C compiler for later use by platform_fix_name() + if lang == 'c': + if comp: + system_compiler = comp.get_id() + else: + raise RuntimeError("Could not find C compiler.") + print() if __name__ == '__main__': parser = argparse.ArgumentParser(description="Run the test suite of Meson.") @@ -749,6 +875,9 @@ choices=backendlist) parser.add_argument('--failfast', action='store_true', help='Stop running if test case fails') + parser.add_argument('--no-unittests', action='store_true', + help='Not used, only here to simplify run_tests.py') + parser.add_argument('--only', help='name of test(s) to run', nargs='+') options = parser.parse_args() setup_commands(options.backend) @@ -759,7 +888,7 @@ check_format() check_meson_commands_work() try: - all_tests = detect_tests_to_run() + all_tests = detect_tests_to_run(options.only) (passing_tests, failing_tests, skipped_tests) = run_tests(all_tests, 'meson-test-run', options.failfast, options.extra_args) except StopException: pass @@ -773,10 +902,10 @@ print(l, '\n') except UnicodeError: print(l.encode('ascii', errors='replace').decode(), '\n') - for name, dirs, skip in all_tests: - dirs = (x.name for x in dirs) - for k, g in itertools.groupby(dirs, key=lambda x: x.split()[0]): + for name, dirs, _ in all_tests: + dir_names = (x.name for x in dirs) + for k, g in itertools.groupby(dir_names, key=lambda x: x.split()[0]): tests = list(g) if len(tests) != 1: print('WARNING: The %s suite contains duplicate "%s" tests: "%s"' % (name, k, '", "'.join(tests))) - sys.exit(failing_tests) + raise SystemExit(failing_tests) diff -Nru meson-0.49.0/run_tests.py meson-0.52.1/run_tests.py --- meson-0.49.0/run_tests.py 2018-12-09 14:27:23.000000000 +0000 +++ meson-0.52.1/run_tests.py 2019-11-28 17:37:44.000000000 +0000 @@ -34,11 +34,13 @@ from mesonbuild.environment import Environment, detect_ninja from mesonbuild.coredata import backendlist -def guess_backend(backend, msbuild_exe): +NINJA_1_9_OR_NEWER = False + +def guess_backend(backend, msbuild_exe: str): # Auto-detect backend if unspecified backend_flags = [] if backend is None: - if msbuild_exe is not None: + if msbuild_exe is not None and (mesonlib.is_windows() and not _using_intelcl()): backend = 'vs' # Meson will auto-detect VS version to use else: backend = 'ninja' @@ -57,6 +59,32 @@ return (backend, backend_flags) +def _using_intelcl() -> bool: + """ + detect if intending to using Intel-Cl compilers (Intel compilers on Windows) + Sufficient evidence of intent is that user is working in the Intel compiler + shell environment, otherwise this function returns False + """ + if not mesonlib.is_windows(): + return False + # handle where user tried to "blank" MKLROOT and left space(s) + if not os.environ.get('MKLROOT', '').strip(): + return False + if (os.environ.get('CC') == 'icl' or + os.environ.get('CXX') == 'icl' or + os.environ.get('FC') == 'ifort'): + return True + # Intel-Cl users might not have the CC,CXX,FC envvars set, + # but because they're in Intel shell, the exe's below are on PATH + if shutil.which('icl') or shutil.which('ifort'): + return True + mlog.warning('It appears you might be intending to use Intel compiler on Windows ' + 'since non-empty environment variable MKLROOT is set to {} ' + 'However, Meson cannot find the Intel WIndows compiler executables (icl,ifort).' + 'Please try using the Intel shell.'.format(os.environ.get('MKLROOT'))) + return False + + # Fake classes and objects for mocking class FakeBuild: def __init__(self, env): @@ -66,19 +94,22 @@ def __init__(self): self.value = [] -def get_fake_options(prefix): +def get_fake_options(prefix=''): import argparse opts = argparse.Namespace() + opts.native_file = [] opts.cross_file = None opts.wrap_mode = None opts.prefix = prefix opts.cmd_line_options = {} - opts.native_file = [] return opts -def get_fake_env(sdir, bdir, prefix): - env = Environment(sdir, bdir, get_fake_options(prefix)) - env.coredata.compiler_options['c_args'] = FakeCompilerOptions() +def get_fake_env(sdir='', bdir=None, prefix='', opts=None): + if opts is None: + opts = get_fake_options(prefix) + env = Environment(sdir, bdir, opts) + env.coredata.compiler_options.host['c_args'] = FakeCompilerOptions() + env.machines.host.cpu_family = 'x86_64' # Used on macOS inside find_library return env @@ -86,7 +117,7 @@ if 'MESON_EXE' in os.environ: import shlex - meson_exe = shlex.split(os.environ['MESON_EXE']) + meson_exe = mesonlib.split_args(os.environ['MESON_EXE']) else: meson_exe = None @@ -133,7 +164,7 @@ p = r'{}\s*\{}'.format(t, ext) else: p = r'{}'.format(t) - for root, dirs, files in os.walk(builddir): + for _, _, files in os.walk(builddir): for f in fnmatch.filter(files, '*.vcxproj'): f = os.path.join(builddir, f) with open(f, 'r', encoding='utf-8') as o: @@ -172,8 +203,20 @@ clean_cmd = cmd + ['-alltargets', 'clean', '-UseNewBuildSystem=FALSE'] test_cmd = cmd + ['-target', 'RUN_TESTS'] elif backend is Backend.ninja: - # We need at least 1.6 because of -w dupbuild=err - cmd = [detect_ninja('1.6'), '-w', 'dupbuild=err', '-d', 'explain'] + global NINJA_1_9_OR_NEWER + # Look for 1.9 to see if https://github.com/ninja-build/ninja/issues/1219 + # is fixed, else require 1.6 for -w dupbuild=err + for v in ('1.9', '1.6'): + ninja_cmd = detect_ninja(v) + if ninja_cmd is not None: + if v == '1.9': + NINJA_1_9_OR_NEWER = True + else: + print('Found ninja <1.9, tests will run slower') + if 'CI' in os.environ: + raise RuntimeError('Require ninja >= 1.9 when running on Meson CI') + break + cmd = [ninja_cmd, '-w', 'dupbuild=err', '-d', 'explain'] if cmd[0] is None: raise RuntimeError('Could not find Ninja v1.6 or newer') if debug: @@ -187,16 +230,25 @@ return cmd, clean_cmd, test_cmd, install_cmd, uninstall_cmd def ensure_backend_detects_changes(backend): - # We're using a ninja with QuLogic's patch for sub-1s resolution timestamps - # and not running on HFS+ which only stores dates in seconds: - # https://developer.apple.com/legacy/library/technotes/tn/tn1150.html#HFSPlusDates - # FIXME: Upgrade Travis image to Apple FS when that becomes available - if 'MESON_FIXED_NINJA' in os.environ and not mesonlib.is_osx(): + global NINJA_1_9_OR_NEWER + if backend is not Backend.ninja: return - # This is needed to increase the difference between build.ninja's - # timestamp and the timestamp of whatever you changed due to a Ninja - # bug: https://github.com/ninja-build/ninja/issues/371 - if backend is Backend.ninja: + need_workaround = False + # We're not running on HFS+ which only stores dates in seconds: + # https://developer.apple.com/legacy/library/technotes/tn/tn1150.html#HFSPlusDates + # XXX: Upgrade Travis image to Apple FS when that becomes available + # TODO: Detect HFS+ vs APFS + if mesonlib.is_osx(): + print('Running on HFS+, enabling timestamp resolution workaround') + need_workaround = True + # We're using ninja >= 1.9 which has QuLogic's patch for sub-1s resolution + # timestamps + if not NINJA_1_9_OR_NEWER: + print('Don\'t have ninja >= 1.9, enabling timestamp resolution workaround') + need_workaround = True + # Increase the difference between build.ninja's timestamp and the timestamp + # of whatever you changed: https://github.com/ninja-build/ninja/issues/371 + if need_workaround: time.sleep(1) def run_mtest_inprocess(commandlist): @@ -211,27 +263,41 @@ sys.stderr = old_stderr return returncode, mystdout.getvalue(), mystderr.getvalue() -def run_configure_inprocess(commandlist): +def clear_meson_configure_class_caches(): + mesonbuild.compilers.CCompiler.library_dirs_cache = {} + mesonbuild.compilers.CCompiler.program_dirs_cache = {} + mesonbuild.compilers.CCompiler.find_library_cache = {} + mesonbuild.compilers.CCompiler.find_framework_cache = {} + mesonbuild.dependencies.PkgConfigDependency.pkgbin_cache = {} + mesonbuild.dependencies.PkgConfigDependency.class_pkgbin = mesonlib.PerMachine(None, None) + +def run_configure_inprocess(commandlist, env=None): old_stdout = sys.stdout sys.stdout = mystdout = StringIO() old_stderr = sys.stderr sys.stderr = mystderr = StringIO() + old_environ = os.environ.copy() + if env is not None: + os.environ.update(env) try: returncode = mesonmain.run(commandlist, get_meson_script()) finally: sys.stdout = old_stdout sys.stderr = old_stderr + clear_meson_configure_class_caches() + os.environ.clear() + os.environ.update(old_environ) return returncode, mystdout.getvalue(), mystderr.getvalue() -def run_configure_external(full_command): - pc, o, e = mesonlib.Popen_safe(full_command) +def run_configure_external(full_command, env=None): + pc, o, e = mesonlib.Popen_safe(full_command, env=env) return pc.returncode, o, e -def run_configure(commandlist): +def run_configure(commandlist, env=None): global meson_exe if meson_exe: - return run_configure_external(meson_exe + commandlist) - return run_configure_inprocess(commandlist) + return run_configure_external(meson_exe + commandlist, env=env) + return run_configure_inprocess(commandlist, env=env) def print_system_info(): print(mlog.bold('System information.').get_text(mlog.colorize_console)) @@ -250,6 +316,7 @@ choices=backendlist) parser.add_argument('--cross', default=False, dest='cross', action='store_true') parser.add_argument('--failfast', action='store_true') + parser.add_argument('--no-unittests', action='store_true', default=False) (options, _) = parser.parse_known_args() # Enable coverage early... enable_coverage = options.cov @@ -261,6 +328,7 @@ returncode = 0 cross = options.cross backend, _ = guess_backend(options.backend, shutil.which('msbuild')) + no_unittests = options.no_unittests # Running on a developer machine? Be nice! if not mesonlib.is_windows() and not mesonlib.is_haiku() and 'CI' not in os.environ: os.nice(20) @@ -280,7 +348,7 @@ os.environ.pop('platform') # Run tests print(mlog.bold('Running unittests.').get_text(mlog.colorize_console)) - print() + print(flush=True) # Can't pass arguments to unit tests, so set the backend to use in the environment env = os.environ.copy() env['MESON_UNIT_TEST_BACKEND'] = backend.name @@ -302,18 +370,22 @@ returncode += subprocess.call(cmd, env=env) if options.failfast and returncode != 0: return returncode - cmd = mesonlib.python_command + ['run_unittests.py', '-v'] - if options.failfast: - cmd += ['--failfast'] - returncode += subprocess.call(cmd, env=env) - if options.failfast and returncode != 0: - return returncode + if no_unittests: + print('Skipping all unit tests.') + returncode = 0 + else: + cmd = mesonlib.python_command + ['run_unittests.py', '-v'] + if options.failfast: + cmd += ['--failfast'] + returncode += subprocess.call(cmd, env=env) + if options.failfast and returncode != 0: + return returncode cmd = mesonlib.python_command + ['run_project_tests.py'] + sys.argv[1:] returncode += subprocess.call(cmd, env=env) else: cross_test_args = mesonlib.python_command + ['run_cross_test.py'] print(mlog.bold('Running armhf cross tests.').get_text(mlog.colorize_console)) - print() + print(flush=True) cmd = cross_test_args + ['cross/ubuntu-armhf.txt'] if options.failfast: cmd += ['--failfast'] @@ -322,7 +394,7 @@ return returncode print(mlog.bold('Running mingw-w64 64-bit cross tests.') .get_text(mlog.colorize_console)) - print() + print(flush=True) cmd = cross_test_args + ['cross/linux-mingw-w64-64bit.txt'] if options.failfast: cmd += ['--failfast'] diff -Nru meson-0.49.0/run_unittests.py meson-0.52.1/run_unittests.py --- meson-0.49.0/run_unittests.py 2018-12-09 17:55:42.000000000 +0000 +++ meson-0.52.1/run_unittests.py 2019-11-28 17:37:44.000000000 +0000 @@ -14,7 +14,6 @@ # limitations under the License. import stat -import shlex import subprocess import re import json @@ -27,23 +26,33 @@ import platform import pickle import functools +import io +import operator +import threading +import urllib.error +import urllib.request from itertools import chain from unittest import mock from configparser import ConfigParser +from contextlib import contextmanager from glob import glob from pathlib import (PurePath, Path) +from distutils.dir_util import copy_tree import mesonbuild.mlog +import mesonbuild.depfile import mesonbuild.compilers import mesonbuild.environment import mesonbuild.mesonlib import mesonbuild.coredata import mesonbuild.modules.gnome from mesonbuild.interpreter import Interpreter, ObjectHolder +from mesonbuild.ast import AstInterpreter from mesonbuild.mesonlib import ( - is_windows, is_osx, is_cygwin, is_dragonflybsd, is_openbsd, is_haiku, - windows_proof_rmtree, python_command, version_compare, - BuildDirLock, Version + BuildDirLock, LibType, MachineChoice, PerMachine, Version, is_windows, + is_osx, is_cygwin, is_dragonflybsd, is_openbsd, is_haiku, is_sunos, + windows_proof_rmtree, python_command, version_compare, split_args, + quote_arg ) from mesonbuild.environment import detect_ninja from mesonbuild.mesonlib import MesonException, EnvironmentException @@ -51,16 +60,22 @@ from mesonbuild.build import Target import mesonbuild.modules.pkgconfig +from mesonbuild.mtest import TAPParser, TestResult + from run_tests import ( Backend, FakeBuild, FakeCompilerOptions, ensure_backend_detects_changes, exe_suffix, get_backend_commands, - get_builddir_target_args, get_fake_env, get_meson_script, + get_builddir_target_args, get_fake_env, get_fake_options, get_meson_script, run_configure_inprocess, run_mtest_inprocess ) + +URLOPEN_TIMEOUT = 5 + + def get_dynamic_section_entry(fname, entry): if is_cygwin() or is_osx(): - raise unittest.SkipTest('Test only applicable to ELF platforms') + raise unittest.SkipTest('Test only applicable to ELF platforms') try: raw_out = subprocess.check_output(['readelf', '-d', fname], @@ -91,6 +106,15 @@ return True return False +def is_pull(): + # Travis + if os.environ.get('TRAVIS_PULL_REQUEST', 'false') != 'false': + return True + # Azure + if 'SYSTEM_PULLREQUEST_ISFORK' in os.environ: + return True + return False + def _git_init(project_dir): subprocess.check_call(['git', 'init'], cwd=project_dir, stdout=subprocess.DEVNULL) subprocess.check_call(['git', 'config', @@ -102,6 +126,29 @@ subprocess.check_call(['git', 'commit', '-a', '-m', 'I am a project'], cwd=project_dir, stdout=subprocess.DEVNULL) +@functools.lru_cache() +def is_real_gnu_compiler(path): + ''' + Check if the gcc we have is a real gcc and not a macOS wrapper around clang + ''' + if not path: + return False + out = subprocess.check_output([path, '--version'], universal_newlines=True, stderr=subprocess.STDOUT) + return 'Free Software Foundation' in out + +def skipIfNoExecutable(exename): + ''' + Skip this test if the given executable is not found. + ''' + def wrapper(func): + @functools.wraps(func) + def wrapped(*args, **kwargs): + if shutil.which(exename) is None: + raise unittest.SkipTest(exename + ' not found') + return func(*args, **kwargs) + return wrapped + return wrapper + def skipIfNoPkgconfig(f): ''' Skip this test if no pkg-config is found, unless we're on CI. @@ -133,31 +180,51 @@ return wrapped return wrapper +def skip_if_no_cmake(f): + ''' + Skip this test if no cmake is found, unless we're on CI. + This allows users to run our test suite without having + cmake installed on, f.ex., macOS, while ensuring that our CI does not + silently skip the test because of misconfiguration. + ''' + @functools.wraps(f) + def wrapped(*args, **kwargs): + if not is_ci() and shutil.which('cmake') is None: + raise unittest.SkipTest('cmake not found') + return f(*args, **kwargs) + return wrapped + def skip_if_not_language(lang): def wrapper(func): @functools.wraps(func) def wrapped(*args, **kwargs): try: - env = get_fake_env('', '', '') + env = get_fake_env() f = getattr(env, 'detect_{}_compiler'.format(lang)) - if lang in ['cs', 'vala', 'java', 'swift']: - f() - else: - f(False) + f(MachineChoice.HOST) except EnvironmentException: raise unittest.SkipTest('No {} compiler found.'.format(lang)) return func(*args, **kwargs) return wrapped return wrapper -def skip_if_env_value(value): +def skip_if_env_set(key): + ''' + Skip a test if a particular env is set, except when running under CI + ''' def wrapper(func): @functools.wraps(func) def wrapped(*args, **kwargs): - if value in os.environ: - raise unittest.SkipTest( - 'Environment variable "{}" set, skipping.'.format(value)) - return func(*args, **kwargs) + old = None + if key in os.environ: + if not is_ci(): + raise unittest.SkipTest('Env var {!r} set, skipping'.format(key)) + old = os.environ.pop(key) + try: + return func(*args, **kwargs) + finally: + if old is not None: + os.environ[key] = old return wrapped return wrapper @@ -169,8 +236,8 @@ def actual(f): @functools.wraps(f) def wrapped(*args, **kwargs): - env = get_fake_env('', '', '') - cc = env.detect_c_compiler(False) + env = get_fake_env() + cc = env.detect_c_compiler(MachineChoice.HOST) if feature not in cc.base_options: raise unittest.SkipTest( '{} not available with {}'.format(feature, cc.id)) @@ -179,11 +246,56 @@ return actual +@contextmanager +def temp_filename(): + '''A context manager which provides a filename to an empty temporary file. + + On exit the file will be deleted. + ''' + + fd, filename = tempfile.mkstemp() + os.close(fd) + try: + yield filename + finally: + try: + os.remove(filename) + except OSError: + pass + +@contextmanager +def no_pkgconfig(): + ''' + A context manager that overrides shutil.which and ExternalProgram to force + them to return None for pkg-config to simulate it not existing. + ''' + old_which = shutil.which + old_search = ExternalProgram._search + + def new_search(self, name, search_dir): + if name == 'pkg-config': + return [None] + return old_search(self, name, search_dir) + + def new_which(cmd, *kwargs): + if cmd == 'pkg-config': + return None + return old_which(cmd, *kwargs) + + shutil.which = new_which + ExternalProgram._search = new_search + try: + yield + finally: + shutil.which = old_which + ExternalProgram._search = old_search + class PatchModule: ''' Fancy monkey-patching! Whee! Can't use mock.patch because it only patches in the local namespace. ''' + def __init__(self, func, name, impl): self.func = func assert(isinstance(name, str)) @@ -247,7 +359,7 @@ def test_compiler_args_class(self): cargsfunc = mesonbuild.compilers.CompilerArgs - cc = mesonbuild.compilers.CCompiler([], 'fake', False) + cc = mesonbuild.compilers.CCompiler([], 'fake', False, MachineChoice.HOST) # Test that bad initialization fails self.assertRaises(TypeError, cargsfunc, []) self.assertRaises(TypeError, cargsfunc, [], []) @@ -333,7 +445,10 @@ def test_compiler_args_class_gnuld(self): cargsfunc = mesonbuild.compilers.CompilerArgs ## Test --start/end-group - gcc = mesonbuild.compilers.GnuCCompiler([], 'fake', mesonbuild.compilers.CompilerType.GCC_STANDARD, False) + linker = mesonbuild.linkers.GnuDynamicLinker([], MachineChoice.HOST, 'fake', '-Wl,') + gcc = mesonbuild.compilers.GnuCCompiler([], 'fake', mesonbuild.compilers.CompilerType.GCC_STANDARD, False, MachineChoice.HOST, linker=linker) + ## Ensure that the fake compiler is never called by overriding the relevant function + gcc.get_default_include_dirs = lambda: ['/usr/include', '/usr/share/include', '/usr/local/include'] ## Test that 'direct' append and extend works l = cargsfunc(gcc, ['-Lfoodir', '-lfoo']) self.assertEqual(l.to_native(copy=True), ['-Lfoodir', '-Wl,--start-group', '-lfoo', '-Wl,--end-group']) @@ -356,6 +471,20 @@ l.append('-Wl,-ldl') self.assertEqual(l.to_native(copy=True), ['-Lfoo', '-Lfoodir', '-Wl,--start-group', '-lfoo', '-Lbardir', '-lbar', '-lbar', '/libbaz.a', '-Wl,--export-dynamic', '-Wl,-ldl', '-Wl,--end-group']) + def test_compiler_args_remove_system(self): + cargsfunc = mesonbuild.compilers.CompilerArgs + ## Test --start/end-group + linker = mesonbuild.linkers.GnuDynamicLinker([], MachineChoice.HOST, 'fake', '-Wl,') + gcc = mesonbuild.compilers.GnuCCompiler([], 'fake', mesonbuild.compilers.CompilerType.GCC_STANDARD, False, MachineChoice.HOST, linker=linker) + ## Ensure that the fake compiler is never called by overriding the relevant function + gcc.get_default_include_dirs = lambda: ['/usr/include', '/usr/share/include', '/usr/local/include'] + ## Test that 'direct' append and extend works + l = cargsfunc(gcc, ['-Lfoodir', '-lfoo']) + self.assertEqual(l.to_native(copy=True), ['-Lfoodir', '-Wl,--start-group', '-lfoo', '-Wl,--end-group']) + ## Test that to_native removes all system includes + l += ['-isystem/usr/include', '-isystem=/usr/share/include', '-DSOMETHING_IMPORTANT=1', '-isystem', '/usr/local/include'] + self.assertEqual(l.to_native(copy=True), ['-Lfoodir', '-Wl,--start-group', '-lfoo', '-Wl,--end-group', '-DSOMETHING_IMPORTANT=1']) + def test_string_templates_substitution(self): dictfunc = mesonbuild.mesonlib.get_filenames_templates_dict substfunc = mesonbuild.mesonlib.substitute_values @@ -529,7 +658,10 @@ config.write(configfile) configfile.flush() configfile.close() - detected_value = mesonbuild.environment.CrossBuildInfo(configfile.name).need_exe_wrapper() + opts = get_fake_options() + opts.cross_file = (configfilename,) + env = get_fake_env(opts=opts) + detected_value = env.need_exe_wrapper() os.unlink(configfilename) desired_value = not detected_value @@ -541,7 +673,10 @@ configfilename = configfile.name config.write(configfile) configfile.close() - forced_value = mesonbuild.environment.CrossBuildInfo(configfile.name).need_exe_wrapper() + opts = get_fake_options() + opts.cross_file = (configfilename,) + env = get_fake_env(opts=opts) + forced_value = env.need_exe_wrapper() os.unlink(configfilename) self.assertEqual(forced_value, desired_value) @@ -612,16 +747,16 @@ def _test_all_naming(self, cc, env, patterns, platform): shr = patterns[platform]['shared'] stc = patterns[platform]['static'] - p = cc.get_library_naming(env, 'shared') + shrstc = shr + tuple([x for x in stc if x not in shr]) + stcshr = stc + tuple([x for x in shr if x not in stc]) + p = cc.get_library_naming(env, LibType.SHARED) self.assertEqual(p, shr) - p = cc.get_library_naming(env, 'static') + p = cc.get_library_naming(env, LibType.STATIC) self.assertEqual(p, stc) - p = cc.get_library_naming(env, 'static-shared') - self.assertEqual(p, stc + shr) - p = cc.get_library_naming(env, 'shared-static') - self.assertEqual(p, shr + stc) - p = cc.get_library_naming(env, 'default') - self.assertEqual(p, shr + stc) + p = cc.get_library_naming(env, LibType.PREFER_STATIC) + self.assertEqual(p, stcshr) + p = cc.get_library_naming(env, LibType.PREFER_SHARED) + self.assertEqual(p, shrstc) # Test find library by mocking up openbsd if platform != 'openbsd': return @@ -636,7 +771,7 @@ f.write('') with open(os.path.join(tmpdir, 'libfoo.so.70.0.so.1'), 'w') as f: f.write('') - found = cc.find_library_real('foo', env, [tmpdir], '', 'default') + found = cc.find_library_real('foo', env, [tmpdir], '', LibType.PREFER_SHARED) self.assertEqual(os.path.basename(found[0]), 'libfoo.so.54.0') def test_find_library_patterns(self): @@ -646,7 +781,7 @@ unix_static = ('lib{}.a', '{}.a') msvc_static = ('lib{}.a', 'lib{}.lib', '{}.a', '{}.lib') # This is the priority list of pattern matching for library searching - patterns = {'openbsd': {'shared': ('lib{}.so', '{}.so', 'lib{}.so.[0-9]*.[0-9]*'), + patterns = {'openbsd': {'shared': ('lib{}.so', '{}.so', 'lib{}.so.[0-9]*.[0-9]*', '{}.so.[0-9]*.[0-9]*'), 'static': unix_static}, 'linux': {'shared': ('lib{}.so', '{}.so'), 'static': unix_static}, @@ -660,8 +795,8 @@ 'windows-mingw': {'shared': ('lib{}.dll.a', 'lib{}.lib', 'lib{}.dll', '{}.dll.a', '{}.lib', '{}.dll'), 'static': msvc_static}} - env = get_fake_env('', '', '') - cc = env.detect_c_compiler(False) + env = get_fake_env() + cc = env.detect_c_compiler(MachineChoice.HOST) if is_osx(): self._test_all_naming(cc, env, patterns, 'darwin') elif is_cygwin(): @@ -671,25 +806,18 @@ self._test_all_naming(cc, env, patterns, 'windows-msvc') else: self._test_all_naming(cc, env, patterns, 'windows-mingw') + elif is_openbsd(): + self._test_all_naming(cc, env, patterns, 'openbsd') else: self._test_all_naming(cc, env, patterns, 'linux') - # Mock OpenBSD since we don't have tests for it - true = lambda x, y: True - if not is_openbsd(): - with PatchModule(mesonbuild.compilers.c.for_openbsd, - 'mesonbuild.compilers.c.for_openbsd', true): - self._test_all_naming(cc, env, patterns, 'openbsd') - else: - self._test_all_naming(cc, env, patterns, 'openbsd') - with PatchModule(mesonbuild.compilers.c.for_darwin, - 'mesonbuild.compilers.c.for_darwin', true): - self._test_all_naming(cc, env, patterns, 'darwin') - with PatchModule(mesonbuild.compilers.c.for_cygwin, - 'mesonbuild.compilers.c.for_cygwin', true): - self._test_all_naming(cc, env, patterns, 'cygwin') - with PatchModule(mesonbuild.compilers.c.for_windows, - 'mesonbuild.compilers.c.for_windows', true): - self._test_all_naming(cc, env, patterns, 'windows-mingw') + env.machines.host.system = 'openbsd' + self._test_all_naming(cc, env, patterns, 'openbsd') + env.machines.host.system = 'darwin' + self._test_all_naming(cc, env, patterns, 'darwin') + env.machines.host.system = 'cygwin' + self._test_all_naming(cc, env, patterns, 'cygwin') + env.machines.host.system = 'windows' + self._test_all_naming(cc, env, patterns, 'windows-mingw') def test_pkgconfig_parse_libs(self): ''' @@ -697,63 +825,76 @@ https://github.com/mesonbuild/meson/issues/3951 ''' + def create_static_lib(name): + if not is_osx(): + name.open('w').close() + return + src = name.with_suffix('.c') + out = name.with_suffix('.o') + with src.open('w') as f: + f.write('int meson_foobar (void) { return 0; }') + subprocess.check_call(['clang', '-c', str(src), '-o', str(out)]) + subprocess.check_call(['ar', 'csr', str(name), str(out)]) + with tempfile.TemporaryDirectory() as tmpdir: pkgbin = ExternalProgram('pkg-config', command=['pkg-config'], silent=True) - env = get_fake_env('', '', '') - compiler = env.detect_c_compiler(False) - env.coredata.compilers = {'c': compiler} - env.coredata.compiler_options['c_link_args'] = FakeCompilerOptions() + env = get_fake_env() + compiler = env.detect_c_compiler(MachineChoice.HOST) + env.coredata.compilers.host = {'c': compiler} + env.coredata.compiler_options.host['c_link_args'] = FakeCompilerOptions() p1 = Path(tmpdir) / '1' p2 = Path(tmpdir) / '2' p1.mkdir() p2.mkdir() # libfoo.a is in one prefix - (p1 / 'libfoo.a').open('w').close() + create_static_lib(p1 / 'libfoo.a') # libbar.a is in both prefixes - (p1 / 'libbar.a').open('w').close() - (p2 / 'libbar.a').open('w').close() + create_static_lib(p1 / 'libbar.a') + create_static_lib(p2 / 'libbar.a') # Ensure that we never statically link to these - (p1 / 'libpthread.a').open('w').close() - (p1 / 'libm.a').open('w').close() - (p1 / 'libc.a').open('w').close() - (p1 / 'libdl.a').open('w').close() - (p1 / 'librt.a').open('w').close() + create_static_lib(p1 / 'libpthread.a') + create_static_lib(p1 / 'libm.a') + create_static_lib(p1 / 'libc.a') + create_static_lib(p1 / 'libdl.a') + create_static_lib(p1 / 'librt.a') def fake_call_pkgbin(self, args, env=None): if '--libs' not in args: - return 0, '' + return 0, '', '' if args[0] == 'foo': - return 0, '-L{} -lfoo -L{} -lbar'.format(p2.as_posix(), p1.as_posix()) + return 0, '-L{} -lfoo -L{} -lbar'.format(p2.as_posix(), p1.as_posix()), '' if args[0] == 'bar': - return 0, '-L{} -lbar'.format(p2.as_posix()) + return 0, '-L{} -lbar'.format(p2.as_posix()), '' if args[0] == 'internal': - return 0, '-L{} -lpthread -lm -lc -lrt -ldl'.format(p1.as_posix()) + return 0, '-L{} -lpthread -lm -lc -lrt -ldl'.format(p1.as_posix()), '' old_call = PkgConfigDependency._call_pkgbin old_check = PkgConfigDependency.check_pkgconfig PkgConfigDependency._call_pkgbin = fake_call_pkgbin - PkgConfigDependency.check_pkgconfig = lambda x: pkgbin + PkgConfigDependency.check_pkgconfig = lambda x, _: pkgbin # Test begins - kwargs = {'required': True, 'silent': True} - foo_dep = PkgConfigDependency('foo', env, kwargs) - self.assertEqual(foo_dep.get_link_args(), - [(p1 / 'libfoo.a').as_posix(), (p2 / 'libbar.a').as_posix()]) - bar_dep = PkgConfigDependency('bar', env, kwargs) - self.assertEqual(bar_dep.get_link_args(), [(p2 / 'libbar.a').as_posix()]) - internal_dep = PkgConfigDependency('internal', env, kwargs) - if compiler.get_argument_syntax() == 'msvc': - self.assertEqual(internal_dep.get_link_args(), []) - else: - link_args = internal_dep.get_link_args() - for link_arg in link_args: - for lib in ('pthread', 'm', 'c', 'dl', 'rt'): - self.assertNotIn('lib{}.a'.format(lib), link_arg, msg=link_args) - # Test ends - PkgConfigDependency._call_pkgbin = old_call - PkgConfigDependency.check_pkgconfig = old_check - # Reset dependency class to ensure that in-process configure doesn't mess up - PkgConfigDependency.pkgbin_cache = {} - PkgConfigDependency.class_pkgbin = None + try: + kwargs = {'required': True, 'silent': True} + foo_dep = PkgConfigDependency('foo', env, kwargs) + self.assertEqual(foo_dep.get_link_args(), + [(p1 / 'libfoo.a').as_posix(), (p2 / 'libbar.a').as_posix()]) + bar_dep = PkgConfigDependency('bar', env, kwargs) + self.assertEqual(bar_dep.get_link_args(), [(p2 / 'libbar.a').as_posix()]) + internal_dep = PkgConfigDependency('internal', env, kwargs) + if compiler.get_argument_syntax() == 'msvc': + self.assertEqual(internal_dep.get_link_args(), []) + else: + link_args = internal_dep.get_link_args() + for link_arg in link_args: + for lib in ('pthread', 'm', 'c', 'dl', 'rt'): + self.assertNotIn('lib{}.a'.format(lib), link_arg, msg=link_args) + finally: + # Test ends + PkgConfigDependency._call_pkgbin = old_call + PkgConfigDependency.check_pkgconfig = old_check + # Reset dependency class to ensure that in-process configure doesn't mess up + PkgConfigDependency.pkgbin_cache = {} + PkgConfigDependency.class_pkgbin = PerMachine(None, None) def test_version_compare(self): comparefunc = mesonbuild.mesonlib.version_compare_many @@ -762,107 +903,267 @@ ]: self.assertEqual(comparefunc(a, b)[0], result) - for (a, b, result) in [ + for (a, b, op) in [ # examples from https://fedoraproject.org/wiki/Archive:Tools/RPM/VersionComparison - ("1.0010", "1.9", 1), - ("1.05", "1.5", 0), - ("1.0", "1", 1), - ("2.50", "2.5", 1), - ("fc4", "fc.4", 0), - ("FC5", "fc4", -1), - ("2a", "2.0", -1), - ("1.0", "1.fc4", 1), - ("3.0.0_fc", "3.0.0.fc", 0), + ("1.0010", "1.9", operator.gt), + ("1.05", "1.5", operator.eq), + ("1.0", "1", operator.gt), + ("2.50", "2.5", operator.gt), + ("fc4", "fc.4", operator.eq), + ("FC5", "fc4", operator.lt), + ("2a", "2.0", operator.lt), + ("1.0", "1.fc4", operator.gt), + ("3.0.0_fc", "3.0.0.fc", operator.eq), # from RPM tests - ("1.0", "1.0", 0), - ("1.0", "2.0", -1), - ("2.0", "1.0", 1), - ("2.0.1", "2.0.1", 0), - ("2.0", "2.0.1", -1), - ("2.0.1", "2.0", 1), - ("2.0.1a", "2.0.1a", 0), - ("2.0.1a", "2.0.1", 1), - ("2.0.1", "2.0.1a", -1), - ("5.5p1", "5.5p1", 0), - ("5.5p1", "5.5p2", -1), - ("5.5p2", "5.5p1", 1), - ("5.5p10", "5.5p10", 0), - ("5.5p1", "5.5p10", -1), - ("5.5p10", "5.5p1", 1), - ("10xyz", "10.1xyz", -1), - ("10.1xyz", "10xyz", 1), - ("xyz10", "xyz10", 0), - ("xyz10", "xyz10.1", -1), - ("xyz10.1", "xyz10", 1), - ("xyz.4", "xyz.4", 0), - ("xyz.4", "8", -1), - ("8", "xyz.4", 1), - ("xyz.4", "2", -1), - ("2", "xyz.4", 1), - ("5.5p2", "5.6p1", -1), - ("5.6p1", "5.5p2", 1), - ("5.6p1", "6.5p1", -1), - ("6.5p1", "5.6p1", 1), - ("6.0.rc1", "6.0", 1), - ("6.0", "6.0.rc1", -1), - ("10b2", "10a1", 1), - ("10a2", "10b2", -1), - ("1.0aa", "1.0aa", 0), - ("1.0a", "1.0aa", -1), - ("1.0aa", "1.0a", 1), - ("10.0001", "10.0001", 0), - ("10.0001", "10.1", 0), - ("10.1", "10.0001", 0), - ("10.0001", "10.0039", -1), - ("10.0039", "10.0001", 1), - ("4.999.9", "5.0", -1), - ("5.0", "4.999.9", 1), - ("20101121", "20101121", 0), - ("20101121", "20101122", -1), - ("20101122", "20101121", 1), - ("2_0", "2_0", 0), - ("2.0", "2_0", 0), - ("2_0", "2.0", 0), - ("a", "a", 0), - ("a+", "a+", 0), - ("a+", "a_", 0), - ("a_", "a+", 0), - ("+a", "+a", 0), - ("+a", "_a", 0), - ("_a", "+a", 0), - ("+_", "+_", 0), - ("_+", "+_", 0), - ("_+", "_+", 0), - ("+", "_", 0), - ("_", "+", 0), + ("1.0", "1.0", operator.eq), + ("1.0", "2.0", operator.lt), + ("2.0", "1.0", operator.gt), + ("2.0.1", "2.0.1", operator.eq), + ("2.0", "2.0.1", operator.lt), + ("2.0.1", "2.0", operator.gt), + ("2.0.1a", "2.0.1a", operator.eq), + ("2.0.1a", "2.0.1", operator.gt), + ("2.0.1", "2.0.1a", operator.lt), + ("5.5p1", "5.5p1", operator.eq), + ("5.5p1", "5.5p2", operator.lt), + ("5.5p2", "5.5p1", operator.gt), + ("5.5p10", "5.5p10", operator.eq), + ("5.5p1", "5.5p10", operator.lt), + ("5.5p10", "5.5p1", operator.gt), + ("10xyz", "10.1xyz", operator.lt), + ("10.1xyz", "10xyz", operator.gt), + ("xyz10", "xyz10", operator.eq), + ("xyz10", "xyz10.1", operator.lt), + ("xyz10.1", "xyz10", operator.gt), + ("xyz.4", "xyz.4", operator.eq), + ("xyz.4", "8", operator.lt), + ("8", "xyz.4", operator.gt), + ("xyz.4", "2", operator.lt), + ("2", "xyz.4", operator.gt), + ("5.5p2", "5.6p1", operator.lt), + ("5.6p1", "5.5p2", operator.gt), + ("5.6p1", "6.5p1", operator.lt), + ("6.5p1", "5.6p1", operator.gt), + ("6.0.rc1", "6.0", operator.gt), + ("6.0", "6.0.rc1", operator.lt), + ("10b2", "10a1", operator.gt), + ("10a2", "10b2", operator.lt), + ("1.0aa", "1.0aa", operator.eq), + ("1.0a", "1.0aa", operator.lt), + ("1.0aa", "1.0a", operator.gt), + ("10.0001", "10.0001", operator.eq), + ("10.0001", "10.1", operator.eq), + ("10.1", "10.0001", operator.eq), + ("10.0001", "10.0039", operator.lt), + ("10.0039", "10.0001", operator.gt), + ("4.999.9", "5.0", operator.lt), + ("5.0", "4.999.9", operator.gt), + ("20101121", "20101121", operator.eq), + ("20101121", "20101122", operator.lt), + ("20101122", "20101121", operator.gt), + ("2_0", "2_0", operator.eq), + ("2.0", "2_0", operator.eq), + ("2_0", "2.0", operator.eq), + ("a", "a", operator.eq), + ("a+", "a+", operator.eq), + ("a+", "a_", operator.eq), + ("a_", "a+", operator.eq), + ("+a", "+a", operator.eq), + ("+a", "_a", operator.eq), + ("_a", "+a", operator.eq), + ("+_", "+_", operator.eq), + ("_+", "+_", operator.eq), + ("_+", "_+", operator.eq), + ("+", "_", operator.eq), + ("_", "+", operator.eq), # other tests - ('0.99.beta19', '0.99.beta14', 1), - ("1.0.0", "2.0.0", -1), - (".0.0", "2.0.0", -1), - ("alpha", "beta", -1), - ("1.0", "1.0.0", -1), - ("2.456", "2.1000", -1), - ("2.1000", "3.111", -1), - ("2.001", "2.1", 0), - ("2.34", "2.34", 0), - ("6.1.2", "6.3.8", -1), - ("1.7.3.0", "2.0.0", -1), - ("2.24.51", "2.25", -1), - ("2.1.5+20120813+gitdcbe778", "2.1.5", 1), - ("3.4.1", "3.4b1", 1), - ("041206", "200090325", -1), - ("0.6.2+git20130413", "0.6.2", 1), - ("2.6.0+bzr6602", "2.6.0", 1), - ("2.6.0", "2.6b2", 1), - ("2.6.0+bzr6602", "2.6b2x", 1), - ("0.6.7+20150214+git3a710f9", "0.6.7", 1), - ("15.8b", "15.8.0.1", -1), - ("1.2rc1", "1.2.0", -1), + ('0.99.beta19', '0.99.beta14', operator.gt), + ("1.0.0", "2.0.0", operator.lt), + (".0.0", "2.0.0", operator.lt), + ("alpha", "beta", operator.lt), + ("1.0", "1.0.0", operator.lt), + ("2.456", "2.1000", operator.lt), + ("2.1000", "3.111", operator.lt), + ("2.001", "2.1", operator.eq), + ("2.34", "2.34", operator.eq), + ("6.1.2", "6.3.8", operator.lt), + ("1.7.3.0", "2.0.0", operator.lt), + ("2.24.51", "2.25", operator.lt), + ("2.1.5+20120813+gitdcbe778", "2.1.5", operator.gt), + ("3.4.1", "3.4b1", operator.gt), + ("041206", "200090325", operator.lt), + ("0.6.2+git20130413", "0.6.2", operator.gt), + ("2.6.0+bzr6602", "2.6.0", operator.gt), + ("2.6.0", "2.6b2", operator.gt), + ("2.6.0+bzr6602", "2.6b2x", operator.gt), + ("0.6.7+20150214+git3a710f9", "0.6.7", operator.gt), + ("15.8b", "15.8.0.1", operator.lt), + ("1.2rc1", "1.2.0", operator.lt), ]: ver_a = Version(a) ver_b = Version(b) - self.assertEqual(ver_a.__cmp__(ver_b), result) - self.assertEqual(ver_b.__cmp__(ver_a), -result) + if op is operator.eq: + for o, name in [(op, 'eq'), (operator.ge, 'ge'), (operator.le, 'le')]: + self.assertTrue(o(ver_a, ver_b), '{} {} {}'.format(ver_a, name, ver_b)) + if op is operator.lt: + for o, name in [(op, 'lt'), (operator.le, 'le'), (operator.ne, 'ne')]: + self.assertTrue(o(ver_a, ver_b), '{} {} {}'.format(ver_a, name, ver_b)) + for o, name in [(operator.gt, 'gt'), (operator.ge, 'ge'), (operator.eq, 'eq')]: + self.assertFalse(o(ver_a, ver_b), '{} {} {}'.format(ver_a, name, ver_b)) + if op is operator.gt: + for o, name in [(op, 'gt'), (operator.ge, 'ge'), (operator.ne, 'ne')]: + self.assertTrue(o(ver_a, ver_b), '{} {} {}'.format(ver_a, name, ver_b)) + for o, name in [(operator.lt, 'lt'), (operator.le, 'le'), (operator.eq, 'eq')]: + self.assertFalse(o(ver_a, ver_b), '{} {} {}'.format(ver_a, name, ver_b)) + + def test_msvc_toolset_version(self): + ''' + Ensure that the toolset version returns the correct value for this MSVC + ''' + env = get_fake_env() + cc = env.detect_c_compiler(MachineChoice.HOST) + if cc.get_argument_syntax() != 'msvc': + raise unittest.SkipTest('Test only applies to MSVC-like compilers') + toolset_ver = cc.get_toolset_version() + self.assertIsNotNone(toolset_ver) + # Visual Studio 2015 and older versions do not define VCToolsVersion + # TODO: ICL doesn't set this in the VSC2015 profile either + if cc.id == 'msvc' and int(''.join(cc.version.split('.')[0:2])) < 1910: + return + if 'VCToolsVersion' in os.environ: + vctools_ver = os.environ['VCToolsVersion'] + else: + self.assertIn('VCINSTALLDIR', os.environ) + # See https://devblogs.microsoft.com/cppblog/finding-the-visual-c-compiler-tools-in-visual-studio-2017/ + vctools_ver = (Path(os.environ['VCINSTALLDIR']) / 'Auxiliary' / 'Build' / 'Microsoft.VCToolsVersion.default.txt').read_text() + self.assertTrue(vctools_ver.startswith(toolset_ver), + msg='{!r} does not start with {!r}'.format(vctools_ver, toolset_ver)) + + def test_split_args(self): + split_args = mesonbuild.mesonlib.split_args + join_args = mesonbuild.mesonlib.join_args + if is_windows(): + test_data = [ + # examples from https://docs.microsoft.com/en-us/cpp/c-language/parsing-c-command-line-arguments + (r'"a b c" d e', ['a b c', 'd', 'e'], True), + (r'"ab\"c" "\\" d', ['ab"c', '\\', 'd'], False), + (r'a\\\b d"e f"g h', [r'a\\\b', 'de fg', 'h'], False), + (r'a\\\"b c d', [r'a\"b', 'c', 'd'], False), + (r'a\\\\"b c" d e', [r'a\\b c', 'd', 'e'], False), + # other basics + (r'""', [''], True), + (r'a b c d "" e', ['a', 'b', 'c', 'd', '', 'e'], True), + (r"'a b c' d e", ["'a", 'b', "c'", 'd', 'e'], True), + (r"'a&b&c' d e", ["'a&b&c'", 'd', 'e'], True), + (r"a & b & c d e", ['a', '&', 'b', '&', 'c', 'd', 'e'], True), + (r"'a & b & c d e'", ["'a", '&', 'b', '&', 'c', 'd', "e'"], True), + ('a b\nc\rd \n\re', ['a', 'b', 'c', 'd', 'e'], False), + # more illustrative tests + (r'cl test.cpp /O1 /Fe:test.exe', ['cl', 'test.cpp', '/O1', '/Fe:test.exe'], True), + (r'cl "test.cpp /O1 /Fe:test.exe"', ['cl', 'test.cpp /O1 /Fe:test.exe'], True), + (r'cl /DNAME=\"Bob\" test.cpp', ['cl', '/DNAME="Bob"', 'test.cpp'], False), + (r'cl "/DNAME=\"Bob\"" test.cpp', ['cl', '/DNAME="Bob"', 'test.cpp'], True), + (r'cl /DNAME=\"Bob, Alice\" test.cpp', ['cl', '/DNAME="Bob,', 'Alice"', 'test.cpp'], False), + (r'cl "/DNAME=\"Bob, Alice\"" test.cpp', ['cl', '/DNAME="Bob, Alice"', 'test.cpp'], True), + (r'cl C:\path\with\backslashes.cpp', ['cl', r'C:\path\with\backslashes.cpp'], True), + (r'cl C:\\path\\with\\double\\backslashes.cpp', ['cl', r'C:\\path\\with\\double\\backslashes.cpp'], True), + (r'cl "C:\\path\\with\\double\\backslashes.cpp"', ['cl', r'C:\\path\\with\\double\\backslashes.cpp'], False), + (r'cl C:\path with spaces\test.cpp', ['cl', r'C:\path', 'with', r'spaces\test.cpp'], False), + (r'cl "C:\path with spaces\test.cpp"', ['cl', r'C:\path with spaces\test.cpp'], True), + (r'cl /DPATH="C:\path\with\backslashes test.cpp', ['cl', r'/DPATH=C:\path\with\backslashes test.cpp'], False), + (r'cl /DPATH=\"C:\\ends\\with\\backslashes\\\" test.cpp', ['cl', r'/DPATH="C:\\ends\\with\\backslashes\"', 'test.cpp'], False), + (r'cl /DPATH="C:\\ends\\with\\backslashes\\" test.cpp', ['cl', '/DPATH=C:\\\\ends\\\\with\\\\backslashes\\', 'test.cpp'], False), + (r'cl "/DNAME=\"C:\\ends\\with\\backslashes\\\"" test.cpp', ['cl', r'/DNAME="C:\\ends\\with\\backslashes\"', 'test.cpp'], True), + (r'cl "/DNAME=\"C:\\ends\\with\\backslashes\\\\"" test.cpp', ['cl', r'/DNAME="C:\\ends\\with\\backslashes\\ test.cpp'], False), + (r'cl "/DNAME=\"C:\\ends\\with\\backslashes\\\\\"" test.cpp', ['cl', r'/DNAME="C:\\ends\\with\\backslashes\\"', 'test.cpp'], True), + ] + else: + test_data = [ + (r"'a b c' d e", ['a b c', 'd', 'e'], True), + (r"a/b/c d e", ['a/b/c', 'd', 'e'], True), + (r"a\b\c d e", [r'abc', 'd', 'e'], False), + (r"a\\b\\c d e", [r'a\b\c', 'd', 'e'], False), + (r'"a b c" d e', ['a b c', 'd', 'e'], False), + (r'"a\\b\\c\\" d e', ['a\\b\\c\\', 'd', 'e'], False), + (r"'a\b\c\' d e", ['a\\b\\c\\', 'd', 'e'], True), + (r"'a&b&c' d e", ['a&b&c', 'd', 'e'], True), + (r"a & b & c d e", ['a', '&', 'b', '&', 'c', 'd', 'e'], False), + (r"'a & b & c d e'", ['a & b & c d e'], True), + (r"abd'e f'g h", [r'abde fg', 'h'], False), + ('a b\nc\rd \n\re', ['a', 'b', 'c', 'd', 'e'], False), + + ('g++ -DNAME="Bob" test.cpp', ['g++', '-DNAME=Bob', 'test.cpp'], False), + ("g++ '-DNAME=\"Bob\"' test.cpp", ['g++', '-DNAME="Bob"', 'test.cpp'], True), + ('g++ -DNAME="Bob, Alice" test.cpp', ['g++', '-DNAME=Bob, Alice', 'test.cpp'], False), + ("g++ '-DNAME=\"Bob, Alice\"' test.cpp", ['g++', '-DNAME="Bob, Alice"', 'test.cpp'], True), + ] + + for (cmd, expected, roundtrip) in test_data: + self.assertEqual(split_args(cmd), expected) + if roundtrip: + self.assertEqual(join_args(expected), cmd) + + def test_quote_arg(self): + split_args = mesonbuild.mesonlib.split_args + quote_arg = mesonbuild.mesonlib.quote_arg + if is_windows(): + test_data = [ + ('', '""'), + ('arg1', 'arg1'), + ('/option1', '/option1'), + ('/Ovalue', '/Ovalue'), + ('/OBob&Alice', '/OBob&Alice'), + ('/Ovalue with spaces', r'"/Ovalue with spaces"'), + (r'/O"value with spaces"', r'"/O\"value with spaces\""'), + (r'/OC:\path with spaces\test.exe', r'"/OC:\path with spaces\test.exe"'), + ('/LIBPATH:C:\\path with spaces\\ends\\with\\backslashes\\', r'"/LIBPATH:C:\path with spaces\ends\with\backslashes\\"'), + ('/LIBPATH:"C:\\path with spaces\\ends\\with\\backslashes\\\\"', r'"/LIBPATH:\"C:\path with spaces\ends\with\backslashes\\\\\""'), + (r'/DMSG="Alice said: \"Let\'s go\""', r'"/DMSG=\"Alice said: \\\"Let\'s go\\\"\""'), + ] + else: + test_data = [ + ('arg1', 'arg1'), + ('--option1', '--option1'), + ('-O=value', '-O=value'), + ('-O=Bob&Alice', "'-O=Bob&Alice'"), + ('-O=value with spaces', "'-O=value with spaces'"), + ('-O="value with spaces"', '\'-O=\"value with spaces\"\''), + ('-O=/path with spaces/test', '\'-O=/path with spaces/test\''), + ('-DMSG="Alice said: \\"Let\'s go\\""', "'-DMSG=\"Alice said: \\\"Let'\"'\"'s go\\\"\"'"), + ] + + for (arg, expected) in test_data: + self.assertEqual(quote_arg(arg), expected) + self.assertEqual(split_args(expected)[0], arg) + + def test_depfile(self): + for (f, target, expdeps) in [ + # empty, unknown target + ([''], 'unknown', set()), + # simple target & deps + (['meson/foo.o : foo.c foo.h'], 'meson/foo.o', set({'foo.c', 'foo.h'})), + (['meson/foo.o: foo.c foo.h'], 'foo.c', set()), + # get all deps + (['meson/foo.o: foo.c foo.h', + 'foo.c: gen.py'], 'meson/foo.o', set({'foo.c', 'foo.h', 'gen.py'})), + (['meson/foo.o: foo.c foo.h', + 'foo.c: gen.py'], 'foo.c', set({'gen.py'})), + # linue continuation, multiple targets + (['foo.o \\', 'foo.h: bar'], 'foo.h', set({'bar'})), + (['foo.o \\', 'foo.h: bar'], 'foo.o', set({'bar'})), + # \\ handling + (['foo: Program\\ F\\iles\\\\X'], 'foo', set({'Program Files\\X'})), + # $ handling + (['f$o.o: c/b'], 'f$o.o', set({'c/b'})), + (['f$$o.o: c/b'], 'f$o.o', set({'c/b'})), + # cycles + (['a: b', 'b: a'], 'a', set({'a', 'b'})), + (['a: b', 'b: a'], 'b', set({'a', 'b'})), + ]: + d = mesonbuild.depfile.DepFile(f) + deps = d.get_all_dependencies(target) + self.assertEqual(deps, expdeps) + @unittest.skipIf(is_tarball(), 'Skipping because this is a tarball release') class DataTests(unittest.TestCase): @@ -903,10 +1204,10 @@ with open('docs/markdown/Builtin-options.md') as f: md = f.read() self.assertIsNotNone(md) - env = get_fake_env('', '', '') + env = get_fake_env() # FIXME: Support other compilers - cc = env.detect_c_compiler(False) - cpp = env.detect_cpp_compiler(False) + cc = env.detect_c_compiler(MachineChoice.HOST) + cpp = env.detect_cpp_compiler(MachineChoice.HOST) for comp in (cc, cpp): for opt in comp.get_options().keys(): self.assertIn(opt, md) @@ -914,6 +1215,45 @@ self.assertIn(opt, md) self.assertNotIn('b_unknown', md) + def test_builtin_options_documented(self): + ''' + Test that universal options and base options are documented in + Builtin-Options.md. + ''' + md = None + with open('docs/markdown/Builtin-options.md') as f: + md = f.read() + self.assertIsNotNone(md) + + found_entries = set() + sections = list(re.finditer(r"^## (.+)$", md, re.MULTILINE)) + [None] + + for s1, s2 in zip(sections[:], sections[1:]): + if s1.group(1) == "Universal options": + # Extract the content for this section + end = s2.start() if s2 is not None else len(md) + content = md[s1.end():end] + subsections = list(re.finditer(r"^### (.+)$", content, re.MULTILINE)) + [None] + + for sub1, sub2 in zip(subsections[:], subsections[1:]): + if sub1.group(1) == "Directories" or sub1.group(1) == "Core options": + # Extract the content for this subsection + sub_end = sub2.start() if sub2 is not None else len(content) + subcontent = content[sub1.end():sub_end] + # Find the list entries + arches = [m.group(1) for m in re.finditer(r"^\| (\w+) .* \|", subcontent, re.MULTILINE)] + # Drop the header + arches = set(arches[1:]) + + self.assertEqual(len(found_entries & arches), 0) + found_entries |= arches + break + + self.assertEqual(found_entries, set([ + *mesonbuild.coredata.builtin_options.keys(), + *mesonbuild.coredata.builtin_options_per_machine.keys() + ])) + def test_cpu_families_documented(self): with open("docs/markdown/Reference-tables.md") as f: md = f.read() @@ -944,18 +1284,64 @@ if f not in exceptions: self.assertIn(f, toc) - def test_syntax_highlighting_files(self): + def test_vim_syntax_highlighting(self): ''' - Ensure that syntax highlighting files were updated for new functions in - the global namespace in build files. + Ensure that vim syntax highlighting files were updated for new + functions in the global namespace in build files. ''' - env = get_fake_env('', '', '') + env = get_fake_env() interp = Interpreter(FakeBuild(env), mock=True) with open('data/syntax-highlighting/vim/syntax/meson.vim') as f: res = re.search(r'syn keyword mesonBuiltin(\s+\\\s\w+)+', f.read(), re.MULTILINE) defined = set([a.strip() for a in res.group().split('\\')][1:]) self.assertEqual(defined, set(chain(interp.funcs.keys(), interp.builtin.keys()))) + @unittest.skipIf(is_pull(), 'Skipping because this is a pull request') + def test_json_grammar_syntax_highlighting(self): + ''' + Ensure that syntax highlighting JSON grammar written by TingPing was + updated for new functions in the global namespace in build files. + https://github.com/TingPing/language-meson/ + ''' + env = get_fake_env() + interp = Interpreter(FakeBuild(env), mock=True) + url = 'https://raw.githubusercontent.com/TingPing/language-meson/master/grammars/meson.json' + try: + # Use a timeout to avoid blocking forever in case the network is + # slow or unavailable in a weird way + r = urllib.request.urlopen(url, timeout=URLOPEN_TIMEOUT) + except urllib.error.URLError as e: + # Skip test when network is not available, such as during packaging + # by a distro or Flatpak + if not isinstance(e, urllib.error.HTTPError): + raise unittest.SkipTest('Network unavailable') + # Don't fail the test if github is down, but do fail if 4xx + if e.code >= 500: + raise unittest.SkipTest('Server error ' + str(e.code)) + raise e + # On Python 3.5, we must decode bytes to string. Newer versions don't require that. + grammar = json.loads(r.read().decode('utf-8', 'surrogatepass')) + for each in grammar['patterns']: + if 'name' in each and each['name'] == 'support.function.builtin.meson': + # The string is of the form: (?x)\\b(func1|func2|...\n)\\b\\s*(?=\\() and + # we convert that to [func1, func2, ...] without using regex to parse regex + funcs = set(each['match'].split('\\b(')[1].split('\n')[0].split('|')) + if 'name' in each and each['name'] == 'support.variable.meson': + # \\b(builtin1|builtin2...)\\b + builtin = set(each['match'].split('\\b(')[1].split(')\\b')[0].split('|')) + self.assertEqual(builtin, set(interp.builtin.keys())) + self.assertEqual(funcs, set(interp.funcs.keys())) + + def test_all_functions_defined_in_ast_interpreter(self): + ''' + Ensure that the all functions defined in the Interpreter are also defined + in the AstInterpreter (and vice versa). + ''' + env = get_fake_env() + interp = Interpreter(FakeBuild(env), mock=True) + astint = AstInterpreter('.', '') + self.assertEqual(set(interp.funcs.keys()), set(astint.funcs.keys())) + class BasePlatformTests(unittest.TestCase): def setUp(self): @@ -975,6 +1361,7 @@ self.mconf_command = self.meson_command + ['configure'] self.mintro_command = self.meson_command + ['introspect'] self.wrap_command = self.meson_command + ['wrap'] + self.rewrite_command = self.meson_command + ['rewrite'] # Backend-specific build commands self.build_command, self.clean_command, self.test_command, self.install_command, \ self.uninstall_command = get_backend_commands(self.backend) @@ -983,6 +1370,7 @@ self.vala_test_dir = os.path.join(src_root, 'test cases/vala') self.framework_test_dir = os.path.join(src_root, 'test cases/frameworks') self.unit_test_dir = os.path.join(src_root, 'test cases/unit') + self.rewrite_test_dir = os.path.join(src_root, 'test cases/rewrite') # Misc stuff self.orig_env = os.environ.copy() if self.backend is Backend.ninja: @@ -1005,9 +1393,17 @@ self.builddirs.append(self.builddir) def new_builddir(self): + if not is_cygwin(): + # Keep builddirs inside the source tree so that virus scanners + # don't complain + newdir = tempfile.mkdtemp(dir=os.getcwd()) + else: + # But not on Cygwin because that breaks the umask tests. See: + # https://github.com/mesonbuild/meson/pull/5546#issuecomment-509666523 + newdir = tempfile.mkdtemp() # In case the directory is inside a symlinked directory, find the real # path otherwise we might not find the srcdir from inside the builddir. - newdir = os.path.realpath(tempfile.mkdtemp()) + newdir = os.path.realpath(newdir) self.change_builddir(newdir) def _print_meson_log(self): @@ -1028,7 +1424,7 @@ os.environ.update(self.orig_env) super().tearDown() - def _run(self, command, workdir=None): + def _run(self, command, *, workdir=None, override_envvars=None): ''' Run a command while printing the stdout and stderr to stdout, and also return a copy of it @@ -1036,8 +1432,14 @@ # If this call hangs CI will just abort. It is very hard to distinguish # between CI issue and test bug in that case. Set timeout and fail loud # instead. + if override_envvars is None: + env = None + else: + env = os.environ.copy() + env.update(override_envvars) + p = subprocess.run(command, stdout=subprocess.PIPE, - stderr=subprocess.STDOUT, env=os.environ.copy(), + stderr=subprocess.STDOUT, env=env, universal_newlines=True, cwd=workdir, timeout=60 * 5) print(p.stdout) if p.returncode != 0: @@ -1046,7 +1448,11 @@ raise subprocess.CalledProcessError(p.returncode, command, output=p.stdout) return p.stdout - def init(self, srcdir, extra_args=None, default_args=True, inprocess=False): + def init(self, srcdir, *, + extra_args=None, + default_args=True, + inprocess=False, + override_envvars=None): self.assertPathExists(srcdir) if extra_args is None: extra_args = [] @@ -1061,7 +1467,13 @@ self.privatedir = os.path.join(self.builddir, 'meson-private') if inprocess: try: + if override_envvars is not None: + old_envvars = os.environ.copy() + os.environ.update(override_envvars) (returncode, out, err) = run_configure_inprocess(self.meson_args + args + extra_args) + if override_envvars is not None: + os.environ.clear() + os.environ.update(old_envvars) if 'MESON_SKIP_TEST' in out: raise unittest.SkipTest('Project requested skipping.') if returncode != 0: @@ -1071,7 +1483,7 @@ print('Stderr:\n') print(err) raise RuntimeError('Configure failed') - except: + except Exception: self._print_meson_log() raise finally: @@ -1081,48 +1493,60 @@ mesonbuild.mlog.log_file = None else: try: - out = self._run(self.setup_command + args + extra_args) + out = self._run(self.setup_command + args + extra_args, override_envvars=override_envvars) except unittest.SkipTest: raise unittest.SkipTest('Project requested skipping: ' + srcdir) - except: + except Exception: self._print_meson_log() raise return out - def build(self, target=None, extra_args=None): + def build(self, target=None, *, extra_args=None, override_envvars=None): if extra_args is None: extra_args = [] # Add arguments for building the target (if specified), # and using the build dir (if required, with VS) args = get_builddir_target_args(self.backend, self.builddir, target) - return self._run(self.build_command + args + extra_args, workdir=self.builddir) + return self._run(self.build_command + args + extra_args, workdir=self.builddir, override_envvars=override_envvars) - def clean(self): + def clean(self, *, override_envvars=None): dir_args = get_builddir_target_args(self.backend, self.builddir, None) - self._run(self.clean_command + dir_args, workdir=self.builddir) + self._run(self.clean_command + dir_args, workdir=self.builddir, override_envvars=override_envvars) - def run_tests(self, inprocess=False): + def run_tests(self, *, inprocess=False, override_envvars=None): if not inprocess: - self._run(self.test_command, workdir=self.builddir) + self._run(self.test_command, workdir=self.builddir, override_envvars=override_envvars) else: - run_mtest_inprocess(['-C', self.builddir]) + if override_envvars is not None: + old_envvars = os.environ.copy() + os.environ.update(override_envvars) + try: + run_mtest_inprocess(['-C', self.builddir]) + finally: + if override_envvars is not None: + os.environ.clear() + os.environ.update(old_envvars) - def install(self, *, use_destdir=True): + def install(self, *, use_destdir=True, override_envvars=None): if self.backend is not Backend.ninja: raise unittest.SkipTest('{!r} backend can\'t install files'.format(self.backend.name)) if use_destdir: - os.environ['DESTDIR'] = self.installdir - self._run(self.install_command, workdir=self.builddir) + destdir = {'DESTDIR': self.installdir} + if override_envvars is None: + override_envvars = destdir + else: + override_envvars.update(destdir) + self._run(self.install_command, workdir=self.builddir, override_envvars=override_envvars) - def uninstall(self): - self._run(self.uninstall_command, workdir=self.builddir) + def uninstall(self, *, override_envvars=None): + self._run(self.uninstall_command, workdir=self.builddir, override_envvars=override_envvars) - def run_target(self, target): + def run_target(self, target, *, override_envvars=None): ''' Run a Ninja target while printing the stdout and stderr to stdout, and also return a copy of it ''' - return self.build(target=target) + return self.build(target=target, override_envvars=override_envvars) def setconf(self, arg, will_build=True): if not isinstance(arg, list): @@ -1186,7 +1610,12 @@ args = [args] out = subprocess.check_output(self.mintro_command + args + [directory], universal_newlines=True) - return json.loads(out) + try: + obj = json.loads(out) + except Exception as e: + print(out) + raise e + return obj def assertPathEqual(self, path1, path2): ''' @@ -1195,6 +1624,15 @@ ''' self.assertEqual(PurePath(path1), PurePath(path2)) + def assertPathListEqual(self, pathlist1, pathlist2): + self.assertEqual(len(pathlist1), len(pathlist2)) + worklist = list(zip(pathlist1, pathlist2)) + for i in worklist: + if i[0] is None: + self.assertEqual(i[0], i[1]) + else: + self.assertPathEqual(i[0], i[1]) + def assertPathBasenameEqual(self, path, basename): msg = '{!r} does not end with {!r}'.format(path, basename) # We cannot use os.path.basename because it returns '' when the path @@ -1248,13 +1686,14 @@ ''' Tests that should run on all platforms ''' + def test_default_options_prefix(self): ''' Tests that setting a prefix in default_options in project() works. Can't be an ordinary test because we pass --prefix to meson there. https://github.com/mesonbuild/meson/issues/1349 ''' - testdir = os.path.join(self.common_test_dir, '91 default options') + testdir = os.path.join(self.common_test_dir, '90 default options') self.init(testdir, default_args=False) opts = self.introspect('--buildoptions') for opt in opts: @@ -1262,6 +1701,21 @@ prefix = opt['value'] self.assertEqual(prefix, '/absoluteprefix') + def test_do_conf_file_preserve_newlines(self): + + def conf_file(in_data, confdata): + with temp_filename() as fin: + with open(fin, 'wb') as fobj: + fobj.write(in_data.encode('utf-8')) + with temp_filename() as fout: + mesonbuild.mesonlib.do_conf_file(fin, fout, confdata, 'meson') + with open(fout, 'rb') as fobj: + return fobj.read().decode('utf-8') + + confdata = {'VAR': ('foo', 'bar')} + self.assertEqual(conf_file('@VAR@\n@VAR@\n', confdata), 'foo\nfoo\n') + self.assertEqual(conf_file('@VAR@\r\n@VAR@\r\n', confdata), 'foo\r\nfoo\r\n') + def test_absolute_prefix_libdir(self): ''' Tests that setting absolute paths for --prefix and --libdir work. Can't @@ -1269,14 +1723,14 @@ https://github.com/mesonbuild/meson/issues/1341 https://github.com/mesonbuild/meson/issues/1345 ''' - testdir = os.path.join(self.common_test_dir, '91 default options') + testdir = os.path.join(self.common_test_dir, '90 default options') prefix = '/someabs' libdir = 'libdir' extra_args = ['--prefix=' + prefix, # This can just be a relative path, but we want to test # that passing this as an absolute path also works '--libdir=' + prefix + '/' + libdir] - self.init(testdir, extra_args, default_args=False) + self.init(testdir, extra_args=extra_args, default_args=False) opts = self.introspect('--buildoptions') for opt in opts: if opt['name'] == 'prefix': @@ -1292,11 +1746,11 @@ testdir = os.path.join(self.common_test_dir, '1 trivial') # libdir being inside prefix is ok args = ['--prefix', '/opt', '--libdir', '/opt/lib32'] - self.init(testdir, args) + self.init(testdir, extra_args=args) self.wipe() # libdir not being inside prefix is not ok args = ['--prefix', '/usr', '--libdir', '/opt/lib32'] - self.assertRaises(subprocess.CalledProcessError, self.init, testdir, args) + self.assertRaises(subprocess.CalledProcessError, self.init, testdir, extra_args=args) self.wipe() # libdir must be inside prefix even when set via mesonconf self.init(testdir) @@ -1336,7 +1790,7 @@ } for prefix in expected: args = ['--prefix', prefix] - self.init(testdir, args, default_args=False) + self.init(testdir, extra_args=args, default_args=False) opts = self.introspect('--buildoptions') for opt in opts: name = opt['name'] @@ -1351,7 +1805,7 @@ dependent defaults for other options, and that those defaults can be overridden in default_options or by the command line. ''' - testdir = os.path.join(self.common_test_dir, '169 default options prefix dependent defaults') + testdir = os.path.join(self.common_test_dir, '168 default options prefix dependent defaults') expected = { '': {'prefix': '/usr', @@ -1375,7 +1829,7 @@ 'sharedstatedir': '/var/state'}, } for args in expected: - self.init(testdir, args.split(), default_args=False) + self.init(testdir, extra_args=args.split(), default_args=False) opts = self.introspect('--buildoptions') for opt in opts: name = opt['name'] @@ -1384,6 +1838,14 @@ self.assertEqual(value, expected[args][name]) self.wipe() + def test_clike_get_library_dirs(self): + env = get_fake_env() + cc = env.detect_c_compiler(MachineChoice.HOST) + for d in cc.get_library_dirs(env): + self.assertTrue(os.path.exists(d)) + self.assertTrue(os.path.isdir(d)) + self.assertTrue(os.path.isabs(d)) + def test_static_library_overwrite(self): ''' Tests that static libraries are never appended to, always overwritten. @@ -1394,7 +1856,7 @@ ''' testdir = os.path.join(self.common_test_dir, '3 static') env = get_fake_env(testdir, self.builddir, self.prefix) - cc = env.detect_c_compiler(False) + cc = env.detect_c_compiler(MachineChoice.HOST) static_linker = env.detect_static_linker(cc) if is_windows(): raise unittest.SkipTest('https://github.com/mesonbuild/meson/issues/1526') @@ -1405,7 +1867,7 @@ # Get name of static library targets = self.introspect('--targets') self.assertEqual(len(targets), 1) - libname = targets[0]['filename'] + libname = targets[0]['filename'][0] # Build and get contents of static library self.build() before = self._run(['ar', 't', os.path.join(self.builddir, libname)]).split() @@ -1446,7 +1908,7 @@ Test that run_targets are run from the correct directory https://github.com/mesonbuild/meson/issues/957 ''' - testdir = os.path.join(self.common_test_dir, '55 run target') + testdir = os.path.join(self.common_test_dir, '54 run target') self.init(testdir) self.run_target('check_exists') @@ -1462,8 +1924,56 @@ intro = self.introspect('--targets') if intro[0]['type'] == 'executable': intro = intro[::-1] - self.assertPathEqual(intro[0]['install_filename'], '/usr/lib/libstat.a') - self.assertPathEqual(intro[1]['install_filename'], '/usr/bin/prog' + exe_suffix) + self.assertPathListEqual(intro[0]['install_filename'], ['/usr/lib/libstat.a']) + self.assertPathListEqual(intro[1]['install_filename'], ['/usr/bin/prog' + exe_suffix]) + + def test_install_subdir_introspection(self): + ''' + Test that the Meson introspection API also contains subdir install information + https://github.com/mesonbuild/meson/issues/5556 + ''' + testdir = os.path.join(self.common_test_dir, '62 install subdir') + self.init(testdir) + intro = self.introspect('--installed') + expected = { + 'sub2': 'share/sub2', + 'subdir/sub1': 'share/sub1', + 'subdir/sub_elided': 'share', + 'sub1': 'share/sub1', + 'sub/sub1': 'share/sub1', + 'sub_elided': 'share', + 'nested_elided/sub': 'share', + } + + self.assertEqual(len(intro), len(expected)) + + # Convert expected to PurePath + expected_converted = {PurePath(os.path.join(testdir, key)): PurePath(os.path.join(self.prefix, val)) for key, val in expected.items()} + intro_converted = {PurePath(key): PurePath(val) for key, val in intro.items()} + + for src, dst in expected_converted.items(): + self.assertIn(src, intro_converted) + self.assertEqual(dst, intro_converted[src]) + + def test_install_introspection_multiple_outputs(self): + ''' + Tests that the Meson introspection API exposes multiple install filenames correctly without crashing + https://github.com/mesonbuild/meson/pull/4555 + + Reverted to the first file only because of https://github.com/mesonbuild/meson/pull/4547#discussion_r244173438 + TODO Change the format to a list officialy in a followup PR + ''' + if self.backend is not Backend.ninja: + raise unittest.SkipTest('{!r} backend can\'t install files'.format(self.backend.name)) + testdir = os.path.join(self.common_test_dir, '144 custom target multiple outputs') + self.init(testdir) + intro = self.introspect('--targets') + if intro[0]['type'] == 'executable': + intro = intro[::-1] + self.assertPathListEqual(intro[0]['install_filename'], ['/usr/include/diff.h', '/usr/bin/diff.sh']) + self.assertPathListEqual(intro[1]['install_filename'], ['/opt/same.h', '/opt/same.sh']) + self.assertPathListEqual(intro[2]['install_filename'], ['/usr/include/first.h', None]) + self.assertPathListEqual(intro[3]['install_filename'], [None, '/usr/bin/second.sh']) def test_uninstall(self): exename = os.path.join(self.installdir, 'usr/bin/prog' + exe_suffix) @@ -1477,13 +1987,24 @@ def test_forcefallback(self): testdir = os.path.join(self.unit_test_dir, '31 forcefallback') - self.init(testdir, ['--wrap-mode=forcefallback']) + self.init(testdir, extra_args=['--wrap-mode=forcefallback']) self.build() self.run_tests() + def test_env_ops_dont_stack(self): + ''' + Test that env ops prepend/append do not stack, and that this usage issues a warning + ''' + testdir = os.path.join(self.unit_test_dir, '63 test env does not stack') + out = self.init(testdir) + self.assertRegex(out, r'WARNING: Overriding.*TEST_VAR_APPEND') + self.assertRegex(out, r'WARNING: Overriding.*TEST_VAR_PREPEND') + self.assertNotRegex(out, r'WARNING: Overriding.*TEST_VAR_SET') + self.run_tests() + def test_testsetups(self): if not shutil.which('valgrind'): - raise unittest.SkipTest('Valgrind not installed.') + raise unittest.SkipTest('Valgrind not installed.') testdir = os.path.join(self.unit_test_dir, '2 testsetups') self.init(testdir) self.build() @@ -1537,7 +2058,7 @@ self.mtest_command + ['--setup=main:onlyinbar']) def test_testsetup_default(self): - testdir = os.path.join(self.unit_test_dir, '47 testsetup default') + testdir = os.path.join(self.unit_test_dir, '49 testsetup default') self.init(testdir) self.build() @@ -1580,51 +2101,51 @@ self.init(testdir) self.build() - self.assertFailedTestCount(3, self.mtest_command) + self.assertFailedTestCount(4, self.mtest_command) self.assertFailedTestCount(0, self.mtest_command + ['--suite', ':success']) self.assertFailedTestCount(3, self.mtest_command + ['--suite', ':fail']) - self.assertFailedTestCount(3, self.mtest_command + ['--no-suite', ':success']) - self.assertFailedTestCount(0, self.mtest_command + ['--no-suite', ':fail']) + self.assertFailedTestCount(4, self.mtest_command + ['--no-suite', ':success']) + self.assertFailedTestCount(1, self.mtest_command + ['--no-suite', ':fail']) self.assertFailedTestCount(1, self.mtest_command + ['--suite', 'mainprj']) self.assertFailedTestCount(0, self.mtest_command + ['--suite', 'subprjsucc']) self.assertFailedTestCount(1, self.mtest_command + ['--suite', 'subprjfail']) self.assertFailedTestCount(1, self.mtest_command + ['--suite', 'subprjmix']) - self.assertFailedTestCount(2, self.mtest_command + ['--no-suite', 'mainprj']) - self.assertFailedTestCount(3, self.mtest_command + ['--no-suite', 'subprjsucc']) - self.assertFailedTestCount(2, self.mtest_command + ['--no-suite', 'subprjfail']) - self.assertFailedTestCount(2, self.mtest_command + ['--no-suite', 'subprjmix']) + self.assertFailedTestCount(3, self.mtest_command + ['--no-suite', 'mainprj']) + self.assertFailedTestCount(4, self.mtest_command + ['--no-suite', 'subprjsucc']) + self.assertFailedTestCount(3, self.mtest_command + ['--no-suite', 'subprjfail']) + self.assertFailedTestCount(3, self.mtest_command + ['--no-suite', 'subprjmix']) self.assertFailedTestCount(1, self.mtest_command + ['--suite', 'mainprj:fail']) self.assertFailedTestCount(0, self.mtest_command + ['--suite', 'mainprj:success']) - self.assertFailedTestCount(2, self.mtest_command + ['--no-suite', 'mainprj:fail']) - self.assertFailedTestCount(3, self.mtest_command + ['--no-suite', 'mainprj:success']) + self.assertFailedTestCount(3, self.mtest_command + ['--no-suite', 'mainprj:fail']) + self.assertFailedTestCount(4, self.mtest_command + ['--no-suite', 'mainprj:success']) self.assertFailedTestCount(1, self.mtest_command + ['--suite', 'subprjfail:fail']) self.assertFailedTestCount(0, self.mtest_command + ['--suite', 'subprjfail:success']) - self.assertFailedTestCount(2, self.mtest_command + ['--no-suite', 'subprjfail:fail']) - self.assertFailedTestCount(3, self.mtest_command + ['--no-suite', 'subprjfail:success']) + self.assertFailedTestCount(3, self.mtest_command + ['--no-suite', 'subprjfail:fail']) + self.assertFailedTestCount(4, self.mtest_command + ['--no-suite', 'subprjfail:success']) self.assertFailedTestCount(0, self.mtest_command + ['--suite', 'subprjsucc:fail']) self.assertFailedTestCount(0, self.mtest_command + ['--suite', 'subprjsucc:success']) - self.assertFailedTestCount(3, self.mtest_command + ['--no-suite', 'subprjsucc:fail']) - self.assertFailedTestCount(3, self.mtest_command + ['--no-suite', 'subprjsucc:success']) + self.assertFailedTestCount(4, self.mtest_command + ['--no-suite', 'subprjsucc:fail']) + self.assertFailedTestCount(4, self.mtest_command + ['--no-suite', 'subprjsucc:success']) self.assertFailedTestCount(1, self.mtest_command + ['--suite', 'subprjmix:fail']) self.assertFailedTestCount(0, self.mtest_command + ['--suite', 'subprjmix:success']) - self.assertFailedTestCount(2, self.mtest_command + ['--no-suite', 'subprjmix:fail']) - self.assertFailedTestCount(3, self.mtest_command + ['--no-suite', 'subprjmix:success']) + self.assertFailedTestCount(3, self.mtest_command + ['--no-suite', 'subprjmix:fail']) + self.assertFailedTestCount(4, self.mtest_command + ['--no-suite', 'subprjmix:success']) self.assertFailedTestCount(2, self.mtest_command + ['--suite', 'subprjfail', '--suite', 'subprjmix:fail']) self.assertFailedTestCount(3, self.mtest_command + ['--suite', 'subprjfail', '--suite', 'subprjmix', '--suite', 'mainprj']) self.assertFailedTestCount(2, self.mtest_command + ['--suite', 'subprjfail', '--suite', 'subprjmix', '--suite', 'mainprj', '--no-suite', 'subprjmix:fail']) self.assertFailedTestCount(1, self.mtest_command + ['--suite', 'subprjfail', '--suite', 'subprjmix', '--suite', 'mainprj', '--no-suite', 'subprjmix:fail', 'mainprj-failing_test']) - self.assertFailedTestCount(1, self.mtest_command + ['--no-suite', 'subprjfail:fail', '--no-suite', 'subprjmix:fail']) + self.assertFailedTestCount(2, self.mtest_command + ['--no-suite', 'subprjfail:fail', '--no-suite', 'subprjmix:fail']) def test_build_by_default(self): - testdir = os.path.join(self.common_test_dir, '134 build by default') + testdir = os.path.join(self.common_test_dir, '133 build by default') self.init(testdir) self.build() genfile1 = os.path.join(self.builddir, 'generated1.dat') @@ -1641,7 +2162,7 @@ self.assertPathExists(exe2) def test_internal_include_order(self): - testdir = os.path.join(self.common_test_dir, '135 include order') + testdir = os.path.join(self.common_test_dir, '134 include order') self.init(testdir) execmd = fxecmd = None for cmd in self.get_compdb(): @@ -1654,7 +2175,7 @@ if not execmd or not fxecmd: raise Exception('Could not find someexe and somfxe commands') # Check include order for 'someexe' - incs = [a for a in shlex.split(execmd) if a.startswith("-I")] + incs = [a for a in split_args(execmd) if a.startswith("-I")] self.assertEqual(len(incs), 9) # target private dir someexe_id = Target.construct_id_from_path("sub4", "someexe", "@exe") @@ -1676,7 +2197,7 @@ # custom target include dir self.assertPathEqual(incs[8], '-Ictsub') # Check include order for 'somefxe' - incs = [a for a in shlex.split(fxecmd) if a.startswith('-I')] + incs = [a for a in split_args(fxecmd) if a.startswith('-I')] self.assertEqual(len(incs), 9) # target private dir self.assertPathEqual(incs[0], '-Isomefxe@exe') @@ -1705,9 +2226,9 @@ ''' gnu = mesonbuild.compilers.GnuCompiler clang = mesonbuild.compilers.ClangCompiler - intel = mesonbuild.compilers.IntelCompiler - msvc = mesonbuild.compilers.VisualStudioCCompiler - clangcl = mesonbuild.compilers.ClangClCCompiler + intel = mesonbuild.compilers.IntelGnuLikeCompiler + msvc = (mesonbuild.compilers.VisualStudioCCompiler, mesonbuild.compilers.VisualStudioCPPCompiler) + clangcl = (mesonbuild.compilers.ClangClCCompiler, mesonbuild.compilers.ClangClCPPCompiler) ar = mesonbuild.linkers.ArLinker lib = mesonbuild.linkers.VisualStudioLinker langs = [('c', 'CC'), ('cpp', 'CXX')] @@ -1718,7 +2239,7 @@ for lang, evar in langs: # Detect with evar and do sanity checks on that if evar in os.environ: - ecc = getattr(env, 'detect_{}_compiler'.format(lang))(False) + ecc = getattr(env, 'detect_{}_compiler'.format(lang))(MachineChoice.HOST) self.assertTrue(ecc.version) elinker = env.detect_static_linker(ecc) # Pop it so we don't use it for the next detection @@ -1744,9 +2265,9 @@ else: raise AssertionError('Unknown compiler {!r}'.format(evalue)) # Check that we actually used the evalue correctly as the compiler - self.assertEqual(ecc.get_exelist(), shlex.split(evalue)) + self.assertEqual(ecc.get_exelist(), split_args(evalue)) # Do auto-detection of compiler based on platform, PATH, etc. - cc = getattr(env, 'detect_{}_compiler'.format(lang))(False) + cc = getattr(env, 'detect_{}_compiler'.format(lang))(MachineChoice.HOST) self.assertTrue(cc.version) linker = env.detect_static_linker(cc) # Check compiler type @@ -1795,14 +2316,14 @@ wrappercc = python_command + [wrapper] + cc.get_exelist() + ['-DSOME_ARG'] wrappercc_s = '' for w in wrappercc: - wrappercc_s += shlex.quote(w) + ' ' + wrappercc_s += quote_arg(w) + ' ' os.environ[evar] = wrappercc_s - wcc = getattr(env, 'detect_{}_compiler'.format(lang))(False) + wcc = getattr(env, 'detect_{}_compiler'.format(lang))(MachineChoice.HOST) # Check static linker too wrapperlinker = python_command + [wrapper] + linker.get_exelist() + linker.get_always_args() wrapperlinker_s = '' for w in wrapperlinker: - wrapperlinker_s += shlex.quote(w) + ' ' + wrapperlinker_s += quote_arg(w) + ' ' os.environ['AR'] = wrapperlinker_s wlinker = env.detect_static_linker(wcc) # Pop it so we don't use it for the next detection @@ -1819,16 +2340,16 @@ self.assertEqual(cc.is_64, wcc.is_64) def test_always_prefer_c_compiler_for_asm(self): - testdir = os.path.join(self.common_test_dir, '138 c cpp and asm') + testdir = os.path.join(self.common_test_dir, '137 c cpp and asm') # Skip if building with MSVC env = get_fake_env(testdir, self.builddir, self.prefix) - if env.detect_c_compiler(False).get_id() == 'msvc': + if env.detect_c_compiler(MachineChoice.HOST).get_id() == 'msvc': raise unittest.SkipTest('MSVC can\'t compile assembly') self.init(testdir) commands = {'c-asm': {}, 'cpp-asm': {}, 'cpp-c-asm': {}, 'c-cpp-asm': {}} for cmd in self.get_compdb(): # Get compiler - split = shlex.split(cmd['command']) + split = split_args(cmd['command']) if split[0] == 'ccache': compiler = split[1] else: @@ -1886,22 +2407,25 @@ def test_preprocessor_checks_CPPFLAGS(self): ''' - Test that preprocessor compiler checks read CPPFLAGS but not CFLAGS + Test that preprocessor compiler checks read CPPFLAGS and also CFLAGS but + not LDFLAGS. ''' - testdir = os.path.join(self.common_test_dir, '137 get define') + testdir = os.path.join(self.common_test_dir, '136 get define') define = 'MESON_TEST_DEFINE_VALUE' # NOTE: this list can't have \n, ' or " # \n is never substituted by the GNU pre-processor via a -D define - # ' and " confuse shlex.split() even when they are escaped + # ' and " confuse split_args() even when they are escaped # % and # confuse the MSVC preprocessor # !, ^, *, and < confuse lcc preprocessor value = 'spaces and fun@$&()-=_+{}[]:;>?,./~`' - os.environ['CPPFLAGS'] = '-D{}="{}"'.format(define, value) - os.environ['CFLAGS'] = '-DMESON_FAIL_VALUE=cflags-read'.format(define) - self.init(testdir, ['-D{}={}'.format(define, value)]) + for env_var in ['CPPFLAGS', 'CFLAGS']: + env = {} + env[env_var] = '-D{}="{}"'.format(define, value) + env['LDFLAGS'] = '-DMESON_FAIL_VALUE=cflags-read'.format(define) + self.init(testdir, extra_args=['-D{}={}'.format(define, value)], override_envvars=env) def test_custom_target_exe_data_deterministic(self): - testdir = os.path.join(self.common_test_dir, '114 custom target capture') + testdir = os.path.join(self.common_test_dir, '113 custom target capture') self.init(testdir) meson_exe_dat1 = glob(os.path.join(self.privatedir, 'meson_exe*.dat')) self.wipe() @@ -1930,7 +2454,7 @@ ExternalProgram, and any File objects on the command-line cause a rebuild. ''' - testdir = os.path.join(self.common_test_dir, '61 custom header generator') + testdir = os.path.join(self.common_test_dir, '60 custom header generator') self.init(testdir) self.build() # Immediately rebuilding should not do anything @@ -1940,6 +2464,20 @@ self.utime(os.path.join(testdir, f)) self.assertRebuiltTarget('prog') + def test_source_generator_program_cause_rebuild(self): + ''' + Test that changes to generator programs in the source tree cause + a rebuild. + ''' + testdir = os.path.join(self.common_test_dir, '94 gen extra') + self.init(testdir) + self.build() + # Immediately rebuilding should not do anything + self.assertBuildIsNoop() + # Changing mtime of generator should rebuild the executable + self.utime(os.path.join(testdir, 'srcgen.py')) + self.assertRebuiltTarget('basic') + def test_static_library_lto(self): ''' Test that static libraries can be built with LTO and linked to @@ -1947,6 +2485,11 @@ https://github.com/mesonbuild/meson/issues/1646 ''' testdir = os.path.join(self.common_test_dir, '5 linkstatic') + + env = get_fake_env(testdir, self.builddir, self.prefix) + if env.detect_c_compiler(MachineChoice.HOST).get_id() == 'clang' and is_windows(): + raise unittest.SkipTest('LTO not (yet) supported by windows clang') + self.init(testdir, extra_args='-Db_lto=true') self.build() self.run_tests() @@ -2020,13 +2563,21 @@ return 0; } ''') + xz_distfile = os.path.join(self.distdir, 'disttest-1.4.3.tar.xz') + xz_checksumfile = xz_distfile + '.sha256sum' + zip_distfile = os.path.join(self.distdir, 'disttest-1.4.3.zip') + zip_checksumfile = zip_distfile + '.sha256sum' vcs_init(project_dir) self.init(project_dir) self.build('dist') - distfile = os.path.join(self.distdir, 'disttest-1.4.3.tar.xz') - checksumfile = distfile + '.sha256sum' - self.assertPathExists(distfile) - self.assertPathExists(checksumfile) + self.assertPathExists(xz_distfile) + self.assertPathExists(xz_checksumfile) + self.assertPathDoesNotExist(zip_distfile) + self.assertPathDoesNotExist(zip_checksumfile) + self._run(self.meson_command + ['dist', '--formats', 'zip'], + workdir=self.builddir) + self.assertPathExists(zip_distfile) + self.assertPathExists(zip_checksumfile) def test_rpath_uses_ORIGIN(self): ''' @@ -2036,12 +2587,12 @@ ''' if is_windows() or is_cygwin(): raise unittest.SkipTest('Windows PE/COFF binaries do not use RPATH') - testdir = os.path.join(self.common_test_dir, '43 library chain') + testdir = os.path.join(self.common_test_dir, '42 library chain') self.init(testdir) self.build() for each in ('prog', 'subdir/liblib1.so', ): rpath = get_rpath(os.path.join(self.builddir, each)) - self.assertTrue(rpath) + self.assertTrue(rpath, 'Rpath could not be determined for {}.'.format(each)) if is_dragonflybsd(): # DragonflyBSD will prepend /usr/lib/gccVERSION to the rpath, # so ignore that. @@ -2072,10 +2623,10 @@ def test_all_forbidden_targets_tested(self): ''' - Test that all forbidden targets are tested in the '155 reserved targets' + Test that all forbidden targets are tested in the '154 reserved targets' test. Needs to be a unit test because it accesses Meson internals. ''' - testdir = os.path.join(self.common_test_dir, '155 reserved targets') + testdir = os.path.join(self.common_test_dir, '154 reserved targets') targets = mesonbuild.coredata.forbidden_target_names # We don't actually define a target with this name targets.pop('build.ninja') @@ -2086,8 +2637,8 @@ self.assertPathExists(os.path.join(testdir, i)) def detect_prebuild_env(self): - env = get_fake_env('', self.builddir, self.prefix) - cc = env.detect_c_compiler(False) + env = get_fake_env() + cc = env.detect_c_compiler(MachineChoice.HOST) stlinker = env.detect_static_linker(cc) if mesonbuild.mesonlib.is_windows(): object_suffix = 'obj' @@ -2103,8 +2654,9 @@ shared_suffix = 'so' return (cc, stlinker, object_suffix, shared_suffix) - def pbcompile(self, compiler, source, objectfile, extra_args=[]): + def pbcompile(self, compiler, source, objectfile, extra_args=None): cmd = compiler.get_exelist() + extra_args = extra_args or [] if compiler.get_argument_syntax() == 'msvc': cmd += ['/nologo', '/Fo' + objectfile, '/c', source] + extra_args else: @@ -2165,7 +2717,9 @@ '/NOLOGO', '/DLL', '/DEBUG', '/IMPLIB:' + impfile, '/OUT:' + outfile, objectfile] else: - extra_args += ['-fPIC'] + if not (compiler.compiler_type.is_windows_compiler or + compiler.compiler_type.is_osx_compiler): + extra_args += ['-fPIC'] link_cmd = compiler.get_exelist() + ['-shared', '-o', outfile, objectfile] if not mesonbuild.mesonlib.is_osx(): link_cmd += ['-Wl,-soname=' + os.path.basename(outfile)] @@ -2229,9 +2783,8 @@ self.build_static_lib(cc, stlinker, source, objectfile, stlibfile, extra_args=['-DFOO_STATIC']) self.build_shared_lib(cc, source, objectfile, shlibfile, impfile) # Run test - os.environ['PKG_CONFIG_LIBDIR'] = self.builddir try: - self.init(testdir) + self.init(testdir, override_envvars={'PKG_CONFIG_LIBDIR': self.builddir}) self.build() self.run_tests() finally: @@ -2246,7 +2799,7 @@ @skipIfNoPkgconfig def test_pkgconfig_gen_escaping(self): - testdir = os.path.join(self.common_test_dir, '48 pkgconfig-gen') + testdir = os.path.join(self.common_test_dir, '47 pkgconfig-gen') prefix = '/usr/with spaces' libdir = 'lib' self.init(testdir, extra_args=['--prefix=' + prefix, @@ -2279,6 +2832,7 @@ 'section': 'user', 'type': 'array', 'value': ['foo', 'bar'], + 'machine': 'any', } tdir = os.path.join(self.unit_test_dir, '19 array option') self.init(tdir) @@ -2304,6 +2858,7 @@ 'section': 'user', 'type': 'array', 'value': ['foo', 'bar'], + 'machine': 'any', } tdir = os.path.join(self.unit_test_dir, '19 array option') self.init(tdir) @@ -2329,6 +2884,7 @@ 'section': 'user', 'type': 'array', 'value': [], + 'machine': 'any', } tdir = os.path.join(self.unit_test_dir, '19 array option') self.init(tdir, extra_args='-Dlist=') @@ -2346,7 +2902,7 @@ self.assertTrue(found, "Array option not found in introspect data.") def test_free_stringarray_setting(self): - testdir = os.path.join(self.common_test_dir, '44 options') + testdir = os.path.join(self.common_test_dir, '43 options') self.init(testdir) self.opt_has('free_array_opt', []) self.setconf('-Dfree_array_opt=foo,bar', will_build=False) @@ -2424,9 +2980,9 @@ if ninja is None: raise unittest.SkipTest('This test currently requires ninja. Fix this once "meson build" works.') for lang in ('c', 'cpp'): - for type in ('executable', 'library'): + for target_type in ('executable', 'library'): with tempfile.TemporaryDirectory() as tmpdir: - self._run(self.meson_command + ['init', '--language', lang, '--type', type], + self._run(self.meson_command + ['init', '--language', lang, '--type', target_type], workdir=tmpdir) self._run(self.setup_command + ['--backend=ninja', 'builddir'], workdir=tmpdir) @@ -2445,11 +3001,15 @@ def test_cross_file_system_paths(self): if is_windows(): raise unittest.SkipTest('system crossfile paths not defined for Windows (yet)') + if is_sunos(): + cc = 'gcc' + else: + cc = 'cc' testdir = os.path.join(self.common_test_dir, '1 trivial') cross_content = textwrap.dedent("""\ [binaries] - c = '/usr/bin/cc' + c = '/usr/bin/{}' ar = '/usr/bin/ar' strip = '/usr/bin/ar' @@ -2460,7 +3020,7 @@ cpu_family = 'x86' cpu = 'i686' endian = 'little' - """) + """.format(cc)) with tempfile.TemporaryDirectory() as d: dir_ = os.path.join(d, 'meson', 'cross') @@ -2470,12 +3030,12 @@ name = os.path.basename(f.name) with mock.patch.dict(os.environ, {'XDG_DATA_HOME': d}): - self.init(testdir, ['--cross-file=' + name], inprocess=True) + self.init(testdir, extra_args=['--cross-file=' + name], inprocess=True) self.wipe() with mock.patch.dict(os.environ, {'XDG_DATA_DIRS': d}): os.environ.pop('XDG_DATA_HOME', None) - self.init(testdir, ['--cross-file=' + name], inprocess=True) + self.init(testdir, extra_args=['--cross-file=' + name], inprocess=True) self.wipe() with tempfile.TemporaryDirectory() as d: @@ -2485,41 +3045,14 @@ f.write(cross_content) name = os.path.basename(f.name) - with mock.patch('mesonbuild.coredata.os.path.expanduser', lambda x: x.replace('~', d)): - self.init(testdir, ['--cross-file=' + name], inprocess=True) - self.wipe() - - def test_introspect_target_files(self): - ''' - Tests that mesonintrospect --target-files returns expected output. - ''' - testdir = os.path.join(self.common_test_dir, '8 install') - self.init(testdir) - expected = { - 'stat@sta': ['stat.c'], - 'prog@exe': ['prog.c'], - } - t_intro = self.introspect('--targets') - self.assertCountEqual([t['id'] for t in t_intro], expected) - for t in t_intro: - id = t['id'] - tf_intro = self.introspect(['--target-files', id]) - self.assertEqual(tf_intro, expected[id]) - self.wipe() - - testdir = os.path.join(self.common_test_dir, '53 custom target') - self.init(testdir) - expected = { - 'bindat@cus': ['data_source.txt'], - 'depfile@cus': [], - } - t_intro = self.introspect('--targets') - self.assertCountEqual([t['id'] for t in t_intro], expected) - for t in t_intro: - id = t['id'] - tf_intro = self.introspect(['--target-files', id]) - self.assertEqual(tf_intro, expected[id]) - self.wipe() + # If XDG_DATA_HOME is set in the environment running the + # tests this test will fail, os mock the environment, pop + # it, then test + with mock.patch.dict(os.environ): + os.environ.pop('XDG_DATA_HOME', None) + with mock.patch('mesonbuild.coredata.os.path.expanduser', lambda x: x.replace('~', d)): + self.init(testdir, extra_args=['--cross-file=' + name], inprocess=True) + self.wipe() def test_compiler_run_command(self): ''' @@ -2534,7 +3067,7 @@ Test that identical targets in different subprojects do not collide if layout is flat. ''' - testdir = os.path.join(self.common_test_dir, '178 identical target name in subproject flat layout') + testdir = os.path.join(self.common_test_dir, '177 identical target name in subproject flat layout') self.init(testdir, extra_args=['--layout=flat']) self.build() @@ -2543,7 +3076,7 @@ Test that identical targets in different subdirs do not collide if layout is flat. ''' - testdir = os.path.join(self.common_test_dir, '187 same target name flat layout') + testdir = os.path.join(self.common_test_dir, '186 same target name flat layout') self.init(testdir, extra_args=['--layout=flat']) self.build() @@ -2591,48 +3124,62 @@ Test that meson adds dependencies for libraries based on the final linker command line. ''' - # build library testdirbase = os.path.join(self.unit_test_dir, '29 guessed linker dependencies') testdirlib = os.path.join(testdirbase, 'lib') + extra_args = None + libdir_flags = ['-L'] env = get_fake_env(testdirlib, self.builddir, self.prefix) - if env.detect_c_compiler(False).get_id() not in ['msvc', 'clang-cl']: + if env.detect_c_compiler(MachineChoice.HOST).get_id() in {'msvc', 'clang-cl', 'intel-cl'}: + # msvc-like compiler, also test it with msvc-specific flags + libdir_flags += ['/LIBPATH:'] + else: # static libraries are not linkable with -l with msvc because meson installs them # as .a files which unix_args_to_native will not know as it expects libraries to use # .lib as extension. For a DLL the import library is installed as .lib. Thus for msvc # this tests needs to use shared libraries to test the path resolving logic in the # dependency generation code path. extra_args = ['--default-library', 'static'] - self.init(testdirlib, extra_args=extra_args) - self.build() - self.install() - libbuilddir = self.builddir - installdir = self.installdir - libdir = os.path.join(self.installdir, self.prefix.lstrip('/').lstrip('\\'), 'lib') - # build user of library - self.new_builddir() - # replace is needed because meson mangles platform pathes passed via LDFLAGS - os.environ["LDFLAGS"] = '-L{}'.format(libdir.replace('\\', '/')) - self.init(os.path.join(testdirbase, 'exe')) - del os.environ["LDFLAGS"] - self.build() - self.assertBuildIsNoop() + initial_builddir = self.builddir + initial_installdir = self.installdir - # rebuild library - exebuilddir = self.builddir - self.installdir = installdir - self.builddir = libbuilddir - # Microsoft's compiler is quite smart about touching import libs on changes, - # so ensure that there is actually a change in symbols. - self.setconf('-Dmore_exports=true') - self.build() - self.install() - # no ensure_backend_detects_changes needed because self.setconf did that already + for libdir_flag in libdir_flags: + # build library + self.init(testdirlib, extra_args=extra_args) + self.build() + self.install() + libbuilddir = self.builddir + installdir = self.installdir + libdir = os.path.join(self.installdir, self.prefix.lstrip('/').lstrip('\\'), 'lib') + + # build user of library + self.new_builddir() + # replace is needed because meson mangles platform pathes passed via LDFLAGS + self.init(os.path.join(testdirbase, 'exe'), + override_envvars={"LDFLAGS": '{}{}'.format(libdir_flag, libdir.replace('\\', '/'))}) + self.build() + self.assertBuildIsNoop() + + # rebuild library + exebuilddir = self.builddir + self.installdir = installdir + self.builddir = libbuilddir + # Microsoft's compiler is quite smart about touching import libs on changes, + # so ensure that there is actually a change in symbols. + self.setconf('-Dmore_exports=true') + self.build() + self.install() + # no ensure_backend_detects_changes needed because self.setconf did that already + + # assert user of library will be rebuild + self.builddir = exebuilddir + self.assertRebuiltTarget('app') + + # restore dirs for the next test case + self.installdir = initial_builddir + self.builddir = initial_installdir - # assert user of library will be rebuild - self.builddir = exebuilddir - self.assertRebuiltTarget('app') def test_conflicting_d_dash_option(self): testdir = os.path.join(self.unit_test_dir, '37 mixed command line args') @@ -2768,13 +3315,14 @@ self.assertEqual(obj.user_options['subp:subp_opt'].value, 'foo') self.wipe() - # c_args value should be parsed with shlex - self.init(testdir, extra_args=['-Dc_args=foo bar "one two"']) + # c_args value should be parsed with split_args + self.init(testdir, extra_args=['-Dc_args=-Dfoo -Dbar "-Dthird=one two"']) obj = mesonbuild.coredata.load(self.builddir) - self.assertEqual(obj.compiler_options['c_args'].value, ['foo', 'bar', 'one two']) + self.assertEqual(obj.compiler_options.host['c_args'].value, ['-Dfoo', '-Dbar', '-Dthird=one two']) + self.setconf('-Dc_args="foo bar" one two') obj = mesonbuild.coredata.load(self.builddir) - self.assertEqual(obj.compiler_options['c_args'].value, ['foo bar', 'one', 'two']) + self.assertEqual(obj.compiler_options.host['c_args'].value, ['foo bar', 'one', 'two']) self.wipe() # Setting a 2nd time the same option should override the first value @@ -2782,21 +3330,21 @@ self.init(testdir, extra_args=['--bindir=foo', '--bindir=bar', '-Dbuildtype=plain', '-Dbuildtype=release', '-Db_sanitize=address', '-Db_sanitize=thread', - '-Dc_args=foo', '-Dc_args=bar']) + '-Dc_args=-Dfoo', '-Dc_args=-Dbar']) obj = mesonbuild.coredata.load(self.builddir) self.assertEqual(obj.builtins['bindir'].value, 'bar') self.assertEqual(obj.builtins['buildtype'].value, 'release') self.assertEqual(obj.base_options['b_sanitize'].value, 'thread') - self.assertEqual(obj.compiler_options['c_args'].value, ['bar']) + self.assertEqual(obj.compiler_options.host['c_args'].value, ['-Dbar']) self.setconf(['--bindir=bar', '--bindir=foo', '-Dbuildtype=release', '-Dbuildtype=plain', '-Db_sanitize=thread', '-Db_sanitize=address', - '-Dc_args=bar', '-Dc_args=foo']) + '-Dc_args=-Dbar', '-Dc_args=-Dfoo']) obj = mesonbuild.coredata.load(self.builddir) self.assertEqual(obj.builtins['bindir'].value, 'foo') self.assertEqual(obj.builtins['buildtype'].value, 'plain') self.assertEqual(obj.base_options['b_sanitize'].value, 'address') - self.assertEqual(obj.compiler_options['c_args'].value, ['foo']) + self.assertEqual(obj.compiler_options.host['c_args'].value, ['-Dfoo']) self.wipe() except KeyError: # Ignore KeyError, it happens on CI for compilers that does not @@ -2804,6 +3352,33 @@ # they used to fail this test with Meson 0.46 an earlier versions. pass + def test_warning_level_0(self): + testdir = os.path.join(self.common_test_dir, '214 warning level 0') + + # Verify default values when passing no args + self.init(testdir) + obj = mesonbuild.coredata.load(self.builddir) + self.assertEqual(obj.builtins['warning_level'].value, '0') + self.wipe() + + # verify we can override w/ --warnlevel + self.init(testdir, extra_args=['--warnlevel=1']) + obj = mesonbuild.coredata.load(self.builddir) + self.assertEqual(obj.builtins['warning_level'].value, '1') + self.setconf('--warnlevel=0') + obj = mesonbuild.coredata.load(self.builddir) + self.assertEqual(obj.builtins['warning_level'].value, '0') + self.wipe() + + # verify we can override w/ -Dwarning_level + self.init(testdir, extra_args=['-Dwarning_level=1']) + obj = mesonbuild.coredata.load(self.builddir) + self.assertEqual(obj.builtins['warning_level'].value, '1') + self.setconf('-Dwarning_level=0') + obj = mesonbuild.coredata.load(self.builddir) + self.assertEqual(obj.builtins['warning_level'].value, '0') + self.wipe() + def test_feature_check_usage_subprojects(self): testdir = os.path.join(self.unit_test_dir, '41 featurenew subprojects') out = self.init(testdir) @@ -2916,25 +3491,32 @@ crossfile.flush() self.meson_cross_file = crossfile.name - os.environ['PKG_CONFIG_LIBDIR'] = os.path.join(testdir, - 'native_pkgconfig') - self.init(testdir, extra_args=['-Dstart_native=false']) + env = {'PKG_CONFIG_LIBDIR': os.path.join(testdir, + 'native_pkgconfig')} + self.init(testdir, extra_args=['-Dstart_native=false'], override_envvars=env) self.wipe() - self.init(testdir, extra_args=['-Dstart_native=true']) - - def test_reconfigure(self): - testdir = os.path.join(self.unit_test_dir, '46 reconfigure') - self.init(testdir, extra_args=['-Dopt1=val1']) - self.setconf('-Dopt2=val2') + self.init(testdir, extra_args=['-Dstart_native=true'], override_envvars=env) + def __reconfigure(self, change_minor=False): # Set an older version to force a reconfigure from scratch filename = os.path.join(self.privatedir, 'coredata.dat') with open(filename, 'rb') as f: obj = pickle.load(f) - obj.version = '0.47.0' + if change_minor: + v = mesonbuild.coredata.version.split('.') + obj.version = '.'.join(v[0:2] + [str(int(v[2]) + 1)]) + else: + obj.version = '0.47.0' with open(filename, 'wb') as f: pickle.dump(obj, f) + def test_reconfigure(self): + testdir = os.path.join(self.unit_test_dir, '48 reconfigure') + self.init(testdir, extra_args=['-Dopt1=val1']) + self.setconf('-Dopt2=val2') + + self.__reconfigure() + out = self.init(testdir, extra_args=['--reconfigure', '-Dopt3=val3']) self.assertRegex(out, 'WARNING:.*Regenerating configuration from scratch') self.assertRegex(out, 'opt1 val1') @@ -2957,6 +3539,30 @@ self.build() self.run_tests() + def test_wipe_from_builddir(self): + testdir = os.path.join(self.common_test_dir, '161 custom target subdir depend files') + self.init(testdir) + self.__reconfigure() + + with Path(self.builddir): + self.init(testdir, extra_args=['--wipe']) + + def test_minor_version_does_not_reconfigure_wipe(self): + testdir = os.path.join(self.unit_test_dir, '48 reconfigure') + self.init(testdir, extra_args=['-Dopt1=val1']) + self.setconf('-Dopt2=val2') + + self.__reconfigure(change_minor=True) + + out = self.init(testdir, extra_args=['--reconfigure', '-Dopt3=val3']) + self.assertNotRegex(out, 'WARNING:.*Regenerating configuration from scratch') + self.assertRegex(out, 'opt1 val1') + self.assertRegex(out, 'opt2 val2') + self.assertRegex(out, 'opt3 val3') + self.assertRegex(out, 'opt4 default4') + self.build() + self.run_tests() + def test_target_construct_id_from_path(self): # This id is stable but not guessable. # The test is supposed to prevent unintentional @@ -2969,24 +3575,24 @@ self.assertEqual('81d46d1@@target2-id@other', target_id) def test_introspect_projectinfo_without_configured_build(self): - testfile = os.path.join(self.common_test_dir, '36 run program', 'meson.build') + testfile = os.path.join(self.common_test_dir, '35 run program', 'meson.build') res = self.introspect_directory(testfile, '--projectinfo') self.assertEqual(set(res['buildsystem_files']), set(['meson.build'])) - self.assertEqual(res['version'], None) + self.assertEqual(res['version'], 'undefined') self.assertEqual(res['descriptive_name'], 'run command') self.assertEqual(res['subprojects'], []) - testfile = os.path.join(self.common_test_dir, '44 options', 'meson.build') + testfile = os.path.join(self.common_test_dir, '43 options', 'meson.build') res = self.introspect_directory(testfile, '--projectinfo') self.assertEqual(set(res['buildsystem_files']), set(['meson_options.txt', 'meson.build'])) - self.assertEqual(res['version'], None) + self.assertEqual(res['version'], 'undefined') self.assertEqual(res['descriptive_name'], 'options') self.assertEqual(res['subprojects'], []) - testfile = os.path.join(self.common_test_dir, '47 subproject options', 'meson.build') + testfile = os.path.join(self.common_test_dir, '46 subproject options', 'meson.build') res = self.introspect_directory(testfile, '--projectinfo') self.assertEqual(set(res['buildsystem_files']), set(['meson_options.txt', 'meson.build'])) - self.assertEqual(res['version'], None) + self.assertEqual(res['version'], 'undefined') self.assertEqual(res['descriptive_name'], 'suboptions') self.assertEqual(len(res['subprojects']), 1) subproject_files = set(f.replace('\\', '/') for f in res['subprojects'][0]['buildsystem_files']) @@ -2995,6 +3601,423 @@ self.assertEqual(res['subprojects'][0]['version'], 'undefined') self.assertEqual(res['subprojects'][0]['descriptive_name'], 'subproject') + def test_introspect_projectinfo_subprojects(self): + testdir = os.path.join(self.common_test_dir, '102 subproject subdir') + self.init(testdir) + res = self.introspect('--projectinfo') + expected = { + 'descriptive_name': 'proj', + 'version': 'undefined', + 'subproject_dir': 'subprojects', + 'subprojects': [ + { + 'descriptive_name': 'sub', + 'name': 'sub', + 'version': 'undefined' + } + ] + } + self.assertDictEqual(res, expected) + + def test_introspection_target_subproject(self): + testdir = os.path.join(self.common_test_dir, '45 subproject') + self.init(testdir) + res = self.introspect('--targets') + + expected = { + 'sublib': 'sublib', + 'simpletest': 'sublib', + 'user': None + } + + for entry in res: + name = entry['name'] + self.assertEqual(entry['subproject'], expected[name]) + + def test_introspect_projectinfo_subproject_dir(self): + testdir = os.path.join(self.common_test_dir, '78 custom subproject dir') + self.init(testdir) + res = self.introspect('--projectinfo') + + self.assertEqual(res['subproject_dir'], 'custom_subproject_dir') + + def test_introspect_projectinfo_subproject_dir_from_source(self): + testfile = os.path.join(self.common_test_dir, '78 custom subproject dir', 'meson.build') + res = self.introspect_directory(testfile, '--projectinfo') + + self.assertEqual(res['subproject_dir'], 'custom_subproject_dir') + + @skipIfNoExecutable('clang-format') + def test_clang_format(self): + if self.backend is not Backend.ninja: + raise unittest.SkipTest('Clang-format is for now only supported on Ninja, not {}'.format(self.backend.name)) + testdir = os.path.join(self.unit_test_dir, '54 clang-format') + testfile = os.path.join(testdir, 'prog.c') + badfile = os.path.join(testdir, 'prog_orig_c') + goodfile = os.path.join(testdir, 'prog_expected_c') + testheader = os.path.join(testdir, 'header.h') + badheader = os.path.join(testdir, 'header_orig_h') + goodheader = os.path.join(testdir, 'header_expected_h') + try: + shutil.copyfile(badfile, testfile) + shutil.copyfile(badheader, testheader) + self.init(testdir) + self.assertNotEqual(Path(testfile).read_text(), + Path(goodfile).read_text()) + self.assertNotEqual(Path(testheader).read_text(), + Path(goodheader).read_text()) + self.run_target('clang-format') + self.assertEqual(Path(testheader).read_text(), + Path(goodheader).read_text()) + finally: + if os.path.exists(testfile): + os.unlink(testfile) + if os.path.exists(testheader): + os.unlink(testheader) + + @skipIfNoExecutable('clang-tidy') + def test_clang_tidy(self): + if self.backend is not Backend.ninja: + raise unittest.SkipTest('Clang-tidy is for now only supported on Ninja, not {}'.format(self.backend.name)) + if shutil.which('c++') is None: + raise unittest.SkipTest('Clang-tidy breaks when ccache is used and "c++" not in path.') + if is_osx(): + raise unittest.SkipTest('Apple ships a broken clang-tidy that chokes on -pipe.') + testdir = os.path.join(self.unit_test_dir, '70 clang-tidy') + self.init(testdir, override_envvars={'CXX': 'c++'}) + out = self.run_target('clang-tidy') + self.assertIn('cttest.cpp:4:20', out) + + def test_introspect_buildoptions_without_configured_build(self): + testdir = os.path.join(self.unit_test_dir, '59 introspect buildoptions') + testfile = os.path.join(testdir, 'meson.build') + res_nb = self.introspect_directory(testfile, ['--buildoptions'] + self.meson_args) + self.init(testdir, default_args=False) + res_wb = self.introspect('--buildoptions') + self.maxDiff = None + self.assertListEqual(res_nb, res_wb) + + def test_meson_configure_from_source_does_not_crash(self): + testdir = os.path.join(self.unit_test_dir, '59 introspect buildoptions') + self._run(self.mconf_command + [testdir]) + + def test_introspect_json_dump(self): + testdir = os.path.join(self.unit_test_dir, '57 introspection') + self.init(testdir) + infodir = os.path.join(self.builddir, 'meson-info') + self.assertPathExists(infodir) + + def assertKeyTypes(key_type_list, obj): + for i in key_type_list: + self.assertIn(i[0], obj) + self.assertIsInstance(obj[i[0]], i[1]) + + root_keylist = [ + ('benchmarks', list), + ('buildoptions', list), + ('buildsystem_files', list), + ('dependencies', list), + ('installed', dict), + ('projectinfo', dict), + ('targets', list), + ('tests', list), + ] + + test_keylist = [ + ('cmd', list), + ('env', dict), + ('name', str), + ('timeout', int), + ('suite', list), + ('is_parallel', bool), + ] + + buildoptions_keylist = [ + ('name', str), + ('section', str), + ('type', str), + ('description', str), + ('machine', str), + ] + + buildoptions_typelist = [ + ('combo', str, [('choices', list)]), + ('string', str, []), + ('boolean', bool, []), + ('integer', int, []), + ('array', list, []), + ] + + buildoptions_sections = ['core', 'backend', 'base', 'compiler', 'directory', 'user', 'test'] + buildoptions_machines = ['any', 'build', 'host'] + + dependencies_typelist = [ + ('name', str), + ('compile_args', list), + ('link_args', list), + ] + + targets_typelist = [ + ('name', str), + ('id', str), + ('type', str), + ('defined_in', str), + ('filename', list), + ('build_by_default', bool), + ('target_sources', list), + ('installed', bool), + ] + + targets_sources_typelist = [ + ('language', str), + ('compiler', list), + ('parameters', list), + ('sources', list), + ('generated_sources', list), + ] + + # First load all files + res = {} + for i in root_keylist: + curr = os.path.join(infodir, 'intro-{}.json'.format(i[0])) + self.assertPathExists(curr) + with open(curr, 'r') as fp: + res[i[0]] = json.load(fp) + + assertKeyTypes(root_keylist, res) + + # Check Tests and benchmarks + tests_to_find = ['test case 1', 'test case 2', 'benchmark 1'] + for i in res['benchmarks'] + res['tests']: + assertKeyTypes(test_keylist, i) + if i['name'] in tests_to_find: + tests_to_find.remove(i['name']) + self.assertListEqual(tests_to_find, []) + + # Check buildoptions + buildopts_to_find = {'cpp_std': 'c++11'} + for i in res['buildoptions']: + assertKeyTypes(buildoptions_keylist, i) + valid_type = False + for j in buildoptions_typelist: + if i['type'] == j[0]: + self.assertIsInstance(i['value'], j[1]) + assertKeyTypes(j[2], i) + valid_type = True + break + + self.assertIn(i['section'], buildoptions_sections) + self.assertIn(i['machine'], buildoptions_machines) + self.assertTrue(valid_type) + if i['name'] in buildopts_to_find: + self.assertEqual(i['value'], buildopts_to_find[i['name']]) + buildopts_to_find.pop(i['name'], None) + self.assertDictEqual(buildopts_to_find, {}) + + # Check buildsystem_files + bs_files = ['meson.build', 'meson_options.txt', 'sharedlib/meson.build', 'staticlib/meson.build'] + bs_files = [os.path.join(testdir, x) for x in bs_files] + self.assertPathListEqual(list(sorted(res['buildsystem_files'])), list(sorted(bs_files))) + + # Check dependencies + dependencies_to_find = ['threads'] + for i in res['dependencies']: + assertKeyTypes(dependencies_typelist, i) + if i['name'] in dependencies_to_find: + dependencies_to_find.remove(i['name']) + self.assertListEqual(dependencies_to_find, []) + + # Check projectinfo + self.assertDictEqual(res['projectinfo'], {'version': '1.2.3', 'descriptive_name': 'introspection', 'subproject_dir': 'subprojects', 'subprojects': []}) + + # Check targets + targets_to_find = { + 'sharedTestLib': ('shared library', True, False, 'sharedlib/meson.build'), + 'staticTestLib': ('static library', True, False, 'staticlib/meson.build'), + 'test1': ('executable', True, True, 'meson.build'), + 'test2': ('executable', True, False, 'meson.build'), + 'test3': ('executable', True, False, 'meson.build'), + } + for i in res['targets']: + assertKeyTypes(targets_typelist, i) + if i['name'] in targets_to_find: + tgt = targets_to_find[i['name']] + self.assertEqual(i['type'], tgt[0]) + self.assertEqual(i['build_by_default'], tgt[1]) + self.assertEqual(i['installed'], tgt[2]) + self.assertPathEqual(i['defined_in'], os.path.join(testdir, tgt[3])) + targets_to_find.pop(i['name'], None) + for j in i['target_sources']: + assertKeyTypes(targets_sources_typelist, j) + self.assertDictEqual(targets_to_find, {}) + + def test_introspect_file_dump_equals_all(self): + testdir = os.path.join(self.unit_test_dir, '57 introspection') + self.init(testdir) + res_all = self.introspect('--all') + res_file = {} + + root_keylist = [ + 'benchmarks', + 'buildoptions', + 'buildsystem_files', + 'dependencies', + 'installed', + 'projectinfo', + 'targets', + 'tests', + ] + + infodir = os.path.join(self.builddir, 'meson-info') + self.assertPathExists(infodir) + for i in root_keylist: + curr = os.path.join(infodir, 'intro-{}.json'.format(i)) + self.assertPathExists(curr) + with open(curr, 'r') as fp: + res_file[i] = json.load(fp) + + self.assertEqual(res_all, res_file) + + def test_introspect_meson_info(self): + testdir = os.path.join(self.unit_test_dir, '57 introspection') + introfile = os.path.join(self.builddir, 'meson-info', 'meson-info.json') + self.init(testdir) + self.assertPathExists(introfile) + with open(introfile, 'r') as fp: + res1 = json.load(fp) + + for i in ['meson_version', 'directories', 'introspection', 'build_files_updated', 'error']: + self.assertIn(i, res1) + + self.assertEqual(res1['error'], False) + self.assertEqual(res1['build_files_updated'], True) + + def test_introspect_config_update(self): + testdir = os.path.join(self.unit_test_dir, '57 introspection') + introfile = os.path.join(self.builddir, 'meson-info', 'intro-buildoptions.json') + self.init(testdir) + self.assertPathExists(introfile) + with open(introfile, 'r') as fp: + res1 = json.load(fp) + + self.setconf('-Dcpp_std=c++14') + self.setconf('-Dbuildtype=release') + + for idx, i in enumerate(res1): + if i['name'] == 'cpp_std': + res1[idx]['value'] = 'c++14' + if i['name'] == 'build.cpp_std': + res1[idx]['value'] = 'c++14' + if i['name'] == 'buildtype': + res1[idx]['value'] = 'release' + if i['name'] == 'optimization': + res1[idx]['value'] = '3' + if i['name'] == 'debug': + res1[idx]['value'] = False + + with open(introfile, 'r') as fp: + res2 = json.load(fp) + + self.assertListEqual(res1, res2) + + def test_introspect_targets_from_source(self): + testdir = os.path.join(self.unit_test_dir, '57 introspection') + testfile = os.path.join(testdir, 'meson.build') + introfile = os.path.join(self.builddir, 'meson-info', 'intro-targets.json') + self.init(testdir) + self.assertPathExists(introfile) + with open(introfile, 'r') as fp: + res_wb = json.load(fp) + + res_nb = self.introspect_directory(testfile, ['--targets'] + self.meson_args) + + # Account for differences in output + for i in res_wb: + i['filename'] = [os.path.relpath(x, self.builddir) for x in i['filename']] + if 'install_filename' in i: + del i['install_filename'] + + sources = [] + for j in i['target_sources']: + sources += j['sources'] + i['target_sources'] = [{ + 'language': 'unknown', + 'compiler': [], + 'parameters': [], + 'sources': sources, + 'generated_sources': [] + }] + + self.maxDiff = None + self.assertListEqual(res_nb, res_wb) + + def test_introspect_dependencies_from_source(self): + testdir = os.path.join(self.unit_test_dir, '57 introspection') + testfile = os.path.join(testdir, 'meson.build') + res_nb = self.introspect_directory(testfile, ['--scan-dependencies'] + self.meson_args) + expected = [ + { + 'name': 'threads', + 'required': True, + 'has_fallback': False, + 'conditional': False + }, + { + 'name': 'zlib', + 'required': False, + 'has_fallback': False, + 'conditional': False + }, + { + 'name': 'bugDep1', + 'required': False, + 'has_fallback': False, + 'conditional': False + }, + { + 'name': 'somethingthatdoesnotexist', + 'required': True, + 'has_fallback': False, + 'conditional': True + }, + { + 'name': 'look_i_have_a_fallback', + 'required': True, + 'has_fallback': True, + 'conditional': True + } + ] + self.maxDiff = None + self.assertListEqual(res_nb, expected) + + def test_unstable_coredata(self): + testdir = os.path.join(self.common_test_dir, '1 trivial') + self.init(testdir) + # just test that the command does not fail (e.g. because it throws an exception) + self._run([*self.meson_command, 'unstable-coredata', self.builddir]) + + @skip_if_no_cmake + def test_cmake_prefix_path(self): + testdir = os.path.join(self.unit_test_dir, '64 cmake_prefix_path') + self.init(testdir, extra_args=['-Dcmake_prefix_path=' + os.path.join(testdir, 'prefix')]) + + @skip_if_no_cmake + def test_cmake_parser(self): + testdir = os.path.join(self.unit_test_dir, '65 cmake parser') + self.init(testdir, extra_args=['-Dcmake_prefix_path=' + os.path.join(testdir, 'prefix')]) + + def test_alias_target(self): + if self.backend is Backend.vs: + # FIXME: This unit test is broken with vs backend, needs investigation + raise unittest.SkipTest('Skipping alias_target test with {} backend'.format(self.backend.name)) + testdir = os.path.join(self.unit_test_dir, '66 alias target') + self.init(testdir) + self.build() + self.assertPathDoesNotExist(os.path.join(self.builddir, 'prog' + exe_suffix)) + self.assertPathDoesNotExist(os.path.join(self.builddir, 'hello.txt')) + self.run_target('build-all') + self.assertPathExists(os.path.join(self.builddir, 'prog' + exe_suffix)) + self.assertPathExists(os.path.join(self.builddir, 'hello.txt')) class FailureTests(BasePlatformTests): ''' @@ -3005,18 +4028,24 @@ and slows down testing. ''' dnf = "[Dd]ependency.*not found(:.*)?" - nopkg = '[Pp]kg-config not found' + nopkg = '[Pp]kg-config.*not found' def setUp(self): super().setUp() self.srcdir = os.path.realpath(tempfile.mkdtemp()) self.mbuild = os.path.join(self.srcdir, 'meson.build') + self.moptions = os.path.join(self.srcdir, 'meson_options.txt') def tearDown(self): super().tearDown() windows_proof_rmtree(self.srcdir) - def assertMesonRaises(self, contents, match, extra_args=None, langs=None, meson_version=None): + def assertMesonRaises(self, contents, match, *, + extra_args=None, + langs=None, + meson_version=None, + options=None, + override_envvars=None): ''' Assert that running meson configure on the specified @contents raises a error message matching regex @match. @@ -3031,11 +4060,20 @@ for lang in langs: f.write("add_languages('{}', required : false)\n".format(lang)) f.write(contents) + if options is not None: + with open(self.moptions, 'w') as f: + f.write(options) + o = {'MESON_FORCE_BACKTRACE': '1'} + if override_envvars is None: + override_envvars = o + else: + override_envvars.update(o) # Force tracebacks so we can detect them properly - os.environ['MESON_FORCE_BACKTRACE'] = '1' with self.assertRaisesRegex(MesonException, match, msg=contents): # Must run in-process or we'll get a generic CalledProcessError - self.init(self.srcdir, extra_args=extra_args, inprocess=True) + self.init(self.srcdir, extra_args=extra_args, + inprocess=True, + override_envvars = override_envvars) def obtainMesonOutput(self, contents, match, extra_args, langs, meson_version=None): if langs is None: @@ -3086,16 +4124,29 @@ self.assertMesonRaises("dependency('appleframeworks')", "requires at least one module") + def test_extraframework_dependency_method(self): + code = "dependency('python', method : 'extraframework')" + if not is_osx(): + self.assertMesonRaises(code, self.dnf) + else: + # Python2 framework is always available on macOS + self.assertMesonOutputs(code, '[Dd]ependency.*python.*found.*YES') + def test_sdl2_notfound_dependency(self): # Want to test failure, so skip if available if shutil.which('sdl2-config'): raise unittest.SkipTest('sdl2-config found') self.assertMesonRaises("dependency('sdl2', method : 'sdlconfig')", self.dnf) if shutil.which('pkg-config'): - errmsg = self.dnf - else: - errmsg = self.nopkg - self.assertMesonRaises("dependency('sdl2', method : 'pkg-config')", errmsg) + self.assertMesonRaises("dependency('sdl2', method : 'pkg-config')", self.dnf) + with no_pkgconfig(): + # Look for pkg-config, cache it, then + # Use cached pkg-config without erroring out, then + # Use cached pkg-config to error out + code = "dependency('foobarrr', method : 'pkg-config', required : false)\n" \ + "dependency('foobarrr2', method : 'pkg-config', required : false)\n" \ + "dependency('sdl2', method : 'pkg-config')" + self.assertMesonRaises(code, self.nopkg) def test_gnustep_notfound_dependency(self): # Want to test failure, so skip if available @@ -3111,7 +4162,7 @@ raise unittest.SkipTest('wx-config, wx-config-3.0 or wx-config-gtk3 found') self.assertMesonRaises("dependency('wxwidgets')", self.dnf) self.assertMesonOutputs("dependency('wxwidgets', required : false)", - "Dependency .*WxWidgets.* found: .*NO.*") + "Run-time dependency .*WxWidgets.* found: .*NO.*") def test_wx_dependency(self): if not shutil.which('wx-config-3.0') and not shutil.which('wx-config') and not shutil.which('wx-config-gtk3'): @@ -3132,15 +4183,15 @@ def test_boost_BOOST_ROOT_dependency(self): # Test BOOST_ROOT; can be run even if Boost is found or not - os.environ['BOOST_ROOT'] = 'relative/path' self.assertMesonRaises("dependency('boost')", - "(BOOST_ROOT.*absolute|{})".format(self.dnf)) + "(BOOST_ROOT.*absolute|{})".format(self.dnf), + override_envvars = {'BOOST_ROOT': 'relative/path'}) def test_dependency_invalid_method(self): code = '''zlib_dep = dependency('zlib', required : false) zlib_dep.get_configtool_variable('foo') ''' - self.assertMesonRaises(code, "'zlib' is not a config-tool dependency") + self.assertMesonRaises(code, ".* is not a config-tool dependency") code = '''zlib_dep = dependency('zlib', required : false) dep = declare_dependency(dependencies : zlib_dep) dep.get_pkgconfig_variable('foo') @@ -3156,10 +4207,10 @@ ''' Test that when we can't detect objc or objcpp, we fail gracefully. ''' - env = get_fake_env('', self.builddir, self.prefix) + env = get_fake_env() try: - env.detect_objc_compiler(False) - env.detect_objcpp_compiler(False) + env.detect_objc_compiler(MachineChoice.HOST) + env.detect_objcpp_compiler(MachineChoice.HOST) except EnvironmentException: code = "add_languages('objc')\nadd_languages('objcpp')" self.assertMesonRaises(code, "Unknown compiler") @@ -3171,32 +4222,30 @@ Test that: 1. The correct message is outputted when a not-required dep is not found and the fallback subproject is also not found. - 2. A not-found not-required dep with a fallback subproject outputs the + 2. A not-required fallback dependency is not found because the + subproject failed to parse. + 3. A not-found not-required dep with a fallback subproject outputs the correct message when the fallback subproject is found but the variable inside it is not. - 3. A fallback dependency is found from the subproject parsed in (2) - 4. A not-required fallback dependency is not found because the - subproject failed to parse. + 4. A fallback dependency is found from the subproject parsed in (3) + 5. The correct message is outputted when the .wrap file is missing for + a sub-subproject. ''' tdir = os.path.join(self.unit_test_dir, '20 subproj dep variables') out = self.init(tdir, inprocess=True) - self.assertRegex(out, r"Couldn't use fallback subproject " - "in.*subprojects.*nosubproj.*for the dependency.*somedep") - self.assertRegex(out, r'Dependency.*somenotfounddep.*from subproject.*' - 'subprojects.*somesubproj.*found:.*NO') - self.assertRegex(out, r'Dependency.*zlibproxy.*from subproject.*' - 'subprojects.*somesubproj.*found:.*YES.*(cached)') - self.assertRegex(out, r'Couldn\'t use fallback subproject in ' - '.*subprojects.*failingsubproj.*for the dependency.*somedep') + self.assertRegex(out, r"Subproject directory not found and .*nosubproj.wrap.* file not found") + self.assertRegex(out, r'Function does not take positional arguments.') + self.assertRegex(out, r'WARNING:.* Dependency .*subsubproject.* not found but it is available in a sub-subproject.') + self.assertRegex(out, r'Subproject directory not found and .*subsubproject.wrap.* file not found') + self.assertRegex(out, r'Dependency .*zlibproxy.* from subproject .*subprojects.*somesubproj.* found: .*YES.*') def test_exception_exit_status(self): ''' Test exit status on python exception ''' tdir = os.path.join(self.unit_test_dir, '21 exit status') - os.environ['MESON_UNIT_TEST'] = '1' with self.assertRaises(subprocess.CalledProcessError) as cm: - self.init(tdir, inprocess=False) + self.init(tdir, inprocess=False, override_envvars = {'MESON_UNIT_TEST': '1'}) self.assertEqual(cm.exception.returncode, 2) self.wipe() @@ -3251,11 +4300,21 @@ "sub1.get_variable('naaa')", """Subproject "subprojects/not-found-subproject" disabled can't get_variable on it.""") + def test_version_checked_before_parsing_options(self): + ''' + https://github.com/mesonbuild/meson/issues/5281 + ''' + options = "option('some-option', type: 'foo', value: '')" + match = 'Meson version is.*but project requires >=2000' + self.assertMesonRaises("", match, meson_version='>=2000', options=options) + +@unittest.skipUnless(is_windows() or is_cygwin(), "requires Windows (or Windows via Cygwin)") class WindowsTests(BasePlatformTests): ''' Tests that should run on Cygwin, MinGW, and MSVC ''' + def setUp(self): super().setUp() self.platform_test_dir = os.path.join(self.src_root, 'test cases/windows') @@ -3284,12 +4343,15 @@ # Finding a script with an extension inside a directory works prog = ExternalProgram(os.path.join(testdir, 'test-script-ext.py')) self.assertTrue(prog.found(), msg='test-script-ext.py not found') - # Finding a script in PATH w/o extension works and adds the interpreter + # Finding a script in PATH os.environ['PATH'] += os.pathsep + testdir - prog = ExternalProgram('test-script-ext') - self.assertTrue(prog.found(), msg='test-script-ext not found in PATH') - self.assertPathEqual(prog.get_command()[0], python_command[0]) - self.assertPathBasenameEqual(prog.get_path(), 'test-script-ext.py') + # Finding a script in PATH w/o extension works and adds the interpreter + # (check only if `.PY` is in PATHEXT) + if '.PY' in [ext.upper() for ext in os.environ['PATHEXT'].split(';')]: + prog = ExternalProgram('test-script-ext') + self.assertTrue(prog.found(), msg='test-script-ext not found in PATH') + self.assertPathEqual(prog.get_command()[0], python_command[0]) + self.assertPathBasenameEqual(prog.get_path(), 'test-script-ext.py') # Finding a script in PATH with extension works and adds the interpreter prog = ExternalProgram('test-script-ext.py') self.assertTrue(prog.found(), msg='test-script-ext.py not found in PATH') @@ -3304,11 +4366,11 @@ ''' testdir = os.path.join(self.platform_test_dir, '1 basic') env = get_fake_env(testdir, self.builddir, self.prefix) - cc = env.detect_c_compiler(False) + cc = env.detect_c_compiler(MachineChoice.HOST) if cc.get_argument_syntax() != 'msvc': raise unittest.SkipTest('Not using MSVC') # To force people to update this test, and also test - self.assertEqual(set(cc.ignore_libs), {'c', 'm', 'pthread', 'dl', 'rt'}) + self.assertEqual(set(cc.ignore_libs), {'c', 'm', 'pthread', 'dl', 'rt', 'execinfo'}) for l in cc.ignore_libs: self.assertEqual(cc.find_library(l, env, []), []) @@ -3317,7 +4379,7 @@ # resource compiler depfile generation is not yet implemented for msvc env = get_fake_env(testdir, self.builddir, self.prefix) - depfile_works = env.detect_c_compiler(False).get_id() not in ['msvc', 'clang-cl'] + depfile_works = env.detect_c_compiler(MachineChoice.HOST).get_id() not in {'msvc', 'clang-cl', 'intel-cl'} self.init(testdir) self.build() @@ -3348,7 +4410,7 @@ testdir = os.path.join(self.unit_test_dir, '45 vscpp17') env = get_fake_env(testdir, self.builddir, self.prefix) - cc = env.detect_c_compiler(False) + cc = env.detect_c_compiler(MachineChoice.HOST) if cc.get_argument_syntax() != 'msvc': raise unittest.SkipTest('Test only applies to MSVC-like compilers') @@ -3362,10 +4424,12 @@ return self.build() +@unittest.skipUnless(is_osx(), "requires Darwin") class DarwinTests(BasePlatformTests): ''' Tests that should run on macOS ''' + def setUp(self): super().setUp() self.platform_test_dir = os.path.join(self.src_root, 'test cases/osx') @@ -3377,18 +4441,21 @@ when it is false. This can't be an ordinary test case because we need to inspect the compiler database. ''' - testdir = os.path.join(self.common_test_dir, '4 shared') - # Try with bitcode enabled - out = self.init(testdir, extra_args='-Db_bitcode=true') + testdir = os.path.join(self.platform_test_dir, '7 bitcode') env = get_fake_env(testdir, self.builddir, self.prefix) - cc = env.detect_c_compiler(False) + cc = env.detect_c_compiler(MachineChoice.HOST) if cc.id != 'clang': raise unittest.SkipTest('Not using Clang on OSX') + # Try with bitcode enabled + out = self.init(testdir, extra_args='-Db_bitcode=true') # Warning was printed self.assertRegex(out, 'WARNING:.*b_bitcode') # Compiler options were added - compdb = self.get_compdb() - self.assertIn('-fembed-bitcode', compdb[0]['command']) + for compdb in self.get_compdb(): + if 'module' in compdb['file']: + self.assertNotIn('-fembed-bitcode', compdb['command']) + else: + self.assertIn('-fembed-bitcode', compdb['command']) build_ninja = os.path.join(self.builddir, 'build.ninja') # Linker options were added with open(build_ninja, 'r', encoding='utf-8') as f: @@ -3399,8 +4466,8 @@ self.setconf('-Db_bitcode=false') # Regenerate build self.build() - compdb = self.get_compdb() - self.assertNotIn('-fembed-bitcode', compdb[0]['command']) + for compdb in self.get_compdb(): + self.assertNotIn('-fembed-bitcode', compdb['command']) build_ninja = os.path.join(self.builddir, 'build.ninja') with open(build_ninja, 'r', encoding='utf-8') as f: contents = f.read() @@ -3411,7 +4478,7 @@ ''' Same as above, just for shared_module() ''' - testdir = os.path.join(self.common_test_dir, '153 shared module resolving symbol in executable') + testdir = os.path.join(self.common_test_dir, '152 shared module resolving symbol in executable') # Ensure that it builds even with bitcode enabled self.init(testdir, extra_args='-Db_bitcode=true') self.build() @@ -3424,6 +4491,7 @@ self.assertIsNotNone(m, msg=out) return m.groups() + @skipIfNoPkgconfig def test_library_versioning(self): ''' Ensure that compatibility_version and current_version are set correctly @@ -3433,7 +4501,7 @@ self.build() targets = {} for t in self.introspect('--targets'): - targets[t['name']] = t['filename'] + targets[t['name']] = t['filename'][0] if isinstance(t['filename'], list) else t['filename'] self.assertEqual(self._get_darwin_versions(targets['some']), ('7.0.0', '7.0.0')) self.assertEqual(self._get_darwin_versions(targets['noversion']), ('0.0.0', '0.0.0')) self.assertEqual(self._get_darwin_versions(targets['onlyversion']), ('1.0.0', '1.0.0')) @@ -3450,17 +4518,18 @@ # to ascertain that Meson does not call install_name_tool # with duplicate -delete_rpath arguments, which would # lead to erroring out on installation - os.environ["LDFLAGS"] = "-Wl,-rpath,/foo/bar" - self.init(testdir) + env = {"LDFLAGS": "-Wl,-rpath,/foo/bar"} + self.init(testdir, override_envvars=env) self.build() self.install() - del os.environ["LDFLAGS"] +@unittest.skipUnless(not is_windows(), "requires something Unix-like") class LinuxlikeTests(BasePlatformTests): ''' Tests that should run on Linux, macOS, and *BSD ''' + def test_basic_soname(self): ''' Test that the soname is set correctly for shared libraries. This can't @@ -3495,7 +4564,7 @@ is true and not when it is false. This can't be an ordinary test case because we need to inspect the compiler database. ''' - if is_cygwin() or is_osx(): + if is_windows() or is_cygwin() or is_osx(): raise unittest.SkipTest('PIC not relevant') testdir = os.path.join(self.common_test_dir, '3 static') @@ -3515,7 +4584,7 @@ need to run pkg-config outside of a Meson build file. https://github.com/mesonbuild/meson/issues/889 ''' - testdir = os.path.join(self.common_test_dir, '48 pkgconfig-gen') + testdir = os.path.join(self.common_test_dir, '47 pkgconfig-gen') self.init(testdir) env = get_fake_env(testdir, self.builddir, self.prefix) kwargs = {'required': True, 'silent': True} @@ -3531,50 +4600,59 @@ ''' Test that generated pkg-config files correctly handle dependencies ''' - testdir = os.path.join(self.common_test_dir, '48 pkgconfig-gen') + testdir = os.path.join(self.common_test_dir, '47 pkgconfig-gen') self.init(testdir) privatedir1 = self.privatedir self.new_builddir() - os.environ['PKG_CONFIG_LIBDIR'] = privatedir1 - testdir = os.path.join(self.common_test_dir, '48 pkgconfig-gen', 'dependencies') - self.init(testdir) + testdir = os.path.join(self.common_test_dir, '47 pkgconfig-gen', 'dependencies') + self.init(testdir, override_envvars={'PKG_CONFIG_LIBDIR': privatedir1}) privatedir2 = self.privatedir - os.environ['PKG_CONFIG_LIBDIR'] = os.pathsep.join([privatedir1, privatedir2]) - cmd = ['pkg-config', 'dependency-test'] + os.environ + env = {'PKG_CONFIG_LIBDIR': os.pathsep.join([privatedir1, privatedir2])} + self._run(['pkg-config', 'dependency-test', '--validate'], override_envvars=env) - out = self._run(cmd + ['--print-requires']).strip().split('\n') - self.assertEqual(sorted(out), sorted(['libexposed'])) - - out = self._run(cmd + ['--print-requires-private']).strip().split('\n') - self.assertEqual(sorted(out), sorted(['libfoo >= 1.0'])) - - out = self._run(cmd + ['--cflags-only-other']).strip().split() - self.check_pkg_flags_are_same(out, ['-pthread', '-DCUSTOM']) - - out = self._run(cmd + ['--libs-only-l', '--libs-only-other']).strip().split() - self.check_pkg_flags_are_same(out, ['-pthread', '-lcustom', - '-llibmain', '-llibexposed']) - - out = self._run(cmd + ['--libs-only-l', '--libs-only-other', '--static']).strip().split() - self.check_pkg_flags_are_same(out, ['-pthread', '-lcustom', - '-llibmain', '-llibexposed', - '-llibinternal', '-lcustom2', - '-lfoo']) + # pkg-config strips some duplicated flags so we have to parse the + # generated file ourself. + expected = { + 'Requires': 'libexposed', + 'Requires.private': 'libfoo >= 1.0', + 'Libs': '-L${libdir} -llibmain -pthread -lcustom', + 'Libs.private': '-lcustom2 -L${libdir} -llibinternal', + 'Cflags': '-I${includedir} -pthread -DCUSTOM', + } + if is_osx() or is_haiku(): + expected['Cflags'] = expected['Cflags'].replace('-pthread ', '') + with open(os.path.join(privatedir2, 'dependency-test.pc')) as f: + matched_lines = 0 + for line in f: + parts = line.split(':', 1) + if parts[0] in expected: + key = parts[0] + val = parts[1].strip() + expected_val = expected[key] + self.assertEqual(expected_val, val) + matched_lines += 1 + self.assertEqual(len(expected), matched_lines) cmd = ['pkg-config', 'requires-test'] - out = self._run(cmd + ['--print-requires']).strip().split('\n') - self.assertEqual(sorted(out), sorted(['libexposed', 'libfoo >= 1.0', 'libhello'])) + out = self._run(cmd + ['--print-requires'], override_envvars=env).strip().split('\n') + if not is_openbsd(): + self.assertEqual(sorted(out), sorted(['libexposed', 'libfoo >= 1.0', 'libhello'])) + else: + self.assertEqual(sorted(out), sorted(['libexposed', 'libfoo>=1.0', 'libhello'])) cmd = ['pkg-config', 'requires-private-test'] - out = self._run(cmd + ['--print-requires-private']).strip().split('\n') - self.assertEqual(sorted(out), sorted(['libexposed', 'libfoo >= 1.0', 'libhello'])) + out = self._run(cmd + ['--print-requires-private'], override_envvars=env).strip().split('\n') + if not is_openbsd(): + self.assertEqual(sorted(out), sorted(['libexposed', 'libfoo >= 1.0', 'libhello'])) + else: + self.assertEqual(sorted(out), sorted(['libexposed', 'libfoo>=1.0', 'libhello'])) - def check_pkg_flags_are_same(self, output, expected): - if is_osx() or is_haiku(): - expected = [x for x in expected if x != '-pthread'] - self.assertEqual(sorted(output), sorted(expected)) + cmd = ['pkg-config', 'pub-lib-order'] + out = self._run(cmd + ['--libs'], override_envvars=env).strip().split() + self.assertEqual(out, ['-llibmain2', '-llibinternal']) def test_pkg_unfound(self): testdir = os.path.join(self.unit_test_dir, '23 unfound pkgconfig') @@ -3629,23 +4707,25 @@ qt4 = subprocess.call(['pkg-config', '--exists', 'QtCore']) qt5 = subprocess.call(['pkg-config', '--exists', 'Qt5Core']) testdir = os.path.join(self.framework_test_dir, '4 qt') - self.init(testdir, ['-Dmethod=pkg-config']) + self.init(testdir, extra_args=['-Dmethod=pkg-config']) # Confirm that the dependency was found with pkg-config mesonlog = self.get_meson_log() if qt4 == 0: self.assertRegex('\n'.join(mesonlog), - r'Dependency qt4 \(modules: Core\) found: YES 4.* \(pkg-config\)\n') + r'Run-time dependency qt4 \(modules: Core\) found: YES 4.* \(pkg-config\)\n') if qt5 == 0: self.assertRegex('\n'.join(mesonlog), - r'Dependency qt5 \(modules: Core\) found: YES 5.* \(pkg-config\)\n') + r'Run-time dependency qt5 \(modules: Core\) found: YES 5.* \(pkg-config\)\n') @skip_if_not_base_option('b_sanitize') def test_generate_gir_with_address_sanitizer(self): if is_cygwin(): raise unittest.SkipTest('asan not available on Cygwin') + if is_openbsd(): + raise unittest.SkipTest('-fsanitize=address is not supported on OpenBSD') testdir = os.path.join(self.framework_test_dir, '7 gnome') - self.init(testdir, ['-Db_sanitize=address', '-Db_lundef=false']) + self.init(testdir, extra_args=['-Db_sanitize=address', '-Db_lundef=false']) self.build() def test_qt5dependency_qmake_detection(self): @@ -3662,11 +4742,11 @@ raise unittest.SkipTest('Qmake found, but it is not for Qt 5.') # Disable pkg-config codepath and force searching with qmake/qmake-qt5 testdir = os.path.join(self.framework_test_dir, '4 qt') - self.init(testdir, ['-Dmethod=qmake']) + self.init(testdir, extra_args=['-Dmethod=qmake']) # Confirm that the dependency was found with qmake mesonlog = self.get_meson_log() self.assertRegex('\n'.join(mesonlog), - r'Dependency qt5 \(modules: Core\) found: YES .* \((qmake|qmake-qt5)\)\n') + r'Run-time dependency qt5 \(modules: Core\) found: YES .* \((qmake|qmake-qt5)\)\n') def _test_soname_impl(self, libpath, install): if is_cygwin() or is_osx(): @@ -3726,38 +4806,58 @@ Test that compiler check flags override all other flags. This can't be an ordinary test case because it needs the environment to be set. ''' + testdir = os.path.join(self.common_test_dir, '39 has function') + env = get_fake_env(testdir, self.builddir, self.prefix) + cpp = env.detect_cpp_compiler(MachineChoice.HOST) Oflag = '-O3' - os.environ['CFLAGS'] = os.environ['CXXFLAGS'] = Oflag - testdir = os.path.join(self.common_test_dir, '40 has function') - self.init(testdir) + OflagCPP = Oflag + if cpp.get_id() in ('clang', 'gcc'): + # prevent developers from adding "int main(int argc, char **argv)" + # to small Meson checks unless these parameters are actually used + OflagCPP += ' -Werror=unused-parameter' + env = {'CFLAGS': Oflag, + 'CXXFLAGS': OflagCPP} + self.init(testdir, override_envvars=env) cmds = self.get_meson_log_compiler_checks() for cmd in cmds: if cmd[0] == 'ccache': cmd = cmd[1:] # Verify that -I flags from the `args` kwarg are first - # This is set in the '40 has function' test case + # This is set in the '39 has function' test case self.assertEqual(cmd[1], '-I/tmp') # Verify that -O3 set via the environment is overridden by -O0 Oargs = [arg for arg in cmd if arg.startswith('-O')] self.assertEqual(Oargs, [Oflag, '-O0']) - def _test_stds_impl(self, testdir, compiler, p): + def _test_stds_impl(self, testdir, compiler, p: str): lang_std = p + '_std' - # Check that all the listed -std=xxx options for this compiler work - # just fine when used + + has_cpp17 = (compiler.get_id() not in {'clang', 'gcc'} or + compiler.get_id() == 'clang' and _clang_at_least(compiler, '>=5.0.0', '>=9.1') or + compiler.get_id() == 'gcc' and version_compare(compiler.version, '>=5.0.0')) + has_cpp2a_c17 = (compiler.get_id() not in {'clang', 'gcc'} or + compiler.get_id() == 'clang' and _clang_at_least(compiler, '>=6.0.0', '>=10.0') or + compiler.get_id() == 'gcc' and version_compare(compiler.version, '>=8.0.0')) + has_c18 = (compiler.get_id() not in {'clang', 'gcc'} or + compiler.get_id() == 'clang' and _clang_at_least(compiler, '>=8.0.0', '>=11.0') or + compiler.get_id() == 'gcc' and version_compare(compiler.version, '>=8.0.0')) + # Check that all the listed -std=xxx options for this compiler work just fine when used + # https://en.wikipedia.org/wiki/Xcode#Latest_versions + # https://www.gnu.org/software/gcc/projects/cxx-status.html for v in compiler.get_options()[lang_std].choices: - if (compiler.get_id() == 'clang' and '17' in v and - (version_compare(compiler.version, '<5.0.0') or - (compiler.compiler_type == mesonbuild.compilers.CompilerType.CLANG_OSX and version_compare(compiler.version, '<9.1')))): + # we do it like this to handle gnu++17,c++17 and gnu17,c17 cleanly + # thus, C++ first + if '++17' in v and not has_cpp17: continue - if (compiler.get_id() == 'clang' and '2a' in v and - (version_compare(compiler.version, '<6.0.0') or - (compiler.compiler_type == mesonbuild.compilers.CompilerType.CLANG_OSX and version_compare(compiler.version, '<9.1')))): + elif '++2a' in v and not has_cpp2a_c17: # https://en.cppreference.com/w/cpp/compiler_support continue - if (compiler.get_id() == 'gcc' and '2a' in v and version_compare(compiler.version, '<8.0.0')): + # now C + elif '17' in v and not has_cpp2a_c17: + continue + elif '18' in v and not has_c18: continue std_opt = '{}={}'.format(lang_std, v) - self.init(testdir, ['-D' + std_opt]) + self.init(testdir, extra_args=['-D' + std_opt]) cmd = self.get_compdb()[0]['command'] # c++03 and gnu++03 are not understood by ICC, don't try to look for them skiplist = frozenset([ @@ -3768,21 +4868,26 @@ self.assertIn(cmd_std, cmd) try: self.build() - except: + except Exception: print('{} was {!r}'.format(lang_std, v)) raise self.wipe() # Check that an invalid std option in CFLAGS/CPPFLAGS fails # Needed because by default ICC ignores invalid options cmd_std = '-std=FAIL' - env_flags = p.upper() + 'FLAGS' - os.environ[env_flags] = cmd_std - self.init(testdir) - cmd = self.get_compdb()[0]['command'] - qcmd_std = " {} ".format(cmd_std) - self.assertIn(qcmd_std, cmd) - with self.assertRaises(subprocess.CalledProcessError, - msg='{} should have failed'.format(qcmd_std)): + if p == 'c': + env_flag_name = 'CFLAGS' + elif p == 'cpp': + env_flag_name = 'CXXFLAGS' + else: + raise NotImplementedError('Language {} not defined.'.format(p)) + env = {} + env[env_flag_name] = cmd_std + with self.assertRaises((subprocess.CalledProcessError, mesonbuild.mesonlib.EnvironmentException), + msg='C compiler should have failed with -std=FAIL'): + self.init(testdir, override_envvars = env) + # ICC won't fail in the above because additional flags are needed to + # make unknown -std=... options errors. self.build() def test_compiler_c_stds(self): @@ -3792,7 +4897,7 @@ ''' testdir = os.path.join(self.common_test_dir, '1 trivial') env = get_fake_env(testdir, self.builddir, self.prefix) - cc = env.detect_c_compiler(False) + cc = env.detect_c_compiler(MachineChoice.HOST) self._test_stds_impl(testdir, cc, 'c') def test_compiler_cpp_stds(self): @@ -3802,11 +4907,11 @@ ''' testdir = os.path.join(self.common_test_dir, '2 cpp') env = get_fake_env(testdir, self.builddir, self.prefix) - cpp = env.detect_cpp_compiler(False) + cpp = env.detect_cpp_compiler(MachineChoice.HOST) self._test_stds_impl(testdir, cpp, 'cpp') def test_unity_subproj(self): - testdir = os.path.join(self.common_test_dir, '46 subproject') + testdir = os.path.join(self.common_test_dir, '45 subproject') self.init(testdir, extra_args='--unity=subprojects') simpletest_id = Target.construct_id_from_path('subprojects/sublib', 'simpletest', '@exe') self.assertPathExists(os.path.join(self.builddir, 'subprojects/sublib', simpletest_id, 'simpletest-unity.c')) @@ -3855,7 +4960,7 @@ self.wipe() # Test directory modes - testdir = os.path.join(self.common_test_dir, '63 install subdir') + testdir = os.path.join(self.common_test_dir, '62 install subdir') self.init(testdir) self.install() @@ -3872,7 +4977,7 @@ ''' Test that files are installed with correct permissions using install_mode. ''' - testdir = os.path.join(self.common_test_dir, '196 install_mode') + testdir = os.path.join(self.common_test_dir, '195 install_mode') self.init(testdir) self.build() self.install() @@ -4029,8 +5134,7 @@ @skipIfNoPkgconfig def test_order_of_l_arguments(self): testdir = os.path.join(self.unit_test_dir, '8 -L -l order') - os.environ['PKG_CONFIG_PATH'] = testdir - self.init(testdir) + self.init(testdir, override_envvars={'PKG_CONFIG_PATH': testdir}) # NOTE: .pc file has -Lfoo -lfoo -Lbar -lbar but pkg-config reorders # the flags before returning them to -Lfoo -Lbar -lfoo -lbar # but pkgconf seems to not do that. Sigh. Support both. @@ -4082,8 +5186,7 @@ docbook_target = t break self.assertIsInstance(docbook_target, dict) - ifile = self.introspect(['--target-files', 'generated-gdbus-docbook@cus'])[0] - self.assertEqual(t['filename'], 'gdbus/generated-gdbus-doc-' + os.path.basename(ifile)) + self.assertEqual(os.path.basename(t['filename'][0]), 'generated-gdbus-doc-' + os.path.basename(t['target_sources'][0]['sources'][0])) def test_build_rpath(self): if is_cygwin(): @@ -4108,9 +5211,11 @@ def test_pch_with_address_sanitizer(self): if is_cygwin(): raise unittest.SkipTest('asan not available on Cygwin') + if is_openbsd(): + raise unittest.SkipTest('-fsanitize=address is not supported on OpenBSD') testdir = os.path.join(self.common_test_dir, '13 pch') - self.init(testdir, ['-Db_sanitize=address']) + self.init(testdir, extra_args=['-Db_sanitize=address', '-Db_lundef=false']) self.build() compdb = self.get_compdb() for i in compdb: @@ -4126,7 +5231,7 @@ # We need to use llvm-cov instead of gcovr with clang raise unittest.SkipTest('Coverage does not work with clang right now, help wanted!') testdir = os.path.join(self.common_test_dir, '1 trivial') - self.init(testdir, ['-Db_coverage=true']) + self.init(testdir, extra_args=['-Db_coverage=true']) self.build() self.run_tests() self.run_target('coverage-html') @@ -4135,28 +5240,30 @@ testdir = os.path.join(self.unit_test_dir, '11 cross prog') crossfile = tempfile.NamedTemporaryFile(mode='w') print(os.path.join(testdir, 'some_cross_tool.py')) - crossfile.write('''[binaries] -c = '/usr/bin/cc' -ar = '/usr/bin/ar' -strip = '/usr/bin/ar' -sometool.py = ['{0}'] -someothertool.py = '{0}' - -[properties] - -[host_machine] -system = 'linux' -cpu_family = 'arm' -cpu = 'armv7' # Not sure if correct. -endian = 'little' -'''.format(os.path.join(testdir, 'some_cross_tool.py'))) + crossfile.write(textwrap.dedent('''\ + [binaries] + c = '/usr/bin/{1}' + ar = '/usr/bin/ar' + strip = '/usr/bin/ar' + sometool.py = ['{0}'] + someothertool.py = '{0}' + + [properties] + + [host_machine] + system = 'linux' + cpu_family = 'arm' + cpu = 'armv7' # Not sure if correct. + endian = 'little' + ''').format(os.path.join(testdir, 'some_cross_tool.py'), + 'gcc' if is_sunos() else 'cc')) crossfile.flush() self.meson_cross_file = crossfile.name self.init(testdir) def test_reconfigure(self): testdir = os.path.join(self.unit_test_dir, '13 reconfigure') - self.init(testdir, ['-Db_coverage=true'], default_args=False) + self.init(testdir, extra_args=['-Db_coverage=true'], default_args=False) self.build('reconfigure') def test_vala_generated_source_buildir_inside_source_tree(self): @@ -4187,11 +5294,15 @@ also tested. ''' testdir = os.path.join(self.framework_test_dir, '7 gnome') - os.environ['MESON_UNIT_TEST_PRETEND_GLIB_OLD'] = "1" mesonbuild.modules.gnome.native_glib_version = '2.20' - self.init(testdir, inprocess=True) - self.build() - mesonbuild.modules.gnome.native_glib_version = None + env = {'MESON_UNIT_TEST_PRETEND_GLIB_OLD': "1"} + try: + self.init(testdir, + inprocess=True, + override_envvars=env) + self.build(override_envvars=env) + finally: + mesonbuild.modules.gnome.native_glib_version = None @skipIfNoPkgconfig def test_pkgconfig_usage(self): @@ -4202,23 +5313,24 @@ stderr=subprocess.DEVNULL) != 0: raise unittest.SkipTest('Glib 2.0 dependency not available.') with tempfile.TemporaryDirectory() as tempdirname: - self.init(testdir1, ['--prefix=' + tempdirname, '--libdir=lib'], default_args=False) + self.init(testdir1, extra_args=['--prefix=' + tempdirname, '--libdir=lib'], default_args=False) self.install(use_destdir=False) shutil.rmtree(self.builddir) os.mkdir(self.builddir) pkg_dir = os.path.join(tempdirname, 'lib/pkgconfig') self.assertTrue(os.path.exists(os.path.join(pkg_dir, 'libpkgdep.pc'))) lib_dir = os.path.join(tempdirname, 'lib') - os.environ['PKG_CONFIG_PATH'] = pkg_dir + myenv = os.environ.copy() + myenv['PKG_CONFIG_PATH'] = pkg_dir # Private internal libraries must not leak out. - pkg_out = subprocess.check_output(['pkg-config', '--static', '--libs', 'libpkgdep']) + pkg_out = subprocess.check_output(['pkg-config', '--static', '--libs', 'libpkgdep'], env=myenv) self.assertFalse(b'libpkgdep-int' in pkg_out, 'Internal library leaked out.') # Dependencies must not leak to cflags when building only a shared library. - pkg_out = subprocess.check_output(['pkg-config', '--cflags', 'libpkgdep']) + pkg_out = subprocess.check_output(['pkg-config', '--cflags', 'libpkgdep'], env=myenv) self.assertFalse(b'glib' in pkg_out, 'Internal dependency leaked to headers.') # Test that the result is usable. - self.init(testdir2) - self.build() + self.init(testdir2, override_envvars=myenv) + self.build(override_envvars=myenv) myenv = os.environ.copy() myenv['LD_LIBRARY_PATH'] = ':'.join([lib_dir, myenv.get('LD_LIBRARY_PATH', '')]) if is_cygwin(): @@ -4230,6 +5342,23 @@ subprocess.check_call(test_exe, env=myenv) @skipIfNoPkgconfig + def test_pkgconfig_relative_paths(self): + testdir = os.path.join(self.unit_test_dir, '62 pkgconfig relative paths') + pkg_dir = os.path.join(testdir, 'pkgconfig') + self.assertTrue(os.path.exists(os.path.join(pkg_dir, 'librelativepath.pc'))) + + env = get_fake_env(testdir, self.builddir, self.prefix) + env.coredata.set_options({'pkg_config_path': pkg_dir}, subproject='') + kwargs = {'required': True, 'silent': True} + relative_path_dep = PkgConfigDependency('librelativepath', env, kwargs) + self.assertTrue(relative_path_dep.found()) + + # Ensure link_args are properly quoted + libpath = Path(self.builddir) / '../relativepath/lib' + link_args = ['-L' + libpath.as_posix(), '-lrelativepath'] + self.assertEqual(relative_path_dep.get_link_args(), link_args) + + @skipIfNoPkgconfig def test_pkgconfig_internal_libraries(self): ''' ''' @@ -4245,9 +5374,36 @@ # build user of library pkg_dir = os.path.join(tempdirname, 'lib/pkgconfig') - os.environ['PKG_CONFIG_PATH'] = pkg_dir self.new_builddir() - self.init(os.path.join(testdirbase, 'app')) + self.init(os.path.join(testdirbase, 'app'), + override_envvars={'PKG_CONFIG_PATH': pkg_dir}) + self.build() + + @skipIfNoPkgconfig + def test_static_archive_stripping(self): + ''' + Check that Meson produces valid static archives with --strip enabled + ''' + with tempfile.TemporaryDirectory() as tempdirname: + testdirbase = os.path.join(self.unit_test_dir, '68 static archive stripping') + + # build lib + self.new_builddir() + testdirlib = os.path.join(testdirbase, 'lib') + testlibprefix = os.path.join(tempdirname, 'libprefix') + self.init(testdirlib, extra_args=['--prefix=' + testlibprefix, + '--libdir=lib', + '--default-library=static', + '--buildtype=debug', + '--strip'], default_args=False) + self.build() + self.install(use_destdir=False) + + # build executable (uses lib, fails if static archive has been stripped incorrectly) + pkg_dir = os.path.join(testlibprefix, 'lib/pkgconfig') + self.new_builddir() + self.init(os.path.join(testdirbase, 'app'), + override_envvars={'PKG_CONFIG_PATH': pkg_dir}) self.build() @skipIfNoPkgconfig @@ -4258,7 +5414,7 @@ myenv['PKG_CONFIG_PATH'] = self.privatedir stdo = subprocess.check_output(['pkg-config', '--libs-only-l', 'libsomething'], env=myenv) deps = [b'-lgobject-2.0', b'-lgio-2.0', b'-lglib-2.0', b'-lsomething'] - if is_windows() or is_cygwin() or is_osx(): + if is_windows() or is_cygwin() or is_osx() or is_openbsd(): # On Windows, libintl is a separate library deps.append(b'-lintl') self.assertEqual(set(deps), set(stdo.split())) @@ -4266,7 +5422,7 @@ @skipIfNoPkgconfig @skip_if_not_language('cs') def test_pkgconfig_csharp_library(self): - testdir = os.path.join(self.unit_test_dir, '48 pkgconfig csharp library') + testdir = os.path.join(self.unit_test_dir, '50 pkgconfig csharp library') self.init(testdir) myenv = os.environ.copy() myenv['PKG_CONFIG_PATH'] = self.privatedir @@ -4274,6 +5430,19 @@ self.assertEqual("-r/usr/lib/libsomething.dll", str(stdo.decode('ascii')).strip()) + @skipIfNoPkgconfig + def test_pkgconfig_link_order(self): + ''' + Test that libraries are listed before their dependencies. + ''' + testdir = os.path.join(self.unit_test_dir, '53 pkgconfig static link order') + self.init(testdir) + myenv = os.environ.copy() + myenv['PKG_CONFIG_PATH'] = self.privatedir + stdo = subprocess.check_output(['pkg-config', '--libs', 'libsomething'], env=myenv) + deps = stdo.split() + self.assertTrue(deps.index(b'-lsomething') < deps.index(b'-ldependency')) + def test_deterministic_dep_order(self): ''' Test that the dependencies are always listed in a deterministic order. @@ -4296,9 +5465,9 @@ testdir = os.path.join(self.unit_test_dir, '42 rpath order') self.init(testdir) if is_osx(): - rpathre = re.compile('-rpath,.*/subprojects/sub1.*-rpath,.*/subprojects/sub2') + rpathre = re.compile(r'-rpath,.*/subprojects/sub1.*-rpath,.*/subprojects/sub2') else: - rpathre = re.compile('-rpath,\$\$ORIGIN/subprojects/sub1:\$\$ORIGIN/subprojects/sub2') + rpathre = re.compile(r'-rpath,\$\$ORIGIN/subprojects/sub1:\$\$ORIGIN/subprojects/sub2') with open(os.path.join(self.builddir, 'build.ninja')) as bfile: for line in bfile: if '-rpath' in line: @@ -4310,7 +5479,7 @@ ''' Test that we produce the correct dependencies when a program is overridden with an executable. ''' - testdir = os.path.join(self.common_test_dir, '202 override with exe') + testdir = os.path.join(self.common_test_dir, '201 override with exe') self.init(testdir) with open(os.path.join(self.builddir, 'build.ninja')) as bfile: for line in bfile: @@ -4339,16 +5508,16 @@ self.install(use_destdir=False) ## New builddir for the consumer self.new_builddir() - os.environ['LIBRARY_PATH'] = os.path.join(installdir, self.libdir) - os.environ['PKG_CONFIG_PATH'] = os.path.join(installdir, self.libdir, 'pkgconfig') + env = {'LIBRARY_PATH': os.path.join(installdir, self.libdir), + 'PKG_CONFIG_PATH': os.path.join(installdir, self.libdir, 'pkgconfig')} testdir = os.path.join(self.unit_test_dir, '40 external, internal library rpath', 'built library') # install into installdir without using DESTDIR self.prefix = self.installdir - self.init(testdir) + self.init(testdir, override_envvars=env) self.prefix = oldprefix - self.build() + self.build(override_envvars=env) # test uninstalled - self.run_tests() + self.run_tests(override_envvars=env) if not is_osx(): # Rest of the workflow only works on macOS return @@ -4361,10 +5530,10 @@ ## New builddir for testing that DESTDIR is not added to install_name self.new_builddir() # install into installdir with DESTDIR - self.init(testdir) - self.build() + self.init(testdir, override_envvars=env) + self.build(override_envvars=env) # test running after installation - self.install() + self.install(override_envvars=env) prog = self.installdir + os.path.join(self.prefix, 'bin', 'prog') lib = self.installdir + os.path.join(self.prefix, 'lib', 'libbar_built.dylib') for f in prog, lib: @@ -4400,17 +5569,17 @@ os.chdir(curdir) def test_install_subdir_symlinks(self): - self.install_subdir_invalid_symlinks('63 install subdir', os.path.join('sub', 'sub1')) + self.install_subdir_invalid_symlinks('62 install subdir', os.path.join('sub', 'sub1')) def test_install_subdir_symlinks_with_default_umask(self): - self.install_subdir_invalid_symlinks('196 install_mode', 'sub2') + self.install_subdir_invalid_symlinks('195 install_mode', 'sub2') def test_install_subdir_symlinks_with_default_umask_and_mode(self): - self.install_subdir_invalid_symlinks('196 install_mode', 'sub1') + self.install_subdir_invalid_symlinks('195 install_mode', 'sub1') @skipIfNoPkgconfigDep('gmodule-2.0') def test_ldflag_dedup(self): - testdir = os.path.join(self.unit_test_dir, '49 ldflagdedup') + testdir = os.path.join(self.unit_test_dir, '52 ldflagdedup') if is_cygwin() or is_osx(): raise unittest.SkipTest('Not applicable on Cygwin or OSX.') self.init(testdir) @@ -4422,10 +5591,73 @@ max_count = max(max_count, line.count(search_term)) self.assertEqual(max_count, 1, 'Export dynamic incorrectly deduplicated.') + def test_compiler_libs_static_dedup(self): + testdir = os.path.join(self.unit_test_dir, '56 dedup compiler libs') + self.init(testdir) + build_ninja = os.path.join(self.builddir, 'build.ninja') + with open(build_ninja, 'r', encoding='utf-8') as f: + lines = f.readlines() + for lib in ('-ldl', '-lm', '-lc', '-lrt'): + for line in lines: + if lib not in line: + continue + # Assert that + self.assertEqual(len(line.split(lib)), 2, msg=(lib, line)) + + def test_noncross_options(self): + # C_std defined in project options must be in effect also when native compiling. + testdir = os.path.join(self.unit_test_dir, '51 noncross options') + self.init(testdir, extra_args=['-Dpkg_config_path=' + testdir]) + compdb = self.get_compdb() + self.assertEqual(len(compdb), 2) + self.assertRegex(compdb[0]['command'], '-std=c99') + self.assertRegex(compdb[1]['command'], '-std=c99') + self.build() + + def test_identity_cross(self): + testdir = os.path.join(self.unit_test_dir, '61 identity cross') + crossfile = tempfile.NamedTemporaryFile(mode='w') + env = {'CC': '"' + os.path.join(testdir, 'build_wrapper.py') + '"'} + crossfile.write('''[binaries] +c = ['{0}'] +'''.format(os.path.join(testdir, 'host_wrapper.py'))) + crossfile.flush() + self.meson_cross_file = crossfile.name + # TODO should someday be explicit about build platform only here + self.init(testdir, override_envvars=env) + + def test_static_link(self): + if is_cygwin(): + raise unittest.SkipTest("Cygwin doesn't support LD_LIBRARY_PATH.") + + # Build some libraries and install them + testdir = os.path.join(self.unit_test_dir, '69 static link/lib') + libdir = os.path.join(self.installdir, self.libdir) + oldprefix = self.prefix + self.prefix = self.installdir + self.init(testdir) + self.install(use_destdir=False) + + # Test that installed libraries works + self.new_builddir() + self.prefix = oldprefix + meson_args = ['-Dc_link_args=-L{}'.format(libdir), + '--fatal-meson-warnings'] + testdir = os.path.join(self.unit_test_dir, '69 static link') + env = {'PKG_CONFIG_LIBDIR': os.path.join(libdir, 'pkgconfig')} + self.init(testdir, extra_args=meson_args, override_envvars=env) + self.build() + self.run_tests() + +def should_run_cross_arm_tests(): + return shutil.which('arm-linux-gnueabihf-gcc') and not platform.machine().lower().startswith('arm') + +@unittest.skipUnless(not is_windows() and should_run_cross_arm_tests(), "requires ability to cross compile to ARM") class LinuxCrossArmTests(BasePlatformTests): ''' Tests that cross-compilation to Linux/ARM works ''' + def setUp(self): super().setUp() src_root = os.path.dirname(__file__) @@ -4438,8 +5670,7 @@ inspect the compiler database. ''' testdir = os.path.join(self.common_test_dir, '3 static') - os.environ['CFLAGS'] = '-DBUILD_ENVIRONMENT_ONLY' - self.init(testdir) + self.init(testdir, override_envvars={'CFLAGS': '-DBUILD_ENVIRONMENT_ONLY'}) compdb = self.get_compdb() self.assertNotIn('-DBUILD_ENVIRONMENT_ONLY', compdb[0]['command']) @@ -4458,10 +5689,45 @@ self.assertRegex(compdb[0]['command'], '-D_FILE_OFFSET_BITS=64.*-U_FILE_OFFSET_BITS') self.build() + def test_cross_libdir(self): + # When cross compiling "libdir" should default to "lib" + # rather than "lib/x86_64-linux-gnu" or something like that. + testdir = os.path.join(self.common_test_dir, '1 trivial') + self.init(testdir) + for i in self.introspect('--buildoptions'): + if i['name'] == 'libdir': + self.assertEqual(i['value'], 'lib') + return + self.assertTrue(False, 'Option libdir not in introspect data.') + + def test_std_remains(self): + # C_std defined in project options must be in effect also when cross compiling. + testdir = os.path.join(self.unit_test_dir, '51 noncross options') + self.init(testdir) + compdb = self.get_compdb() + self.assertRegex(compdb[0]['command'], '-std=c99') + self.build() + + @skipIfNoPkgconfig + def test_pkg_config_option(self): + if not shutil.which('arm-linux-gnueabihf-pkg-config'): + raise unittest.SkipTest('Cross-pkgconfig not found.') + testdir = os.path.join(self.unit_test_dir, '58 pkg_config_path option') + self.init(testdir, extra_args=[ + '-Dbuild.pkg_config_path=' + os.path.join(testdir, 'build_extra_path'), + '-Dpkg_config_path=' + os.path.join(testdir, 'host_extra_path'), + ]) + + +def should_run_cross_mingw_tests(): + return shutil.which('x86_64-w64-mingw32-gcc') and not (is_windows() or is_cygwin()) + +@unittest.skipUnless(not is_windows() and should_run_cross_mingw_tests(), "requires ability to cross compile with MinGW") class LinuxCrossMingwTests(BasePlatformTests): ''' Tests that cross-compilation to Windows/MinGW works ''' + def setUp(self): super().setUp() src_root = os.path.dirname(__file__) @@ -4484,24 +5750,38 @@ # Change cross file to use a non-existing exe_wrapper and it should fail self.meson_cross_file = os.path.join(testdir, 'broken-cross.txt') # Force tracebacks so we can detect them properly - os.environ['MESON_FORCE_BACKTRACE'] = '1' + env = {'MESON_FORCE_BACKTRACE': '1'} with self.assertRaisesRegex(MesonException, 'exe_wrapper.*target.*use-exe-wrapper'): # Must run in-process or we'll get a generic CalledProcessError - self.init(testdir, extra_args='-Drun-target=false', inprocess=True) + self.init(testdir, extra_args='-Drun-target=false', + inprocess=True, + override_envvars=env) with self.assertRaisesRegex(MesonException, 'exe_wrapper.*run target.*run-prog'): # Must run in-process or we'll get a generic CalledProcessError - self.init(testdir, extra_args='-Dcustom-target=false', inprocess=True) - self.init(testdir, extra_args=['-Dcustom-target=false', '-Drun-target=false']) + self.init(testdir, extra_args='-Dcustom-target=false', + inprocess=True, + override_envvars=env) + self.init(testdir, extra_args=['-Dcustom-target=false', '-Drun-target=false'], + override_envvars=env) self.build() with self.assertRaisesRegex(MesonException, 'exe_wrapper.*PATH'): # Must run in-process or we'll get a generic CalledProcessError - self.run_tests(inprocess=True) + self.run_tests(inprocess=True, override_envvars=env) + + @skipIfNoPkgconfig + def test_cross_pkg_config_option(self): + testdir = os.path.join(self.unit_test_dir, '58 pkg_config_path option') + self.init(testdir, extra_args=[ + '-Dbuild.pkg_config_path=' + os.path.join(testdir, 'build_extra_path'), + '-Dpkg_config_path=' + os.path.join(testdir, 'host_extra_path'), + ]) class PythonTests(BasePlatformTests): ''' Tests that verify compilation of python extension modules ''' + def test_versions(self): if self.backend is not Backend.ninja: raise unittest.SkipTest('Skipping python tests with {} backend'.format(self.backend.name)) @@ -4518,7 +5798,7 @@ # will also try 'python' as a fallback and use it if the major # version matches try: - self.init(testdir, ['-Dpython=python2']) + self.init(testdir, extra_args=['-Dpython=python2']) self.build() self.run_tests() except unittest.SkipTest: @@ -4534,7 +5814,7 @@ for py in ('pypy', 'pypy3'): try: - self.init(testdir, ['-Dpython=%s' % py]) + self.init(testdir, extra_args=['-Dpython=%s' % py]) except unittest.SkipTest: # Same as above, pypy2 and pypy3 are not expected to be present # on the test system, the test project only raises in these cases @@ -4548,84 +5828,347 @@ # The test is configured to error out with MESON_SKIP_TEST # in case it could not find python with self.assertRaises(unittest.SkipTest): - self.init(testdir, ['-Dpython=not-python']) + self.init(testdir, extra_args=['-Dpython=not-python']) self.wipe() # While dir is an external command on both Windows and Linux, # it certainly isn't python with self.assertRaises(unittest.SkipTest): - self.init(testdir, ['-Dpython=dir']) + self.init(testdir, extra_args=['-Dpython=dir']) self.wipe() -class RewriterTests(unittest.TestCase): - +class RewriterTests(BasePlatformTests): def setUp(self): super().setUp() - src_root = os.path.dirname(__file__) - self.testroot = os.path.realpath(tempfile.mkdtemp()) - self.rewrite_command = python_command + [os.path.join(src_root, 'mesonrewriter.py')] - self.tmpdir = os.path.realpath(tempfile.mkdtemp()) - self.workdir = os.path.join(self.tmpdir, 'foo') - self.test_dir = os.path.join(src_root, 'test cases/rewrite') + self.maxDiff = None - def tearDown(self): - windows_proof_rmtree(self.tmpdir) + def prime(self, dirname): + copy_tree(os.path.join(self.rewrite_test_dir, dirname), self.builddir) - def read_contents(self, fname): - with open(os.path.join(self.workdir, fname)) as f: - return f.read() - - def check_effectively_same(self, mainfile, truth): - mf = self.read_contents(mainfile) - t = self.read_contents(truth) - # Rewriting is not guaranteed to do a perfect job of - # maintaining whitespace. - self.assertEqual(mf.replace(' ', ''), t.replace(' ', '')) + def rewrite_raw(self, directory, args): + if isinstance(args, str): + args = [args] + command = self.rewrite_command + ['--verbose', '--skip', '--sourcedir', directory] + args + p = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, + universal_newlines=True, timeout=60) + print('STDOUT:') + print(p.stdout) + print('STDERR:') + print(p.stderr) + if p.returncode != 0: + if 'MESON_SKIP_TEST' in p.stdout: + raise unittest.SkipTest('Project requested skipping.') + raise subprocess.CalledProcessError(p.returncode, command, output=p.stdout) + if not p.stderr: + return {} + return json.loads(p.stderr) - def prime(self, dirname): - shutil.copytree(os.path.join(self.test_dir, dirname), self.workdir) + def rewrite(self, directory, args): + if isinstance(args, str): + args = [args] + return self.rewrite_raw(directory, ['command'] + args) + + def test_target_source_list(self): + self.prime('1 basic') + out = self.rewrite(self.builddir, os.path.join(self.builddir, 'info.json')) + expected = { + 'target': { + 'trivialprog0@exe': {'name': 'trivialprog0', 'sources': ['main.cpp', 'fileA.cpp', 'fileB.cpp', 'fileC.cpp']}, + 'trivialprog1@exe': {'name': 'trivialprog1', 'sources': ['main.cpp', 'fileA.cpp']}, + 'trivialprog2@exe': {'name': 'trivialprog2', 'sources': ['fileB.cpp', 'fileC.cpp']}, + 'trivialprog3@exe': {'name': 'trivialprog3', 'sources': ['main.cpp', 'fileA.cpp']}, + 'trivialprog4@exe': {'name': 'trivialprog4', 'sources': ['main.cpp', 'fileA.cpp']}, + 'trivialprog5@exe': {'name': 'trivialprog5', 'sources': ['main.cpp', 'fileB.cpp', 'fileC.cpp']}, + 'trivialprog6@exe': {'name': 'trivialprog6', 'sources': ['main.cpp', 'fileA.cpp']}, + 'trivialprog7@exe': {'name': 'trivialprog7', 'sources': ['fileB.cpp', 'fileC.cpp', 'main.cpp', 'fileA.cpp']}, + 'trivialprog8@exe': {'name': 'trivialprog8', 'sources': ['main.cpp', 'fileA.cpp']}, + 'trivialprog9@exe': {'name': 'trivialprog9', 'sources': ['main.cpp', 'fileA.cpp']}, + } + } + self.assertDictEqual(out, expected) + + def test_target_add_sources(self): + self.prime('1 basic') + out = self.rewrite(self.builddir, os.path.join(self.builddir, 'addSrc.json')) + expected = { + 'target': { + 'trivialprog0@exe': {'name': 'trivialprog0', 'sources': ['a1.cpp', 'a2.cpp', 'a6.cpp', 'fileA.cpp', 'main.cpp', 'a7.cpp', 'fileB.cpp', 'fileC.cpp']}, + 'trivialprog1@exe': {'name': 'trivialprog1', 'sources': ['a1.cpp', 'a2.cpp', 'a6.cpp', 'fileA.cpp', 'main.cpp']}, + 'trivialprog2@exe': {'name': 'trivialprog2', 'sources': ['a7.cpp', 'fileB.cpp', 'fileC.cpp']}, + 'trivialprog3@exe': {'name': 'trivialprog3', 'sources': ['a5.cpp', 'fileA.cpp', 'main.cpp']}, + 'trivialprog4@exe': {'name': 'trivialprog4', 'sources': ['a5.cpp', 'main.cpp', 'fileA.cpp']}, + 'trivialprog5@exe': {'name': 'trivialprog5', 'sources': ['a3.cpp', 'main.cpp', 'a7.cpp', 'fileB.cpp', 'fileC.cpp']}, + 'trivialprog6@exe': {'name': 'trivialprog6', 'sources': ['main.cpp', 'fileA.cpp', 'a4.cpp']}, + 'trivialprog7@exe': {'name': 'trivialprog7', 'sources': ['fileB.cpp', 'fileC.cpp', 'a1.cpp', 'a2.cpp', 'a6.cpp', 'fileA.cpp', 'main.cpp']}, + 'trivialprog8@exe': {'name': 'trivialprog8', 'sources': ['a1.cpp', 'a2.cpp', 'a6.cpp', 'fileA.cpp', 'main.cpp']}, + 'trivialprog9@exe': {'name': 'trivialprog9', 'sources': ['a1.cpp', 'a2.cpp', 'a6.cpp', 'fileA.cpp', 'main.cpp']}, + } + } + self.assertDictEqual(out, expected) + + # Check the written file + out = self.rewrite(self.builddir, os.path.join(self.builddir, 'info.json')) + self.assertDictEqual(out, expected) - def test_basic(self): + def test_target_add_sources_abs(self): self.prime('1 basic') - subprocess.check_call(self.rewrite_command + ['remove', - '--target=trivialprog', - '--filename=notthere.c', - '--sourcedir', self.workdir], - universal_newlines=True) - self.check_effectively_same('meson.build', 'removed.txt') - subprocess.check_call(self.rewrite_command + ['add', - '--target=trivialprog', - '--filename=notthere.c', - '--sourcedir', self.workdir], - universal_newlines=True) - self.check_effectively_same('meson.build', 'added.txt') - subprocess.check_call(self.rewrite_command + ['remove', - '--target=trivialprog', - '--filename=notthere.c', - '--sourcedir', self.workdir], - universal_newlines=True) - self.check_effectively_same('meson.build', 'removed.txt') + abs_src = [os.path.join(self.builddir, x) for x in ['a1.cpp', 'a2.cpp', 'a6.cpp']] + add = json.dumps([{"type": "target", "target": "trivialprog1", "operation": "src_add", "sources": abs_src}]) + inf = json.dumps([{"type": "target", "target": "trivialprog1", "operation": "info"}]) + self.rewrite(self.builddir, add) + out = self.rewrite(self.builddir, inf) + expected = {'target': {'trivialprog1@exe': {'name': 'trivialprog1', 'sources': ['a1.cpp', 'a2.cpp', 'a6.cpp', 'fileA.cpp', 'main.cpp']}}} + self.assertDictEqual(out, expected) + + def test_target_remove_sources(self): + self.prime('1 basic') + out = self.rewrite(self.builddir, os.path.join(self.builddir, 'rmSrc.json')) + expected = { + 'target': { + 'trivialprog0@exe': {'name': 'trivialprog0', 'sources': ['main.cpp', 'fileC.cpp']}, + 'trivialprog1@exe': {'name': 'trivialprog1', 'sources': ['main.cpp']}, + 'trivialprog2@exe': {'name': 'trivialprog2', 'sources': ['fileC.cpp']}, + 'trivialprog3@exe': {'name': 'trivialprog3', 'sources': ['main.cpp']}, + 'trivialprog4@exe': {'name': 'trivialprog4', 'sources': ['main.cpp']}, + 'trivialprog5@exe': {'name': 'trivialprog5', 'sources': ['main.cpp', 'fileC.cpp']}, + 'trivialprog6@exe': {'name': 'trivialprog6', 'sources': ['main.cpp']}, + 'trivialprog7@exe': {'name': 'trivialprog7', 'sources': ['fileC.cpp', 'main.cpp']}, + 'trivialprog8@exe': {'name': 'trivialprog8', 'sources': ['main.cpp']}, + 'trivialprog9@exe': {'name': 'trivialprog9', 'sources': ['main.cpp']}, + } + } + self.assertDictEqual(out, expected) + + # Check the written file + out = self.rewrite(self.builddir, os.path.join(self.builddir, 'info.json')) + self.assertDictEqual(out, expected) + + def test_target_subdir(self): + self.prime('2 subdirs') + out = self.rewrite(self.builddir, os.path.join(self.builddir, 'addSrc.json')) + expected = {'name': 'something', 'sources': ['first.c', 'second.c', 'third.c']} + self.assertDictEqual(list(out['target'].values())[0], expected) + + # Check the written file + out = self.rewrite(self.builddir, os.path.join(self.builddir, 'info.json')) + self.assertDictEqual(list(out['target'].values())[0], expected) + + def test_target_remove(self): + self.prime('1 basic') + self.rewrite(self.builddir, os.path.join(self.builddir, 'rmTgt.json')) + out = self.rewrite(self.builddir, os.path.join(self.builddir, 'info.json')) + + expected = { + 'target': { + 'trivialprog2@exe': {'name': 'trivialprog2', 'sources': ['fileB.cpp', 'fileC.cpp']}, + 'trivialprog3@exe': {'name': 'trivialprog3', 'sources': ['main.cpp', 'fileA.cpp']}, + 'trivialprog4@exe': {'name': 'trivialprog4', 'sources': ['main.cpp', 'fileA.cpp']}, + 'trivialprog5@exe': {'name': 'trivialprog5', 'sources': ['main.cpp', 'fileB.cpp', 'fileC.cpp']}, + 'trivialprog6@exe': {'name': 'trivialprog6', 'sources': ['main.cpp', 'fileA.cpp']}, + 'trivialprog7@exe': {'name': 'trivialprog7', 'sources': ['fileB.cpp', 'fileC.cpp', 'main.cpp', 'fileA.cpp']}, + 'trivialprog8@exe': {'name': 'trivialprog8', 'sources': ['main.cpp', 'fileA.cpp']}, + } + } + self.assertDictEqual(out, expected) + + def test_tatrget_add(self): + self.prime('1 basic') + self.rewrite(self.builddir, os.path.join(self.builddir, 'addTgt.json')) + out = self.rewrite(self.builddir, os.path.join(self.builddir, 'info.json')) + + expected = { + 'target': { + 'trivialprog0@exe': {'name': 'trivialprog0', 'sources': ['main.cpp', 'fileA.cpp', 'fileB.cpp', 'fileC.cpp']}, + 'trivialprog1@exe': {'name': 'trivialprog1', 'sources': ['main.cpp', 'fileA.cpp']}, + 'trivialprog2@exe': {'name': 'trivialprog2', 'sources': ['fileB.cpp', 'fileC.cpp']}, + 'trivialprog3@exe': {'name': 'trivialprog3', 'sources': ['main.cpp', 'fileA.cpp']}, + 'trivialprog4@exe': {'name': 'trivialprog4', 'sources': ['main.cpp', 'fileA.cpp']}, + 'trivialprog5@exe': {'name': 'trivialprog5', 'sources': ['main.cpp', 'fileB.cpp', 'fileC.cpp']}, + 'trivialprog6@exe': {'name': 'trivialprog6', 'sources': ['main.cpp', 'fileA.cpp']}, + 'trivialprog7@exe': {'name': 'trivialprog7', 'sources': ['fileB.cpp', 'fileC.cpp', 'main.cpp', 'fileA.cpp']}, + 'trivialprog8@exe': {'name': 'trivialprog8', 'sources': ['main.cpp', 'fileA.cpp']}, + 'trivialprog9@exe': {'name': 'trivialprog9', 'sources': ['main.cpp', 'fileA.cpp']}, + 'trivialprog10@sha': {'name': 'trivialprog10', 'sources': ['new1.cpp', 'new2.cpp']}, + } + } + self.assertDictEqual(out, expected) + + def test_target_remove_subdir(self): + self.prime('2 subdirs') + self.rewrite(self.builddir, os.path.join(self.builddir, 'rmTgt.json')) + out = self.rewrite(self.builddir, os.path.join(self.builddir, 'info.json')) + self.assertDictEqual(out, {}) - def test_subdir(self): + def test_target_add_subdir(self): self.prime('2 subdirs') - top = self.read_contents('meson.build') - s2 = self.read_contents('sub2/meson.build') - subprocess.check_call(self.rewrite_command + ['remove', - '--target=something', - '--filename=second.c', - '--sourcedir', self.workdir], - universal_newlines=True) - self.check_effectively_same('sub1/meson.build', 'sub1/after.txt') - self.assertEqual(top, self.read_contents('meson.build')) - self.assertEqual(s2, self.read_contents('sub2/meson.build')) + self.rewrite(self.builddir, os.path.join(self.builddir, 'addTgt.json')) + out = self.rewrite(self.builddir, os.path.join(self.builddir, 'info.json')) + expected = {'name': 'something', 'sources': ['first.c', 'second.c']} + self.assertDictEqual(out['target']['94b671c@@something@exe'], expected) + + def test_target_source_sorting(self): + self.prime('5 sorting') + add_json = json.dumps([{'type': 'target', 'target': 'exe1', 'operation': 'src_add', 'sources': ['a666.c']}]) + inf_json = json.dumps([{'type': 'target', 'target': 'exe1', 'operation': 'info'}]) + out = self.rewrite(self.builddir, add_json) + out = self.rewrite(self.builddir, inf_json) + expected = { + 'target': { + 'exe1@exe': { + 'name': 'exe1', + 'sources': [ + 'aaa/a/a1.c', + 'aaa/b/b1.c', + 'aaa/b/b2.c', + 'aaa/f1.c', + 'aaa/f2.c', + 'aaa/f3.c', + 'bbb/a/b1.c', + 'bbb/b/b2.c', + 'bbb/c1/b5.c', + 'bbb/c2/b7.c', + 'bbb/c10/b6.c', + 'bbb/a4.c', + 'bbb/b3.c', + 'bbb/b4.c', + 'bbb/b5.c', + 'a1.c', + 'a2.c', + 'a3.c', + 'a10.c', + 'a20.c', + 'a30.c', + 'a100.c', + 'a101.c', + 'a110.c', + 'a210.c', + 'a666.c', + 'b1.c', + 'c2.c' + ] + } + } + } + self.assertDictEqual(out, expected) + + def test_target_same_name_skip(self): + self.prime('4 same name targets') + out = self.rewrite(self.builddir, os.path.join(self.builddir, 'addSrc.json')) + out = self.rewrite(self.builddir, os.path.join(self.builddir, 'info.json')) + expected = {'name': 'myExe', 'sources': ['main.cpp']} + self.assertEqual(len(out['target']), 2) + for val in out['target'].values(): + self.assertDictEqual(expected, val) + + def test_kwargs_info(self): + self.prime('3 kwargs') + out = self.rewrite(self.builddir, os.path.join(self.builddir, 'info.json')) + expected = { + 'kwargs': { + 'project#/': {'version': '0.0.1'}, + 'target#tgt1': {'build_by_default': True}, + 'dependency#dep1': {'required': False} + } + } + self.assertDictEqual(out, expected) + + def test_kwargs_set(self): + self.prime('3 kwargs') + self.rewrite(self.builddir, os.path.join(self.builddir, 'set.json')) + out = self.rewrite(self.builddir, os.path.join(self.builddir, 'info.json')) + expected = { + 'kwargs': { + 'project#/': {'version': '0.0.2', 'meson_version': '0.50.0', 'license': ['GPL', 'MIT']}, + 'target#tgt1': {'build_by_default': False, 'build_rpath': '/usr/local', 'dependencies': 'dep1'}, + 'dependency#dep1': {'required': True, 'method': 'cmake'} + } + } + self.assertDictEqual(out, expected) + + def test_kwargs_add(self): + self.prime('3 kwargs') + self.rewrite(self.builddir, os.path.join(self.builddir, 'add.json')) + out = self.rewrite(self.builddir, os.path.join(self.builddir, 'info.json')) + expected = { + 'kwargs': { + 'project#/': {'version': '0.0.1', 'license': ['GPL', 'MIT', 'BSD']}, + 'target#tgt1': {'build_by_default': True}, + 'dependency#dep1': {'required': False} + } + } + self.assertDictEqual(out, expected) + + def test_kwargs_remove(self): + self.prime('3 kwargs') + self.rewrite(self.builddir, os.path.join(self.builddir, 'remove.json')) + out = self.rewrite(self.builddir, os.path.join(self.builddir, 'info.json')) + expected = { + 'kwargs': { + 'project#/': {'version': '0.0.1', 'license': 'GPL'}, + 'target#tgt1': {'build_by_default': True}, + 'dependency#dep1': {'required': False} + } + } + self.assertDictEqual(out, expected) + + def test_kwargs_remove_regex(self): + self.prime('3 kwargs') + self.rewrite(self.builddir, os.path.join(self.builddir, 'remove_regex.json')) + out = self.rewrite(self.builddir, os.path.join(self.builddir, 'info.json')) + expected = { + 'kwargs': { + 'project#/': {'version': '0.0.1', 'default_options': ['buildtype=release', 'debug=true']}, + 'target#tgt1': {'build_by_default': True}, + 'dependency#dep1': {'required': False} + } + } + self.assertDictEqual(out, expected) + + def test_kwargs_delete(self): + self.prime('3 kwargs') + self.rewrite(self.builddir, os.path.join(self.builddir, 'delete.json')) + out = self.rewrite(self.builddir, os.path.join(self.builddir, 'info.json')) + expected = { + 'kwargs': { + 'project#/': {}, + 'target#tgt1': {}, + 'dependency#dep1': {'required': False} + } + } + self.assertDictEqual(out, expected) + def test_default_options_set(self): + self.prime('3 kwargs') + self.rewrite(self.builddir, os.path.join(self.builddir, 'defopts_set.json')) + out = self.rewrite(self.builddir, os.path.join(self.builddir, 'info.json')) + expected = { + 'kwargs': { + 'project#/': {'version': '0.0.1', 'default_options': ['buildtype=release', 'debug=True', 'cpp_std=c++11']}, + 'target#tgt1': {'build_by_default': True}, + 'dependency#dep1': {'required': False} + } + } + self.assertDictEqual(out, expected) + + def test_default_options_delete(self): + self.prime('3 kwargs') + self.rewrite(self.builddir, os.path.join(self.builddir, 'defopts_delete.json')) + out = self.rewrite(self.builddir, os.path.join(self.builddir, 'info.json')) + expected = { + 'kwargs': { + 'project#/': {'version': '0.0.1', 'default_options': ['cpp_std=c++14', 'debug=true']}, + 'target#tgt1': {'build_by_default': True}, + 'dependency#dep1': {'required': False} + } + } + self.assertDictEqual(out, expected) class NativeFileTests(BasePlatformTests): def setUp(self): super().setUp() - self.testcase = os.path.join(self.unit_test_dir, '46 native file binary') + self.testcase = os.path.join(self.unit_test_dir, '47 native file binary') self.current_config = 0 self.current_wrapper = 0 @@ -4644,9 +6187,10 @@ f.write("{}='{}'\n".format(k, v)) return filename - def helper_create_binary_wrapper(self, binary, **kwargs): + def helper_create_binary_wrapper(self, binary, dir_=None, extra_args=None, **kwargs): """Creates a wrapper around a binary that overrides specific values.""" - filename = os.path.join(self.builddir, 'binary_wrapper{}.py'.format(self.current_wrapper)) + filename = os.path.join(dir_ or self.builddir, 'binary_wrapper{}.py'.format(self.current_wrapper)) + extra_args = extra_args or {} self.current_wrapper += 1 if is_haiku(): chbang = '#!/bin/env python3' @@ -4663,10 +6207,10 @@ def main(): parser = argparse.ArgumentParser() '''.format(chbang))) - for name in kwargs: + for name in chain(extra_args, kwargs): f.write(' parser.add_argument("-{0}", "--{0}", action="store_true")\n'.format(name)) f.write(' args, extra_args = parser.parse_known_args()\n') - for name, value in kwargs.items(): + for name, value in chain(extra_args.items(), kwargs.items()): f.write(' if args.{}:\n'.format(name)) f.write(' print("{}", file=sys.{})\n'.format(value, kwargs.get('outfile', 'stdout'))) f.write(' sys.exit(0)\n') @@ -4674,10 +6218,9 @@ ret = subprocess.run( ["{}"] + extra_args, stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding='utf-8') - print(ret.stdout) - print(ret.stderr, file=sys.stderr) + stderr=subprocess.PIPE) + print(ret.stdout.decode('utf-8')) + print(ret.stderr.decode('utf-8'), file=sys.stderr) sys.exit(ret.returncode) if __name__ == '__main__': @@ -4693,20 +6236,19 @@ # invokes our python wrapper batfile = os.path.join(self.builddir, 'binary_wrapper{}.bat'.format(self.current_wrapper)) with open(batfile, 'wt') as f: - f.write('py -3 {} %*'.format(filename)) + f.write(r'@{} {} %*'.format(sys.executable, filename)) return batfile - def helper_for_compiler(self, lang, cb): + def helper_for_compiler(self, lang, cb, for_machine = MachineChoice.HOST): """Helper for generating tests for overriding compilers for langaugages with more than one implementation, such as C, C++, ObjC, ObjC++, and D. """ - env = get_fake_env('', '', '') + env = get_fake_env() getter = getattr(env, 'detect_{}_compiler'.format(lang)) - if lang not in ['cs']: - getter = functools.partial(getter, False) + getter = functools.partial(getter, for_machine) cc = getter() binary, newid = cb(cc) - env.config_info.binaries = {lang: binary} + env.binaries[for_machine].binaries[lang] = binary compiler = getter() self.assertEqual(compiler.id, newid) @@ -4719,6 +6261,29 @@ '--native-file', config, '--native-file', config2, '-Dcase=find_program']) + # This test hangs on cygwin. + @unittest.skipIf(os.name != 'posix' or is_cygwin(), 'Uses fifos, which are not available on non Unix OSes.') + def test_native_file_is_pipe(self): + fifo = os.path.join(self.builddir, 'native.file') + os.mkfifo(fifo) + with tempfile.TemporaryDirectory() as d: + wrapper = self.helper_create_binary_wrapper('bash', d, version='12345') + + def filler(): + with open(fifo, 'w') as f: + f.write('[binaries]\n') + f.write("bash = '{}'\n".format(wrapper)) + + thread = threading.Thread(target=filler) + thread.start() + + self.init(self.testcase, extra_args=['--native-file', fifo, '-Dcase=find_program']) + + thread.join() + os.unlink(fifo) + + self.init(self.testcase, extra_args=['--wipe']) + def test_multiple_native_files(self): wrapper = self.helper_create_binary_wrapper('bash', version='12345') config = self.helper_create_native_file({'binaries': {'bash': wrapper}}) @@ -4738,6 +6303,8 @@ def test_config_tool_dep(self): # Do the skip at this level to avoid screwing up the cache + if mesonbuild.environment.detect_msys2_arch(): + raise unittest.SkipTest('Skipped due to problems with LLVM on MSYS2') if not shutil.which('llvm-config'): raise unittest.SkipTest('No llvm-installed, cannot test') self._simple_test('config_dep', 'llvm-config') @@ -4751,62 +6318,71 @@ # python module breaks. This is fine on other OSes because they # don't need the extra indirection. raise unittest.SkipTest('bat indirection breaks internal sanity checks.') + if os.path.exists('/etc/debian_version'): + rc = subprocess.call(['pkg-config', '--cflags', 'python2'], + stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL) + if rc != 0: + # Python 2 will be removed in Debian Bullseye, thus we must + # remove the build dependency on python2-dev. Keep the tests + # but only run them if dev packages are available. + raise unittest.SkipTest('Not running Python 2 tests because dev packages not installed.') self._simple_test('python', 'python') @unittest.skipIf(is_windows(), 'Setting up multiple compilers on windows is hard') - @skip_if_env_value('CC') + @skip_if_env_set('CC') def test_c_compiler(self): def cb(comp): if comp.id == 'gcc': if not shutil.which('clang'): raise unittest.SkipTest('Only one compiler found, cannot test.') return 'clang', 'clang' - if not shutil.which('gcc'): + if not is_real_gnu_compiler(shutil.which('gcc')): raise unittest.SkipTest('Only one compiler found, cannot test.') return 'gcc', 'gcc' self.helper_for_compiler('c', cb) @unittest.skipIf(is_windows(), 'Setting up multiple compilers on windows is hard') - @skip_if_env_value('CXX') + @skip_if_env_set('CXX') def test_cpp_compiler(self): def cb(comp): if comp.id == 'gcc': if not shutil.which('clang++'): raise unittest.SkipTest('Only one compiler found, cannot test.') return 'clang++', 'clang' - if not shutil.which('g++'): + if not is_real_gnu_compiler(shutil.which('g++')): raise unittest.SkipTest('Only one compiler found, cannot test.') return 'g++', 'gcc' self.helper_for_compiler('cpp', cb) @skip_if_not_language('objc') - @skip_if_env_value('OBJC') + @skip_if_env_set('OBJC') def test_objc_compiler(self): def cb(comp): if comp.id == 'gcc': if not shutil.which('clang'): raise unittest.SkipTest('Only one compiler found, cannot test.') return 'clang', 'clang' - if not shutil.which('gcc'): + if not is_real_gnu_compiler(shutil.which('gcc')): raise unittest.SkipTest('Only one compiler found, cannot test.') return 'gcc', 'gcc' self.helper_for_compiler('objc', cb) @skip_if_not_language('objcpp') - @skip_if_env_value('OBJCXX') + @skip_if_env_set('OBJCXX') def test_objcpp_compiler(self): def cb(comp): if comp.id == 'gcc': if not shutil.which('clang++'): raise unittest.SkipTest('Only one compiler found, cannot test.') return 'clang++', 'clang' - if not shutil.which('g++'): + if not is_real_gnu_compiler(shutil.which('g++')): raise unittest.SkipTest('Only one compiler found, cannot test.') return 'g++', 'gcc' self.helper_for_compiler('objcpp', cb) @skip_if_not_language('d') - @skip_if_env_value('DC') + @skip_if_env_set('DC') def test_d_compiler(self): def cb(comp): if comp.id == 'dmd': @@ -4822,7 +6398,7 @@ self.helper_for_compiler('d', cb) @skip_if_not_language('cs') - @skip_if_env_value('CSC') + @skip_if_env_set('CSC') def test_cs_compiler(self): def cb(comp): if comp.id == 'csc': @@ -4835,17 +6411,29 @@ self.helper_for_compiler('cs', cb) @skip_if_not_language('fortran') - @skip_if_env_value('FC') + @skip_if_env_set('FC') def test_fortran_compiler(self): def cb(comp): - if comp.id == 'gcc': + if comp.id == 'lcc': + if shutil.which('lfortran'): + return 'lfortran', 'lcc' + raise unittest.SkipTest('No alternate Fortran implementation.') + elif comp.id == 'gcc': if shutil.which('ifort'): + # There is an ICC for windows (windows build, linux host), + # but we don't support that ATM so lets not worry about it. + if is_windows(): + return 'ifort', 'intel-cl' return 'ifort', 'intel' + elif shutil.which('flang'): + return 'flang', 'flang' + elif shutil.which('pgfortran'): + return 'pgfortran', 'pgi' # XXX: there are several other fortran compilers meson # supports, but I don't have any of them to test with raise unittest.SkipTest('No alternate Fortran implementation.') if not shutil.which('gfortran'): - raise unittest.SkipTest('No alternate C# implementation.') + raise unittest.SkipTest('No alternate Fortran implementation.') return 'gfortran', 'gcc' self.helper_for_compiler('fortran', cb) @@ -4855,22 +6443,21 @@ Builds a wrapper around the compiler to override the version. """ wrapper = self.helper_create_binary_wrapper(binary, version=version_str) - env = get_fake_env('', '', '') + env = get_fake_env() getter = getattr(env, 'detect_{}_compiler'.format(lang)) - if lang in ['rust']: - getter = functools.partial(getter, False) - env.config_info.binaries = {lang: wrapper} + getter = functools.partial(getter, MachineChoice.HOST) + env.binaries.host.binaries[lang] = wrapper compiler = getter() self.assertEqual(compiler.version, version) @skip_if_not_language('vala') - @skip_if_env_value('VALAC') + @skip_if_env_set('VALAC') def test_vala_compiler(self): self._single_implementation_compiler( 'vala', 'valac', 'Vala 1.2345', '1.2345') @skip_if_not_language('rust') - @skip_if_env_value('RUSTC') + @skip_if_env_set('RUSTC') def test_rust_compiler(self): self._single_implementation_compiler( 'rust', 'rustc', 'rustc 1.2345', '1.2345') @@ -4883,12 +6470,399 @@ @skip_if_not_language('swift') def test_swift_compiler(self): wrapper = self.helper_create_binary_wrapper( - 'swiftc', version='Swift 1.2345', outfile='stderr') - env = get_fake_env('', '', '') - env.config_info.binaries = {'swift': wrapper} - compiler = env.detect_swift_compiler() + 'swiftc', version='Swift 1.2345', outfile='stderr', + extra_args={'Xlinker': 'macosx_version. PROJECT:ld - 1.2.3'}) + env = get_fake_env() + env.binaries.host.binaries['swift'] = wrapper + compiler = env.detect_swift_compiler(MachineChoice.HOST) self.assertEqual(compiler.version, '1.2345') + def test_native_file_dirs(self): + testcase = os.path.join(self.unit_test_dir, '60 native file override') + self.init(testcase, default_args=False, + extra_args=['--native-file', os.path.join(testcase, 'nativefile')]) + + def test_native_file_dirs_overriden(self): + testcase = os.path.join(self.unit_test_dir, '60 native file override') + self.init(testcase, default_args=False, + extra_args=['--native-file', os.path.join(testcase, 'nativefile'), + '-Ddef_libdir=liblib', '-Dlibdir=liblib']) + + def test_compile_sys_path(self): + """Compiling with a native file stored in a system path works. + + There was a bug which caused the paths to be stored incorrectly and + would result in ninja invoking meson in an infinite loop. This tests + for that by actually invoking ninja. + """ + testcase = os.path.join(self.common_test_dir, '1 trivial') + + # It really doesn't matter what's in the native file, just that it exists + config = self.helper_create_native_file({'binaries': {'bash': 'false'}}) + + self.init(testcase, extra_args=['--native-file', config]) + self.build() + + +class CrossFileTests(BasePlatformTests): + + """Tests for cross file functioality not directly related to + cross compiling. + + This is mainly aimed to testing overrides from cross files. + """ + + def test_cross_file_dirs(self): + testcase = os.path.join(self.unit_test_dir, '60 native file override') + self.init(testcase, default_args=False, + extra_args=['--native-file', os.path.join(testcase, 'nativefile'), + '--cross-file', os.path.join(testcase, 'crossfile'), + '-Ddef_bindir=binbar', + '-Ddef_datadir=databar', + '-Ddef_includedir=includebar', + '-Ddef_infodir=infobar', + '-Ddef_libdir=libbar', + '-Ddef_libexecdir=libexecbar', + '-Ddef_localedir=localebar', + '-Ddef_localstatedir=localstatebar', + '-Ddef_mandir=manbar', + '-Ddef_sbindir=sbinbar', + '-Ddef_sharedstatedir=sharedstatebar', + '-Ddef_sysconfdir=sysconfbar']) + + def test_cross_file_dirs_overriden(self): + testcase = os.path.join(self.unit_test_dir, '60 native file override') + self.init(testcase, default_args=False, + extra_args=['--native-file', os.path.join(testcase, 'nativefile'), + '--cross-file', os.path.join(testcase, 'crossfile'), + '-Ddef_libdir=liblib', '-Dlibdir=liblib', + '-Ddef_bindir=binbar', + '-Ddef_datadir=databar', + '-Ddef_includedir=includebar', + '-Ddef_infodir=infobar', + '-Ddef_libexecdir=libexecbar', + '-Ddef_localedir=localebar', + '-Ddef_localstatedir=localstatebar', + '-Ddef_mandir=manbar', + '-Ddef_sbindir=sbinbar', + '-Ddef_sharedstatedir=sharedstatebar', + '-Ddef_sysconfdir=sysconfbar']) + + def test_cross_file_dirs_chain(self): + # crossfile2 overrides crossfile overrides nativefile + testcase = os.path.join(self.unit_test_dir, '60 native file override') + self.init(testcase, default_args=False, + extra_args=['--native-file', os.path.join(testcase, 'nativefile'), + '--cross-file', os.path.join(testcase, 'crossfile'), + '--cross-file', os.path.join(testcase, 'crossfile2'), + '-Ddef_bindir=binbar2', + '-Ddef_datadir=databar', + '-Ddef_includedir=includebar', + '-Ddef_infodir=infobar', + '-Ddef_libdir=libbar', + '-Ddef_libexecdir=libexecbar', + '-Ddef_localedir=localebar', + '-Ddef_localstatedir=localstatebar', + '-Ddef_mandir=manbar', + '-Ddef_sbindir=sbinbar', + '-Ddef_sharedstatedir=sharedstatebar', + '-Ddef_sysconfdir=sysconfbar']) + +class TAPParserTests(unittest.TestCase): + def assert_test(self, events, **kwargs): + if 'explanation' not in kwargs: + kwargs['explanation'] = None + self.assertEqual(next(events), TAPParser.Test(**kwargs)) + + def assert_plan(self, events, **kwargs): + if 'skipped' not in kwargs: + kwargs['skipped'] = False + if 'explanation' not in kwargs: + kwargs['explanation'] = None + self.assertEqual(next(events), TAPParser.Plan(**kwargs)) + + def assert_version(self, events, **kwargs): + self.assertEqual(next(events), TAPParser.Version(**kwargs)) + + def assert_error(self, events): + self.assertEqual(type(next(events)), TAPParser.Error) + + def assert_bailout(self, events, **kwargs): + self.assertEqual(next(events), TAPParser.Bailout(**kwargs)) + + def assert_last(self, events): + with self.assertRaises(StopIteration): + next(events) + + def parse_tap(self, s): + parser = TAPParser(io.StringIO(s)) + return iter(parser.parse()) + + def parse_tap_v13(self, s): + events = self.parse_tap('TAP version 13\n' + s) + self.assert_version(events, version=13) + return events + + def test_empty(self): + events = self.parse_tap('') + self.assert_last(events) + + def test_empty_plan(self): + events = self.parse_tap('1..0') + self.assert_plan(events, count=0, late=False, skipped=True) + self.assert_last(events) + + def test_plan_directive(self): + events = self.parse_tap('1..0 # skipped for some reason') + self.assert_plan(events, count=0, late=False, skipped=True, + explanation='for some reason') + self.assert_last(events) + + events = self.parse_tap('1..1 # skipped for some reason\nok 1') + self.assert_error(events) + self.assert_plan(events, count=1, late=False, skipped=True, + explanation='for some reason') + self.assert_test(events, number=1, name='', result=TestResult.OK) + self.assert_last(events) + + events = self.parse_tap('1..1 # todo not supported here\nok 1') + self.assert_error(events) + self.assert_plan(events, count=1, late=False, skipped=False, + explanation='not supported here') + self.assert_test(events, number=1, name='', result=TestResult.OK) + self.assert_last(events) + + def test_one_test_ok(self): + events = self.parse_tap('ok') + self.assert_test(events, number=1, name='', result=TestResult.OK) + self.assert_last(events) + + def test_one_test_with_number(self): + events = self.parse_tap('ok 1') + self.assert_test(events, number=1, name='', result=TestResult.OK) + self.assert_last(events) + + def test_one_test_with_name(self): + events = self.parse_tap('ok 1 abc') + self.assert_test(events, number=1, name='abc', result=TestResult.OK) + self.assert_last(events) + + def test_one_test_not_ok(self): + events = self.parse_tap('not ok') + self.assert_test(events, number=1, name='', result=TestResult.FAIL) + self.assert_last(events) + + def test_one_test_todo(self): + events = self.parse_tap('not ok 1 abc # TODO') + self.assert_test(events, number=1, name='abc', result=TestResult.EXPECTEDFAIL) + self.assert_last(events) + + events = self.parse_tap('ok 1 abc # TODO') + self.assert_test(events, number=1, name='abc', result=TestResult.UNEXPECTEDPASS) + self.assert_last(events) + + def test_one_test_skip(self): + events = self.parse_tap('ok 1 abc # SKIP') + self.assert_test(events, number=1, name='abc', result=TestResult.SKIP) + self.assert_last(events) + + def test_one_test_skip_failure(self): + events = self.parse_tap('not ok 1 abc # SKIP') + self.assert_test(events, number=1, name='abc', result=TestResult.FAIL) + self.assert_last(events) + + def test_many_early_plan(self): + events = self.parse_tap('1..4\nok 1\nnot ok 2\nok 3\nnot ok 4') + self.assert_plan(events, count=4, late=False) + self.assert_test(events, number=1, name='', result=TestResult.OK) + self.assert_test(events, number=2, name='', result=TestResult.FAIL) + self.assert_test(events, number=3, name='', result=TestResult.OK) + self.assert_test(events, number=4, name='', result=TestResult.FAIL) + self.assert_last(events) + + def test_many_late_plan(self): + events = self.parse_tap('ok 1\nnot ok 2\nok 3\nnot ok 4\n1..4') + self.assert_test(events, number=1, name='', result=TestResult.OK) + self.assert_test(events, number=2, name='', result=TestResult.FAIL) + self.assert_test(events, number=3, name='', result=TestResult.OK) + self.assert_test(events, number=4, name='', result=TestResult.FAIL) + self.assert_plan(events, count=4, late=True) + self.assert_last(events) + + def test_directive_case(self): + events = self.parse_tap('ok 1 abc # skip') + self.assert_test(events, number=1, name='abc', result=TestResult.SKIP) + self.assert_last(events) + + events = self.parse_tap('ok 1 abc # ToDo') + self.assert_test(events, number=1, name='abc', result=TestResult.UNEXPECTEDPASS) + self.assert_last(events) + + def test_directive_explanation(self): + events = self.parse_tap('ok 1 abc # skip why') + self.assert_test(events, number=1, name='abc', result=TestResult.SKIP, + explanation='why') + self.assert_last(events) + + events = self.parse_tap('ok 1 abc # ToDo Because') + self.assert_test(events, number=1, name='abc', result=TestResult.UNEXPECTEDPASS, + explanation='Because') + self.assert_last(events) + + def test_one_test_early_plan(self): + events = self.parse_tap('1..1\nok') + self.assert_plan(events, count=1, late=False) + self.assert_test(events, number=1, name='', result=TestResult.OK) + self.assert_last(events) + + def test_one_test_late_plan(self): + events = self.parse_tap('ok\n1..1') + self.assert_test(events, number=1, name='', result=TestResult.OK) + self.assert_plan(events, count=1, late=True) + self.assert_last(events) + + def test_out_of_order(self): + events = self.parse_tap('ok 2') + self.assert_error(events) + self.assert_test(events, number=2, name='', result=TestResult.OK) + self.assert_last(events) + + def test_middle_plan(self): + events = self.parse_tap('ok 1\n1..2\nok 2') + self.assert_test(events, number=1, name='', result=TestResult.OK) + self.assert_plan(events, count=2, late=True) + self.assert_error(events) + self.assert_test(events, number=2, name='', result=TestResult.OK) + self.assert_last(events) + + def test_too_many_plans(self): + events = self.parse_tap('1..1\n1..2\nok 1') + self.assert_plan(events, count=1, late=False) + self.assert_error(events) + self.assert_test(events, number=1, name='', result=TestResult.OK) + self.assert_last(events) + + def test_too_many(self): + events = self.parse_tap('ok 1\nnot ok 2\n1..1') + self.assert_test(events, number=1, name='', result=TestResult.OK) + self.assert_test(events, number=2, name='', result=TestResult.FAIL) + self.assert_plan(events, count=1, late=True) + self.assert_error(events) + self.assert_last(events) + + events = self.parse_tap('1..1\nok 1\nnot ok 2') + self.assert_plan(events, count=1, late=False) + self.assert_test(events, number=1, name='', result=TestResult.OK) + self.assert_test(events, number=2, name='', result=TestResult.FAIL) + self.assert_error(events) + self.assert_last(events) + + def test_too_few(self): + events = self.parse_tap('ok 1\nnot ok 2\n1..3') + self.assert_test(events, number=1, name='', result=TestResult.OK) + self.assert_test(events, number=2, name='', result=TestResult.FAIL) + self.assert_plan(events, count=3, late=True) + self.assert_error(events) + self.assert_last(events) + + events = self.parse_tap('1..3\nok 1\nnot ok 2') + self.assert_plan(events, count=3, late=False) + self.assert_test(events, number=1, name='', result=TestResult.OK) + self.assert_test(events, number=2, name='', result=TestResult.FAIL) + self.assert_error(events) + self.assert_last(events) + + def test_too_few_bailout(self): + events = self.parse_tap('1..3\nok 1\nnot ok 2\nBail out! no third test') + self.assert_plan(events, count=3, late=False) + self.assert_test(events, number=1, name='', result=TestResult.OK) + self.assert_test(events, number=2, name='', result=TestResult.FAIL) + self.assert_bailout(events, message='no third test') + self.assert_last(events) + + def test_diagnostics(self): + events = self.parse_tap('1..1\n# ignored\nok 1') + self.assert_plan(events, count=1, late=False) + self.assert_test(events, number=1, name='', result=TestResult.OK) + self.assert_last(events) + + events = self.parse_tap('# ignored\n1..1\nok 1\n# ignored too') + self.assert_plan(events, count=1, late=False) + self.assert_test(events, number=1, name='', result=TestResult.OK) + self.assert_last(events) + + events = self.parse_tap('# ignored\nok 1\n1..1\n# ignored too') + self.assert_test(events, number=1, name='', result=TestResult.OK) + self.assert_plan(events, count=1, late=True) + self.assert_last(events) + + def test_empty_line(self): + events = self.parse_tap('1..1\n\nok 1') + self.assert_plan(events, count=1, late=False) + self.assert_test(events, number=1, name='', result=TestResult.OK) + self.assert_last(events) + + def test_unexpected(self): + events = self.parse_tap('1..1\ninvalid\nok 1') + self.assert_plan(events, count=1, late=False) + self.assert_error(events) + self.assert_test(events, number=1, name='', result=TestResult.OK) + self.assert_last(events) + + def test_version(self): + events = self.parse_tap('TAP version 13\n') + self.assert_version(events, version=13) + self.assert_last(events) + + events = self.parse_tap('TAP version 12\n') + self.assert_error(events) + self.assert_last(events) + + events = self.parse_tap('1..0\nTAP version 13\n') + self.assert_plan(events, count=0, late=False, skipped=True) + self.assert_error(events) + self.assert_last(events) + + def test_yaml(self): + events = self.parse_tap_v13('ok\n ---\n foo: abc\n bar: def\n ...\nok 2') + self.assert_test(events, number=1, name='', result=TestResult.OK) + self.assert_test(events, number=2, name='', result=TestResult.OK) + self.assert_last(events) + + events = self.parse_tap_v13('ok\n ---\n foo: abc\n bar: def') + self.assert_test(events, number=1, name='', result=TestResult.OK) + self.assert_error(events) + self.assert_last(events) + + events = self.parse_tap_v13('ok 1\n ---\n foo: abc\n bar: def\nnot ok 2') + self.assert_test(events, number=1, name='', result=TestResult.OK) + self.assert_error(events) + self.assert_test(events, number=2, name='', result=TestResult.FAIL) + self.assert_last(events) + + +def _clang_at_least(compiler, minver: str, apple_minver: str) -> bool: + """ + check that Clang compiler is at least a specified version, whether AppleClang or regular Clang + + Parameters + ---------- + compiler: + Meson compiler object + minver: str + Clang minimum version + apple_minver: str + AppleCLang minimum version + + Returns + ------- + at_least: bool + Clang is at least the specified version + """ + if compiler.compiler_type == mesonbuild.compilers.CompilerType.CLANG_OSX: + return version_compare(compiler.version, apple_minver) + return version_compare(compiler.version, minver) + def unset_envs(): # For unit tests we must fully control all command lines @@ -4899,26 +6873,40 @@ if v in os.environ: del os.environ[v] -def should_run_cross_arm_tests(): - return shutil.which('arm-linux-gnueabihf-gcc') and not platform.machine().lower().startswith('arm') - -def should_run_cross_mingw_tests(): - return shutil.which('x86_64-w64-mingw32-gcc') and not (is_windows() or is_cygwin()) +def convert_args(argv): + # If we got passed a list of tests, pass it on + pytest_args = ['-v'] if '-v' in argv else [] + test_list = [] + for arg in argv: + if arg.startswith('-'): + continue + # ClassName.test_name => 'ClassName and test_name' + if '.' in arg: + arg = ' and '.join(arg.split('.')) + test_list.append(arg) + if test_list: + pytest_args += ['-k', ' or '.join(test_list)] + return pytest_args def main(): unset_envs() + try: + import pytest # noqa: F401 + # Need pytest-xdist for `-n` arg + import xdist # noqa: F401 + pytest_args = ['-n', 'auto', './run_unittests.py'] + pytest_args += convert_args(sys.argv[1:]) + return subprocess.run(python_command + ['-m', 'pytest'] + pytest_args).returncode + except ImportError: + print('pytest-xdist not found, using unittest instead') + pass + # All attempts at locating pytest failed, fall back to plain unittest. cases = ['InternalTests', 'DataTests', 'AllPlatformTests', 'FailureTests', - 'PythonTests', 'NativeFileTests'] - if not is_windows(): - cases += ['LinuxlikeTests'] - if should_run_cross_arm_tests(): - cases += ['LinuxCrossArmTests'] - if should_run_cross_mingw_tests(): - cases += ['LinuxCrossMingwTests'] - if is_windows() or is_cygwin(): - cases += ['WindowsTests'] - if is_osx(): - cases += ['DarwinTests'] + 'PythonTests', 'NativeFileTests', 'RewriterTests', 'CrossFileTests', + 'TAPParserTests', + + 'LinuxlikeTests', 'LinuxCrossArmTests', 'LinuxCrossMingwTests', + 'WindowsTests', 'DarwinTests'] return unittest.main(defaultTest=cases, buffer=True) diff -Nru meson-0.49.0/setup.cfg meson-0.52.1/setup.cfg --- meson-0.49.0/setup.cfg 2018-12-09 20:02:29.000000000 +0000 +++ meson-0.52.1/setup.cfg 2019-11-29 13:51:14.000000000 +0000 @@ -1,20 +1,35 @@ -[flake8] -ignore = - E241, - E251, - E261, - E265, - E501, - E302, - E305, - E401, - E266, - E402, - E731 - E741 - E722 - W504 -max-line-length = 120 +[metadata] +description = A high performance build system +author = Jussi Pakkanen +author_email = jpakkane@gmail.com +url = https://mesonbuild.com +keywords = + meson + mesonbuild + build system + cmake +license = Apache License, Version 2.0 +license_file = COPYING +classifiers = + Development Status :: 5 - Production/Stable + Environment :: Console + Intended Audience :: Developers + License :: OSI Approved :: Apache Software License + Natural Language :: English + Operating System :: MacOS :: MacOS X + Operating System :: Microsoft :: Windows + Operating System :: POSIX :: BSD + Operating System :: POSIX :: Linux + Programming Language :: Python :: 3 :: Only + Programming Language :: Python :: 3.5 + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Topic :: Software Development :: Build Tools +long_description = Meson is a cross-platform build system designed to be both as fast and as user friendly as possible. It supports many languages and compilers, including GCC, Clang, PGI, Intel, and Visual Studio. Its build definitions are written in a simple non-Turing complete DSL. + +[options] +python_requires = >= 3.5.2 [egg_info] tag_build = diff -Nru meson-0.49.0/setup.py meson-0.52.1/setup.py --- meson-0.49.0/setup.py 2018-12-09 14:27:23.000000000 +0000 +++ meson-0.52.1/setup.py 2019-11-28 17:37:44.000000000 +0000 @@ -16,10 +16,9 @@ import sys -if sys.version_info < (3, 5, 0): - print('Tried to install with an unsupported version of Python. ' - 'Meson requires Python 3.5.0 or greater') - sys.exit(1) +if sys.version_info < (3, 5, 2): + raise SystemExit('ERROR: Tried to install Meson with an unsupported Python version: \n{}' + '\nMeson requires Python 3.5.2 or greater'.format(sys.version)) from mesonbuild.coredata import version from setuptools import setup @@ -28,13 +27,19 @@ # Other platforms will create bin/meson entries = {'console_scripts': ['meson=mesonbuild.mesonmain:main']} packages = ['mesonbuild', + 'mesonbuild.ast', 'mesonbuild.backend', + 'mesonbuild.cmake', 'mesonbuild.compilers', + 'mesonbuild.compilers.mixins', 'mesonbuild.dependencies', 'mesonbuild.modules', 'mesonbuild.scripts', 'mesonbuild.wrap'] -package_data = {'mesonbuild.dependencies': ['data/CMakeLists.txt']} +package_data = { + 'mesonbuild.dependencies': ['data/CMakeLists.txt', 'data/CMakeListsLLVM.txt', 'data/CMakePathInfo.txt'], + 'mesonbuild.cmake': ['data/run_ctgt.py'], +} data_files = [] if sys.platform != 'win32': # Only useful on UNIX-like systems @@ -44,29 +49,8 @@ if __name__ == '__main__': setup(name='meson', version=version, - description='A high performance build system', - author='Jussi Pakkanen', - author_email='jpakkane@gmail.com', - url='http://mesonbuild.com', - license=' Apache License, Version 2.0', - python_requires='>=3.5', + extras_require={'progress': ['tqdm']}, packages=packages, package_data=package_data, entry_points=entries, - data_files=data_files, - classifiers=['Development Status :: 5 - Production/Stable', - 'Environment :: Console', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: Apache Software License', - 'Natural Language :: English', - 'Operating System :: MacOS :: MacOS X', - 'Operating System :: Microsoft :: Windows', - 'Operating System :: POSIX :: BSD', - 'Operating System :: POSIX :: Linux', - 'Programming Language :: Python :: 3 :: Only', - 'Topic :: Software Development :: Build Tools', - ], - long_description='''Meson is a cross-platform build system designed to be both as - fast and as user friendly as possible. It supports many languages and compilers, including - GCC, Clang and Visual Studio. Its build definitions are written in a simple non-turing - complete DSL.''') + data_files=data_files,) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/10 header only/main.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/10 header only/main.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/10 header only/main.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/10 header only/main.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,10 @@ +#include +#include + +using namespace std; + +int main() { + cmModClass obj("Hello"); + cout << obj.getStr() << endl; + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/10 header only/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/10 header only/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/10 header only/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/10 header only/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,12 @@ +project('cmakeSubTest', ['c', 'cpp']) + +cm = import('cmake') + +sub_pro = cm.subproject('cmMod') +sub_dep = sub_pro.dependency('cmModLib') + +assert(sub_pro.target_list() == ['cmModLib'], 'There should be exactly one target') +assert(sub_pro.target_type('cmModLib') == 'header_only', 'Target type should be header_only') + +exe1 = executable('main', ['main.cpp'], dependencies: [sub_dep]) +test('test1', exe1) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/10 header only/subprojects/cmMod/CMakeLists.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/10 header only/subprojects/cmMod/CMakeLists.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/10 header only/subprojects/cmMod/CMakeLists.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/10 header only/subprojects/cmMod/CMakeLists.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.5) + +project(cmMod) +set (CMAKE_CXX_STANDARD 14) + +add_definitions("-DDO_NOTHING_JUST_A_FLAG=1") + +add_library(cmModLib INTERFACE) +set_target_properties(cmModLib PROPERTIES INTERFACE_COMPILE_OPTIONS "-DCMAKE_FLAG_MUST_BE_PRESENT") +target_include_directories(cmModLib INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/include") +target_compile_definitions(cmModLib INTERFACE -DCMAKE_COMPILER_DEFINE_STR="compDef") diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/10 header only/subprojects/cmMod/include/cmMod.hpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/10 header only/subprojects/cmMod/include/cmMod.hpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/10 header only/subprojects/cmMod/include/cmMod.hpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/10 header only/subprojects/cmMod/include/cmMod.hpp" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,19 @@ +#pragma once + +#include + +#ifndef CMAKE_FLAG_MUST_BE_PRESENT +#error "The flag CMAKE_FLAG_MUST_BE_PRESENT was not set" +#endif + +class cmModClass { + private: + std::string str; + public: + cmModClass(std::string foo) { + str = foo + " World "; + str += CMAKE_COMPILER_DEFINE_STR; + } + + inline std::string getStr() const { return str; } +}; diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/11 cmake_module_path/cmake/FindSomethingLikePython.cmake" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/11 cmake_module_path/cmake/FindSomethingLikePython.cmake" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/11 cmake_module_path/cmake/FindSomethingLikePython.cmake" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/11 cmake_module_path/cmake/FindSomethingLikePython.cmake" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,24 @@ +cmake_policy(VERSION 3.7) + +if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.12) + find_package(Python COMPONENTS Interpreter) +else() + find_package(PythonInterp) +endif() + +if(Python_FOUND OR PYTHONINTERP_FOUND) + set(SomethingLikePython_FOUND ON) + set(SomethingLikePython_EXECUTABLE ${Python_EXECUTABLE}) + + if(NOT DEFINED Python_VERSION) + set(Python_VERSION ${Python_VERSION_STRING}) + endif() + if(NOT TARGET Python::Interpreter) + add_executable(Python::Interpreter IMPORTED) + set_target_properties(Python::Interpreter PROPERTIES + IMPORTED_LOCATION ${Python_EXECUTABLE} + VERSION ${Python_VERSION}) + endif() +else() + set(SomethingLikePython_FOUND OFF) +endif() diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/11 cmake_module_path/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/11 cmake_module_path/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/11 cmake_module_path/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/11 cmake_module_path/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,17 @@ +# We use Python3 as it's the only thing guaranteed to be available on any platform Meson can run on (unlike Zlib in linuxlike/13 cmake dependency). + +project('user CMake find_package module using cmake_module_path', + meson_version: '>= 0.50.0') + +if not find_program('cmake', required: false).found() + error('MESON_SKIP_TEST cmake binary not available.') +endif + +# NOTE: can't request Python3 via dependency('Python3', method: 'cmake') +# Meson intercepts and wants "method: auto" + +# Try to find a dependency with a custom CMake module + +dependency('SomethingLikePython', required : true, method : 'cmake', cmake_module_path : 'cmake', modules: 'Python::Interpreter') + +dependency('SomethingLikePython', method : 'cmake', cmake_module_path : ['doesNotExist', 'cmake'], modules: 'Python::Interpreter') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/12 generator expressions/main.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/12 generator expressions/main.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/12 generator expressions/main.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/12 generator expressions/main.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,10 @@ +#include +#include + +using namespace std; + +int main() { + cmModClass obj("Hello"); + cout << obj.getStr() << endl; + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/12 generator expressions/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/12 generator expressions/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/12 generator expressions/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/12 generator expressions/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,12 @@ +project('cmakeSubTest', ['c', 'cpp']) + +cm = import('cmake') + +sub_pro = cm.subproject('cmMod') +sub_dep = sub_pro.dependency('cmModLib') + +assert(sub_pro.target_list() == ['cmModLib'], 'There should be exactly one target') +assert(sub_pro.target_type('cmModLib') == 'header_only', 'Target type should be header_only') + +exe1 = executable('main', ['main.cpp'], dependencies: [sub_dep]) +test('test1', exe1) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/12 generator expressions/subprojects/cmMod/CMakeLists.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/12 generator expressions/subprojects/cmMod/CMakeLists.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/12 generator expressions/subprojects/cmMod/CMakeLists.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/12 generator expressions/subprojects/cmMod/CMakeLists.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,22 @@ +cmake_minimum_required(VERSION 3.5) + +project(cmMod) +set (CMAKE_CXX_STANDARD 14) + +include(GNUInstallDirs) + +add_library(cmModLib INTERFACE) + +target_compile_options(cmModLib + INTERFACE $<$,$>:-DCMAKE_FLAG_ERROR_A> # Check discard = false + INTERFACE "-DCMAKE_FLAG_REQUIRED_A" + INTERFACE $<$>,$>>:-DCMAKE_FLAG_REQUIRED_B> + INTERFACE $<$:-DCMAKE_FLAG_REQUIRED_C> +) + +target_include_directories(cmModLib INTERFACE + $ + $ +) + +target_compile_definitions(cmModLib INTERFACE -DCMAKE_COMPILER_DEFINE_STR="compDef") diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/12 generator expressions/subprojects/cmMod/include/cmMod.hpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/12 generator expressions/subprojects/cmMod/include/cmMod.hpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/12 generator expressions/subprojects/cmMod/include/cmMod.hpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/12 generator expressions/subprojects/cmMod/include/cmMod.hpp" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,31 @@ +#pragma once + +#include + +#ifndef CMAKE_FLAG_REQUIRED_A +#error "The flag CMAKE_FLAG_REQUIRED_A was not set" +#endif + +#ifndef CMAKE_FLAG_REQUIRED_B +#error "The flag CMAKE_FLAG_REQUIRED_B was not set" +#endif + +#ifndef CMAKE_FLAG_REQUIRED_C +#error "The flag CMAKE_FLAG_REQUIRED_C was not set" +#endif + +#ifdef CMAKE_FLAG_ERROR_A +#error "The flag CMAKE_FLAG_ERROR_A was set" +#endif + +class cmModClass { + private: + std::string str; + public: + cmModClass(std::string foo) { + str = foo + " World "; + str += CMAKE_COMPILER_DEFINE_STR; + } + + inline std::string getStr() const { return str; } +}; diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/13 system includes/main.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/13 system includes/main.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/13 system includes/main.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/13 system includes/main.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,10 @@ +#include +#include + +using namespace std; + +int main() { + cmModClass obj("Hello"); + cout << obj.getStr() << endl; + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/13 system includes/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/13 system includes/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/13 system includes/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/13 system includes/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,14 @@ +project( + 'meson_cmake_system_include_bug', ['c', 'cpp'], + default_options: [ + 'warning_level=3', + #'werror=true', # TODO implement system includes + ], +) + +cm = import('cmake') +sub_pro = cm.subproject('cmMod') +sub_dep = sub_pro.dependency('cmModLib') + +exe1 = executable('main1', ['main.cpp'], dependencies: [sub_dep]) +test('test1', exe1) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/13 system includes/subprojects/cmMod/CMakeLists.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/13 system includes/subprojects/cmMod/CMakeLists.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/13 system includes/subprojects/cmMod/CMakeLists.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/13 system includes/subprojects/cmMod/CMakeLists.txt" 2019-10-24 20:20:56.000000000 +0000 @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.5) + +project(cmMod) +set (CMAKE_CXX_STANDARD 14) + +include_directories(${CMAKE_CURRENT_BINARY_DIR}) + +add_definitions("-DDO_NOTHING_JUST_A_FLAG=1") + +add_library(cmModLib SHARED cmMod.cpp) +include(GenerateExportHeader) +generate_export_header(cmModLib) + +target_compile_options(cmModLib PRIVATE "-Wall" "-Werror") +target_include_directories(cmModLib SYSTEM PRIVATE "sysInc") diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/13 system includes/subprojects/cmMod/cmMod.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/13 system includes/subprojects/cmMod/cmMod.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/13 system includes/subprojects/cmMod/cmMod.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/13 system includes/subprojects/cmMod/cmMod.cpp" 2019-10-24 20:20:56.000000000 +0000 @@ -0,0 +1,12 @@ +#include "cmMod.hpp" +#include "triggerWarn.hpp" + +using namespace std; + +cmModClass::cmModClass(string foo) { + str = foo + " World " + to_string(bar(World)); +} + +string cmModClass::getStr() const { + return str; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/13 system includes/subprojects/cmMod/cmMod.hpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/13 system includes/subprojects/cmMod/cmMod.hpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/13 system includes/subprojects/cmMod/cmMod.hpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/13 system includes/subprojects/cmMod/cmMod.hpp" 2019-10-24 20:20:56.000000000 +0000 @@ -0,0 +1,13 @@ +#pragma once + +#include +#include "cmmodlib_export.h" + +class CMMODLIB_EXPORT cmModClass { + private: + std::string str; + public: + cmModClass(std::string foo); + + std::string getStr() const; +}; diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/13 system includes/subprojects/cmMod/sysInc/triggerWarn.hpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/13 system includes/subprojects/cmMod/sysInc/triggerWarn.hpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/13 system includes/subprojects/cmMod/sysInc/triggerWarn.hpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/13 system includes/subprojects/cmMod/sysInc/triggerWarn.hpp" 2019-10-24 20:20:56.000000000 +0000 @@ -0,0 +1,14 @@ +#pragma once + +enum Foo { + Hello, + World +}; + +inline int bar( Foo foo ) { + switch(foo) { + case Hello: return 0; + // Warn because of missung case for World + } + return 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/1 basic/main.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/1 basic/main.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/1 basic/main.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/1 basic/main.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,10 @@ +#include +#include + +using namespace std; + +int main() { + cmModClass obj("Hello"); + cout << obj.getStr() << endl; + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/1 basic/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/1 basic/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/1 basic/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/1 basic/meson.build" 2019-08-16 20:33:41.000000000 +0000 @@ -0,0 +1,12 @@ +project('cmakeSubTest', ['c', 'cpp']) + +cm = import('cmake') + +sub_pro = cm.subproject('cmMod') +sub_dep = sub_pro.dependency('cmModLib') + +assert(sub_pro.target_list() == ['cmModLib'], 'There should be exactly one target') +assert(sub_pro.target_type('cmModLib') == 'shared_library', 'Target type should be shared_library') + +exe1 = executable('main', ['main.cpp'], dependencies: [sub_dep]) +test('test1', exe1) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/1 basic/subprojects/cmMod/CMakeLists.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/1 basic/subprojects/cmMod/CMakeLists.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/1 basic/subprojects/cmMod/CMakeLists.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/1 basic/subprojects/cmMod/CMakeLists.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.5) + +project(cmMod) +set (CMAKE_CXX_STANDARD 14) + +include_directories(${CMAKE_CURRENT_BINARY_DIR}) + +add_definitions("-DDO_NOTHING_JUST_A_FLAG=1") + +add_library(cmModLib SHARED cmMod.cpp) +include(GenerateExportHeader) +generate_export_header(cmModLib) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/1 basic/subprojects/cmMod/cmMod.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/1 basic/subprojects/cmMod/cmMod.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/1 basic/subprojects/cmMod/cmMod.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/1 basic/subprojects/cmMod/cmMod.cpp" 2019-06-16 18:54:18.000000000 +0000 @@ -0,0 +1,11 @@ +#include "cmMod.hpp" + +using namespace std; + +cmModClass::cmModClass(string foo) { + str = foo + " World"; +} + +string cmModClass::getStr() const { + return str; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/1 basic/subprojects/cmMod/cmMod.hpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/1 basic/subprojects/cmMod/cmMod.hpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/1 basic/subprojects/cmMod/cmMod.hpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/1 basic/subprojects/cmMod/cmMod.hpp" 2019-06-16 18:54:18.000000000 +0000 @@ -0,0 +1,13 @@ +#pragma once + +#include +#include "cmmodlib_export.h" + +class CMMODLIB_EXPORT cmModClass { + private: + std::string str; + public: + cmModClass(std::string foo); + + std::string getStr() const; +}; diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/2 advanced/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/2 advanced/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/2 advanced/installed_files.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/2 advanced/installed_files.txt" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,4 @@ +usr/?lib/libcmModLib?so +?cygwin:usr/lib/libcmModLib?implib +?!cygwin:usr/bin/libcmModLib?implib +usr/bin/testEXE?exe \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/2 advanced/main.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/2 advanced/main.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/2 advanced/main.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/2 advanced/main.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,15 @@ +#include +#include +#include "config.h" + +#if CONFIG_OPT != 42 +#error "Invalid value of CONFIG_OPT" +#endif + +using namespace std; + +int main() { + cmModClass obj("Hello"); + cout << obj.getStr() << endl; + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/2 advanced/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/2 advanced/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/2 advanced/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/2 advanced/meson.build" 2019-08-16 20:33:41.000000000 +0000 @@ -0,0 +1,20 @@ +project('cmakeSubTest_advanced', ['c', 'cpp']) + +dep_test = dependency('ZLIB', method: 'cmake', required: false) +if not dep_test.found() + error('MESON_SKIP_TEST: zlib is not installed') +endif + +cm = import('cmake') + +# Test the "normal" subproject call +sub_pro = cm.subproject('cmMod') +sub_dep = sub_pro.dependency('cmModLib') + +# Build some files +exe1 = executable('main1', ['main.cpp'], dependencies: [sub_dep]) +test('test1', exe1) + +# Test if we can also extract executables +assert(sub_pro.target_type('testEXE') == 'executable', 'The type must be executable for obvious reasons') +test('test2', sub_pro.target('testEXE')) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/2 advanced/subprojects/cmMod/CMakeLists.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/2 advanced/subprojects/cmMod/CMakeLists.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/2 advanced/subprojects/cmMod/CMakeLists.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/2 advanced/subprojects/cmMod/CMakeLists.txt" 2019-10-06 17:01:35.000000000 +0000 @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 3.5) + +project(cmMod) +set(CMAKE_CXX_STANDARD 14) + +find_package(ZLIB REQUIRED) + +include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/lib) + +set(CONFIG_OPT 42) +configure_file("config.h.in" "${CMAKE_CURRENT_BINARY_DIR}/config.h" @ONLY) + +add_library(cmModLib SHARED lib/cmMod.cpp) +include(GenerateExportHeader) +generate_export_header(cmModLib) + +set_target_properties(cmModLib PROPERTIES VERSION 1.0.1) + +add_executable(testEXE main.cpp) + +target_link_libraries(cmModLib ZLIB::ZLIB) +target_link_libraries(testEXE cmModLib) + +install(TARGETS cmModLib testEXE LIBRARY DESTINATION lib RUNTIME DESTINATION bin) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/2 advanced/subprojects/cmMod/config.h.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/2 advanced/subprojects/cmMod/config.h.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/2 advanced/subprojects/cmMod/config.h.in" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/2 advanced/subprojects/cmMod/config.h.in" 2019-06-16 18:54:18.000000000 +0000 @@ -0,0 +1,3 @@ +#pragma once + +#define CONFIG_OPT @CONFIG_OPT@ diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/2 advanced/subprojects/cmMod/lib/cmMod.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/2 advanced/subprojects/cmMod/lib/cmMod.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/2 advanced/subprojects/cmMod/lib/cmMod.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/2 advanced/subprojects/cmMod/lib/cmMod.cpp" 2019-06-16 18:54:18.000000000 +0000 @@ -0,0 +1,17 @@ +#include "cmMod.hpp" +#include +#include "config.h" + +#if CONFIG_OPT != 42 +#error "Invalid value of CONFIG_OPT" +#endif + +using namespace std; + +cmModClass::cmModClass(string foo) { + str = foo + " World " + zlibVersion(); +} + +string cmModClass::getStr() const { + return str; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/2 advanced/subprojects/cmMod/lib/cmMod.hpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/2 advanced/subprojects/cmMod/lib/cmMod.hpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/2 advanced/subprojects/cmMod/lib/cmMod.hpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/2 advanced/subprojects/cmMod/lib/cmMod.hpp" 2019-06-16 18:54:18.000000000 +0000 @@ -0,0 +1,13 @@ +#pragma once + +#include +#include "cmmodlib_export.h" + +class CMMODLIB_EXPORT cmModClass { + private: + std::string str; + public: + cmModClass(std::string foo); + + std::string getStr() const; +}; diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/2 advanced/subprojects/cmMod/main.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/2 advanced/subprojects/cmMod/main.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/2 advanced/subprojects/cmMod/main.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/2 advanced/subprojects/cmMod/main.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,11 @@ +#include +#include +#include "lib/cmMod.hpp" + +using namespace std; + +int main() { + cmModClass obj("Hello (LIB TEST)"); + cout << obj.getStr() << " ZLIB: " << zlibVersion() << endl; + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/3 advanced no dep/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/3 advanced no dep/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/3 advanced no dep/installed_files.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/3 advanced no dep/installed_files.txt" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,6 @@ +usr/?lib/libcmModLib?so +?cygwin:usr/lib/libcmModLib?implib +?!cygwin:usr/bin/libcmModLib?implib +?msvc:usr/bin/cmModLib.pdb +?msvc:usr/bin/testEXE.pdb +usr/bin/testEXE?exe \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/3 advanced no dep/main.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/3 advanced no dep/main.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/3 advanced no dep/main.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/3 advanced no dep/main.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,15 @@ +#include +#include +#include "config.h" + +#if CONFIG_OPT != 42 +#error "Invalid value of CONFIG_OPT" +#endif + +using namespace std; + +int main() { + cmModClass obj("Hello"); + cout << obj.getStr() << endl; + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/3 advanced no dep/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/3 advanced no dep/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/3 advanced no dep/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/3 advanced no dep/meson.build" 2019-08-16 20:33:41.000000000 +0000 @@ -0,0 +1,15 @@ +project('cmakeSubTest_advanced', ['c', 'cpp']) + +cm = import('cmake') + +# Test the "normal" subproject call +sub_pro = cm.subproject('cmMod') +sub_dep = sub_pro.dependency('cmModLib') + +# Build some files +exe1 = executable('main1', ['main.cpp'], dependencies: [sub_dep]) +test('test1', exe1) + +# Test if we can also extract executables +assert(sub_pro.target_type('testEXE') == 'executable', 'The type must be executable for obvious reasons') +test('test2', sub_pro.target('testEXE')) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/3 advanced no dep/subprojects/cmMod/CMakeLists.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/3 advanced no dep/subprojects/cmMod/CMakeLists.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/3 advanced no dep/subprojects/cmMod/CMakeLists.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/3 advanced no dep/subprojects/cmMod/CMakeLists.txt" 2019-10-06 17:01:35.000000000 +0000 @@ -0,0 +1,21 @@ +cmake_minimum_required(VERSION 3.5) + +project(cmMod) +set(CMAKE_CXX_STANDARD 14) + +include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/lib) + +set(CONFIG_OPT 42) +configure_file("config.h.in" "${CMAKE_CURRENT_BINARY_DIR}/config.h" @ONLY) + +add_library(cmModLib SHARED lib/cmMod.cpp) +include(GenerateExportHeader) +generate_export_header(cmModLib) + +set_target_properties(cmModLib PROPERTIES VERSION 1.0.1) + +add_executable(testEXE main.cpp) + +target_link_libraries(testEXE cmModLib) + +install(TARGETS cmModLib testEXE LIBRARY DESTINATION lib RUNTIME DESTINATION bin) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/3 advanced no dep/subprojects/cmMod/config.h.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/3 advanced no dep/subprojects/cmMod/config.h.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/3 advanced no dep/subprojects/cmMod/config.h.in" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/3 advanced no dep/subprojects/cmMod/config.h.in" 2019-06-16 18:54:18.000000000 +0000 @@ -0,0 +1,3 @@ +#pragma once + +#define CONFIG_OPT @CONFIG_OPT@ diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/3 advanced no dep/subprojects/cmMod/lib/cmMod.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/3 advanced no dep/subprojects/cmMod/lib/cmMod.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/3 advanced no dep/subprojects/cmMod/lib/cmMod.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/3 advanced no dep/subprojects/cmMod/lib/cmMod.cpp" 2019-06-16 18:54:18.000000000 +0000 @@ -0,0 +1,16 @@ +#include "cmMod.hpp" +#include "config.h" + +#if CONFIG_OPT != 42 +#error "Invalid value of CONFIG_OPT" +#endif + +using namespace std; + +cmModClass::cmModClass(string foo) { + str = foo + " World"; +} + +string cmModClass::getStr() const { + return str; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/3 advanced no dep/subprojects/cmMod/lib/cmMod.hpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/3 advanced no dep/subprojects/cmMod/lib/cmMod.hpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/3 advanced no dep/subprojects/cmMod/lib/cmMod.hpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/3 advanced no dep/subprojects/cmMod/lib/cmMod.hpp" 2019-06-16 18:54:18.000000000 +0000 @@ -0,0 +1,13 @@ +#pragma once + +#include +#include "cmmodlib_export.h" + +class CMMODLIB_EXPORT cmModClass { + private: + std::string str; + public: + cmModClass(std::string foo); + + std::string getStr() const; +}; diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/3 advanced no dep/subprojects/cmMod/main.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/3 advanced no dep/subprojects/cmMod/main.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/3 advanced no dep/subprojects/cmMod/main.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/3 advanced no dep/subprojects/cmMod/main.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,10 @@ +#include +#include "lib/cmMod.hpp" + +using namespace std; + +int main() { + cmModClass obj("Hello (LIB TEST)"); + cout << obj.getStr() << endl; + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/4 code gen/main.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/4 code gen/main.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/4 code gen/main.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/4 code gen/main.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,8 @@ +#include +#include "test.hpp" + +using namespace std; + +int main() { + cout << getStr() << endl; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/4 code gen/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/4 code gen/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/4 code gen/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/4 code gen/meson.build" 2019-08-16 20:33:40.000000000 +0000 @@ -0,0 +1,20 @@ +project('cmake_code_gen', ['c', 'cpp']) + +cm = import('cmake') + +# Subproject with the "code generator" +sub_pro = cm.subproject('cmCodeGen') +sub_exe = sub_pro.target('genA') + +# Generate the source +generated = custom_target( + 'cmake-generated', + input: [], + output: ['test.cpp'], + command: [sub_exe, '@OUTPUT@'] +) + +# Build the exe +exe1 = executable('main1', ['main.cpp', generated]) + +test('test1', exe1) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/4 code gen/subprojects/cmCodeGen/CMakeLists.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/4 code gen/subprojects/cmCodeGen/CMakeLists.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/4 code gen/subprojects/cmCodeGen/CMakeLists.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/4 code gen/subprojects/cmCodeGen/CMakeLists.txt" 2019-06-16 18:54:18.000000000 +0000 @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 3.7) + +set(CMAKE_CXX_STANDARD 14) + +add_executable(genA main.cpp) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/4 code gen/subprojects/cmCodeGen/main.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/4 code gen/subprojects/cmCodeGen/main.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/4 code gen/subprojects/cmCodeGen/main.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/4 code gen/subprojects/cmCodeGen/main.cpp" 2019-06-16 18:54:18.000000000 +0000 @@ -0,0 +1,21 @@ +#include +#include + +using namespace std; + +int main(int argc, const char *argv[]) { + if(argc < 2) { + cerr << argv[0] << " requires an output file!" << endl; + return 1; + } + ofstream out(argv[1]); + out << R"( +#include "test.hpp" + +std::string getStr() { + return "Hello World"; +} +)"; + + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/4 code gen/test.hpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/4 code gen/test.hpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/4 code gen/test.hpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/4 code gen/test.hpp" 2019-06-16 18:54:18.000000000 +0000 @@ -0,0 +1,5 @@ +#pragma once + +#include + +std::string getStr(); diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/5 object library/main.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/5 object library/main.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/5 object library/main.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/5 object library/main.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,9 @@ +#include +#include "libA.hpp" +#include "libB.hpp" + +using namespace std; + +int main() { + cout << getLibStr() << " -- " << getZlibVers() << endl; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/5 object library/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/5 object library/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/5 object library/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/5 object library/meson.build" 2019-08-16 20:33:58.000000000 +0000 @@ -0,0 +1,25 @@ +project('cmake_object_lib_test', ['c', 'cpp']) + +dep_test = dependency('ZLIB', method: 'cmake', required: false) +if not dep_test.found() + error('MESON_SKIP_TEST: zlib is not installed') +endif + +if build_machine.system() == 'windows' + error('MESON_SKIP_TEST: Windows is not supported because of symbol export problems') +endif + +cm = import('cmake') + +sub_pro = cm.subproject('cmObjLib') +sub_sha = sub_pro.dependency('lib_sha') +sub_sta = sub_pro.dependency('lib_sta') + +# Required for the static library +zlib_dep = dependency('zlib') + +exe_sha = executable('shared', ['main.cpp'], dependencies: [sub_sha]) +exe_sta = executable('static', ['main.cpp'], dependencies: [sub_sta, zlib_dep]) + +test('test1', exe_sha) +test('test1', exe_sta) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/5 object library/subprojects/cmObjLib/CMakeLists.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/5 object library/subprojects/cmObjLib/CMakeLists.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/5 object library/subprojects/cmObjLib/CMakeLists.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/5 object library/subprojects/cmObjLib/CMakeLists.txt" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.7) + +find_package(ZLIB REQUIRED) + +add_library(lib_obj OBJECT libA.cpp libB.cpp) +add_library(lib_sha SHARED $) +add_library(lib_sta STATIC $) + +target_link_libraries(lib_sha ZLIB::ZLIB) +target_link_libraries(lib_sta ZLIB::ZLIB) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/5 object library/subprojects/cmObjLib/libA.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/5 object library/subprojects/cmObjLib/libA.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/5 object library/subprojects/cmObjLib/libA.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/5 object library/subprojects/cmObjLib/libA.cpp" 2019-06-16 18:54:18.000000000 +0000 @@ -0,0 +1,5 @@ +#include "libA.hpp" + +std::string getLibStr() { + return "Hello World"; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/5 object library/subprojects/cmObjLib/libA.hpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/5 object library/subprojects/cmObjLib/libA.hpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/5 object library/subprojects/cmObjLib/libA.hpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/5 object library/subprojects/cmObjLib/libA.hpp" 2019-06-16 18:54:18.000000000 +0000 @@ -0,0 +1,5 @@ +#pragma once + +#include + +std::string getLibStr(); diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/5 object library/subprojects/cmObjLib/libB.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/5 object library/subprojects/cmObjLib/libB.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/5 object library/subprojects/cmObjLib/libB.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/5 object library/subprojects/cmObjLib/libB.cpp" 2019-06-16 18:54:18.000000000 +0000 @@ -0,0 +1,6 @@ +#include "libB.hpp" +#include + +std::string getZlibVers() { + return zlibVersion(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/5 object library/subprojects/cmObjLib/libB.hpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/5 object library/subprojects/cmObjLib/libB.hpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/5 object library/subprojects/cmObjLib/libB.hpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/5 object library/subprojects/cmObjLib/libB.hpp" 2019-06-16 18:54:18.000000000 +0000 @@ -0,0 +1,5 @@ +#pragma once + +#include + +std::string getZlibVers(); diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/6 object library no dep/main.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/6 object library no dep/main.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/6 object library no dep/main.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/6 object library no dep/main.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,9 @@ +#include +#include "libA.hpp" +#include "libB.hpp" + +using namespace std; + +int main() { + cout << getLibStr() << " -- " << getZlibVers() << endl; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/6 object library no dep/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/6 object library no dep/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/6 object library no dep/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/6 object library no dep/meson.build" 2019-08-16 20:33:58.000000000 +0000 @@ -0,0 +1,17 @@ +project('cmake_object_lib_test', ['c', 'cpp']) + +if build_machine.system() == 'windows' + error('MESON_SKIP_TEST: Windows is not supported because of symbol export problems') +endif + +cm = import('cmake') + +sub_pro = cm.subproject('cmObjLib') +sub_sha = sub_pro.dependency('lib_sha') +sub_sta = sub_pro.dependency('lib_sta') + +exe_sha = executable('shared', ['main.cpp'], dependencies: [sub_sha]) +exe_sta = executable('static', ['main.cpp'], dependencies: [sub_sta]) + +test('test1', exe_sha) +test('test1', exe_sta) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/6 object library no dep/subprojects/cmObjLib/CMakeLists.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/6 object library no dep/subprojects/cmObjLib/CMakeLists.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/6 object library no dep/subprojects/cmObjLib/CMakeLists.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/6 object library no dep/subprojects/cmObjLib/CMakeLists.txt" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 3.7) + +add_library(lib_obj OBJECT libA.cpp libB.cpp) +add_library(lib_sha SHARED $) +add_library(lib_sta STATIC $) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libA.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libA.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libA.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libA.cpp" 2019-06-16 18:54:18.000000000 +0000 @@ -0,0 +1,5 @@ +#include "libA.hpp" + +std::string getLibStr() { + return "Hello World"; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libA.hpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libA.hpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libA.hpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libA.hpp" 2019-06-16 18:54:18.000000000 +0000 @@ -0,0 +1,5 @@ +#pragma once + +#include + +std::string getLibStr(); diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libB.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libB.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libB.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libB.cpp" 2019-06-16 18:54:18.000000000 +0000 @@ -0,0 +1,5 @@ +#include "libB.hpp" + +std::string getZlibVers() { + return "STUB"; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libB.hpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libB.hpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libB.hpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libB.hpp" 2019-06-16 18:54:18.000000000 +0000 @@ -0,0 +1,5 @@ +#pragma once + +#include + +std::string getZlibVers(); diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/7 cmake options/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/7 cmake options/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/7 cmake options/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/7 cmake options/meson.build" 2019-08-16 20:33:54.000000000 +0000 @@ -0,0 +1,3 @@ +project('cmake_set_opt', ['c', 'cpp']) + +import('cmake').subproject('cmOpts', cmake_options: '-DSOME_CMAKE_VAR=something') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/7 cmake options/subprojects/cmOpts/CMakeLists.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/7 cmake options/subprojects/cmOpts/CMakeLists.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/7 cmake options/subprojects/cmOpts/CMakeLists.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/7 cmake options/subprojects/cmOpts/CMakeLists.txt" 2019-06-16 18:54:18.000000000 +0000 @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 3.7) + +if(NOT "${SOME_CMAKE_VAR}" STREQUAL "something") + message(FATAL_ERROR "Setting the CMake var failed") +endif() diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/8 custom command/main.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/8 custom command/main.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/8 custom command/main.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/8 custom command/main.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,11 @@ +#include +#include + +using namespace std; + +int main() { + cmModClass obj("Hello"); + cout << obj.getStr() << endl; + cout << obj.getOther() << endl; + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/8 custom command/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/8 custom command/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/8 custom command/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/8 custom command/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,12 @@ +project('cmakeSubTest', ['c', 'cpp']) + +cm = import('cmake') + +sub_pro = cm.subproject('cmMod') +sub_dep = sub_pro.dependency('cmModLib') + +assert(sub_pro.target_type('cmModLib') == 'shared_library', 'Target type should be shared_library') +assert(sub_pro.target_type('gen') == 'executable', 'Target type should be executable') + +exe1 = executable('main', ['main.cpp'], dependencies: [sub_dep]) +test('test1', exe1) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/8 custom command/subprojects/cmMod/CMakeLists.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/8 custom command/subprojects/cmMod/CMakeLists.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/8 custom command/subprojects/cmMod/CMakeLists.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/8 custom command/subprojects/cmMod/CMakeLists.txt" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,46 @@ +cmake_minimum_required(VERSION 3.5) + +project(cmMod) +set (CMAKE_CXX_STANDARD 14) + +include_directories(${CMAKE_CURRENT_BINARY_DIR}) +add_definitions("-DDO_NOTHING_JUST_A_FLAG=1") + +add_executable(gen main.cpp) +add_executable(mycpy cp.cpp) + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/genTest.cpp" "${CMAKE_CURRENT_BINARY_DIR}/genTest.hpp" + COMMAND gen ARGS genTest +) + +add_custom_command( + OUTPUT cpyBase.cpp + COMMAND mycpy "${CMAKE_CURRENT_SOURCE_DIR}/cpyBase.cpp.am" cpyBase.cpp.in + COMMAND mycpy cpyBase.cpp.in cpyBase.cpp.something + COMMAND mycpy cpyBase.cpp.something cpyBase.cpp.IAmRunningOutOfIdeas + COMMAND mycpy cpyBase.cpp.IAmRunningOutOfIdeas cpyBase.cpp + DEPENDS cpyBase.cpp.am gen +) + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/cpyBase.hpp.in" + COMMAND mycpy "${CMAKE_CURRENT_SOURCE_DIR}/cpyBase.hpp.am" cpyBase.hpp.in + DEPENDS cpyBase.hpp.am +) + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/cpyBase.hpp.something" + COMMAND mycpy cpyBase.hpp.in cpyBase.hpp.something + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/cpyBase.hpp.in" +) + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/cpyBase.hpp" + COMMAND mycpy cpyBase.hpp.something cpyBase.hpp + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/cpyBase.hpp.something" +) + +add_library(cmModLib SHARED cmMod.cpp genTest.cpp cpyBase.cpp cpyBase.hpp) +include(GenerateExportHeader) +generate_export_header(cmModLib) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/8 custom command/subprojects/cmMod/cmMod.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/8 custom command/subprojects/cmMod/cmMod.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/8 custom command/subprojects/cmMod/cmMod.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/8 custom command/subprojects/cmMod/cmMod.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,17 @@ +#include "cmMod.hpp" +#include "genTest.hpp" +#include "cpyBase.hpp" + +using namespace std; + +cmModClass::cmModClass(string foo) { + str = foo + " World"; +} + +string cmModClass::getStr() const { + return str; +} + +string cmModClass::getOther() const { + return getStr() + " -- " + getStrCpy(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/8 custom command/subprojects/cmMod/cmMod.hpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/8 custom command/subprojects/cmMod/cmMod.hpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/8 custom command/subprojects/cmMod/cmMod.hpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/8 custom command/subprojects/cmMod/cmMod.hpp" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,14 @@ +#pragma once + +#include +#include "cmmodlib_export.h" + +class CMMODLIB_EXPORT cmModClass { + private: + std::string str; + public: + cmModClass(std::string foo); + + std::string getStr() const; + std::string getOther() const; +}; diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/8 custom command/subprojects/cmMod/cp.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/8 custom command/subprojects/cmMod/cp.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/8 custom command/subprojects/cmMod/cp.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/8 custom command/subprojects/cmMod/cp.cpp" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,17 @@ +#include +#include + +using namespace std; + +int main(int argc, char *argv[]) { + if(argc < 3) { + cerr << argv[0] << " requires an input and an output file!" << endl; + return 1; + } + + ifstream src(argv[1]); + ofstream dst(argv[2]); + + dst << src.rdbuf(); + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/8 custom command/subprojects/cmMod/cpyBase.cpp.am" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/8 custom command/subprojects/cmMod/cpyBase.cpp.am" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/8 custom command/subprojects/cmMod/cpyBase.cpp.am" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/8 custom command/subprojects/cmMod/cpyBase.cpp.am" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +#include "cpyBase.hpp" + +std::string getStrCpy() { + return "Hello Copied File"; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/8 custom command/subprojects/cmMod/cpyBase.hpp.am" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/8 custom command/subprojects/cmMod/cpyBase.hpp.am" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/8 custom command/subprojects/cmMod/cpyBase.hpp.am" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/8 custom command/subprojects/cmMod/cpyBase.hpp.am" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +#pragma once + +#include + +std::string getStrCpy(); diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/8 custom command/subprojects/cmMod/main.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/8 custom command/subprojects/cmMod/main.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/8 custom command/subprojects/cmMod/main.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/8 custom command/subprojects/cmMod/main.cpp" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,30 @@ +#include +#include + +using namespace std; + +int main(int argc, const char *argv[]) { + if(argc < 2) { + cerr << argv[0] << " requires an output file!" << endl; + return 1; + } + ofstream out1(string(argv[1]) + ".hpp"); + ofstream out2(string(argv[1]) + ".cpp"); + out1 << R"( +#pragma once + +#include + +std::string getStr(); +)"; + + out2 << R"( +#include ")" << argv[1] << R"(.hpp" + +std::string getStr() { + return "Hello World"; +} +)"; + + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/9 disabled subproject/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/9 disabled subproject/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cmake/9 disabled subproject/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cmake/9 disabled subproject/meson.build" 2019-08-25 19:17:02.000000000 +0000 @@ -0,0 +1,5 @@ +project('cmakeSubTest', ['c', 'cpp']) + +cm = import('cmake') + +sub_pro = cm.subproject('nothinig', required: false) \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/100 manygen/depuser.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/100 manygen/depuser.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/100 manygen/depuser.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/100 manygen/depuser.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -#include"gen_func.h" - -int main(int argc, char **argv) { - unsigned int i = (unsigned int) gen_func_in_lib(); - unsigned int j = (unsigned int) gen_func_in_obj(); - unsigned int k = (unsigned int) gen_func_in_src(); - return (int)(i + j + k); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/100 manygen/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/100 manygen/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/100 manygen/meson.build" 2018-12-09 16:30:18.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/100 manygen/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -project('manygen', 'c') - -if meson.is_cross_build() - # FIXME error out with skip message once cross test runner - # recognizes it. - message('Not running this test during cross build.') -else - subdir('subdir') - - exe = executable('depuser', 'depuser.c', - generated) - - test('depuser test', exe) -endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/100 manygen/subdir/funcinfo.def" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/100 manygen/subdir/funcinfo.def" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/100 manygen/subdir/funcinfo.def" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/100 manygen/subdir/funcinfo.def" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -gen_func diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/100 manygen/subdir/manygen.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/100 manygen/subdir/manygen.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/100 manygen/subdir/manygen.py" 2018-12-09 14:27:16.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/100 manygen/subdir/manygen.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,83 +0,0 @@ -#!/usr/bin/env python - -from __future__ import print_function - -# Generates a static library, object file, source -# file and a header file. - -import sys, os -import subprocess - -with open(sys.argv[1]) as f: - funcname = f.readline().strip() -outdir = sys.argv[2] -buildtype_args = sys.argv[3] -compiler_type = sys.argv[4] -compiler = sys.argv[5:] - -if not os.path.isdir(outdir): - print('Outdir does not exist.') - sys.exit(1) - -if compiler_type == 'msvc': - libsuffix = '.lib' - is_vs = True - if any(['clang-cl' in c for c in compiler]): - linker = 'llvm-lib' - else: - linker = 'lib' -else: - libsuffix = '.a' - is_vs = False - linker = 'ar' - -objsuffix = '.o' - -outo = os.path.join(outdir, funcname + objsuffix) -outa = os.path.join(outdir, funcname + libsuffix) -outh = os.path.join(outdir, funcname + '.h') -outc = os.path.join(outdir, funcname + '.c') - -tmpc = 'diibadaaba.c' -tmpo = 'diibadaaba' + objsuffix - -with open(outc, 'w') as f: - f.write('''#include"%s.h" -int %s_in_src() { - return 0; -} -''' % (funcname, funcname)) - -with open(outh, 'w') as f: - f.write('''#pragma once -int %s_in_lib(); -int %s_in_obj(); -int %s_in_src(); -''' % (funcname, funcname, funcname)) - -with open(tmpc, 'w') as f: - f.write('''int %s_in_obj() { - return 0; -} -''' % funcname) - -if is_vs: - subprocess.check_call(compiler + ['/nologo', '/c', buildtype_args, '/Fo' + outo, tmpc]) -else: - subprocess.check_call(compiler + ['-c', '-o', outo, tmpc]) - -with open(tmpc, 'w') as f: - f.write('''int %s_in_lib() { - return 0; -} -''' % funcname) - -if is_vs: - subprocess.check_call(compiler + ['/nologo', '/c', '/Fo' + tmpo, tmpc]) - subprocess.check_call([linker, '/NOLOGO', '/OUT:' + outa, tmpo]) -else: - subprocess.check_call(compiler + ['-c', '-o', tmpo, tmpc]) - subprocess.check_call([linker, 'csr', outa, tmpo]) - -os.unlink(tmpo) -os.unlink(tmpc) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/100 manygen/subdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/100 manygen/subdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/100 manygen/subdir/meson.build" 2018-12-09 14:27:16.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/100 manygen/subdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -gen = files('manygen.py') -py3_bin = import('python3').find_python() - -buildtype = get_option('buildtype') -buildtype_args = '-Dfooxxx' # a useless compiler argument -cc = meson.get_compiler('c') -if cc.get_argument_syntax() == 'msvc' - # We need our manually generated code to use the same CRT as the executable. - # Taken from compilers.py since build files do not have access to this. - if buildtype == 'debug' - buildtype_args = '/MDd' - elif buildtype == 'debugoptimized' - buildtype_args = '/MDd' - elif buildtype == 'release' - buildtype_args = '/MD' - endif - outfiles = ['gen_func.lib', 'gen_func.c', 'gen_func.h', 'gen_func.o'] -else - outfiles = ['gen_func.a', 'gen_func.c', 'gen_func.h', 'gen_func.o'] -endif - -generated = custom_target('manygen', - output : outfiles, - input : ['funcinfo.def'], - command : [py3_bin, gen[0], '@INPUT@', '@OUTDIR@', buildtype_args, cc.get_argument_syntax(), cc.cmd_array()], -) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/100 stringdef/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/100 stringdef/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/100 stringdef/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/100 stringdef/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +project('stringdef', 'c') + +test('stringdef', executable('stringdef', 'stringdef.c', c_args : '-DFOO="bar"')) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/100 stringdef/stringdef.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/100 stringdef/stringdef.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/100 stringdef/stringdef.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/100 stringdef/stringdef.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,10 @@ +#include +#include + +int main(int argc, char **argv) { + if(strcmp(FOO, "bar")) { + printf("FOO is misquoted: %s\n", FOO); + return 1; + } + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/101 find program path/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/101 find program path/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/101 find program path/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/101 find program path/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,22 @@ +project('find program', 'c') + +python = import('python3').find_python() + +# Source file via string +prog = find_program('program.py') +# Source file via files() +progf = files('program.py') +# Built file +py = configure_file(input : 'program.py', + output : 'builtprogram.py', + configuration : configuration_data()) + +foreach f : [prog, progf, py, find_program(py), find_program(progf)] + ret = run_command(python, f) + assert(ret.returncode() == 0, 'can\'t manually run @0@'.format(prog.path())) + assert(ret.stdout().strip() == 'Found', 'wrong output from manually-run @0@'.format(prog.path())) + + ret = run_command(f) + assert(ret.returncode() == 0, 'can\'t run @0@'.format(prog.path())) + assert(ret.stdout().strip() == 'Found', 'wrong output from @0@'.format(prog.path())) +endforeach diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/101 find program path/program.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/101 find program path/program.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/101 find program path/program.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/101 find program path/program.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +#!/usr/bin/env python3 + +print("Found") diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/101 stringdef/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/101 stringdef/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/101 stringdef/meson.build" 2018-12-09 16:30:18.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/101 stringdef/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -project('stringdef', 'c') - -test('stringdef', executable('stringdef', 'stringdef.c', c_args : '-DFOO="bar"')) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/101 stringdef/stringdef.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/101 stringdef/stringdef.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/101 stringdef/stringdef.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/101 stringdef/stringdef.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -#include -#include - -int main(int argc, char **argv) { - if(strcmp(FOO, "bar")) { - printf("FOO is misquoted: %s\n", FOO); - return 1; - } - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/102 find program path/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/102 find program path/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/102 find program path/meson.build" 2018-12-09 16:30:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/102 find program path/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ -project('find program', 'c') - -python = import('python3').find_python() - -# Source file via string -prog = find_program('program.py') -# Source file via files() -progf = files('program.py') -# Built file -py = configure_file(input : 'program.py', - output : 'builtprogram.py', - configuration : configuration_data()) - -foreach f : [prog, progf, py, find_program(py), find_program(progf)] - ret = run_command(python, f) - assert(ret.returncode() == 0, 'can\'t manually run @0@'.format(prog.path())) - assert(ret.stdout().strip() == 'Found', 'wrong output from manually-run @0@'.format(prog.path())) - - ret = run_command(f) - assert(ret.returncode() == 0, 'can\'t run @0@'.format(prog.path())) - assert(ret.stdout().strip() == 'Found', 'wrong output from @0@'.format(prog.path())) -endforeach diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/102 find program path/program.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/102 find program path/program.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/102 find program path/program.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/102 find program path/program.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -#!/usr/bin/env python3 - -print("Found") diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/102 subproject subdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/102 subproject subdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/102 subproject subdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/102 subproject subdir/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,6 @@ +project('proj', 'c') +subproject('sub') +libSub = dependency('sub', fallback: ['sub', 'libSub']) + +exe = executable('prog', 'prog.c', dependencies: libSub) +test('subproject subdir', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/102 subproject subdir/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/102 subproject subdir/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/102 subproject subdir/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/102 subproject subdir/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +#include + +int main() { + return sub(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/102 subproject subdir/subprojects/sub/lib/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/102 subproject subdir/subprojects/sub/lib/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/102 subproject subdir/subprojects/sub/lib/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/102 subproject subdir/subprojects/sub/lib/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +lib = static_library('sub', 'sub.c') +libSub = declare_dependency(include_directories: include_directories('.'), link_with: lib) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/102 subproject subdir/subprojects/sub/lib/sub.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/102 subproject subdir/subprojects/sub/lib/sub.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/102 subproject subdir/subprojects/sub/lib/sub.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/102 subproject subdir/subprojects/sub/lib/sub.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +#include "sub.h" + +int sub() { + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/102 subproject subdir/subprojects/sub/lib/sub.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/102 subproject subdir/subprojects/sub/lib/sub.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/102 subproject subdir/subprojects/sub/lib/sub.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/102 subproject subdir/subprojects/sub/lib/sub.h" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,6 @@ +#ifndef SUB_H +#define SUB_H + +int sub(); + +#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/102 subproject subdir/subprojects/sub/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/102 subproject subdir/subprojects/sub/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/102 subproject subdir/subprojects/sub/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/102 subproject subdir/subprojects/sub/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +project('sub', 'c') +subdir('lib') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/103 postconf/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/103 postconf/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/103 postconf/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/103 postconf/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +project('postconf script', 'c') + +meson.add_postconf_script('postconf.py') + +test('post', executable('prog', 'prog.c')) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/103 postconf/postconf.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/103 postconf/postconf.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/103 postconf/postconf.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/103 postconf/postconf.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,16 @@ +#!/usr/bin/env python3 + +import os + +template = '''#pragma once + +#define THE_NUMBER {} +''' + +input_file = os.path.join(os.environ['MESON_SOURCE_ROOT'], 'raw.dat') +output_file = os.path.join(os.environ['MESON_BUILD_ROOT'], 'generated.h') + +with open(input_file) as f: + data = f.readline().strip() +with open(output_file, 'w') as f: + f.write(template.format(data)) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/103 postconf/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/103 postconf/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/103 postconf/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/103 postconf/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +#include"generated.h" + +int main(int argc, char **argv) { + return THE_NUMBER != 9; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/103 postconf/raw.dat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/103 postconf/raw.dat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/103 postconf/raw.dat" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/103 postconf/raw.dat" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +9 diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/103 subproject subdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/103 subproject subdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/103 subproject subdir/meson.build" 2018-12-09 16:30:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/103 subproject subdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -project('proj', 'c') -subproject('sub') -libSub = dependency('sub', fallback: ['sub', 'libSub']) - -exe = executable('prog', 'prog.c', dependencies: libSub) -test('subproject subdir', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/103 subproject subdir/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/103 subproject subdir/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/103 subproject subdir/prog.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/103 subproject subdir/prog.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#include - -int main() { - return sub(); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/103 subproject subdir/subprojects/sub/lib/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/103 subproject subdir/subprojects/sub/lib/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/103 subproject subdir/subprojects/sub/lib/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/103 subproject subdir/subprojects/sub/lib/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -lib = static_library('sub', 'sub.c') -libSub = declare_dependency(include_directories: include_directories('.'), link_with: lib) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/103 subproject subdir/subprojects/sub/lib/sub.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/103 subproject subdir/subprojects/sub/lib/sub.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/103 subproject subdir/subprojects/sub/lib/sub.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/103 subproject subdir/subprojects/sub/lib/sub.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#include "sub.h" - -int sub() { - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/103 subproject subdir/subprojects/sub/lib/sub.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/103 subproject subdir/subprojects/sub/lib/sub.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/103 subproject subdir/subprojects/sub/lib/sub.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/103 subproject subdir/subprojects/sub/lib/sub.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#ifndef SUB_H -#define SUB_H - -int sub(); - -#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/103 subproject subdir/subprojects/sub/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/103 subproject subdir/subprojects/sub/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/103 subproject subdir/subprojects/sub/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/103 subproject subdir/subprojects/sub/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -project('sub', 'c') -subdir('lib') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/104 postconf/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/104 postconf/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/104 postconf/meson.build" 2018-12-09 16:30:22.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/104 postconf/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -project('postconf script', 'c') - -meson.add_postconf_script('postconf.py') - -test('post', executable('prog', 'prog.c')) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/104 postconf/postconf.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/104 postconf/postconf.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/104 postconf/postconf.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/104 postconf/postconf.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -#!/usr/bin/env python3 - -import os - -template = '''#pragma once - -#define THE_NUMBER {} -''' - -input_file = os.path.join(os.environ['MESON_SOURCE_ROOT'], 'raw.dat') -output_file = os.path.join(os.environ['MESON_BUILD_ROOT'], 'generated.h') - -with open(input_file) as f: - data = f.readline().strip() -with open(output_file, 'w') as f: - f.write(template.format(data)) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/104 postconf/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/104 postconf/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/104 postconf/prog.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/104 postconf/prog.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#include"generated.h" - -int main(int argc, char **argv) { - return THE_NUMBER != 9; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/104 postconf/raw.dat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/104 postconf/raw.dat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/104 postconf/raw.dat" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/104 postconf/raw.dat" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -9 diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/104 postconf with args/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/104 postconf with args/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/104 postconf with args/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/104 postconf with args/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +project('postconf script', 'c') + +meson.add_postconf_script('postconf.py', '5', '33') + +test('post', executable('prog', 'prog.c')) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/104 postconf with args/postconf.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/104 postconf with args/postconf.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/104 postconf with args/postconf.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/104 postconf with args/postconf.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 + +import sys, os + +template = '''#pragma once + +#define THE_NUMBER {} +#define THE_ARG1 {} +#define THE_ARG2 {} +''' + +input_file = os.path.join(os.environ['MESON_SOURCE_ROOT'], 'raw.dat') +output_file = os.path.join(os.environ['MESON_BUILD_ROOT'], 'generated.h') + +with open(input_file) as f: + data = f.readline().strip() +with open(output_file, 'w') as f: + f.write(template.format(data, sys.argv[1], sys.argv[2])) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/104 postconf with args/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/104 postconf with args/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/104 postconf with args/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/104 postconf with args/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +#include"generated.h" + +int main(int argc, char **argv) { + return THE_NUMBER != 9 || THE_ARG1 != 5 || THE_ARG2 != 33; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/104 postconf with args/raw.dat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/104 postconf with args/raw.dat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/104 postconf with args/raw.dat" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/104 postconf with args/raw.dat" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +9 diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/105 postconf with args/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/105 postconf with args/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/105 postconf with args/meson.build" 2018-12-09 16:30:22.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/105 postconf with args/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -project('postconf script', 'c') - -meson.add_postconf_script('postconf.py', '5', '33') - -test('post', executable('prog', 'prog.c')) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/105 postconf with args/postconf.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/105 postconf with args/postconf.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/105 postconf with args/postconf.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/105 postconf with args/postconf.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -#!/usr/bin/env python3 - -import sys, os - -template = '''#pragma once - -#define THE_NUMBER {} -#define THE_ARG1 {} -#define THE_ARG2 {} -''' - -input_file = os.path.join(os.environ['MESON_SOURCE_ROOT'], 'raw.dat') -output_file = os.path.join(os.environ['MESON_BUILD_ROOT'], 'generated.h') - -with open(input_file) as f: - data = f.readline().strip() -with open(output_file, 'w') as f: - f.write(template.format(data, sys.argv[1], sys.argv[2])) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/105 postconf with args/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/105 postconf with args/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/105 postconf with args/prog.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/105 postconf with args/prog.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#include"generated.h" - -int main(int argc, char **argv) { - return THE_NUMBER != 9 || THE_ARG1 != 5 || THE_ARG2 != 33; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/105 postconf with args/raw.dat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/105 postconf with args/raw.dat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/105 postconf with args/raw.dat" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/105 postconf with args/raw.dat" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -9 diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/105 testframework options/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/105 testframework options/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/105 testframework options/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/105 testframework options/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +project('options', 'c') + +assert(get_option('testoption') == 'A string with spaces', 'Incorrect value for testoption option.') +assert(get_option('other_one') == true, 'Incorrect value for other_one option.') +assert(get_option('combo_opt') == 'one', 'Incorrect value for combo_opt option.') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/105 testframework options/meson_options.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/105 testframework options/meson_options.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/105 testframework options/meson_options.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/105 testframework options/meson_options.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +option('testoption', type : 'string', value : 'optval', description : 'An option to do something') +option('other_one', type : 'boolean', value : false) +option('combo_opt', type : 'combo', choices : ['one', 'two', 'combo'], value : 'combo') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/105 testframework options/test_args.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/105 testframework options/test_args.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/105 testframework options/test_args.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/105 testframework options/test_args.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,4 @@ +# This file is not read by meson itself, but by the test framework. +# It is not possible to pass arguments to meson from a file. +['--werror', '-D', 'testoption=A string with spaces', '-D', 'other_one=true', \ + '-D', 'combo_opt=one'] diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/106 extract same name/lib.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/106 extract same name/lib.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/106 extract same name/lib.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/106 extract same name/lib.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,3 @@ +int func1() { + return 23; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/106 extract same name/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/106 extract same name/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/106 extract same name/main.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/106 extract same name/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,6 @@ +int func1(); +int func2(); + +int main(int argc, char **argv) { + return !(func1() == 23 && func2() == 42); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/106 extract same name/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/106 extract same name/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/106 extract same name/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/106 extract same name/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,7 @@ +project('object extraction', 'c') + +lib = shared_library('somelib', ['lib.c', 'src/lib.c']) +# Also tests that the object list is flattened properly +obj = lib.extract_objects(['lib.c', ['src/lib.c']]) +exe = executable('main', 'main.c', objects: obj) +test('extraction', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/106 extract same name/src/lib.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/106 extract same name/src/lib.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/106 extract same name/src/lib.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/106 extract same name/src/lib.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,3 @@ +int func2() { + return 42; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/106 testframework options/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/106 testframework options/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/106 testframework options/meson.build" 2018-12-09 16:30:24.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/106 testframework options/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -project('options', 'c') - -assert(get_option('testoption') == 'A string with spaces', 'Incorrect value for testoption option.') -assert(get_option('other_one') == true, 'Incorrect value for other_one option.') -assert(get_option('combo_opt') == 'one', 'Incorrect value for combo_opt option.') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/106 testframework options/meson_options.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/106 testframework options/meson_options.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/106 testframework options/meson_options.txt" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/106 testframework options/meson_options.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -option('testoption', type : 'string', value : 'optval', description : 'An option to do something') -option('other_one', type : 'boolean', value : false) -option('combo_opt', type : 'combo', choices : ['one', 'two', 'combo'], value : 'combo') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/106 testframework options/test_args.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/106 testframework options/test_args.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/106 testframework options/test_args.txt" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/106 testframework options/test_args.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -# This file is not read by meson itself, but by the test framework. -# It is not possible to pass arguments to meson from a file. -['--werror', '-D', 'testoption=A string with spaces', '-D', 'other_one=true', \ - '-D', 'combo_opt=one'] diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/107 extract same name/lib.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/107 extract same name/lib.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/107 extract same name/lib.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/107 extract same name/lib.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -int func1() { - return 23; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/107 extract same name/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/107 extract same name/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/107 extract same name/main.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/107 extract same name/main.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -int func1(); -int func2(); - -int main(int argc, char **argv) { - return !(func1() == 23 && func2() == 42); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/107 extract same name/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/107 extract same name/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/107 extract same name/meson.build" 2018-12-09 16:30:24.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/107 extract same name/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -project('object extraction', 'c') - -lib = shared_library('somelib', ['lib.c', 'src/lib.c']) -# Also tests that the object list is flattened properly -obj = lib.extract_objects(['lib.c', ['src/lib.c']]) -exe = executable('main', 'main.c', objects: obj) -test('extraction', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/107 extract same name/src/lib.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/107 extract same name/src/lib.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/107 extract same name/src/lib.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/107 extract same name/src/lib.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -int func2() { - return 42; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/107 has header symbol/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/107 has header symbol/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/107 has header symbol/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/107 has header symbol/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,36 @@ +project('has header symbol', 'c', 'cpp') + +cc = meson.get_compiler('c') +cpp = meson.get_compiler('cpp') + +foreach comp : [cc, cpp] + assert (comp.has_header_symbol('stdio.h', 'int'), 'base types should always be available') + assert (comp.has_header_symbol('stdio.h', 'printf'), 'printf function not found') + assert (comp.has_header_symbol('stdio.h', 'FILE'), 'FILE structure not found') + assert (comp.has_header_symbol('limits.h', 'INT_MAX'), 'INT_MAX define not found') + assert (not comp.has_header_symbol('limits.h', 'guint64'), 'guint64 is not defined in limits.h') + assert (not comp.has_header_symbol('stdlib.h', 'FILE'), 'FILE structure is defined in stdio.h, not stdlib.h') + assert (not comp.has_header_symbol('stdlol.h', 'printf'), 'stdlol.h shouldn\'t exist') + assert (not comp.has_header_symbol('stdlol.h', 'int'), 'shouldn\'t be able to find "int" with invalid header') +endforeach + +# This is available on Glibc, Solaris & the BSD's, so just test for _GNU_SOURCE +# on Linux +if cc.has_function('ppoll') and host_machine.system() == 'linux' + assert (not cc.has_header_symbol('poll.h', 'ppoll'), 'ppoll should not be accessible without _GNU_SOURCE') + assert (cc.has_header_symbol('poll.h', 'ppoll', prefix : '#define _GNU_SOURCE'), 'ppoll should be accessible with _GNU_SOURCE') +endif + +assert (cpp.has_header_symbol('iostream', 'std::iostream'), 'iostream not found in iostream.h') +assert (cpp.has_header_symbol('vector', 'std::vector'), 'vector not found in vector.h') +assert (not cpp.has_header_symbol('limits.h', 'std::iostream'), 'iostream should not be defined in limits.h') + +# Cross compilation and boost do not mix. +if not meson.is_cross_build() + boost = dependency('boost', required : false) + if boost.found() + assert (cpp.has_header_symbol('boost/math/quaternion.hpp', 'boost::math::quaternion', dependencies : boost), 'quaternion not found') + else + assert (not cpp.has_header_symbol('boost/math/quaternion.hpp', 'boost::math::quaternion', dependencies : boost), 'quaternion found?!') + endif +endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/108 has arg/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/108 has arg/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/108 has arg/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/108 has arg/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,60 @@ +project('has arg', 'c', 'cpp') + +cc = meson.get_compiler('c') +cpp = meson.get_compiler('cpp') + +if cc.get_id() == 'msvc' + is_arg = '/O2' + useless = '/DFOO' +else + is_arg = '-O2' + useless = '-DFOO' +endif + +isnt_arg = '-fiambroken' + +assert(cc.has_argument(is_arg), 'Arg that should have worked does not work.') +assert(not cc.has_argument(isnt_arg), 'Arg that should be broken is not.') + +assert(cpp.has_argument(is_arg), 'Arg that should have worked does not work.') +assert(not cpp.has_argument(isnt_arg), 'Arg that should be broken is not.') + +assert(cc.get_supported_arguments([is_arg, isnt_arg, useless]) == [is_arg, useless], 'Arg filtering returned different result.') +assert(cpp.get_supported_arguments([is_arg, isnt_arg, useless]) == [is_arg, useless], 'Arg filtering returned different result.') + +# Have useless at the end to ensure that the search goes from front to back. +l1 = cc.first_supported_argument([isnt_arg, is_arg, isnt_arg, useless]) +l2 = cc.first_supported_argument(isnt_arg, isnt_arg, isnt_arg) + +assert(l1.length() == 1, 'First supported returned wrong result.') +assert(l1.get(0) == is_arg, 'First supported returned wrong argument.') +assert(l2.length() == 0, 'First supported did not return empty array.') + +l1 = cpp.first_supported_argument([isnt_arg, is_arg, isnt_arg, useless]) +l2 = cpp.first_supported_argument(isnt_arg, isnt_arg, isnt_arg) + +assert(l1.length() == 1, 'First supported returned wrong result.') +assert(l1.get(0) == is_arg, 'First supported returned wrong argument.') +assert(l2.length() == 0, 'First supported did not return empty array.') + +if cc.get_id() == 'gcc' + pre_arg = '-Wformat' + # NOTE: We have special handling for -Wno-foo args because gcc silently + # ignores unknown -Wno-foo args unless you pass -Werror, so for this test, we + # pass it as two separate arguments. + anti_pre_arg = ['-W', 'no-format'] + arg = '-Werror=format-security' + assert(not cc.has_multi_arguments([anti_pre_arg, arg]), 'Arg that should be broken is not.') + assert(cc.has_multi_arguments(pre_arg), 'Arg that should have worked does not work.') + assert(cc.has_multi_arguments([pre_arg, arg]), 'Arg that should have worked does not work.') + # Test that gcc correctly errors out on unknown -Wno flags + assert(not cc.has_argument('-Wno-lol-meson-test-flags'), 'should error out on unknown -Wno args') + assert(not cc.has_multi_arguments(['-Wno-pragmas', '-Wno-lol-meson-test-flags']), 'should error out even if some -Wno args are valid') +endif + +if cc.get_id() == 'clang' and cc.version().version_compare('<=4.0.0') + # 4.0.0 does not support -fpeel-loops. Newer versions may. + # Please adjust above version number as new versions of clang are released. + notyet_arg = '-fpeel-loops' + assert(not cc.has_argument(notyet_arg), 'Arg that should be broken (unless clang added support recently) is not.') +endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/108 has header symbol/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/108 has header symbol/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/108 has header symbol/meson.build" 2018-12-09 16:30:36.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/108 has header symbol/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -project('has header symbol', 'c', 'cpp') - -cc = meson.get_compiler('c') -cpp = meson.get_compiler('cpp') - -foreach comp : [cc, cpp] - assert (comp.has_header_symbol('stdio.h', 'int'), 'base types should always be available') - assert (comp.has_header_symbol('stdio.h', 'printf'), 'printf function not found') - assert (comp.has_header_symbol('stdio.h', 'FILE'), 'FILE structure not found') - assert (comp.has_header_symbol('limits.h', 'INT_MAX'), 'INT_MAX define not found') - assert (not comp.has_header_symbol('limits.h', 'guint64'), 'guint64 is not defined in limits.h') - assert (not comp.has_header_symbol('stdlib.h', 'FILE'), 'FILE structure is defined in stdio.h, not stdlib.h') - assert (not comp.has_header_symbol('stdlol.h', 'printf'), 'stdlol.h shouldn\'t exist') - assert (not comp.has_header_symbol('stdlol.h', 'int'), 'shouldn\'t be able to find "int" with invalid header') -endforeach - -# This is available on Glibc, Solaris & the BSD's, so just test for _GNU_SOURCE -# on Linux -if cc.has_function('ppoll') and host_machine.system() == 'linux' - assert (not cc.has_header_symbol('poll.h', 'ppoll'), 'ppoll should not be accessible without _GNU_SOURCE') - assert (cc.has_header_symbol('poll.h', 'ppoll', prefix : '#define _GNU_SOURCE'), 'ppoll should be accessible with _GNU_SOURCE') -endif - -assert (cpp.has_header_symbol('iostream', 'std::iostream'), 'iostream not found in iostream.h') -assert (cpp.has_header_symbol('vector', 'std::vector'), 'vector not found in vector.h') -assert (not cpp.has_header_symbol('limits.h', 'std::iostream'), 'iostream should not be defined in limits.h') - -# Cross compilation and boost do not mix. -if not meson.is_cross_build() - boost = dependency('boost', required : false) - if boost.found() - assert (cpp.has_header_symbol('boost/math/quaternion.hpp', 'boost::math::quaternion', dependencies : boost), 'quaternion not found') - else - assert (not cpp.has_header_symbol('boost/math/quaternion.hpp', 'boost::math::quaternion', dependencies : boost), 'quaternion found?!') - endif -endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/109 generatorcustom/catter.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/109 generatorcustom/catter.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/109 generatorcustom/catter.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/109 generatorcustom/catter.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,14 @@ +#!/usr/bin/env python3 + +import sys + +output = sys.argv[-1] +inputs = sys.argv[1:-1] + +with open(output, 'w') as ofile: + ofile.write('#pragma once\n') + for i in inputs: + with open(i, 'r') as ifile: + content = ifile.read() + ofile.write(content) + ofile.write('\n') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/109 generatorcustom/gen.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/109 generatorcustom/gen.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/109 generatorcustom/gen.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/109 generatorcustom/gen.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 + +import sys + +ifile = sys.argv[1] +ofile = sys.argv[2] + +with open(ifile, 'r') as f: + resname = f.readline().strip() + +templ = 'const char %s[] = "%s";\n' +with open(ofile, 'w') as f: + f.write(templ % (resname, resname)) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/109 generatorcustom/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/109 generatorcustom/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/109 generatorcustom/main.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/109 generatorcustom/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,7 @@ +#include + +#include"alltogether.h" + +int main(int argc, char **argv) { + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/109 generatorcustom/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/109 generatorcustom/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/109 generatorcustom/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/109 generatorcustom/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,18 @@ +project('generatorcustom', 'c') + +creator = find_program('gen.py') +catter = find_program('catter.py') + +gen = generator(creator, + output: '@BASENAME@.h', + arguments : ['@INPUT@', '@OUTPUT@']) + +hs = gen.process('res1.txt', 'res2.txt') + +allinone = custom_target('alltogether', + input : hs, + output : 'alltogether.h', + command : [catter, '@INPUT@', '@OUTPUT@']) + +executable('proggie', 'main.c', allinone) + diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/109 generatorcustom/res1.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/109 generatorcustom/res1.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/109 generatorcustom/res1.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/109 generatorcustom/res1.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +res1 diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/109 generatorcustom/res2.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/109 generatorcustom/res2.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/109 generatorcustom/res2.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/109 generatorcustom/res2.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +res2 diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/109 has arg/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/109 has arg/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/109 has arg/meson.build" 2018-12-09 16:30:26.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/109 has arg/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,60 +0,0 @@ -project('has arg', 'c', 'cpp') - -cc = meson.get_compiler('c') -cpp = meson.get_compiler('cpp') - -if cc.get_id() == 'msvc' - is_arg = '/O2' - useless = '/DFOO' -else - is_arg = '-O2' - useless = '-DFOO' -endif - -isnt_arg = '-fiambroken' - -assert(cc.has_argument(is_arg), 'Arg that should have worked does not work.') -assert(not cc.has_argument(isnt_arg), 'Arg that should be broken is not.') - -assert(cpp.has_argument(is_arg), 'Arg that should have worked does not work.') -assert(not cpp.has_argument(isnt_arg), 'Arg that should be broken is not.') - -assert(cc.get_supported_arguments([is_arg, isnt_arg, useless]) == [is_arg, useless], 'Arg filtering returned different result.') -assert(cpp.get_supported_arguments([is_arg, isnt_arg, useless]) == [is_arg, useless], 'Arg filtering returned different result.') - -# Have useless at the end to ensure that the search goes from front to back. -l1 = cc.first_supported_argument([isnt_arg, is_arg, isnt_arg, useless]) -l2 = cc.first_supported_argument(isnt_arg, isnt_arg, isnt_arg) - -assert(l1.length() == 1, 'First supported returned wrong result.') -assert(l1.get(0) == is_arg, 'First supported returned wrong argument.') -assert(l2.length() == 0, 'First supported did not return empty array.') - -l1 = cpp.first_supported_argument([isnt_arg, is_arg, isnt_arg, useless]) -l2 = cpp.first_supported_argument(isnt_arg, isnt_arg, isnt_arg) - -assert(l1.length() == 1, 'First supported returned wrong result.') -assert(l1.get(0) == is_arg, 'First supported returned wrong argument.') -assert(l2.length() == 0, 'First supported did not return empty array.') - -if cc.get_id() == 'gcc' - pre_arg = '-Wformat' - # NOTE: We have special handling for -Wno-foo args because gcc silently - # ignores unknown -Wno-foo args unless you pass -Werror, so for this test, we - # pass it as two separate arguments. - anti_pre_arg = ['-W', 'no-format'] - arg = '-Werror=format-security' - assert(not cc.has_multi_arguments([anti_pre_arg, arg]), 'Arg that should be broken is not.') - assert(cc.has_multi_arguments(pre_arg), 'Arg that should have worked does not work.') - assert(cc.has_multi_arguments([pre_arg, arg]), 'Arg that should have worked does not work.') - # Test that gcc correctly errors out on unknown -Wno flags - assert(not cc.has_argument('-Wno-lol-meson-test-flags'), 'should error out on unknown -Wno args') - assert(not cc.has_multi_arguments(['-Wno-pragmas', '-Wno-lol-meson-test-flags']), 'should error out even if some -Wno args are valid') -endif - -if cc.get_id() == 'clang' and cc.version().version_compare('<=4.0.0') - # 4.0.0 does not support -fpeel-loops. Newer versions may. - # Please adjust above version number as new versions of clang are released. - notyet_arg = '-fpeel-loops' - assert(not cc.has_argument(notyet_arg), 'Arg that should be broken (unless clang added support recently) is not.') -endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/110 generatorcustom/catter.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/110 generatorcustom/catter.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/110 generatorcustom/catter.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/110 generatorcustom/catter.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -#!/usr/bin/env python3 - -import sys - -output = sys.argv[-1] -inputs = sys.argv[1:-1] - -with open(output, 'w') as ofile: - ofile.write('#pragma once\n') - for i in inputs: - with open(i, 'r') as ifile: - content = ifile.read() - ofile.write(content) - ofile.write('\n') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/110 generatorcustom/gen.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/110 generatorcustom/gen.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/110 generatorcustom/gen.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/110 generatorcustom/gen.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -#!/usr/bin/env python3 - -import sys - -ifile = sys.argv[1] -ofile = sys.argv[2] - -with open(ifile, 'r') as f: - resname = f.readline().strip() - -templ = 'const char %s[] = "%s";\n' -with open(ofile, 'w') as f: - f.write(templ % (resname, resname)) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/110 generatorcustom/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/110 generatorcustom/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/110 generatorcustom/main.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/110 generatorcustom/main.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -#include - -#include"alltogether.h" - -int main(int argc, char **argv) { - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/110 generatorcustom/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/110 generatorcustom/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/110 generatorcustom/meson.build" 2018-12-09 16:30:27.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/110 generatorcustom/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -project('generatorcustom', 'c') - -creator = find_program('gen.py') -catter = find_program('catter.py') - -gen = generator(creator, - output: '@BASENAME@.h', - arguments : ['@INPUT@', '@OUTPUT@']) - -hs = gen.process('res1.txt', 'res2.txt') - -allinone = custom_target('alltogether', - input : hs, - output : 'alltogether.h', - command : [catter, '@INPUT@', '@OUTPUT@']) - -executable('proggie', 'main.c', allinone) - diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/110 generatorcustom/res1.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/110 generatorcustom/res1.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/110 generatorcustom/res1.txt" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/110 generatorcustom/res1.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -res1 diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/110 generatorcustom/res2.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/110 generatorcustom/res2.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/110 generatorcustom/res2.txt" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/110 generatorcustom/res2.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -res2 diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/110 multiple dir configure file/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/110 multiple dir configure file/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/110 multiple dir configure file/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/110 multiple dir configure file/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,11 @@ +project('multiple dir configure file', 'c') + +subdir('subdir') + +configure_file(input : 'subdir/someinput.in', + output : 'outputhere', + copy: true) + +configure_file(input : cfile1, + output : '@BASENAME@', + copy: true) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/110 multiple dir configure file/subdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/110 multiple dir configure file/subdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/110 multiple dir configure file/subdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/110 multiple dir configure file/subdir/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,11 @@ +configure_file(input : 'someinput.in', + output : 'outputsubdir', + install : false, + copy: true) + +py3 = import('python3').find_python() + +cfile1 = configure_file(input : 'foo.txt', + output : 'foo.h.in', + capture : true, + command : [py3, '-c', 'print("#mesondefine FOO_BAR")']) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/111 multiple dir configure file/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/111 multiple dir configure file/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/111 multiple dir configure file/meson.build" 2018-12-09 16:30:27.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/111 multiple dir configure file/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -project('multiple dir configure file', 'c') - -subdir('subdir') - -configure_file(input : 'subdir/someinput.in', - output : 'outputhere', - copy: true) - -configure_file(input : cfile1, - output : '@BASENAME@', - copy: true) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/111 multiple dir configure file/subdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/111 multiple dir configure file/subdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/111 multiple dir configure file/subdir/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/111 multiple dir configure file/subdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -configure_file(input : 'someinput.in', - output : 'outputsubdir', - install : false, - copy: true) - -py3 = import('python3').find_python() - -cfile1 = configure_file(input : 'foo.txt', - output : 'foo.h.in', - capture : true, - command : [py3, '-c', 'print("#mesondefine FOO_BAR")']) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/111 spaces backslash/asm output/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/111 spaces backslash/asm output/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/111 spaces backslash/asm output/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/111 spaces backslash/asm output/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +configure_file(output : 'blank.txt', configuration : configuration_data()) + diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/111 spaces backslash/comparer.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/111 spaces backslash/comparer.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/111 spaces backslash/comparer.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/111 spaces backslash/comparer.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,16 @@ +#include "comparer.h" + +#ifndef COMPARER_INCLUDED +#error "comparer.h not included" +#endif + +#define COMPARE_WITH "foo\\bar" /* This is the literal `foo\bar` */ + +int main (int argc, char **argv) { + if (strcmp (DEF_WITH_BACKSLASH, COMPARE_WITH)) { + printf ("Arg string is quoted incorrectly: %s instead of %s\n", + DEF_WITH_BACKSLASH, COMPARE_WITH); + return 1; + } + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/111 spaces backslash/comparer-end.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/111 spaces backslash/comparer-end.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/111 spaces backslash/comparer-end.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/111 spaces backslash/comparer-end.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,16 @@ +#include "comparer.h" + +#ifndef COMPARER_INCLUDED +#error "comparer.h not included" +#endif + +#define COMPARE_WITH "foo\\bar\\" /* This is `foo\bar\` */ + +int main (int argc, char **argv) { + if (strcmp (DEF_WITH_BACKSLASH, COMPARE_WITH)) { + printf ("Arg string is quoted incorrectly: %s vs %s\n", + DEF_WITH_BACKSLASH, COMPARE_WITH); + return 1; + } + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/111 spaces backslash/comparer-end-notstring.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/111 spaces backslash/comparer-end-notstring.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/111 spaces backslash/comparer-end-notstring.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/111 spaces backslash/comparer-end-notstring.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,20 @@ +#include "comparer.h" + +#ifndef COMPARER_INCLUDED +#error "comparer.h not included" +#endif + +/* This converts foo\\\\bar\\\\ to "foo\\bar\\" (string literal) */ +#define Q(x) #x +#define QUOTE(x) Q(x) + +#define COMPARE_WITH "foo\\bar\\" /* This is the literal `foo\bar\` */ + +int main(int argc, char **argv) { + if(strcmp(QUOTE(DEF_WITH_BACKSLASH), COMPARE_WITH)) { + printf("Arg string is quoted incorrectly: %s instead of %s\n", + QUOTE(DEF_WITH_BACKSLASH), COMPARE_WITH); + return 1; + } + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/111 spaces backslash/include/comparer.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/111 spaces backslash/include/comparer.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/111 spaces backslash/include/comparer.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/111 spaces backslash/include/comparer.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,4 @@ +#include +#include + +#define COMPARER_INCLUDED diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/111 spaces backslash/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/111 spaces backslash/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/111 spaces backslash/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/111 spaces backslash/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,28 @@ +project('comparer', 'c') + +# Added manually as a c_arg to test handling of include paths with backslashes +# and spaces. This is especially useful on Windows in vcxproj files since it +# stores include directories in a separate element that has its own +# context-specific escaping/quoting. +include_dir = meson.current_source_dir() + '/include' +default_c_args = ['-I' + include_dir] + +if meson.get_compiler('c').get_argument_syntax() == 'msvc' + default_c_args += ['/Faasm output\\'] + # Hack to create the 'asm output' directory in the builddir + subdir('asm output') +endif + +# Path can contain \. Here we're sending `"foo\bar"`. +test('backslash quoting', + executable('comparer', 'comparer.c', + c_args : default_c_args + ['-DDEF_WITH_BACKSLASH="foo\\bar"'])) +# Path can end in \ without any special quoting. Here we send `"foo\bar\"`. +test('backslash end quoting', + executable('comparer-end', 'comparer-end.c', + c_args : default_c_args + ['-DDEF_WITH_BACKSLASH="foo\\bar\\"'])) +# Path can (really) end in \ if we're not passing a string literal without any +# special quoting. Here we're sending `foo\bar\`. +test('backslash end quoting when not a string literal', + executable('comparer-end-notstring', 'comparer-end-notstring.c', + c_args : default_c_args + ['-DDEF_WITH_BACKSLASH=foo\\bar\\'])) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/112 spaces backslash/asm output/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/112 spaces backslash/asm output/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/112 spaces backslash/asm output/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/112 spaces backslash/asm output/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -configure_file(output : 'blank.txt', configuration : configuration_data()) - diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/112 spaces backslash/comparer.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/112 spaces backslash/comparer.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/112 spaces backslash/comparer.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/112 spaces backslash/comparer.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -#include "comparer.h" - -#ifndef COMPARER_INCLUDED -#error "comparer.h not included" -#endif - -#define COMPARE_WITH "foo\\bar" /* This is the literal `foo\bar` */ - -int main (int argc, char **argv) { - if (strcmp (DEF_WITH_BACKSLASH, COMPARE_WITH)) { - printf ("Arg string is quoted incorrectly: %s instead of %s\n", - DEF_WITH_BACKSLASH, COMPARE_WITH); - return 1; - } - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/112 spaces backslash/comparer-end.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/112 spaces backslash/comparer-end.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/112 spaces backslash/comparer-end.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/112 spaces backslash/comparer-end.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -#include "comparer.h" - -#ifndef COMPARER_INCLUDED -#error "comparer.h not included" -#endif - -#define COMPARE_WITH "foo\\bar\\" /* This is `foo\bar\` */ - -int main (int argc, char **argv) { - if (strcmp (DEF_WITH_BACKSLASH, COMPARE_WITH)) { - printf ("Arg string is quoted incorrectly: %s vs %s\n", - DEF_WITH_BACKSLASH, COMPARE_WITH); - return 1; - } - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/112 spaces backslash/comparer-end-notstring.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/112 spaces backslash/comparer-end-notstring.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/112 spaces backslash/comparer-end-notstring.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/112 spaces backslash/comparer-end-notstring.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -#include "comparer.h" - -#ifndef COMPARER_INCLUDED -#error "comparer.h not included" -#endif - -/* This converts foo\\\\bar\\\\ to "foo\\bar\\" (string literal) */ -#define Q(x) #x -#define QUOTE(x) Q(x) - -#define COMPARE_WITH "foo\\bar\\" /* This is the literal `foo\bar\` */ - -int main(int argc, char **argv) { - if(strcmp(QUOTE(DEF_WITH_BACKSLASH), COMPARE_WITH)) { - printf("Arg string is quoted incorrectly: %s instead of %s\n", - QUOTE(DEF_WITH_BACKSLASH), COMPARE_WITH); - return 1; - } - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/112 spaces backslash/include/comparer.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/112 spaces backslash/include/comparer.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/112 spaces backslash/include/comparer.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/112 spaces backslash/include/comparer.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -#include -#include - -#define COMPARER_INCLUDED diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/112 spaces backslash/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/112 spaces backslash/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/112 spaces backslash/meson.build" 2018-12-09 16:30:30.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/112 spaces backslash/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -project('comparer', 'c') - -# Added manually as a c_arg to test handling of include paths with backslashes -# and spaces. This is especially useful on Windows in vcxproj files since it -# stores include directories in a separate element that has its own -# context-specific escaping/quoting. -include_dir = meson.current_source_dir() + '/include' -default_c_args = ['-I' + include_dir] - -if meson.get_compiler('c').get_argument_syntax() == 'msvc' - default_c_args += ['/Faasm output\\'] - # Hack to create the 'asm output' directory in the builddir - subdir('asm output') -endif - -# Path can contain \. Here we're sending `"foo\bar"`. -test('backslash quoting', - executable('comparer', 'comparer.c', - c_args : default_c_args + ['-DDEF_WITH_BACKSLASH="foo\\bar"'])) -# Path can end in \ without any special quoting. Here we send `"foo\bar\"`. -test('backslash end quoting', - executable('comparer-end', 'comparer-end.c', - c_args : default_c_args + ['-DDEF_WITH_BACKSLASH="foo\\bar\\"'])) -# Path can (really) end in \ if we're not passing a string literal without any -# special quoting. Here we're sending `foo\bar\`. -test('backslash end quoting when not a string literal', - executable('comparer-end-notstring', 'comparer-end-notstring.c', - c_args : default_c_args + ['-DDEF_WITH_BACKSLASH=foo\\bar\\'])) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/112 ternary/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/112 ternary/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/112 ternary/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/112 ternary/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,12 @@ +project('ternary operator', 'c') + +x = true +one = true ? 1 : error('False branch should not be evaluated') +two = false ? error('True branch should not be evaluated.') : 2 +three = '@0@'.format(x ? 'yes' : 'no') +four = [x ? '0' : '1'] + +assert(one == 1, 'Return value from ternary true is wrong.') +assert(two == 2, 'Return value from ternary false is wrong.') +assert(three == 'yes', 'Return value for ternary inside method call is wrong.') +assert(four == ['0'], 'Return value for ternary inside of list is wrong.') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/113 custom target capture/data_source.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/113 custom target capture/data_source.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/113 custom target capture/data_source.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/113 custom target capture/data_source.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +This is a text only input file. diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/113 custom target capture/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/113 custom target capture/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/113 custom target capture/installed_files.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/113 custom target capture/installed_files.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +usr/subdir/data.dat diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/113 custom target capture/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/113 custom target capture/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/113 custom target capture/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/113 custom target capture/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,24 @@ +project('custom target', 'c') + +python3 = import('python3').find_python() + +# Note that this will not add a dependency to the compiler executable. +# Code will not be rebuilt if it changes. +comp = '@0@/@1@'.format(meson.current_source_dir(), 'my_compiler.py') + +mytarget = custom_target('bindat', + output : 'data.dat', + input : 'data_source.txt', + capture : true, + command : [python3, comp, '@INPUT@'], + install : true, + install_dir : 'subdir' +) + +ct_output_exists = '''import os, sys +if not os.path.exists(sys.argv[1]): + print("could not find {!r} in {!r}".format(sys.argv[1], os.getcwd())) + sys.exit(1) +''' + +test('capture-wrote', python3, args : ['-c', ct_output_exists, mytarget]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/113 custom target capture/my_compiler.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/113 custom target capture/my_compiler.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/113 custom target capture/my_compiler.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/113 custom target capture/my_compiler.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,14 @@ +#!/usr/bin/env python3 + +import sys + +if __name__ == '__main__': + if len(sys.argv) != 2: + print(sys.argv[0], 'input_file') + sys.exit(1) + with open(sys.argv[1]) as f: + ifile = f.read() + if ifile != 'This is a text only input file.\n': + print('Malformed input') + sys.exit(1) + print('This is a binary output file.') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/113 ternary/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/113 ternary/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/113 ternary/meson.build" 2018-12-09 16:30:31.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/113 ternary/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -project('ternary operator', 'c') - -one = true ? 1 : error('False branch should not be evaluated') -two = false ? error('True branch should not be evaluated.') : 2 - -assert(one == 1, 'Return value from ternary true is wrong.') -assert(two == 2, 'Return value from ternary false is wrong.') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/114 allgenerate/converter.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/114 allgenerate/converter.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/114 allgenerate/converter.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/114 allgenerate/converter.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,8 @@ +#!/usr/bin/env python3 + +import sys + +ifile = sys.argv[1] +ofile = sys.argv[2] + +open(ofile, 'w').write(open(ifile).read()) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/114 allgenerate/foobar.cpp.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/114 allgenerate/foobar.cpp.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/114 allgenerate/foobar.cpp.in" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/114 allgenerate/foobar.cpp.in" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,6 @@ +#include + +int main(int argc, char **argv) { + printf("I am a program.\n"); + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/114 allgenerate/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/114 allgenerate/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/114 allgenerate/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/114 allgenerate/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,20 @@ +# Must have two languages here to exercise linker language +# selection bug +project('all sources generated', 'c', 'cpp') + +comp = find_program('converter.py') + +g = generator(comp, + output : '@BASENAME@', + arguments : ['@INPUT@', '@OUTPUT@']) + +c = g.process('foobar.cpp.in') + +prog = executable('genexe', c) + +c2 = custom_target('c2gen', + output : '@BASENAME@', + input : 'foobar.cpp.in', + command : [comp, '@INPUT@', '@OUTPUT@']) + +prog2 = executable('genexe2', c2) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/114 custom target capture/data_source.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/114 custom target capture/data_source.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/114 custom target capture/data_source.txt" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/114 custom target capture/data_source.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -This is a text only input file. diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/114 custom target capture/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/114 custom target capture/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/114 custom target capture/installed_files.txt" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/114 custom target capture/installed_files.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -usr/subdir/data.dat diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/114 custom target capture/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/114 custom target capture/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/114 custom target capture/meson.build" 2018-12-09 16:30:31.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/114 custom target capture/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -project('custom target', 'c') - -python3 = import('python3').find_python() - -# Note that this will not add a dependency to the compiler executable. -# Code will not be rebuilt if it changes. -comp = '@0@/@1@'.format(meson.current_source_dir(), 'my_compiler.py') - -mytarget = custom_target('bindat', - output : 'data.dat', - input : 'data_source.txt', - capture : true, - command : [python3, comp, '@INPUT@'], - install : true, - install_dir : 'subdir' -) - -ct_output_exists = '''import os, sys -if not os.path.exists(sys.argv[1]): - print("could not find {!r} in {!r}".format(sys.argv[1], os.getcwd())) - sys.exit(1) -''' - -test('capture-wrote', python3, args : ['-c', ct_output_exists, mytarget]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/114 custom target capture/my_compiler.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/114 custom target capture/my_compiler.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/114 custom target capture/my_compiler.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/114 custom target capture/my_compiler.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -#!/usr/bin/env python3 - -import sys - -if __name__ == '__main__': - if len(sys.argv) != 2: - print(sys.argv[0], 'input_file') - sys.exit(1) - with open(sys.argv[1]) as f: - ifile = f.read() - if ifile != 'This is a text only input file.\n': - print('Malformed input') - sys.exit(1) - print('This is a binary output file.') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/115 allgenerate/converter.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/115 allgenerate/converter.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/115 allgenerate/converter.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/115 allgenerate/converter.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -#!/usr/bin/env python3 - -import sys - -ifile = sys.argv[1] -ofile = sys.argv[2] - -open(ofile, 'w').write(open(ifile).read()) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/115 allgenerate/foobar.cpp.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/115 allgenerate/foobar.cpp.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/115 allgenerate/foobar.cpp.in" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/115 allgenerate/foobar.cpp.in" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#include - -int main(int argc, char **argv) { - printf("I am a program.\n"); - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/115 allgenerate/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/115 allgenerate/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/115 allgenerate/meson.build" 2018-12-09 16:30:33.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/115 allgenerate/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -# Must have two languages here to exercise linker language -# selection bug -project('all sources generated', 'c', 'cpp') - -comp = find_program('converter.py') - -g = generator(comp, - output : '@BASENAME@', - arguments : ['@INPUT@', '@OUTPUT@']) - -c = g.process('foobar.cpp.in') - -prog = executable('genexe', c) - -c2 = custom_target('c2gen', - output : '@BASENAME@', - input : 'foobar.cpp.in', - command : [comp, '@INPUT@', '@OUTPUT@']) - -prog2 = executable('genexe2', c2) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/115 pathjoin/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/115 pathjoin/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/115 pathjoin/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/115 pathjoin/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,24 @@ +project('pathjoin', 'c') + +# Test string-args form since that is the canonical way +assert(join_paths('foo') == 'foo', 'Single argument join is broken') +assert(join_paths('foo', 'bar') == 'foo/bar', 'Path joining is broken') +assert(join_paths('foo', 'bar', 'baz') == 'foo/bar/baz', 'Path joining is broken') +assert(join_paths('/foo', 'bar') == '/foo/bar', 'Path joining is broken') +assert(join_paths('foo', '/bar') == '/bar', 'Absolute path joining is broken') +assert(join_paths('/foo', '/bar') == '/bar', 'Absolute path joining is broken') + +# Test array form since people are using that too +assert(join_paths(['foo']) == 'foo', 'Single argument join is broken') +assert(join_paths(['foo', 'bar']) == 'foo/bar', 'Path joining is broken') +assert(join_paths(['foo', 'bar', 'baz']) == 'foo/bar/baz', 'Path joining is broken') +assert(join_paths(['/foo', 'bar']) == '/foo/bar', 'Path joining is broken') +assert(join_paths(['foo', '/bar']) == '/bar', 'Absolute path joining is broken') +assert(join_paths(['/foo', '/bar']) == '/bar', 'Absolute path joining is broken') + +# Division operator should do the same as join_paths +assert('foo' / 'bar' == 'foo/bar', 'Path division is broken') +assert('foo' /'bar' /'baz' == 'foo/bar/baz', 'Path division is broken') +assert('/foo' / 'bar' == '/foo/bar', 'Path division is broken') +assert('foo' / '/bar' == '/bar', 'Absolute path division is broken') +assert('/foo' / '/bar' == '/bar', 'Absolute path division is broken') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/116 pathjoin/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/116 pathjoin/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/116 pathjoin/meson.build" 2018-12-09 16:30:34.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/116 pathjoin/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -project('pathjoin', 'c') - -# Test string-args form since that is the canonical way -assert(join_paths('foo') == 'foo', 'Single argument join is broken') -assert(join_paths('foo', 'bar') == 'foo/bar', 'Path joining is broken') -assert(join_paths('foo', 'bar', 'baz') == 'foo/bar/baz', 'Path joining is broken') -assert(join_paths('/foo', 'bar') == '/foo/bar', 'Path joining is broken') -assert(join_paths('foo', '/bar') == '/bar', 'Absolute path joining is broken') -assert(join_paths('/foo', '/bar') == '/bar', 'Absolute path joining is broken') - -# Test array form since people are using that too -assert(join_paths(['foo']) == 'foo', 'Single argument join is broken') -assert(join_paths(['foo', 'bar']) == 'foo/bar', 'Path joining is broken') -assert(join_paths(['foo', 'bar', 'baz']) == 'foo/bar/baz', 'Path joining is broken') -assert(join_paths(['/foo', 'bar']) == '/foo/bar', 'Path joining is broken') -assert(join_paths(['foo', '/bar']) == '/bar', 'Absolute path joining is broken') -assert(join_paths(['/foo', '/bar']) == '/bar', 'Absolute path joining is broken') - -# Division operator should do the same as join_paths -assert('foo' / 'bar' == 'foo/bar', 'Path division is broken') -assert('foo' /'bar' /'baz' == 'foo/bar/baz', 'Path division is broken') -assert('/foo' / 'bar' == '/foo/bar', 'Path division is broken') -assert('foo' / '/bar' == '/bar', 'Absolute path division is broken') -assert('/foo' / '/bar' == '/bar', 'Absolute path division is broken') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/116 subdir subproject/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/116 subdir subproject/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/116 subdir subproject/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/116 subdir subproject/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +project('proj', 'c') +subdir('prog') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/116 subdir subproject/prog/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/116 subdir subproject/prog/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/116 subdir subproject/prog/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/116 subdir subproject/prog/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +subproject('sub') +libSub = dependency('sub', fallback: ['sub', 'libSub']) + +exe = executable('prog', 'prog.c', dependencies: libSub) +test('subdir subproject', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/116 subdir subproject/prog/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/116 subdir subproject/prog/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/116 subdir subproject/prog/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/116 subdir subproject/prog/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +#include + +int main() { + return sub(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/116 subdir subproject/subprojects/sub/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/116 subdir subproject/subprojects/sub/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/116 subdir subproject/subprojects/sub/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/116 subdir subproject/subprojects/sub/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +project('sub', 'c') +lib = static_library('sub', 'sub.c') +libSub = declare_dependency(include_directories: include_directories('.'), link_with: lib) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/116 subdir subproject/subprojects/sub/sub.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/116 subdir subproject/subprojects/sub/sub.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/116 subdir subproject/subprojects/sub/sub.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/116 subdir subproject/subprojects/sub/sub.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +#include "sub.h" + +int sub() { + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/116 subdir subproject/subprojects/sub/sub.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/116 subdir subproject/subprojects/sub/sub.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/116 subdir subproject/subprojects/sub/sub.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/116 subdir subproject/subprojects/sub/sub.h" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,6 @@ +#ifndef SUB_H +#define SUB_H + +int sub(); + +#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/117 interpreter copy mutable var on assignment/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/117 interpreter copy mutable var on assignment/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/117 interpreter copy mutable var on assignment/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/117 interpreter copy mutable var on assignment/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,20 @@ +project('foo', 'c') + +a = configuration_data() +a.set('HELLO', 1) + +b = a + +assert(a.has('HELLO'), 'Original config data should be set on a') +assert(b.has('HELLO'), 'Original config data should be set on copy') + +configure_file(output : 'b.h', configuration : b) + +# This should still work, as we didn't use the original above but a copy! +a.set('WORLD', 1) + +assert(a.has('WORLD'), 'New config data should have been set') +assert(not b.has('WORLD'), 'New config data set should not affect var copied earlier') + +configure_file(output : 'a.h', configuration : a) + diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/117 subdir subproject/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/117 subdir subproject/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/117 subdir subproject/meson.build" 2018-12-09 16:30:35.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/117 subdir subproject/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -project('proj', 'c') -subdir('prog') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/117 subdir subproject/prog/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/117 subdir subproject/prog/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/117 subdir subproject/prog/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/117 subdir subproject/prog/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -subproject('sub') -libSub = dependency('sub', fallback: ['sub', 'libSub']) - -exe = executable('prog', 'prog.c', dependencies: libSub) -test('subdir subproject', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/117 subdir subproject/prog/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/117 subdir subproject/prog/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/117 subdir subproject/prog/prog.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/117 subdir subproject/prog/prog.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#include - -int main() { - return sub(); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/117 subdir subproject/subprojects/sub/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/117 subdir subproject/subprojects/sub/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/117 subdir subproject/subprojects/sub/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/117 subdir subproject/subprojects/sub/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -project('sub', 'c') -lib = static_library('sub', 'sub.c') -libSub = declare_dependency(include_directories: include_directories('.'), link_with: lib) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/117 subdir subproject/subprojects/sub/sub.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/117 subdir subproject/subprojects/sub/sub.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/117 subdir subproject/subprojects/sub/sub.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/117 subdir subproject/subprojects/sub/sub.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#include "sub.h" - -int sub() { - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/117 subdir subproject/subprojects/sub/sub.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/117 subdir subproject/subprojects/sub/sub.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/117 subdir subproject/subprojects/sub/sub.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/117 subdir subproject/subprojects/sub/sub.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#ifndef SUB_H -#define SUB_H - -int sub(); - -#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/118 interpreter copy mutable var on assignment/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/118 interpreter copy mutable var on assignment/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/118 interpreter copy mutable var on assignment/meson.build" 2018-12-09 16:30:37.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/118 interpreter copy mutable var on assignment/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -project('foo', 'c') - -a = configuration_data() -a.set('HELLO', 1) - -b = a - -assert(a.has('HELLO'), 'Original config data should be set on a') -assert(b.has('HELLO'), 'Original config data should be set on copy') - -configure_file(output : 'b.h', configuration : b) - -# This should still work, as we didn't use the original above but a copy! -a.set('WORLD', 1) - -assert(a.has('WORLD'), 'New config data should have been set') -assert(not b.has('WORLD'), 'New config data set should not affect var copied earlier') - -configure_file(output : 'a.h', configuration : a) - diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/118 skip/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/118 skip/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/118 skip/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/118 skip/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,4 @@ +project('skip', 'c') + +error('MESON_SKIP_TEST this test is always skipped.') + diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/119 skip/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/119 skip/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/119 skip/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/119 skip/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -project('skip', 'c') - -error('MESON_SKIP_TEST this test is always skipped.') - diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/119 subproject project arguments/exe.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/119 subproject project arguments/exe.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/119 subproject project arguments/exe.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/119 subproject project arguments/exe.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,27 @@ +#ifndef PROJECT_OPTION +#error +#endif + +#ifndef PROJECT_OPTION_1 +#error +#endif + +#ifndef GLOBAL_ARGUMENT +#error +#endif + +#ifdef SUBPROJECT_OPTION +#error +#endif + +#ifdef OPTION_CPP +#error +#endif + +#ifndef PROJECT_OPTION_C_CPP +#error +#endif + +int main(int argc, char **argv) { + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/119 subproject project arguments/exe.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/119 subproject project arguments/exe.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/119 subproject project arguments/exe.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/119 subproject project arguments/exe.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,28 @@ +#ifdef PROJECT_OPTION +#error +#endif + +#ifdef PROJECT_OPTION_1 +#error +#endif + +#ifdef GLOBAL_ARGUMENT +#error +#endif + +#ifdef SUBPROJECT_OPTION +#error +#endif + +#ifndef PROJECT_OPTION_CPP +#error +#endif + +#ifndef PROJECT_OPTION_C_CPP +#error +#endif + +int main(int argc, char **argv) { + return 0; +} + diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/119 subproject project arguments/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/119 subproject project arguments/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/119 subproject project arguments/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/119 subproject project arguments/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,17 @@ +project('project options tester', 'c', 'cpp', + version : '2.3.4', + license : 'mylicense') + +add_global_arguments('-DGLOBAL_ARGUMENT', language: 'c') +add_project_arguments('-DPROJECT_OPTION', language: 'c') +add_project_arguments('-DPROJECT_OPTION_CPP', language: 'cpp') +add_project_arguments('-DPROJECT_OPTION_C_CPP', language: ['c', 'cpp']) + +sub = subproject('subexe', version : '1.0.0') + +add_project_arguments('-DPROJECT_OPTION_1', language: 'c') + +e = executable('exe', 'exe.c') +e = executable('execpp', 'exe.cpp') +test('exetest', e) +test('execpptest', e) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/119 subproject project arguments/subprojects/subexe/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/119 subproject project arguments/subprojects/subexe/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/119 subproject project arguments/subprojects/subexe/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/119 subproject project arguments/subprojects/subexe/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,13 @@ +project('subproject', 'c', + version : '1.0.0', + license : ['sublicense1', 'sublicense2']) + +if not meson.is_subproject() + error('Claimed to be master project even though we are a subproject.') +endif + +assert(meson.project_name() == 'subproject', 'Incorrect subproject name') + +add_project_arguments('-DSUBPROJECT_OPTION', language: 'c') +e = executable('subexe', 'subexe.c') +test('subexetest', e) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/119 subproject project arguments/subprojects/subexe/subexe.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/119 subproject project arguments/subprojects/subexe/subexe.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/119 subproject project arguments/subprojects/subexe/subexe.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/119 subproject project arguments/subprojects/subexe/subexe.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,27 @@ +#ifdef PROJECT_OPTION +#error +#endif + +#ifdef PROJECT_OPTION_1 +#error +#endif + +#ifdef PROJECT_OPTION_C_CPP +#error +#endif + +#ifndef GLOBAL_ARGUMENT +#error +#endif + +#ifndef SUBPROJECT_OPTION +#error +#endif + +#ifdef OPTION_CPP +#error +#endif + +int main(int argc, char **argv) { + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/120 subproject project arguments/exe.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/120 subproject project arguments/exe.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/120 subproject project arguments/exe.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/120 subproject project arguments/exe.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -#ifndef PROJECT_OPTION -#error -#endif - -#ifndef PROJECT_OPTION_1 -#error -#endif - -#ifndef GLOBAL_ARGUMENT -#error -#endif - -#ifdef SUBPROJECT_OPTION -#error -#endif - -#ifdef OPTION_CPP -#error -#endif - -#ifndef PROJECT_OPTION_C_CPP -#error -#endif - -int main(int argc, char **argv) { - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/120 subproject project arguments/exe.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/120 subproject project arguments/exe.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/120 subproject project arguments/exe.cpp" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/120 subproject project arguments/exe.cpp" 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -#ifdef PROJECT_OPTION -#error -#endif - -#ifdef PROJECT_OPTION_1 -#error -#endif - -#ifdef GLOBAL_ARGUMENT -#error -#endif - -#ifdef SUBPROJECT_OPTION -#error -#endif - -#ifndef PROJECT_OPTION_CPP -#error -#endif - -#ifndef PROJECT_OPTION_C_CPP -#error -#endif - -int main(int argc, char **argv) { - return 0; -} - diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/120 subproject project arguments/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/120 subproject project arguments/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/120 subproject project arguments/meson.build" 2018-12-09 16:30:38.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/120 subproject project arguments/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -project('project options tester', 'c', 'cpp', - version : '2.3.4', - license : 'mylicense') - -add_global_arguments('-DGLOBAL_ARGUMENT', language: 'c') -add_project_arguments('-DPROJECT_OPTION', language: 'c') -add_project_arguments('-DPROJECT_OPTION_CPP', language: 'cpp') -add_project_arguments('-DPROJECT_OPTION_C_CPP', language: ['c', 'cpp']) - -sub = subproject('subexe', version : '1.0.0') - -add_project_arguments('-DPROJECT_OPTION_1', language: 'c') - -e = executable('exe', 'exe.c') -e = executable('execpp', 'exe.cpp') -test('exetest', e) -test('execpptest', e) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/120 subproject project arguments/subprojects/subexe/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/120 subproject project arguments/subprojects/subexe/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/120 subproject project arguments/subprojects/subexe/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/120 subproject project arguments/subprojects/subexe/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -project('subproject', 'c', - version : '1.0.0', - license : ['sublicense1', 'sublicense2']) - -if not meson.is_subproject() - error('Claimed to be master project even though we are a subproject.') -endif - -assert(meson.project_name() == 'subproject', 'Incorrect subproject name') - -add_project_arguments('-DSUBPROJECT_OPTION', language: 'c') -e = executable('subexe', 'subexe.c') -test('subexetest', e) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/120 subproject project arguments/subprojects/subexe/subexe.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/120 subproject project arguments/subprojects/subexe/subexe.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/120 subproject project arguments/subprojects/subexe/subexe.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/120 subproject project arguments/subprojects/subexe/subexe.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -#ifdef PROJECT_OPTION -#error -#endif - -#ifdef PROJECT_OPTION_1 -#error -#endif - -#ifdef PROJECT_OPTION_C_CPP -#error -#endif - -#ifndef GLOBAL_ARGUMENT -#error -#endif - -#ifndef SUBPROJECT_OPTION -#error -#endif - -#ifdef OPTION_CPP -#error -#endif - -int main(int argc, char **argv) { - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/120 test skip/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/120 test skip/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/120 test skip/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/120 test skip/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,4 @@ +project('test skip', 'c') + +exe_test_skip = executable('test_skip', 'test_skip.c') +test('test_skip', exe_test_skip) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/120 test skip/test_skip.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/120 test skip/test_skip.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/120 test skip/test_skip.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/120 test skip/test_skip.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,3 @@ +int main(int argc, char *argv[]) { + return 77; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/121 shared module/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/121 shared module/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/121 shared module/installed_files.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/121 shared module/installed_files.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +usr/lib/modules/libnosyms?so +usr/lib/modules/libnosyms?implibempty +?msvc:usr/lib/modules/nosyms.pdb diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/121 shared module/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/121 shared module/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/121 shared module/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/121 shared module/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,22 @@ +project('shared module', 'c') + +dl = meson.get_compiler('c').find_library('dl', required : false) +l = shared_library('runtime', 'runtime.c') +# Do NOT link the module with the runtime library. This +# is a common approach for plugins that are only used +# with dlopen. Any symbols are resolved dynamically +# at runtime. This requires extra help on Windows, so +# should be avoided unless really necessary. +m = shared_module('mymodule', 'module.c') +e = executable('prog', 'prog.c', + link_with : l, export_dynamic : true, dependencies : dl) +test('import test', e, args : m) + +# Same as above, but module created with build_target() +m2 = build_target('mymodule2', 'module.c', target_type: 'shared_module') +test('import test 2', e, args : m2) + +# Shared module that does not export any symbols +shared_module('nosyms', 'nosyms.c', + install : true, + install_dir : join_paths(get_option('libdir'), 'modules')) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/121 shared module/module.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/121 shared module/module.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/121 shared module/module.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/121 shared module/module.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,96 @@ +#if defined _WIN32 || defined __CYGWIN__ + #define DLL_PUBLIC __declspec(dllexport) +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif + +#if defined(_WIN32) || defined(__CYGWIN__) + +#include + +typedef int (*fptr) (void); + +#ifdef __CYGWIN__ + +#include + +fptr find_any_f (const char *name) { + return (fptr) dlsym(RTLD_DEFAULT, name); +} +#else /* _WIN32 */ + +#include +#include + +static wchar_t* +win32_get_last_error (void) +{ + wchar_t *msg = NULL; + + FormatMessageW (FORMAT_MESSAGE_ALLOCATE_BUFFER + | FORMAT_MESSAGE_IGNORE_INSERTS + | FORMAT_MESSAGE_FROM_SYSTEM, + NULL, GetLastError (), 0, + (LPWSTR) &msg, 0, NULL); + return msg; +} + +/* Unlike Linux and OS X, when a library is loaded, all the symbols aren't + * loaded into a single namespace. You must fetch the symbol by iterating over + * all loaded modules. Code for finding the function from any of the loaded + * modules is taken from gmodule.c in glib */ +fptr find_any_f (const char *name) { + fptr f; + HANDLE snapshot; + MODULEENTRY32 me32; + + snapshot = CreateToolhelp32Snapshot (TH32CS_SNAPMODULE, 0); + if (snapshot == (HANDLE) -1) { + wchar_t *msg = win32_get_last_error (); + printf("Could not get snapshot: %S\n", msg); + return 0; + } + + me32.dwSize = sizeof (me32); + + f = NULL; + if (Module32First (snapshot, &me32)) { + do { + if ((f = (fptr) GetProcAddress (me32.hModule, name)) != NULL) + break; + } while (Module32Next (snapshot, &me32)); + } + + CloseHandle (snapshot); + return f; +} +#endif + +int DLL_PUBLIC func() { + fptr f; + + f = find_any_f ("func_from_language_runtime"); + if (f != NULL) + return f(); + printf ("Could not find function\n"); + return 1; +} + +#else +/* + * Shared modules often have references to symbols that are not defined + * at link time, but which will be provided from deps of the executable that + * dlopens it. We need to make sure that this works, i.e. that we do + * not pass -Wl,--no-undefined when linking modules. + */ +int func_from_language_runtime(); + +int DLL_PUBLIC func(void) { + return func_from_language_runtime(); +} +#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/121 shared module/nosyms.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/121 shared module/nosyms.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/121 shared module/nosyms.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/121 shared module/nosyms.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,4 @@ +static int +func_not_exported (void) { + return 99; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/121 shared module/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/121 shared module/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/121 shared module/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/121 shared module/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,102 @@ + +#include + +int func_from_language_runtime(void); +typedef int (*fptr) (void); + +#ifdef _WIN32 + +#include + +static wchar_t* +win32_get_last_error (void) +{ + wchar_t *msg = NULL; + + FormatMessageW (FORMAT_MESSAGE_ALLOCATE_BUFFER + | FORMAT_MESSAGE_IGNORE_INSERTS + | FORMAT_MESSAGE_FROM_SYSTEM, + NULL, GetLastError (), 0, + (LPWSTR) &msg, 0, NULL); + return msg; +} + +int +main (int argc, char **argv) +{ + HINSTANCE handle; + fptr importedfunc; + int expected, actual; + int ret = 1; + + handle = LoadLibraryA (argv[1]); + if (!handle) { + wchar_t *msg = win32_get_last_error (); + printf ("Could not open %s: %S\n", argv[1], msg); + goto nohandle; + } + + importedfunc = (fptr) GetProcAddress (handle, "func"); + if (importedfunc == NULL) { + wchar_t *msg = win32_get_last_error (); + printf ("Could not find 'func': %S\n", msg); + goto out; + } + + actual = importedfunc (); + expected = func_from_language_runtime (); + if (actual != expected) { + printf ("Got %i instead of %i\n", actual, expected); + goto out; + } + + ret = 0; +out: + FreeLibrary (handle); +nohandle: + return ret; +} + +#else + +#include +#include + +int main(int argc, char **argv) { + void *dl; + fptr importedfunc; + int expected, actual; + char *error; + int ret = 1; + + dlerror(); + dl = dlopen(argv[1], RTLD_LAZY); + error = dlerror(); + if(error) { + printf("Could not open %s: %s\n", argv[1], error); + goto nodl; + } + + importedfunc = (fptr) dlsym(dl, "func"); + if (importedfunc == NULL) { + printf ("Could not find 'func'\n"); + goto out; + } + + assert(importedfunc != func_from_language_runtime); + + actual = (*importedfunc)(); + expected = func_from_language_runtime (); + if (actual != expected) { + printf ("Got %i instead of %i\n", actual, expected); + goto out; + } + + ret = 0; +out: + dlclose(dl); +nodl: + return ret; +} + +#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/121 shared module/runtime.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/121 shared module/runtime.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/121 shared module/runtime.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/121 shared module/runtime.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,19 @@ +#if defined _WIN32 || defined __CYGWIN__ + #define DLL_PUBLIC __declspec(dllexport) +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif + +/* + * This file pretends to be a language runtime that supports extension + * modules. + */ + +int DLL_PUBLIC func_from_language_runtime(void) { + return 86; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/121 test skip/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/121 test skip/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/121 test skip/meson.build" 2018-12-09 16:30:38.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/121 test skip/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -project('test skip', 'c') - -exe_test_skip = executable('test_skip', 'test_skip.c') -test('test_skip', exe_test_skip) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/121 test skip/test_skip.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/121 test skip/test_skip.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/121 test skip/test_skip.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/121 test skip/test_skip.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -int main(int argc, char *argv[]) { - return 77; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/122 llvm ir and assembly/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/122 llvm ir and assembly/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/122 llvm ir and assembly/main.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/122 llvm ir and assembly/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,14 @@ +#include + +unsigned square_unsigned (unsigned a); + +int +main (int argc, char * argv[]) +{ + unsigned int ret = square_unsigned (2); + if (ret != 4) { + printf("Got %u instead of 4\n", ret); + return 1; + } + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/122 llvm ir and assembly/main.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/122 llvm ir and assembly/main.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/122 llvm ir and assembly/main.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/122 llvm ir and assembly/main.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,16 @@ +#include + +extern "C" { + unsigned square_unsigned (unsigned a); +} + +int +main (int argc, char * argv[]) +{ + unsigned int ret = square_unsigned (2); + if (ret != 4) { + printf("Got %u instead of 4\n", ret); + return 1; + } + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/122 llvm ir and assembly/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/122 llvm ir and assembly/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/122 llvm ir and assembly/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/122 llvm ir and assembly/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,63 @@ +project('llvm-ir', 'c', 'cpp') + +cpu = host_machine.cpu_family() +supported_cpus = ['arm', 'x86', 'x86_64'] + +foreach lang : ['c', 'cpp'] + cc = meson.get_compiler(lang) + cc_id = cc.get_id() + ## Build a trivial executable with mixed LLVM IR source + if cc_id == 'clang' + e = executable('square_ir_' + lang, 'square.ll', 'main.' + lang) + test('test IR square' + lang, e) + endif + ## Build a trivial executable with mixed assembly source + # This also helps test whether cc.symbols_have_underscore_prefix() is working + # properly. This is done by assembling some assembly into an object that will + # provide the unsigned_squared() symbol to main.c/cpp. This requires the + # C symbol mangling to be known in advance. + if cc.symbols_have_underscore_prefix() + uscore_args = ['-DMESON_TEST__UNDERSCORE_SYMBOL'] + message('underscore is prefixed') + else + uscore_args = [] + message('underscore is NOT prefixed') + endif + square_base = 'square-' + cpu + square_impl = square_base + '.S' + # MSVC cannot directly compile assembly files, so we pass it through the + # cl.exe pre-processor first and then assemble it with the ml.exe assembler. + # Then we can link it into the executable. + if cc.get_argument_syntax() == 'msvc' + cl = cc.cmd_array() + if cpu == 'x86' + ml = find_program('ml', required: false) + elif cpu == 'x86_64' + ml = find_program('ml64', required: false) + else + error('Unsupported cpu family: "' + cpu + '"') + endif + if not ml.found() + error('MESON_SKIP_TEST: ML (masm) not found') + endif + # Preprocess file (ml doesn't support pre-processing) + # Force the intput to be C (/Tc) because ICL otherwise assumes it's an object (.obj) file + preproc_name = lang + square_base + '.i' + square_preproc = custom_target(lang + square_impl + 'preproc', + input : square_impl, + output : preproc_name, + command : [cl, '/nologo', '/EP', '/P', '/Fi' + preproc_name, '/Tc', '@INPUT@'] + uscore_args) + # Use assembled object file instead of the original .S assembly source + square_impl = custom_target(lang + square_impl, + input : square_preproc, + output : lang + square_base + '.obj', + command : [ml, '/nologo', '/safeseh', '/Fo', '@OUTPUT@', '/c', '@INPUT@']) + endif + if supported_cpus.contains(cpu) + e = executable('square_asm_' + lang, square_impl, 'main.' + lang, + c_args : uscore_args, cpp_args : uscore_args) + test('test ASM square' + lang, e) + elif cc_id != 'clang' + error('MESON_SKIP_TEST: Unsupported cpu: "' + cpu + '", and LLVM not found') + endif +endforeach diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/122 llvm ir and assembly/square-arm.S" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/122 llvm ir and assembly/square-arm.S" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/122 llvm ir and assembly/square-arm.S" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/122 llvm ir and assembly/square-arm.S" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,12 @@ +#include "symbol-underscore.h" + +.text +.globl SYMBOL_NAME(square_unsigned) +# ifdef __linux__ +.type square_unsigned, %function +#endif + +SYMBOL_NAME(square_unsigned): + mul r1, r0, r0 + mov r0, r1 + mov pc, lr diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/122 llvm ir and assembly/square.ll" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/122 llvm ir and assembly/square.ll" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/122 llvm ir and assembly/square.ll" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/122 llvm ir and assembly/square.ll" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,4 @@ +define i32 @square_unsigned(i32 %a) { + %1 = mul i32 %a, %a + ret i32 %1 +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/122 llvm ir and assembly/square-x86_64.S" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/122 llvm ir and assembly/square-x86_64.S" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/122 llvm ir and assembly/square-x86_64.S" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/122 llvm ir and assembly/square-x86_64.S" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,37 @@ +#include "symbol-underscore.h" + +#ifdef _MSC_VER /* MSVC on Windows */ + +PUBLIC SYMBOL_NAME(square_unsigned) +_TEXT SEGMENT + +SYMBOL_NAME(square_unsigned) PROC + mov eax, ecx + imul eax, eax + ret +SYMBOL_NAME(square_unsigned) ENDP + +_TEXT ENDS +END + +#else + +.text +.globl SYMBOL_NAME(square_unsigned) +# ifdef __linux__ +.type square_unsigned, %function +#endif + +# if defined(_WIN32) || defined(__CYGWIN__) /* msabi */ +SYMBOL_NAME(square_unsigned): + imull %ecx, %ecx + movl %ecx, %eax + retq +# else /* sysvabi */ +SYMBOL_NAME(square_unsigned): + imull %edi, %edi + movl %edi, %eax + retq +# endif + +#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/122 llvm ir and assembly/square-x86.S" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/122 llvm ir and assembly/square-x86.S" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/122 llvm ir and assembly/square-x86.S" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/122 llvm ir and assembly/square-x86.S" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,36 @@ +#include "symbol-underscore.h" + +/* This sadly doesn't test the symbol underscore stuff. I can't figure out how + * to not use an automatic stdcall mechanism and do everything manually. */ +#ifdef _MSC_VER + +.386 +.MODEL FLAT, C + +PUBLIC square_unsigned +_TEXT SEGMENT + +square_unsigned PROC var1:DWORD + mov eax, var1 + imul eax, eax + ret + +square_unsigned ENDP + +_TEXT ENDS +END + +#else + +.text +.globl SYMBOL_NAME(square_unsigned) +# ifdef __linux__ +.type square_unsigned, %function +#endif + +SYMBOL_NAME(square_unsigned): + movl 4(%esp), %eax + imull %eax, %eax + retl + +#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/122 llvm ir and assembly/symbol-underscore.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/122 llvm ir and assembly/symbol-underscore.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/122 llvm ir and assembly/symbol-underscore.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/122 llvm ir and assembly/symbol-underscore.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +#if defined(MESON_TEST__UNDERSCORE_SYMBOL) +# define SYMBOL_NAME(name) _##name +#else +# define SYMBOL_NAME(name) name +#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/122 shared module/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/122 shared module/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/122 shared module/installed_files.txt" 2018-12-09 14:27:16.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/122 shared module/installed_files.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -usr/lib/modules/libnosyms?so -usr/lib/modules/libnosyms?implibempty -?msvc:usr/lib/modules/nosyms.pdb diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/122 shared module/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/122 shared module/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/122 shared module/meson.build" 2018-12-09 16:30:41.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/122 shared module/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -project('shared module', 'c') - -dl = meson.get_compiler('c').find_library('dl', required : false) -l = shared_library('runtime', 'runtime.c') -# Do NOT link the module with the runtime library. This -# is a common approach for plugins that are only used -# with dlopen. Any symbols are resolved dynamically -# at runtime. This requires extra help on Windows, so -# should be avoided unless really necessary. -m = shared_module('mymodule', 'module.c') -e = executable('prog', 'prog.c', - link_with : l, export_dynamic : true, dependencies : dl) -test('import test', e, args : m) - -# Shared module that does not export any symbols -shared_module('nosyms', 'nosyms.c', - install : true, - install_dir : join_paths(get_option('libdir'), 'modules')) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/122 shared module/module.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/122 shared module/module.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/122 shared module/module.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/122 shared module/module.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,82 +0,0 @@ -#if defined _WIN32 || defined __CYGWIN__ - #define DLL_PUBLIC __declspec(dllexport) -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif - -#if defined(_WIN32) || defined(__CYGWIN__) - -#include - -typedef int (*fptr) (void); - -#ifdef __CYGWIN__ - -#include - -fptr find_any_f (const char *name) { - return (fptr) dlsym(RTLD_DEFAULT, name); -} -#else /* _WIN32 */ - -#include -#include - -/* Unlike Linux and OS X, when a library is loaded, all the symbols aren't - * loaded into a single namespace. You must fetch the symbol by iterating over - * all loaded modules. Code for finding the function from any of the loaded - * modules is taken from gmodule.c in glib */ -fptr find_any_f (const char *name) { - fptr f; - HANDLE snapshot; - MODULEENTRY32 me32; - - snapshot = CreateToolhelp32Snapshot (TH32CS_SNAPMODULE, 0); - if (snapshot == (HANDLE) -1) { - printf("Could not get snapshot\n"); - return 0; - } - - me32.dwSize = sizeof (me32); - - f = NULL; - if (Module32First (snapshot, &me32)) { - do { - if ((f = (fptr) GetProcAddress (me32.hModule, name)) != NULL) - break; - } while (Module32Next (snapshot, &me32)); - } - - CloseHandle (snapshot); - return f; -} -#endif - -int DLL_PUBLIC func() { - fptr f; - - f = find_any_f ("func_from_language_runtime"); - if (f != NULL) - return f(); - printf ("Could not find function\n"); - return 1; -} - -#else -/* - * Shared modules often have references to symbols that are not defined - * at link time, but which will be provided from deps of the executable that - * dlopens it. We need to make sure that this works, i.e. that we do - * not pass -Wl,--no-undefined when linking modules. - */ -int func_from_language_runtime(); - -int DLL_PUBLIC func(void) { - return func_from_language_runtime(); -} -#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/122 shared module/nosyms.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/122 shared module/nosyms.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/122 shared module/nosyms.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/122 shared module/nosyms.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -static int -func_not_exported (void) { - return 99; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/122 shared module/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/122 shared module/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/122 shared module/prog.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/122 shared module/prog.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,102 +0,0 @@ - -#include - -int func_from_language_runtime(void); -typedef int (*fptr) (void); - -#ifdef _WIN32 - -#include - -wchar_t* -win32_get_last_error (void) -{ - wchar_t *msg = NULL; - - FormatMessageW (FORMAT_MESSAGE_ALLOCATE_BUFFER - | FORMAT_MESSAGE_IGNORE_INSERTS - | FORMAT_MESSAGE_FROM_SYSTEM, - NULL, GetLastError (), 0, - (LPWSTR) &msg, 0, NULL); - return msg; -} - -int -main (int argc, char **argv) -{ - HINSTANCE handle; - fptr importedfunc; - int expected, actual; - int ret = 1; - - handle = LoadLibraryA (argv[1]); - if (!handle) { - wchar_t *msg = win32_get_last_error (); - printf ("Could not open %s: %S\n", argv[1], msg); - goto nohandle; - } - - importedfunc = (fptr) GetProcAddress (handle, "func"); - if (importedfunc == NULL) { - wchar_t *msg = win32_get_last_error (); - printf ("Could not find 'func': %S\n", msg); - goto out; - } - - actual = importedfunc (); - expected = func_from_language_runtime (); - if (actual != expected) { - printf ("Got %i instead of %i\n", actual, expected); - goto out; - } - - ret = 0; -out: - FreeLibrary (handle); -nohandle: - return ret; -} - -#else - -#include -#include - -int main(int argc, char **argv) { - void *dl; - fptr importedfunc; - int expected, actual; - char *error; - int ret = 1; - - dlerror(); - dl = dlopen(argv[1], RTLD_LAZY); - error = dlerror(); - if(error) { - printf("Could not open %s: %s\n", argv[1], error); - goto nodl; - } - - importedfunc = (fptr) dlsym(dl, "func"); - if (importedfunc == NULL) { - printf ("Could not find 'func'\n"); - goto out; - } - - assert(importedfunc != func_from_language_runtime); - - actual = (*importedfunc)(); - expected = func_from_language_runtime (); - if (actual != expected) { - printf ("Got %i instead of %i\n", actual, expected); - goto out; - } - - ret = 0; -out: - dlclose(dl); -nodl: - return ret; -} - -#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/122 shared module/runtime.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/122 shared module/runtime.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/122 shared module/runtime.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/122 shared module/runtime.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -#if defined _WIN32 || defined __CYGWIN__ - #define DLL_PUBLIC __declspec(dllexport) -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif - -/* - * This file pretends to be a language runtime that supports extension - * modules. - */ - -int DLL_PUBLIC func_from_language_runtime(void) { - return 86; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/123 cpp and asm/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/123 cpp and asm/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/123 cpp and asm/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/123 cpp and asm/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,28 @@ +project('c++ and assembly test', 'cpp') + +cpp = meson.get_compiler('cpp') +cpu = host_machine.cpu_family() + +supported_cpus = ['arm', 'x86', 'x86_64'] + +if not supported_cpus.contains(cpu) + error('MESON_SKIP_TEST unsupported cpu:' + cpu) +endif + +if cpp.symbols_have_underscore_prefix() + add_project_arguments('-DMESON_TEST__UNDERSCORE_SYMBOL', language : 'cpp') +endif + +sources = ['trivial.cc'] +# If the compiler cannot compile assembly, don't use it +if not ['msvc', 'clang-cl', 'intel-cl'].contains(meson.get_compiler('cpp').get_id()) + sources += ['retval-' + cpu + '.S'] + cpp_args = ['-DUSE_ASM'] + message('Using ASM') +else + cpp_args = ['-DNO_USE_ASM'] +endif + +exe = executable('trivialprog', sources, + cpp_args : cpp_args) +test('runtest', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/123 cpp and asm/retval-arm.S" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/123 cpp and asm/retval-arm.S" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/123 cpp and asm/retval-arm.S" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/123 cpp and asm/retval-arm.S" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,11 @@ +#include "symbol-underscore.h" + +.text +.globl SYMBOL_NAME(get_retval) +# ifdef __linux__ +.type get_retval, %function +#endif + +SYMBOL_NAME(get_retval): + mov r0, #0 + mov pc, lr diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/123 cpp and asm/retval-x86_64.S" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/123 cpp and asm/retval-x86_64.S" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/123 cpp and asm/retval-x86_64.S" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/123 cpp and asm/retval-x86_64.S" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,11 @@ +#include "symbol-underscore.h" + +.text +.globl SYMBOL_NAME(get_retval) +# ifdef __linux__ +.type get_retval, %function +#endif + +SYMBOL_NAME(get_retval): + xorl %eax, %eax + retq diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/123 cpp and asm/retval-x86.S" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/123 cpp and asm/retval-x86.S" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/123 cpp and asm/retval-x86.S" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/123 cpp and asm/retval-x86.S" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,11 @@ +#include "symbol-underscore.h" + +.text +.globl SYMBOL_NAME(get_retval) +# ifdef __linux__ +.type get_retval, %function +#endif + +SYMBOL_NAME(get_retval): + xorl %eax, %eax + retl diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/123 cpp and asm/symbol-underscore.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/123 cpp and asm/symbol-underscore.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/123 cpp and asm/symbol-underscore.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/123 cpp and asm/symbol-underscore.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +#if defined(MESON_TEST__UNDERSCORE_SYMBOL) +# define SYMBOL_NAME(name) _##name +#else +# define SYMBOL_NAME(name) name +#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/123 cpp and asm/trivial.cc" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/123 cpp and asm/trivial.cc" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/123 cpp and asm/trivial.cc" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/123 cpp and asm/trivial.cc" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,16 @@ +#include + +extern "C" { + int get_retval(void); +} + +int main(int argc, char **argv) { + std::cout << "C++ seems to be working." << std::endl; +#if defined(USE_ASM) + return get_retval(); +#elif defined(NO_USE_ASM) + return 0; +#else + #error "Forgot to pass asm define" +#endif +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/123 llvm ir and assembly/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/123 llvm ir and assembly/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/123 llvm ir and assembly/main.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/123 llvm ir and assembly/main.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -#include - -unsigned square_unsigned (unsigned a); - -int -main (int argc, char * argv[]) -{ - unsigned int ret = square_unsigned (2); - if (ret != 4) { - printf("Got %u instead of 4\n", ret); - return 1; - } - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/123 llvm ir and assembly/main.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/123 llvm ir and assembly/main.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/123 llvm ir and assembly/main.cpp" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/123 llvm ir and assembly/main.cpp" 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -#include - -extern "C" { - unsigned square_unsigned (unsigned a); -} - -int -main (int argc, char * argv[]) -{ - unsigned int ret = square_unsigned (2); - if (ret != 4) { - printf("Got %u instead of 4\n", ret); - return 1; - } - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/123 llvm ir and assembly/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/123 llvm ir and assembly/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/123 llvm ir and assembly/meson.build" 2018-12-09 16:30:42.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/123 llvm ir and assembly/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,62 +0,0 @@ -project('llvm-ir', 'c', 'cpp') - -cpu = host_machine.cpu_family() -supported_cpus = ['arm', 'x86', 'x86_64'] - -foreach lang : ['c', 'cpp'] - cc = meson.get_compiler(lang) - cc_id = cc.get_id() - ## Build a trivial executable with mixed LLVM IR source - if cc_id == 'clang' - e = executable('square_ir_' + lang, 'square.ll', 'main.' + lang) - test('test IR square' + lang, e) - endif - ## Build a trivial executable with mixed assembly source - # This also helps test whether cc.symbols_have_underscore_prefix() is working - # properly. This is done by assembling some assembly into an object that will - # provide the unsigned_squared() symbol to main.c/cpp. This requires the - # C symbol mangling to be known in advance. - if cc.symbols_have_underscore_prefix() - uscore_args = ['-DMESON_TEST__UNDERSCORE_SYMBOL'] - message('underscore is prefixed') - else - uscore_args = [] - message('underscore is NOT prefixed') - endif - square_base = 'square-' + cpu - square_impl = square_base + '.S' - # MSVC cannot directly compile assembly files, so we pass it through the - # cl.exe pre-processor first and then assemble it with the ml.exe assembler. - # Then we can link it into the executable. - if cc.get_argument_syntax() == 'msvc' - cl = cc.cmd_array() - if cpu == 'x86' - ml = find_program('ml', required: false) - elif cpu == 'x86_64' - ml = find_program('ml64', required: false) - else - error('Unsupported cpu family: "' + cpu + '"') - endif - if not ml.found() - error('MESON_SKIP_TEST: ML (masm) not found') - endif - # Preprocess file (ml doesn't support pre-processing) - preproc_name = lang + square_base + '.i' - square_preproc = custom_target(lang + square_impl + 'preproc', - input : square_impl, - output : preproc_name, - command : [cl, '/EP', '/P', '/Fi' + preproc_name, '@INPUT@'] + uscore_args) - # Use assembled object file instead of the original .S assembly source - square_impl = custom_target(lang + square_impl, - input : square_preproc, - output : lang + square_base + '.obj', - command : [ml, '/safeseh', '/Fo', '@OUTPUT@', '/c', '@INPUT@']) - endif - if supported_cpus.contains(cpu) - e = executable('square_asm_' + lang, square_impl, 'main.' + lang, - c_args : uscore_args, cpp_args : uscore_args) - test('test ASM square' + lang, e) - elif cc_id != 'clang' - error('MESON_SKIP_TEST: Unsupported cpu: "' + cpu + '", and LLVM not found') - endif -endforeach diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/123 llvm ir and assembly/square-arm.S" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/123 llvm ir and assembly/square-arm.S" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/123 llvm ir and assembly/square-arm.S" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/123 llvm ir and assembly/square-arm.S" 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -#include "symbol-underscore.h" - -.text -.globl SYMBOL_NAME(square_unsigned) -# ifdef __linux__ -.type square_unsigned, %function -#endif - -SYMBOL_NAME(square_unsigned): - mul r1, r0, r0 - mov r0, r1 - mov pc, lr diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/123 llvm ir and assembly/square.ll" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/123 llvm ir and assembly/square.ll" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/123 llvm ir and assembly/square.ll" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/123 llvm ir and assembly/square.ll" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -define i32 @square_unsigned(i32 %a) { - %1 = mul i32 %a, %a - ret i32 %1 -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/123 llvm ir and assembly/square-x86_64.S" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/123 llvm ir and assembly/square-x86_64.S" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/123 llvm ir and assembly/square-x86_64.S" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/123 llvm ir and assembly/square-x86_64.S" 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -#include "symbol-underscore.h" - -#ifdef _MSC_VER /* MSVC on Windows */ - -PUBLIC SYMBOL_NAME(square_unsigned) -_TEXT SEGMENT - -SYMBOL_NAME(square_unsigned) PROC - mov eax, ecx - imul eax, eax - ret -SYMBOL_NAME(square_unsigned) ENDP - -_TEXT ENDS -END - -#else - -.text -.globl SYMBOL_NAME(square_unsigned) -# ifdef __linux__ -.type square_unsigned, %function -#endif - -# if defined(_WIN32) || defined(__CYGWIN__) /* msabi */ -SYMBOL_NAME(square_unsigned): - imull %ecx, %ecx - movl %ecx, %eax - retq -# else /* sysvabi */ -SYMBOL_NAME(square_unsigned): - imull %edi, %edi - movl %edi, %eax - retq -# endif - -#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/123 llvm ir and assembly/square-x86.S" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/123 llvm ir and assembly/square-x86.S" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/123 llvm ir and assembly/square-x86.S" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/123 llvm ir and assembly/square-x86.S" 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -#include "symbol-underscore.h" - -/* This sadly doesn't test the symbol underscore stuff. I can't figure out how - * to not use an automatic stdcall mechanism and do everything manually. */ -#ifdef _MSC_VER - -.386 -.MODEL FLAT, C - -PUBLIC square_unsigned -_TEXT SEGMENT - -square_unsigned PROC var1:DWORD - mov eax, var1 - imul eax, eax - ret - -square_unsigned ENDP - -_TEXT ENDS -END - -#else - -.text -.globl SYMBOL_NAME(square_unsigned) -# ifdef __linux__ -.type square_unsigned, %function -#endif - -SYMBOL_NAME(square_unsigned): - movl 4(%esp), %eax - imull %eax, %eax - retl - -#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/123 llvm ir and assembly/symbol-underscore.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/123 llvm ir and assembly/symbol-underscore.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/123 llvm ir and assembly/symbol-underscore.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/123 llvm ir and assembly/symbol-underscore.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#if defined(MESON_TEST__UNDERSCORE_SYMBOL) -# define SYMBOL_NAME(name) _##name -#else -# define SYMBOL_NAME(name) name -#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/124 cpp and asm/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/124 cpp and asm/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/124 cpp and asm/meson.build" 2018-12-09 16:30:42.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/124 cpp and asm/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -project('c++ and assembly test', 'cpp') - -cpp = meson.get_compiler('cpp') -cpu = host_machine.cpu_family() - -supported_cpus = ['arm', 'x86', 'x86_64'] - -if not supported_cpus.contains(cpu) - error('MESON_SKIP_TEST unsupported cpu:' + cpu) -endif - -if cpp.symbols_have_underscore_prefix() - add_project_arguments('-DMESON_TEST__UNDERSCORE_SYMBOL', language : 'cpp') -endif - -sources = ['trivial.cc'] -# If the compiler cannot compile assembly, don't use it -if not ['msvc', 'clang-cl'].contains(meson.get_compiler('cpp').get_id()) - sources += ['retval-' + cpu + '.S'] - cpp_args = ['-DUSE_ASM'] - message('Using ASM') -else - cpp_args = ['-DNO_USE_ASM'] -endif - -exe = executable('trivialprog', sources, - cpp_args : cpp_args) -test('runtest', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/124 cpp and asm/retval-arm.S" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/124 cpp and asm/retval-arm.S" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/124 cpp and asm/retval-arm.S" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/124 cpp and asm/retval-arm.S" 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -#include "symbol-underscore.h" - -.text -.globl SYMBOL_NAME(get_retval) -# ifdef __linux__ -.type get_retval, %function -#endif - -SYMBOL_NAME(get_retval): - mov r0, #0 - mov pc, lr diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/124 cpp and asm/retval-x86_64.S" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/124 cpp and asm/retval-x86_64.S" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/124 cpp and asm/retval-x86_64.S" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/124 cpp and asm/retval-x86_64.S" 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -#include "symbol-underscore.h" - -.text -.globl SYMBOL_NAME(get_retval) -# ifdef __linux__ -.type get_retval, %function -#endif - -SYMBOL_NAME(get_retval): - xorl %eax, %eax - retq diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/124 cpp and asm/retval-x86.S" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/124 cpp and asm/retval-x86.S" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/124 cpp and asm/retval-x86.S" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/124 cpp and asm/retval-x86.S" 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -#include "symbol-underscore.h" - -.text -.globl SYMBOL_NAME(get_retval) -# ifdef __linux__ -.type get_retval, %function -#endif - -SYMBOL_NAME(get_retval): - xorl %eax, %eax - retl diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/124 cpp and asm/symbol-underscore.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/124 cpp and asm/symbol-underscore.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/124 cpp and asm/symbol-underscore.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/124 cpp and asm/symbol-underscore.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#if defined(MESON_TEST__UNDERSCORE_SYMBOL) -# define SYMBOL_NAME(name) _##name -#else -# define SYMBOL_NAME(name) name -#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/124 cpp and asm/trivial.cc" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/124 cpp and asm/trivial.cc" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/124 cpp and asm/trivial.cc" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/124 cpp and asm/trivial.cc" 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -#include - -extern "C" { - int get_retval(void); -} - -int main(int argc, char **argv) { - std::cout << "C++ seems to be working." << std::endl; -#if defined(USE_ASM) - return get_retval(); -#elif defined(NO_USE_ASM) - return 0; -#else - #error "Forgot to pass asm define" -#endif -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/124 extract all shared library/extractor.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/124 extract all shared library/extractor.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/124 extract all shared library/extractor.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/124 extract all shared library/extractor.h" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,6 @@ +#pragma once + +int func1(); +int func2(); +int func3(); +int func4(); diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/124 extract all shared library/four.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/124 extract all shared library/four.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/124 extract all shared library/four.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/124 extract all shared library/four.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +#include"extractor.h" + +int func4() { + return 4; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/124 extract all shared library/func1234.def" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/124 extract all shared library/func1234.def" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/124 extract all shared library/func1234.def" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/124 extract all shared library/func1234.def" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +EXPORTS + func1 + func2 + func3 + func4 diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/124 extract all shared library/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/124 extract all shared library/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/124 extract all shared library/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/124 extract all shared library/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,10 @@ +project('extract all', 'c', 'cpp') + +a = static_library('a', 'one.c', 'two.c') +b = static_library('b', 'three.c', 'four.c') +c = shared_library('c', + objects : [a.extract_all_objects(), b.extract_all_objects()], + vs_module_defs : 'func1234.def') + +e = executable('proggie', 'prog.c', link_with : c) +test('extall', e) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/124 extract all shared library/one.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/124 extract all shared library/one.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/124 extract all shared library/one.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/124 extract all shared library/one.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +#include"extractor.h" + +int func1() { + return 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/124 extract all shared library/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/124 extract all shared library/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/124 extract all shared library/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/124 extract all shared library/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,10 @@ +#include"extractor.h" +#include + +int main(int argc, char **argv) { + if((1+2+3+4) != (func1() + func2() + func3() + func4())) { + printf("Arithmetic is fail.\n"); + return 1; + } + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/124 extract all shared library/three.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/124 extract all shared library/three.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/124 extract all shared library/three.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/124 extract all shared library/three.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +#include"extractor.h" + +int func3() { + return 3; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/124 extract all shared library/two.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/124 extract all shared library/two.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/124 extract all shared library/two.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/124 extract all shared library/two.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +#include"extractor.h" + +int func2() { + return 2; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/125 extract all shared library/extractor.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/125 extract all shared library/extractor.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/125 extract all shared library/extractor.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/125 extract all shared library/extractor.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#pragma once - -int func1(); -int func2(); -int func3(); -int func4(); diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/125 extract all shared library/four.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/125 extract all shared library/four.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/125 extract all shared library/four.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/125 extract all shared library/four.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#include"extractor.h" - -int func4() { - return 4; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/125 extract all shared library/func1234.def" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/125 extract all shared library/func1234.def" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/125 extract all shared library/func1234.def" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/125 extract all shared library/func1234.def" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -EXPORTS - func1 - func2 - func3 - func4 diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/125 extract all shared library/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/125 extract all shared library/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/125 extract all shared library/meson.build" 2018-12-09 16:30:44.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/125 extract all shared library/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -project('extract all', 'c', 'cpp') - -a = static_library('a', 'one.c', 'two.c') -b = static_library('b', 'three.c', 'four.c') -c = shared_library('c', - objects : [a.extract_all_objects(), b.extract_all_objects()], - vs_module_defs : 'func1234.def') - -e = executable('proggie', 'prog.c', link_with : c) -test('extall', e) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/125 extract all shared library/one.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/125 extract all shared library/one.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/125 extract all shared library/one.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/125 extract all shared library/one.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#include"extractor.h" - -int func1() { - return 1; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/125 extract all shared library/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/125 extract all shared library/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/125 extract all shared library/prog.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/125 extract all shared library/prog.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -#include"extractor.h" -#include - -int main(int argc, char **argv) { - if((1+2+3+4) != (func1() + func2() + func3() + func4())) { - printf("Arithmetic is fail.\n"); - return 1; - } - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/125 extract all shared library/three.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/125 extract all shared library/three.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/125 extract all shared library/three.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/125 extract all shared library/three.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#include"extractor.h" - -int func3() { - return 3; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/125 extract all shared library/two.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/125 extract all shared library/two.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/125 extract all shared library/two.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/125 extract all shared library/two.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#include"extractor.h" - -int func2() { - return 2; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/125 object only target/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/125 object only target/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/125 object only target/installed_files.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/125 object only target/installed_files.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +usr/bin/prog?exe +?msvc:usr/bin/prog.pdb diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/125 object only target/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/125 object only target/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/125 object only target/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/125 object only target/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,45 @@ +project('object generator', 'c') + +# FIXME: Note that this will not add a dependency to the compiler executable. +# Code will not be rebuilt if it changes. +comp = find_program('obj_generator.py') + +if host_machine.system() == 'windows' + ext = '.obj' +else + ext = '.o' +endif + +cc = meson.get_compiler('c').cmd_array().get(-1) + +# Generate an object file with configure_file to mimic prebuilt objects +# provided by the source tree +source1 = configure_file(input : 'source.c', + output : 'source' + ext, + command : [comp, cc, files('source.c'), + join_paths(meson.current_build_dir(), 'source' + ext)]) + +obj = static_library('obj', objects : source1) + +# Generate an object file manually. +gen = generator(comp, + output : '@BASENAME@' + ext, + arguments : [cc, '@INPUT@', '@OUTPUT@']) + +generated = gen.process(['source2.c']) + +shr = shared_library('shr', generated, + vs_module_defs : 'source2.def') + +# Generate an object file with indexed OUTPUT replacement. +gen2 = generator(comp, + output : '@BASENAME@' + ext, + arguments : [cc, '@INPUT@', '@OUTPUT0@']) +generated2 = gen2.process(['source3.c']) + +stc = static_library('stc', generated2) + +e = executable('prog', 'prog.c', link_with : [obj, shr, stc], + install : true) + +test('objgen', e) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/125 object only target/obj_generator.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/125 object only target/obj_generator.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/125 object only target/obj_generator.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/125 object only target/obj_generator.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 + +# Mimic a binary that generates an object file (e.g. windres). + +import sys, subprocess + +if __name__ == '__main__': + if len(sys.argv) != 4: + print(sys.argv[0], 'compiler input_file output_file') + sys.exit(1) + compiler = sys.argv[1] + ifile = sys.argv[2] + ofile = sys.argv[3] + if compiler.endswith('cl'): + cmd = [compiler, '/nologo', '/MDd', '/Fo' + ofile, '/c', ifile] + else: + cmd = [compiler, '-c', ifile, '-o', ofile] + sys.exit(subprocess.call(cmd)) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/125 object only target/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/125 object only target/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/125 object only target/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/125 object only target/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,7 @@ +int func1_in_obj(); +int func2_in_obj(); +int func3_in_obj(); + +int main(int argc, char **argv) { + return func1_in_obj() + func2_in_obj() + func3_in_obj(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/125 object only target/source2.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/125 object only target/source2.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/125 object only target/source2.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/125 object only target/source2.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,3 @@ +int func2_in_obj() { + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/125 object only target/source2.def" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/125 object only target/source2.def" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/125 object only target/source2.def" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/125 object only target/source2.def" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +EXPORTS + func2_in_obj diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/125 object only target/source3.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/125 object only target/source3.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/125 object only target/source3.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/125 object only target/source3.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,3 @@ +int func3_in_obj() { + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/125 object only target/source.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/125 object only target/source.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/125 object only target/source.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/125 object only target/source.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,3 @@ +int func1_in_obj() { + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/126 no buildincdir/include/header.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/126 no buildincdir/include/header.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/126 no buildincdir/include/header.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/126 no buildincdir/include/header.h" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,3 @@ +#pragma once + +int foobar(); diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/126 no buildincdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/126 no buildincdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/126 no buildincdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/126 no buildincdir/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,14 @@ +project('nobuilddir', 'c', + default_options : ['werror=true', 'buildtype=plain']) + +cc = meson.get_compiler('c') + +incwarg = '-Wmissing-include-dirs' + +if cc.has_argument(incwarg) + executable('prog', 'prog.c', + c_args : incwarg, + include_directories : include_directories('include')) +else + error('MESON_SKIP_TEST compiler does not support bad inc dir argument.') +endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/126 no buildincdir/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/126 no buildincdir/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/126 no buildincdir/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/126 no buildincdir/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +#include"header.h" + +int main(int argc, char **argv) { + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/126 object only target/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/126 object only target/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/126 object only target/installed_files.txt" 2018-10-31 09:31:57.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/126 object only target/installed_files.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -usr/bin/prog?exe -?msvc:usr/bin/prog.pdb diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/126 object only target/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/126 object only target/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/126 object only target/meson.build" 2018-12-09 16:30:45.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/126 object only target/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,45 +0,0 @@ -project('object generator', 'c') - -# FIXME: Note that this will not add a dependency to the compiler executable. -# Code will not be rebuilt if it changes. -comp = find_program('obj_generator.py') - -if host_machine.system() == 'windows' - ext = '.obj' -else - ext = '.o' -endif - -cc = meson.get_compiler('c').cmd_array().get(-1) - -# Generate an object file with configure_file to mimic prebuilt objects -# provided by the source tree -source1 = configure_file(input : 'source.c', - output : 'source' + ext, - command : [comp, cc, files('source.c'), - join_paths(meson.current_build_dir(), 'source' + ext)]) - -obj = static_library('obj', objects : source1) - -# Generate an object file manually. -gen = generator(comp, - output : '@BASENAME@' + ext, - arguments : [cc, '@INPUT@', '@OUTPUT@']) - -generated = gen.process(['source2.c']) - -shr = shared_library('shr', generated, - vs_module_defs : 'source2.def') - -# Generate an object file with indexed OUTPUT replacement. -gen2 = generator(comp, - output : '@BASENAME@' + ext, - arguments : [cc, '@INPUT@', '@OUTPUT0@']) -generated2 = gen2.process(['source3.c']) - -stc = static_library('stc', generated2) - -e = executable('prog', 'prog.c', link_with : [obj, shr, stc], - install : true) - -test('objgen', e) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/126 object only target/obj_generator.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/126 object only target/obj_generator.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/126 object only target/obj_generator.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/126 object only target/obj_generator.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -#!/usr/bin/env python3 - -# Mimic a binary that generates an object file (e.g. windres). - -import sys, subprocess - -if __name__ == '__main__': - if len(sys.argv) != 4: - print(sys.argv[0], 'compiler input_file output_file') - sys.exit(1) - compiler = sys.argv[1] - ifile = sys.argv[2] - ofile = sys.argv[3] - if compiler.endswith('cl'): - cmd = [compiler, '/nologo', '/MDd', '/Fo' + ofile, '/c', ifile] - else: - cmd = [compiler, '-c', ifile, '-o', ofile] - sys.exit(subprocess.call(cmd)) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/126 object only target/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/126 object only target/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/126 object only target/prog.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/126 object only target/prog.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -int func1_in_obj(); -int func2_in_obj(); -int func3_in_obj(); - -int main(int argc, char **argv) { - return func1_in_obj() + func2_in_obj() + func3_in_obj(); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/126 object only target/source2.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/126 object only target/source2.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/126 object only target/source2.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/126 object only target/source2.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -int func2_in_obj() { - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/126 object only target/source2.def" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/126 object only target/source2.def" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/126 object only target/source2.def" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/126 object only target/source2.def" 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -EXPORTS - func2_in_obj diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/126 object only target/source3.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/126 object only target/source3.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/126 object only target/source3.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/126 object only target/source3.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -int func3_in_obj() { - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/126 object only target/source.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/126 object only target/source.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/126 object only target/source.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/126 object only target/source.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -int func1_in_obj() { - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/127 custom target directory install/docgen.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/127 custom target directory install/docgen.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/127 custom target directory install/docgen.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/127 custom target directory install/docgen.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,12 @@ +#!/usr/bin/env python3 + +import os +import sys + +out = sys.argv[1] + +os.mkdir(out) + +for name in ('a', 'b', 'c'): + with open(os.path.join(out, name + '.html'), 'w') as f: + f.write(name) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/127 custom target directory install/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/127 custom target directory install/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/127 custom target directory install/installed_files.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/127 custom target directory install/installed_files.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +usr/share/doc/testpkgname/html/a.html +usr/share/doc/testpkgname/html/b.html +usr/share/doc/testpkgname/html/c.html diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/127 custom target directory install/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/127 custom target directory install/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/127 custom target directory install/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/127 custom target directory install/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,9 @@ +project('custom-target-dir-install', 'c') + +docgen = find_program('docgen.py') + +custom_target('docgen', + output : 'html', + command : [docgen, '@OUTPUT@'], + install : true, + install_dir : join_paths(get_option('datadir'), 'doc/testpkgname')) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/127 no buildincdir/include/header.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/127 no buildincdir/include/header.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/127 no buildincdir/include/header.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/127 no buildincdir/include/header.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -#pragma once - -int foobar(); diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/127 no buildincdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/127 no buildincdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/127 no buildincdir/meson.build" 2018-12-09 16:30:45.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/127 no buildincdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -project('nobuilddir', 'c', - default_options : ['werror=true', 'buildtype=plain']) - -cc = meson.get_compiler('c') - -incwarg = '-Wmissing-include-dirs' - -if cc.has_argument(incwarg) - executable('prog', 'prog.c', - c_args : incwarg, - include_directories : include_directories('include')) -else - error('MESON_SKIP_TEST compiler does not support bad inc dir argument.') -endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/127 no buildincdir/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/127 no buildincdir/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/127 no buildincdir/prog.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/127 no buildincdir/prog.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#include"header.h" - -int main(int argc, char **argv) { - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/128 custom target directory install/docgen.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/128 custom target directory install/docgen.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/128 custom target directory install/docgen.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/128 custom target directory install/docgen.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -#!/usr/bin/env python3 - -import os -import sys - -out = sys.argv[1] - -os.mkdir(out) - -for name in ('a', 'b', 'c'): - with open(os.path.join(out, name + '.html'), 'w') as f: - f.write(name) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/128 custom target directory install/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/128 custom target directory install/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/128 custom target directory install/installed_files.txt" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/128 custom target directory install/installed_files.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -usr/share/doc/testpkgname/html/a.html -usr/share/doc/testpkgname/html/b.html -usr/share/doc/testpkgname/html/c.html diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/128 custom target directory install/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/128 custom target directory install/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/128 custom target directory install/meson.build" 2018-12-09 16:30:45.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/128 custom target directory install/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -project('custom-target-dir-install', 'c') - -docgen = find_program('docgen.py') - -custom_target('docgen', - output : 'html', - command : [docgen, '@OUTPUT@'], - install : true, - install_dir : join_paths(get_option('datadir'), 'doc/testpkgname')) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/128 dependency file generation/main .c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/128 dependency file generation/main .c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/128 dependency file generation/main .c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/128 dependency file generation/main .c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,3 @@ +int main(int argc, char *argv[]) { + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/128 dependency file generation/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/128 dependency file generation/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/128 dependency file generation/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/128 dependency file generation/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,14 @@ +project('dep file gen', 'c') + +cc_id = meson.get_compiler('c').get_id() +cc_ver = meson.get_compiler('c').version() + +if cc_id == 'intel' or (cc_id == 'lcc' and cc_ver.version_compare('<=1.23.08')) + # ICC and LCC <= 1.23.08 do not escape spaces in paths in the dependency file, so Ninja + # (correctly) thinks that the rule has multiple outputs and errors out: + # 'depfile has multiple output paths' + error('MESON_SKIP_TEST: Skipping test because your compiler is known to generate broken dependency files') +endif + +e = executable('main file', 'main .c') +test('test it', e) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/129 configure file in generator/inc/confdata.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/129 configure file in generator/inc/confdata.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/129 configure file in generator/inc/confdata.in" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/129 configure file in generator/inc/confdata.in" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +@VALUE@ diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/129 configure file in generator/inc/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/129 configure file in generator/inc/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/129 configure file in generator/inc/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/129 configure file in generator/inc/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,6 @@ +cdata = configuration_data() +cdata.set('VALUE', '42') + +cfile = configure_file(input : 'confdata.in', +output : 'confdata', +configuration : cdata) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/129 configure file in generator/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/129 configure file in generator/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/129 configure file in generator/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/129 configure file in generator/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,4 @@ +project('conf file in generator', 'c') + +subdir('inc') +subdir('src') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/129 configure file in generator/src/gen.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/129 configure file in generator/src/gen.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/129 configure file in generator/src/gen.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/129 configure file in generator/src/gen.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 + +import sys + +ifile = sys.argv[1] +ofile = sys.argv[2] + +with open(ifile, 'r') as f: + resval = f.readline().strip() + +templ = '#define RESULT (%s)\n' +with open(ofile, 'w') as f: + f.write(templ % (resval, )) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/129 configure file in generator/src/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/129 configure file in generator/src/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/129 configure file in generator/src/main.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/129 configure file in generator/src/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,17 @@ +#include + +#include"confdata.h" +#if RESULT != 42 +#error Configuration RESULT is not defined correctly +#endif + +#undef RESULT + +#include"source.h" +#if RESULT != 23 +#error Source RESULT is not defined correctly +#endif + +int main(int argc, char **argv) { + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/129 configure file in generator/src/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/129 configure file in generator/src/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/129 configure file in generator/src/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/129 configure file in generator/src/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,7 @@ +compiler = find_program('gen.py') +gen = generator(compiler, + output: '@BASENAME@.h', + arguments : ['@INPUT@', '@OUTPUT@']) +hs = gen.process(cfile, files('source')) + +executable('proggie', 'main.c', hs) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/129 configure file in generator/src/source" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/129 configure file in generator/src/source" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/129 configure file in generator/src/source" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/129 configure file in generator/src/source" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +23 diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/129 dependency file generation/main .c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/129 dependency file generation/main .c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/129 dependency file generation/main .c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/129 dependency file generation/main .c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -int main(int argc, char *argv[]) { - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/129 dependency file generation/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/129 dependency file generation/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/129 dependency file generation/meson.build" 2018-12-09 16:30:48.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/129 dependency file generation/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -project('dep file gen', 'c') - -cc_id = meson.get_compiler('c').get_id() -cc_ver = meson.get_compiler('c').version() - -if cc_id == 'intel' or (cc_id == 'lcc' and cc_ver.version_compare('<=1.23.08')) - # ICC and LCC <= 1.23.08 do not escape spaces in paths in the dependency file, so Ninja - # (correctly) thinks that the rule has multiple outputs and errors out: - # 'depfile has multiple output paths' - error('MESON_SKIP_TEST: Skipping test because your compiler is known to generate broken dependency files') -endif - -e = executable('main file', 'main .c') -test('test it', e) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/130 configure file in generator/inc/confdata.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/130 configure file in generator/inc/confdata.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/130 configure file in generator/inc/confdata.in" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/130 configure file in generator/inc/confdata.in" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -@VALUE@ diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/130 configure file in generator/inc/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/130 configure file in generator/inc/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/130 configure file in generator/inc/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/130 configure file in generator/inc/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -cdata = configuration_data() -cdata.set('VALUE', '42') - -cfile = configure_file(input : 'confdata.in', -output : 'confdata', -configuration : cdata) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/130 configure file in generator/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/130 configure file in generator/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/130 configure file in generator/meson.build" 2018-12-09 16:30:48.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/130 configure file in generator/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -project('conf file in generator', 'c') - -subdir('inc') -subdir('src') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/130 configure file in generator/src/gen.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/130 configure file in generator/src/gen.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/130 configure file in generator/src/gen.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/130 configure file in generator/src/gen.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -#!/usr/bin/env python3 - -import sys - -ifile = sys.argv[1] -ofile = sys.argv[2] - -with open(ifile, 'r') as f: - resval = f.readline().strip() - -templ = '#define RESULT (%s)\n' -with open(ofile, 'w') as f: - f.write(templ % (resval, )) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/130 configure file in generator/src/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/130 configure file in generator/src/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/130 configure file in generator/src/main.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/130 configure file in generator/src/main.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -#include - -#include"confdata.h" -#if RESULT != 42 -#error Configuration RESULT is not defined correctly -#endif - -#undef RESULT - -#include"source.h" -#if RESULT != 23 -#error Source RESULT is not defined correctly -#endif - -int main(int argc, char **argv) { - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/130 configure file in generator/src/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/130 configure file in generator/src/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/130 configure file in generator/src/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/130 configure file in generator/src/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -compiler = find_program('gen.py') -gen = generator(compiler, - output: '@BASENAME@.h', - arguments : ['@INPUT@', '@OUTPUT@']) -hs = gen.process(cfile, files('source')) - -executable('proggie', 'main.c', hs) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/130 configure file in generator/src/source" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/130 configure file in generator/src/source" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/130 configure file in generator/src/source" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/130 configure file in generator/src/source" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -23 diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/130 generated llvm ir/copyfile.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/130 generated llvm ir/copyfile.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/130 generated llvm ir/copyfile.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/130 generated llvm ir/copyfile.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,6 @@ +#!/usr/bin/env python3 + +import sys +import shutil + +shutil.copyfile(sys.argv[1], sys.argv[2]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/130 generated llvm ir/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/130 generated llvm ir/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/130 generated llvm ir/main.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/130 generated llvm ir/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,14 @@ +#include + +unsigned square_unsigned (unsigned a); + +int +main (int argc, char * argv[]) +{ + unsigned int ret = square_unsigned (2); + if (ret != 4) { + printf("Got %u instead of 4\n", ret); + return 1; + } + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/130 generated llvm ir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/130 generated llvm ir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/130 generated llvm ir/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/130 generated llvm ir/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,24 @@ +project('generated llvm ir', 'c') + +if meson.get_compiler('c').get_id() != 'clang' + error('MESON_SKIP_TEST: LLVM IR files can only be built with clang') +endif + +copy = find_program('copyfile.py') + +copygen = generator(copy, + arguments : ['@INPUT@', '@OUTPUT@'], + output : '@BASENAME@') + +l = shared_library('square-gen', copygen.process('square.ll.in')) + +test('square-gen-test', executable('square-gen-test', 'main.c', link_with : l)) + +copyct = custom_target('square', + input : 'square.ll.in', + output : 'square.ll', + command : [copy, '@INPUT@', '@OUTPUT@']) + +l = shared_library('square-ct', copyct) + +test('square-ct-test', executable('square-ct-test', 'main.c', link_with : l)) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/130 generated llvm ir/square.ll.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/130 generated llvm ir/square.ll.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/130 generated llvm ir/square.ll.in" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/130 generated llvm ir/square.ll.in" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,4 @@ +define i32 @square_unsigned(i32 %a) { + %1 = mul i32 %a, %a + ret i32 %1 +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/131 generated assembly/copyfile.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/131 generated assembly/copyfile.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/131 generated assembly/copyfile.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/131 generated assembly/copyfile.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,6 @@ +#!/usr/bin/env python3 + +import sys +import shutil + +shutil.copyfile(sys.argv[1], sys.argv[2]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/131 generated assembly/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/131 generated assembly/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/131 generated assembly/main.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/131 generated assembly/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,17 @@ +#include + +#if defined(_WIN32) || defined(__CYGWIN__) + __declspec(dllimport) +#endif +unsigned square_unsigned (unsigned a); + +int +main (int argc, char * argv[]) +{ + unsigned int ret = square_unsigned (2); + if (ret != 4) { + printf("Got %u instead of 4\n", ret); + return 1; + } + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/131 generated assembly/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/131 generated assembly/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/131 generated assembly/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/131 generated assembly/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,39 @@ +project('generated assembly', 'c') + +cc = meson.get_compiler('c') + +if ['msvc', 'clang-cl', 'intel-cl'].contains(cc.get_id()) + error('MESON_SKIP_TEST: assembly files cannot be compiled directly by the compiler') +endif + +cpu = host_machine.cpu_family() +supported_cpus = ['arm', 'x86', 'x86_64'] + +if not supported_cpus.contains(cpu) + error('MESON_SKIP_TEST: unsupported cpu family: ' + cpu) +endif + +if cc.symbols_have_underscore_prefix() + add_project_arguments('-DMESON_TEST__UNDERSCORE_SYMBOL', language : 'c') +endif + +copy = find_program('copyfile.py') +output = 'square-@0@.S'.format(cpu) +input = output + '.in' + +copygen = generator(copy, + arguments : ['@INPUT@', '@OUTPUT@'], + output : '@BASENAME@') + +l = shared_library('square-gen', copygen.process(input)) + +test('square-gen-test', executable('square-gen-test', 'main.c', link_with : l)) + +copyct = custom_target('square', + input : input, + output : output, + command : [copy, '@INPUT@', '@OUTPUT@']) + +l = shared_library('square-ct', copyct) + +test('square-ct-test', executable('square-ct-test', 'main.c', link_with : l)) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/131 generated assembly/square-arm.S.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/131 generated assembly/square-arm.S.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/131 generated assembly/square-arm.S.in" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/131 generated assembly/square-arm.S.in" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,13 @@ +#include "symbol-underscore.h" + +.text +.globl SYMBOL_NAME(square_unsigned) +/* Only supported with GAS */ +# if defined(__linux__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) +.type square_unsigned,%function +#endif + +SYMBOL_NAME(square_unsigned): + mul r1, r0, r0 + mov r0, r1 + mov pc, lr diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/131 generated assembly/square-x86_64.S.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/131 generated assembly/square-x86_64.S.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/131 generated assembly/square-x86_64.S.in" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/131 generated assembly/square-x86_64.S.in" 2019-09-16 21:20:45.000000000 +0000 @@ -0,0 +1,38 @@ +#include "symbol-underscore.h" + +#ifdef _MSC_VER /* MSVC on Windows */ + +PUBLIC SYMBOL_NAME(square_unsigned) +_TEXT SEGMENT + +SYMBOL_NAME(square_unsigned) PROC + mov eax, ecx + imul eax, eax + ret +SYMBOL_NAME(square_unsigned) ENDP + +_TEXT ENDS +END + +#else + +.text +.globl SYMBOL_NAME(square_unsigned) +/* Only supported with GAS */ +# if defined(__linux__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__sun) +.type square_unsigned,@function +# endif + +# if defined(_WIN32) || defined(__CYGWIN__) /* msabi */ +SYMBOL_NAME(square_unsigned): + imull %ecx, %ecx + movl %ecx, %eax + retq +# else /* sysvabi */ +SYMBOL_NAME(square_unsigned): + imull %edi, %edi + movl %edi, %eax + retq +# endif + +#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/131 generated assembly/square-x86.S.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/131 generated assembly/square-x86.S.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/131 generated assembly/square-x86.S.in" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/131 generated assembly/square-x86.S.in" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,34 @@ +#include "symbol-underscore.h" + +#ifdef _MSC_VER + +.386 +.MODEL FLAT, C + +PUBLIC square_unsigned +_TEXT SEGMENT + +square_unsigned PROC var1:DWORD + mov eax, var1 + imul eax, eax + ret +square_unsigned ENDP + +_TEXT ENDS +END + +#else + +.text +.globl SYMBOL_NAME(square_unsigned) +/* Only supported with GAS */ +# if defined(__linux__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) +.type square_unsigned,@function +# endif + +SYMBOL_NAME(square_unsigned): + movl 4(%esp), %eax + imull %eax, %eax + retl + +#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/131 generated assembly/symbol-underscore.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/131 generated assembly/symbol-underscore.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/131 generated assembly/symbol-underscore.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/131 generated assembly/symbol-underscore.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +#if defined(MESON_TEST__UNDERSCORE_SYMBOL) +# define SYMBOL_NAME(name) _##name +#else +# define SYMBOL_NAME(name) name +#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/131 generated llvm ir/copyfile.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/131 generated llvm ir/copyfile.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/131 generated llvm ir/copyfile.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/131 generated llvm ir/copyfile.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#!/usr/bin/env python3 - -import sys -import shutil - -shutil.copyfile(sys.argv[1], sys.argv[2]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/131 generated llvm ir/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/131 generated llvm ir/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/131 generated llvm ir/main.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/131 generated llvm ir/main.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -#include - -unsigned square_unsigned (unsigned a); - -int -main (int argc, char * argv[]) -{ - unsigned int ret = square_unsigned (2); - if (ret != 4) { - printf("Got %u instead of 4\n", ret); - return 1; - } - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/131 generated llvm ir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/131 generated llvm ir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/131 generated llvm ir/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/131 generated llvm ir/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -project('generated llvm ir', 'c') - -if meson.get_compiler('c').get_id() != 'clang' - error('MESON_SKIP_TEST: LLVM IR files can only be built with clang') -endif - -copy = find_program('copyfile.py') - -copygen = generator(copy, - arguments : ['@INPUT@', '@OUTPUT@'], - output : '@BASENAME@') - -l = shared_library('square-gen', copygen.process('square.ll.in')) - -test('square-gen-test', executable('square-gen-test', 'main.c', link_with : l)) - -copyct = custom_target('square', - input : 'square.ll.in', - output : 'square.ll', - command : [copy, '@INPUT@', '@OUTPUT@']) - -l = shared_library('square-ct', copyct) - -test('square-ct-test', executable('square-ct-test', 'main.c', link_with : l)) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/131 generated llvm ir/square.ll.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/131 generated llvm ir/square.ll.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/131 generated llvm ir/square.ll.in" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/131 generated llvm ir/square.ll.in" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -define i32 @square_unsigned(i32 %a) { - %1 = mul i32 %a, %a - ret i32 %1 -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/132 build by default targets in tests/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/132 build by default targets in tests/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/132 build by default targets in tests/main.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/132 build by default targets in tests/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,3 @@ +int main (int argc, char *argv[]) { + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/132 build by default targets in tests/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/132 build by default targets in tests/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/132 build by default targets in tests/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/132 build by default targets in tests/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,23 @@ +project('unit-test', 'c', version : '1.0') + +write_file = find_program('write_file.py') + +# A test that consumes and verifies the output generated by a custom target. +# Should work even if target is not built by default. Makes sure that foo.out +# is actually created before the test command that uses foo_out is run. +foo_out = custom_target('foo.out', + output : 'foo.out', + command : [write_file, '@OUTPUT@']) + +# Also verify that a build_by_default : false BuildTarget added to a test is +# built before the test is run. +exe_out = executable('out', 'main.c', build_by_default : false) + +py_file_exists = '''import os, sys +if not os.path.exists(sys.argv[1]) or not os.path.exists(sys.argv[2]): + print("could not find {!r} or {!r} in {!r}" + "".format(sys.argv[1], sys.argv[2], os.getcwd())) + sys.exit(1)''' + +python = import('python3').find_python() +test('output-check', python, args : ['-c', py_file_exists, foo_out, exe_out]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/132 build by default targets in tests/write_file.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/132 build by default targets in tests/write_file.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/132 build by default targets in tests/write_file.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/132 build by default targets in tests/write_file.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,6 @@ +#!/usr/bin/env python3 + +import sys + +with open(sys.argv[1], 'w') as f: + f.write('Test') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/132 generated assembly/copyfile.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/132 generated assembly/copyfile.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/132 generated assembly/copyfile.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/132 generated assembly/copyfile.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#!/usr/bin/env python3 - -import sys -import shutil - -shutil.copyfile(sys.argv[1], sys.argv[2]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/132 generated assembly/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/132 generated assembly/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/132 generated assembly/main.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/132 generated assembly/main.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -#include - -#if defined(_WIN32) || defined(__CYGWIN__) - __declspec(dllimport) -#endif -unsigned square_unsigned (unsigned a); - -int -main (int argc, char * argv[]) -{ - unsigned int ret = square_unsigned (2); - if (ret != 4) { - printf("Got %u instead of 4\n", ret); - return 1; - } - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/132 generated assembly/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/132 generated assembly/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/132 generated assembly/meson.build" 2018-12-09 16:30:51.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/132 generated assembly/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -project('generated assembly', 'c') - -cc = meson.get_compiler('c') - -if ['msvc', 'clang-cl'].contains(cc.get_id()) - error('MESON_SKIP_TEST: assembly files cannot be compiled directly by the compiler') -endif - -cpu = host_machine.cpu_family() -supported_cpus = ['arm', 'x86', 'x86_64'] - -if not supported_cpus.contains(cpu) - error('MESON_SKIP_TEST: unsupported cpu family: ' + cpu) -endif - -if cc.symbols_have_underscore_prefix() - add_project_arguments('-DMESON_TEST__UNDERSCORE_SYMBOL', language : 'c') -endif - -copy = find_program('copyfile.py') -output = 'square-@0@.S'.format(cpu) -input = output + '.in' - -copygen = generator(copy, - arguments : ['@INPUT@', '@OUTPUT@'], - output : '@BASENAME@') - -l = shared_library('square-gen', copygen.process(input)) - -test('square-gen-test', executable('square-gen-test', 'main.c', link_with : l)) - -copyct = custom_target('square', - input : input, - output : output, - command : [copy, '@INPUT@', '@OUTPUT@']) - -l = shared_library('square-ct', copyct) - -test('square-ct-test', executable('square-ct-test', 'main.c', link_with : l)) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/132 generated assembly/square-arm.S.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/132 generated assembly/square-arm.S.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/132 generated assembly/square-arm.S.in" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/132 generated assembly/square-arm.S.in" 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -#include "symbol-underscore.h" - -.text -.globl SYMBOL_NAME(square_unsigned) -/* Only supported with GAS */ -# if defined(__linux__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) -.type square_unsigned,%function -#endif - -SYMBOL_NAME(square_unsigned): - mul r1, r0, r0 - mov r0, r1 - mov pc, lr diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/132 generated assembly/square-x86_64.S.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/132 generated assembly/square-x86_64.S.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/132 generated assembly/square-x86_64.S.in" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/132 generated assembly/square-x86_64.S.in" 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -#include "symbol-underscore.h" - -#ifdef _MSC_VER /* MSVC on Windows */ - -PUBLIC SYMBOL_NAME(square_unsigned) -_TEXT SEGMENT - -SYMBOL_NAME(square_unsigned) PROC - mov eax, ecx - imul eax, eax - ret -SYMBOL_NAME(square_unsigned) ENDP - -_TEXT ENDS -END - -#else - -.text -.globl SYMBOL_NAME(square_unsigned) -/* Only supported with GAS */ -# if defined(__linux__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) -.type square_unsigned,@function -# endif - -# if defined(_WIN32) || defined(__CYGWIN__) /* msabi */ -SYMBOL_NAME(square_unsigned): - imull %ecx, %ecx - movl %ecx, %eax - retq -# else /* sysvabi */ -SYMBOL_NAME(square_unsigned): - imull %edi, %edi - movl %edi, %eax - retq -# endif - -#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/132 generated assembly/square-x86.S.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/132 generated assembly/square-x86.S.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/132 generated assembly/square-x86.S.in" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/132 generated assembly/square-x86.S.in" 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -#include "symbol-underscore.h" - -#ifdef _MSC_VER - -.386 -.MODEL FLAT, C - -PUBLIC square_unsigned -_TEXT SEGMENT - -square_unsigned PROC var1:DWORD - mov eax, var1 - imul eax, eax - ret -square_unsigned ENDP - -_TEXT ENDS -END - -#else - -.text -.globl SYMBOL_NAME(square_unsigned) -/* Only supported with GAS */ -# if defined(__linux__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) -.type square_unsigned,@function -# endif - -SYMBOL_NAME(square_unsigned): - movl 4(%esp), %eax - imull %eax, %eax - retl - -#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/132 generated assembly/symbol-underscore.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/132 generated assembly/symbol-underscore.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/132 generated assembly/symbol-underscore.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/132 generated assembly/symbol-underscore.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#if defined(MESON_TEST__UNDERSCORE_SYMBOL) -# define SYMBOL_NAME(name) _##name -#else -# define SYMBOL_NAME(name) name -#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/133 build by default/checkexists.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/133 build by default/checkexists.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/133 build by default/checkexists.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/133 build by default/checkexists.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,10 @@ +#!/usr/bin/env python3 + +import os.path, sys + +invert = False +for path in sys.argv[1:]: + if path == '--not': + invert = True + elif not os.path.exists(path) ^ invert: + sys.exit(1) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/133 build by default/foo.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/133 build by default/foo.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/133 build by default/foo.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/133 build by default/foo.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,6 @@ +#include + +int main(int argc, char **argv) { + printf("Existentialism.\n"); + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/133 build by default/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/133 build by default/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/133 build by default/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/133 build by default/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,45 @@ +project('build on all', 'c') + +py3_mod = import('python3') +py3 = py3_mod.find_python() + +executable('fooprog', 'foo.c', + build_by_default : false, +) + +executable('barprog', 'foo.c', + build_by_default : false, + build_always : true, +) + +comp = files('mygen.py') +checkexists = files('checkexists.py') + +mytarget = custom_target('gendat1', + output : 'generated1.dat', + input : 'source.txt', + command : [py3] + comp + ['@INPUT@', '@OUTPUT@'], + build_by_default : true, +) + +mytarget = custom_target('gendat2', + output : 'generated2.dat', + input : 'source.txt', + command : [py3] + comp + ['@INPUT@', '@OUTPUT@'], + build_by_default : true, + build_always : false, +) + +ct1_output = join_paths(meson.build_root(), 'generated1.dat') +ct2_output = join_paths(meson.build_root(), 'generated2.dat') +exe1_output = join_paths(meson.build_root(), 'fooprog') +exe2_output = join_paths(meson.build_root(), 'barprog') + +if host_machine.system() == 'windows' + exe1_output += '.exe' + exe2_output += '.exe' +endif + +test('check-build-by-default', py3, + args : [checkexists, + ct1_output, ct2_output, '--not', exe1_output, exe2_output]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/133 build by default/mygen.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/133 build by default/mygen.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/133 build by default/mygen.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/133 build by default/mygen.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,8 @@ +#!/usr/bin/env python3 + +import sys + +ifile = open(sys.argv[1]) +ofile = open(sys.argv[2], 'w') + +ofile.write(ifile.read()) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/133 build by default/source.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/133 build by default/source.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/133 build by default/source.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/133 build by default/source.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +I am a bunch of text. diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/133 build by default targets in tests/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/133 build by default targets in tests/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/133 build by default targets in tests/main.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/133 build by default targets in tests/main.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -int main (int argc, char *argv[]) { - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/133 build by default targets in tests/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/133 build by default targets in tests/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/133 build by default targets in tests/meson.build" 2018-12-09 16:30:50.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/133 build by default targets in tests/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -project('unit-test', 'c', version : '1.0') - -write_file = find_program('write_file.py') - -# A test that consumes and verifies the output generated by a custom target. -# Should work even if target is not built by default. Makes sure that foo.out -# is actually created before the test command that uses foo_out is run. -foo_out = custom_target('foo.out', - output : 'foo.out', - command : [write_file, '@OUTPUT@']) - -# Also verify that a build_by_default : false BuildTarget added to a test is -# built before the test is run. -exe_out = executable('out', 'main.c', build_by_default : false) - -py_file_exists = '''import os, sys -if not os.path.exists(sys.argv[1]) or not os.path.exists(sys.argv[2]): - print("could not find {!r} or {!r} in {!r}" - "".format(sys.argv[1], sys.argv[2], os.getcwd())) - sys.exit(1)''' - -python = import('python3').find_python() -test('output-check', python, args : ['-c', py_file_exists, foo_out, exe_out]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/133 build by default targets in tests/write_file.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/133 build by default targets in tests/write_file.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/133 build by default targets in tests/write_file.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/133 build by default targets in tests/write_file.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#!/usr/bin/env python3 - -import sys - -with open(sys.argv[1], 'w') as f: - f.write('Test') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 build by default/checkexists.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 build by default/checkexists.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 build by default/checkexists.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 build by default/checkexists.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -#!/usr/bin/env python3 - -import os.path, sys - -invert = False -for path in sys.argv[1:]: - if path == '--not': - invert = True - elif not os.path.exists(path) ^ invert: - sys.exit(1) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 build by default/foo.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 build by default/foo.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 build by default/foo.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 build by default/foo.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#include - -int main(int argc, char **argv) { - printf("Existentialism.\n"); - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 build by default/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 build by default/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 build by default/meson.build" 2018-12-09 16:30:53.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 build by default/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,45 +0,0 @@ -project('build on all', 'c') - -py3_mod = import('python3') -py3 = py3_mod.find_python() - -executable('fooprog', 'foo.c', - build_by_default : false, -) - -executable('barprog', 'foo.c', - build_by_default : false, - build_always : true, -) - -comp = files('mygen.py') -checkexists = files('checkexists.py') - -mytarget = custom_target('gendat1', - output : 'generated1.dat', - input : 'source.txt', - command : [py3] + comp + ['@INPUT@', '@OUTPUT@'], - build_by_default : true, -) - -mytarget = custom_target('gendat2', - output : 'generated2.dat', - input : 'source.txt', - command : [py3] + comp + ['@INPUT@', '@OUTPUT@'], - build_by_default : true, - build_always : false, -) - -ct1_output = join_paths(meson.build_root(), 'generated1.dat') -ct2_output = join_paths(meson.build_root(), 'generated2.dat') -exe1_output = join_paths(meson.build_root(), 'fooprog') -exe2_output = join_paths(meson.build_root(), 'barprog') - -if host_machine.system() == 'windows' - exe1_output += '.exe' - exe2_output += '.exe' -endif - -test('check-build-by-default', py3, - args : [checkexists, - ct1_output, ct2_output, '--not', exe1_output, exe2_output]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 build by default/mygen.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 build by default/mygen.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 build by default/mygen.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 build by default/mygen.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -#!/usr/bin/env python3 - -import sys - -ifile = open(sys.argv[1]) -ofile = open(sys.argv[2], 'w') - -ofile.write(ifile.read()) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 build by default/source.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 build by default/source.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 build by default/source.txt" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 build by default/source.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -I am a bunch of text. diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 include order/ctsub/copyfile.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 include order/ctsub/copyfile.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 include order/ctsub/copyfile.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 include order/ctsub/copyfile.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,6 @@ +#!/usr/bin/env python3 + +import sys +import shutil + +shutil.copyfile(sys.argv[1], sys.argv[2]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 include order/ctsub/main.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 include order/ctsub/main.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 include order/ctsub/main.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 include order/ctsub/main.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +#error "ctsub/main.h included" diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 include order/ctsub/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 include order/ctsub/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 include order/ctsub/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 include order/ctsub/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,9 @@ +# https://github.com/mesonbuild/meson/pull/2291 +copy = find_program('copyfile.py') +configure_file(input : 'main.h', + output : 'main.h', + command : [copy, '@INPUT@', '@OUTPUT@']) +ctfile = custom_target('emptyfile', + input : 'emptyfile.c', + output : 'emptyfile.c', + command : [copy, '@INPUT@', '@OUTPUT@']) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 include order/inc1/hdr.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 include order/inc1/hdr.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 include order/inc1/hdr.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 include order/inc1/hdr.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +#define SOME_DEFINE 42 diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 include order/inc2/hdr.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 include order/inc2/hdr.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 include order/inc2/hdr.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 include order/inc2/hdr.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +#undef SOME_DEFINE diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 include order/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 include order/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 include order/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 include order/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,36 @@ +project('include order', 'c') + +# Test that the order of priority of include paths (from first to last) is: +# +# 1. Target's current build directory +# 2. Target's current source directory +# 3. Include paths added with the `c_args:` kwarg +# 4. Include paths added with the `include_directories`: kwarg +# Within this, the build dir takes precedence over the source dir +# 5. Include paths added via `include_directories:` of internal deps +# Within this, the build dir takes precedence over the source dir + +# Custom target dir with a built header +subdir('ctsub') +# Defines an internal dep +subdir('sub1') +# Defines a per-target include path +subdir('sub2') +# Directory for `c_args:` include path +subdir('sub3') +# The directory where the target resides +subdir('sub4') + +# Test that the order in which internal dependencies are specified is +# preserved. This is needed especially when subprojects get involved and +# multiple build-root config.h files exist, and we must be sure that the +# correct one is found: https://github.com/mesonbuild/meson/issues/1495 +f = executable('somefxe', 'sub4/main.c', + dependencies : [correctinc, dep, wronginc]) + +test('eh', e) +test('oh', f) + +# Test that the order in include_directories() is maintained +incs = include_directories('inc1', 'inc2') +executable('ordertest', 'ordertest.c', include_directories: incs) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 include order/ordertest.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 include order/ordertest.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 include order/ordertest.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 include order/ordertest.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,11 @@ +#include "hdr.h" + +#if !defined(SOME_DEFINE) || SOME_DEFINE != 42 +#error "Should have picked up hdr.h from inc1/hdr.h" +#endif + +int +main (int c, char ** argv) +{ + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 include order/sub1/main.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 include order/sub1/main.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 include order/sub1/main.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 include order/sub1/main.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +#error "sub1/main.h included" diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 include order/sub1/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 include order/sub1/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 include order/sub1/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 include order/sub1/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,4 @@ +i = include_directories('.') +l = shared_library('somelib', 'some.c') +dep = declare_dependency(link_with : l, + include_directories : i) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 include order/sub1/some.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 include order/sub1/some.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 include order/sub1/some.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 include order/sub1/some.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,6 @@ +#if defined _WIN32 || defined __CYGWIN__ + __declspec(dllexport) +#endif +int somefunc(void) { + return 1984; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 include order/sub1/some.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 include order/sub1/some.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 include order/sub1/some.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 include order/sub1/some.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,10 @@ +#pragma once + +#if defined _WIN32 || defined __CYGWIN__ + #define DLL_PUBLIC __declspec(dllimport) +#else + #define DLL_PUBLIC +#endif + +DLL_PUBLIC +int somefunc(void); diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 include order/sub2/main.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 include order/sub2/main.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 include order/sub2/main.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 include order/sub2/main.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +#error "sub2/main.h included" diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 include order/sub2/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 include order/sub2/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 include order/sub2/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 include order/sub2/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +j = include_directories('.') +wronginc = declare_dependency(include_directories : j) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 include order/sub3/main.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 include order/sub3/main.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 include order/sub3/main.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 include order/sub3/main.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +#error "sub3/main.h included" diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 include order/sub3/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 include order/sub3/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 include order/sub3/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 include order/sub3/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +sub3 = meson.current_source_dir() diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 include order/sub4/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 include order/sub4/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 include order/sub4/main.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 include order/sub4/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,8 @@ +/* Use the <> include notation to force searching in include directories */ +#include + +int main(int argc, char *argv[]) { + if (somefunc() == 1984) + return 0; + return 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 include order/sub4/main.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 include order/sub4/main.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 include order/sub4/main.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 include order/sub4/main.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +#pragma once + +#include "some.h" diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 include order/sub4/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 include order/sub4/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/134 include order/sub4/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/134 include order/sub4/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,6 @@ +e = executable('someexe', 'main.c', ctfile, + c_args : ['-I' + sub3], + include_directories : j, + dependencies : dep) + +correctinc = declare_dependency(include_directories : include_directories('.')) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 include order/ctsub/copyfile.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 include order/ctsub/copyfile.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 include order/ctsub/copyfile.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 include order/ctsub/copyfile.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#!/usr/bin/env python3 - -import sys -import shutil - -shutil.copyfile(sys.argv[1], sys.argv[2]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 include order/ctsub/main.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 include order/ctsub/main.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 include order/ctsub/main.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 include order/ctsub/main.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#error "ctsub/main.h included" diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 include order/ctsub/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 include order/ctsub/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 include order/ctsub/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 include order/ctsub/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -# https://github.com/mesonbuild/meson/pull/2291 -copy = find_program('copyfile.py') -configure_file(input : 'main.h', - output : 'main.h', - command : [copy, '@INPUT@', '@OUTPUT@']) -ctfile = custom_target('emptyfile', - input : 'emptyfile.c', - output : 'emptyfile.c', - command : [copy, '@INPUT@', '@OUTPUT@']) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 include order/inc1/hdr.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 include order/inc1/hdr.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 include order/inc1/hdr.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 include order/inc1/hdr.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#define SOME_DEFINE 42 diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 include order/inc2/hdr.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 include order/inc2/hdr.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 include order/inc2/hdr.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 include order/inc2/hdr.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#undef SOME_DEFINE diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 include order/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 include order/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 include order/meson.build" 2018-12-09 16:30:54.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 include order/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -project('include order', 'c') - -# Test that the order of priority of include paths (from first to last) is: -# -# 1. Target's current build directory -# 2. Target's current source directory -# 3. Include paths added with the `c_args:` kwarg -# 4. Include paths added with the `include_directories`: kwarg -# Within this, the build dir takes precedence over the source dir -# 5. Include paths added via `include_directories:` of internal deps -# Within this, the build dir takes precedence over the source dir - -# Custom target dir with a built header -subdir('ctsub') -# Defines an internal dep -subdir('sub1') -# Defines a per-target include path -subdir('sub2') -# Directory for `c_args:` include path -subdir('sub3') -# The directory where the target resides -subdir('sub4') - -# Test that the order in which internal dependencies are specified is -# preserved. This is needed especially when subprojects get involved and -# multiple build-root config.h files exist, and we must be sure that the -# correct one is found: https://github.com/mesonbuild/meson/issues/1495 -f = executable('somefxe', 'sub4/main.c', - dependencies : [correctinc, dep, wronginc]) - -test('eh', e) -test('oh', f) - -# Test that the order in include_directories() is maintained -incs = include_directories('inc1', 'inc2') -executable('ordertest', 'ordertest.c', include_directories: incs) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 include order/ordertest.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 include order/ordertest.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 include order/ordertest.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 include order/ordertest.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -#include "hdr.h" - -#if !defined(SOME_DEFINE) || SOME_DEFINE != 42 -#error "Should have picked up hdr.h from inc1/hdr.h" -#endif - -int -main (int c, char ** argv) -{ - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 include order/sub1/main.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 include order/sub1/main.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 include order/sub1/main.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 include order/sub1/main.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#error "sub1/main.h included" diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 include order/sub1/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 include order/sub1/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 include order/sub1/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 include order/sub1/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -i = include_directories('.') -l = shared_library('somelib', 'some.c') -dep = declare_dependency(link_with : l, - include_directories : i) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 include order/sub1/some.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 include order/sub1/some.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 include order/sub1/some.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 include order/sub1/some.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#if defined _WIN32 || defined __CYGWIN__ - __declspec(dllexport) -#endif -int somefunc(void) { - return 1984; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 include order/sub1/some.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 include order/sub1/some.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 include order/sub1/some.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 include order/sub1/some.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -#pragma once - -#if defined _WIN32 || defined __CYGWIN__ - #define DLL_PUBLIC __declspec(dllimport) -#else - #define DLL_PUBLIC -#endif - -DLL_PUBLIC -int somefunc(void); diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 include order/sub2/main.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 include order/sub2/main.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 include order/sub2/main.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 include order/sub2/main.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#error "sub2/main.h included" diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 include order/sub2/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 include order/sub2/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 include order/sub2/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 include order/sub2/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -j = include_directories('.') -wronginc = declare_dependency(include_directories : j) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 include order/sub3/main.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 include order/sub3/main.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 include order/sub3/main.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 include order/sub3/main.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#error "sub3/main.h included" diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 include order/sub3/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 include order/sub3/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 include order/sub3/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 include order/sub3/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -sub3 = meson.current_source_dir() diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 include order/sub4/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 include order/sub4/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 include order/sub4/main.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 include order/sub4/main.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -/* Use the <> include notation to force searching in include directories */ -#include - -int main(int argc, char *argv[]) { - if (somefunc() == 1984) - return 0; - return 1; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 include order/sub4/main.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 include order/sub4/main.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 include order/sub4/main.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 include order/sub4/main.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -#pragma once - -#include "some.h" diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 include order/sub4/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 include order/sub4/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 include order/sub4/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 include order/sub4/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -e = executable('someexe', 'main.c', ctfile, - c_args : ['-I' + sub3], - include_directories : j, - dependencies : dep) - -correctinc = declare_dependency(include_directories : include_directories('.')) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 override options/four.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 override options/four.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 override options/four.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 override options/four.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,9 @@ +int func(); + +static int duplicate_func() { + return -4; +} + +int main(int argc, char **argv) { + return duplicate_func() + func(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 override options/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 override options/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 override options/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 override options/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,6 @@ +project('option override', 'c', + default_options : 'unity=on') + +executable('mustunity', 'one.c', 'two.c') +executable('notunity', 'three.c', 'four.c', + override_options : ['unity=off']) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 override options/one.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 override options/one.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 override options/one.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 override options/one.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,3 @@ +static int hidden_func() { + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 override options/three.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 override options/three.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 override options/three.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 override options/three.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,7 @@ +static int duplicate_func() { + return 4; +} + +int func() { + return duplicate_func(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 override options/two.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 override options/two.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/135 override options/two.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/135 override options/two.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,6 @@ +/* + * Requires a Unity build. Otherwise hidden_func is not specified. + */ +int main(int argc, char **argv) { + return hidden_func(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/136 get define/concat.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/136 get define/concat.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/136 get define/concat.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/136 get define/concat.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,24 @@ +#define __STRINGIFY(x) #x +#define TEST_STRINGIFY(x) __STRINGIFY(x) + +#define TEST_VERSION_MAJOR 6 +#define TEST_VERSION_MINOR 0 +#define TEST_VERSION_BUGFIX 0 + +#define TEST_VERSION_STR \ + TEST_STRINGIFY(TEST_VERSION_MAJOR) \ + "." TEST_STRINGIFY(TEST_VERSION_MINOR) "." TEST_STRINGIFY( \ + TEST_VERSION_BUGFIX) + +#define TEST_CONCAT_1 \ + "ab" \ + "cd" \ + "ef" \ + "" +#define TEST_CONCAT_2 1 +#define TEST_CONCAT_3 1 2 3 +#define TEST_CONCAT_4 "ab" 1 "cd" +#define TEST_CONCAT_5 \ + "ab\"" \ + "cd" +#define TEST_CONCAT_6 "ab\" \"cd" diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/136 get define/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/136 get define/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/136 get define/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/136 get define/meson.build" 2019-09-16 21:20:45.000000000 +0000 @@ -0,0 +1,104 @@ +project('get define', 'c', 'cpp') + +host_system = host_machine.system() + +foreach lang : ['c', 'cpp'] + cc = meson.get_compiler(lang) + if host_system == 'linux' + d = cc.get_define('__linux__') + assert(d == '1', '__linux__ value is @0@ instead of 1'.format(d)) + elif host_system == 'darwin' + d = cc.get_define('__APPLE__') + assert(d == '1', '__APPLE__ value is @0@ instead of 1'.format(d)) + elif host_system == 'windows' + d = cc.get_define('_WIN32') + assert(d == '1', '_WIN32 value is @0@ instead of 1'.format(d)) + elif host_system == 'cygwin' + d = cc.get_define('__CYGWIN__') + assert(d == '1', '__CYGWIN__ value is @0@ instead of 1'.format(d)) + elif host_system == 'haiku' + d = cc.get_define('__HAIKU__') + assert(d == '1', '__HAIKU__ value is @0@ instead of 1'.format(d)) + elif host_system == 'freebsd' + # the __FreeBSD__ define will be equal to the major version of the release + # (ex, in FreeBSD 11.x, __FreeBSD__ == 11). To make the test robust when + # being run on various versions of FreeBSD, just test that the define is + # set. + d = cc.get_define('__FreeBSD__') + assert(d != '', '__FreeBSD__ value is unset') + elif host_system == 'dragonfly' + d = cc.get_define('__DragonFly__') + assert(d == '1', '__DragonFly__ value is @0@ instead of 1'.format(d)) + elif host_system == 'netbsd' + d = cc.get_define('__NetBSD__') + assert(d == '1', '__NetBSD__ value is @0@ instead of 1'.format(d)) + elif host_system == 'openbsd' + d = cc.get_define('__OpenBSD__') + assert(d == '1', '__OpenBSD__ value is @0@ instead of 1'.format(d)) + elif host_system == 'gnu' + d = cc.get_define('__GNU__') + assert(d == '1', '__GNU__ value is @0@ instead of 1'.format(d)) + elif host_system == 'sunos' + d = cc.get_define('__sun__') + assert(d == '1', '__sun__ value is @0@ instead of 1'.format(d)) + else + error('Please report a bug and help us improve support for this platform') + endif + + if cc.find_library('z', required : false).found() + # When a C file containing #include is pre-processed and foo.h is + # found in the compiler's default search path, GCC inserts an extra comment + # between the delimiter and the define which causes a parsing error. + # https://github.com/mesonbuild/meson/issues/1726 + if host_machine.system() == 'netbsd' or host_machine.system() == 'openbsd' + # NetBSD and OpenBSD's zlib don't have a ZLIB_VER_MAJOR, but they do have + # a ZLIB_VERSION (which is a string), so check the first non-quote + # character of that. + ver = cc.get_define('ZLIB_VERSION', prefix : '#include ')[1] + assert(ver == '1', 'ZLIB_VERSION (major) value is "@0@" instead of "1"'.format(ver)) + else + ver = cc.get_define('ZLIB_VER_MAJOR', prefix : '#include ') + assert(ver == '1', 'ZLIB_VER_MAJOR value is "@0@" instead of "1"'.format(ver)) + endif + endif + + # Check that an undefined value is empty. + have = cc.get_define('MESON_FAIL_VALUE') + assert(have == '', 'MESON_FAIL_VALUE value is "@0@" instead of ""'.format(have)) + + # This is used in the test_preprocessor_checks_CPPFLAGS() unit test. + have = cc.get_define('MESON_TEST_DEFINE_VALUE') + expect = get_option('MESON_TEST_DEFINE_VALUE') + assert(have == expect, 'MESON_TEST_DEFINE_VALUE value is "@0@" instead of "@1@"'.format(have, expect)) + + run_1665_test = false + if meson.is_cross_build() + lang_arg = meson.get_cross_property(lang + '_args', '') + if lang_arg == '-DMESON_TEST_ISSUE_1665=1' + run_1665_test = true + endif + endif + + if run_1665_test + have = cc.get_define('MESON_TEST_ISSUE_1665') + assert(have == '1', 'MESON_TEST_ISSUE_1665 value is "@0@" instead of "1"'.format(have)) + endif + + have = cc.get_define('TEST_VERSION_STR', + prefix : '#include ', include_directories: include_directories('.')) + assert(have == '"6.0.0"', 'TEST_VERSION_STR value is "@0@" instead of ""6.0.0""'.format(have)) + + concat_examples = { + 'TEST_CONCAT_1': '"abcdef"', + 'TEST_CONCAT_2': '1', + 'TEST_CONCAT_3': '1 2 3', + 'TEST_CONCAT_4': '"ab" 1 "cd"', + 'TEST_CONCAT_5': '"ab\"cd"', + 'TEST_CONCAT_6': '"ab\" \"cd"', + } + foreach def,expected : concat_examples + have = cc.get_define(def, + prefix : '#include ', include_directories: include_directories('.')) + assert(have == expected, '@0@ value is "@1@" instead of "@2@"'.format(def, have, expected)) + endforeach +endforeach diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/136 get define/meson_options.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/136 get define/meson_options.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/136 get define/meson_options.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/136 get define/meson_options.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +option('MESON_TEST_DEFINE_VALUE', type : 'string', value : '') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/136 override options/four.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/136 override options/four.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/136 override options/four.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/136 override options/four.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -int func(); - -static int duplicate_func() { - return -4; -} - -int main(int argc, char **argv) { - return duplicate_func() + func(); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/136 override options/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/136 override options/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/136 override options/meson.build" 2018-12-09 16:30:55.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/136 override options/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -project('option override', 'c', - default_options : 'unity=on') - -executable('mustunity', 'one.c', 'two.c') -executable('notunity', 'three.c', 'four.c', - override_options : ['unity=off']) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/136 override options/one.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/136 override options/one.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/136 override options/one.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/136 override options/one.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -static int hidden_func() { - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/136 override options/three.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/136 override options/three.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/136 override options/three.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/136 override options/three.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -static int duplicate_func() { - return 4; -} - -int func() { - return duplicate_func(); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/136 override options/two.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/136 override options/two.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/136 override options/two.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/136 override options/two.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -/* - * Requires a Unity build. Otherwise hidden_func is not specified. - */ -int main(int argc, char **argv) { - return hidden_func(); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/137 c cpp and asm/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/137 c cpp and asm/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/137 c cpp and asm/main.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/137 c cpp and asm/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,8 @@ +#include + +int get_retval(void); + +int main(int argc, char **argv) { + printf("C seems to be working.\n"); + return get_retval(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/137 c cpp and asm/main.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/137 c cpp and asm/main.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/137 c cpp and asm/main.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/137 c cpp and asm/main.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,11 @@ +#include + +extern "C" { + int get_retval(void); + int get_cval(void); +} + +int main(int argc, char **argv) { + std::cout << "C++ seems to be working." << std::endl; + return get_retval(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/137 c cpp and asm/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/137 c cpp and asm/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/137 c cpp and asm/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/137 c cpp and asm/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,23 @@ +project('c cpp and asm', 'c', 'cpp') + +cpu = host_machine.cpu_family() +cc = meson.get_compiler('c') + +supported_cpus = ['arm', 'x86', 'x86_64'] + +if not supported_cpus.contains(cpu) + error('MESON_SKIP_TEST unsupported cpu:' + cpu) +endif + +if meson.get_compiler('c').get_argument_syntax() == 'msvc' + error('MESON_SKIP_TEST MSVC can\'t compile assembly') +endif + +if cc.symbols_have_underscore_prefix() + add_project_arguments('-DMESON_TEST__UNDERSCORE_SYMBOL', language: 'c') +endif + +test('test-c-asm', executable('c-asm', ['main.c', 'retval-' + cpu + '.S'])) +test('test-cpp-asm', executable('cpp-asm', ['main.cpp', 'retval-' + cpu + '.S'])) +test('test-c-cpp-asm', executable('c-cpp-asm', ['somelib.c', 'main.cpp', 'retval-' + cpu + '.S'])) +test('test-cpp-c-asm', executable('cpp-c-asm', ['main.cpp', 'somelib.c', 'retval-' + cpu + '.S'])) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/137 c cpp and asm/retval-arm.S" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/137 c cpp and asm/retval-arm.S" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/137 c cpp and asm/retval-arm.S" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/137 c cpp and asm/retval-arm.S" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,11 @@ +#include "symbol-underscore.h" + +.text +.globl SYMBOL_NAME(get_retval) +# ifdef __linux__ +.type get_retval, %function +#endif + +SYMBOL_NAME(get_retval): + mov r0, #0 + mov pc, lr diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/137 c cpp and asm/retval-x86_64.S" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/137 c cpp and asm/retval-x86_64.S" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/137 c cpp and asm/retval-x86_64.S" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/137 c cpp and asm/retval-x86_64.S" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,11 @@ +#include "symbol-underscore.h" + +.text +.globl SYMBOL_NAME(get_retval) +# ifdef __linux__ +.type get_retval, %function +#endif + +SYMBOL_NAME(get_retval): + xorl %eax, %eax + retq diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/137 c cpp and asm/retval-x86.S" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/137 c cpp and asm/retval-x86.S" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/137 c cpp and asm/retval-x86.S" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/137 c cpp and asm/retval-x86.S" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,12 @@ +#include "symbol-underscore.h" + +.text +.globl SYMBOL_NAME(get_retval) +/* Only supported on Linux with GAS */ +# ifdef __linux__ +.type get_retval, %function +#endif + +SYMBOL_NAME(get_retval): + xorl %eax, %eax + retl diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/137 c cpp and asm/somelib.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/137 c cpp and asm/somelib.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/137 c cpp and asm/somelib.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/137 c cpp and asm/somelib.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +int get_cval (void) { + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/137 c cpp and asm/symbol-underscore.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/137 c cpp and asm/symbol-underscore.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/137 c cpp and asm/symbol-underscore.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/137 c cpp and asm/symbol-underscore.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +#if defined(MESON_TEST__UNDERSCORE_SYMBOL) +# define SYMBOL_NAME(name) _##name +#else +# define SYMBOL_NAME(name) name +#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/137 get define/concat.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/137 get define/concat.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/137 get define/concat.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/137 get define/concat.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -#define __STRINGIFY(x) #x -#define TEST_STRINGIFY(x) __STRINGIFY(x) - -#define TEST_VERSION_MAJOR 6 -#define TEST_VERSION_MINOR 0 -#define TEST_VERSION_BUGFIX 0 - -#define TEST_VERSION_STR \ - TEST_STRINGIFY(TEST_VERSION_MAJOR) \ - "." TEST_STRINGIFY(TEST_VERSION_MINOR) "." TEST_STRINGIFY( \ - TEST_VERSION_BUGFIX) - -#define TEST_CONCAT_1 \ - "ab" \ - "cd" \ - "ef" \ - "" -#define TEST_CONCAT_2 1 -#define TEST_CONCAT_3 1 2 3 -#define TEST_CONCAT_4 "ab" 1 "cd" -#define TEST_CONCAT_5 \ - "ab\"" \ - "cd" -#define TEST_CONCAT_6 "ab\" \"cd" diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/137 get define/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/137 get define/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/137 get define/meson.build" 2018-12-09 16:30:58.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/137 get define/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,104 +0,0 @@ -project('get define', 'c', 'cpp') - -host_system = host_machine.system() - -foreach lang : ['c', 'cpp'] - cc = meson.get_compiler(lang) - if host_system == 'linux' - d = cc.get_define('__linux__') - assert(d == '1', '__linux__ value is @0@ instead of 1'.format(d)) - elif host_system == 'darwin' - d = cc.get_define('__APPLE__') - assert(d == '1', '__APPLE__ value is @0@ instead of 1'.format(d)) - elif host_system == 'windows' - d = cc.get_define('_WIN32') - assert(d == '1', '_WIN32 value is @0@ instead of 1'.format(d)) - elif host_system == 'cygwin' - d = cc.get_define('__CYGWIN__') - assert(d == '1', '__CYGWIN__ value is @0@ instead of 1'.format(d)) - elif host_system == 'haiku' - d = cc.get_define('__HAIKU__') - assert(d == '1', '__HAIKU__ value is @0@ instead of 1'.format(d)) - elif host_system == 'freebsd' - # the __FreeBSD__ define will be equal to the major version of the release - # (ex, in FreeBSD 11.x, __FreeBSD__ == 11). To make the test robust when - # being run on various versions of FreeBSD, just test that the define is - # set. - d = cc.get_define('__FreeBSD__') - assert(d != '', '__FreeBSD__ value is unset') - elif host_system == 'dragonfly' - d = cc.get_define('__DragonFly__') - assert(d == '1', '__DragonFly__ value is @0@ instead of 1'.format(d)) - elif host_system == 'netbsd' - d = cc.get_define('__NetBSD__') - assert(d == '1', '__NetBSD__ value is @0@ instead of 1'.format(d)) - elif host_system == 'gnu' - d = cc.get_define('__GNU__') - assert(d == '1', '__GNU__ value is @0@ instead of 1'.format(d)) - else - error('Please report a bug and help us improve support for this platform') - endif - - if cc.find_library('z', required : false).found() - # When a C file containing #include is pre-processed and foo.h is - # found in the compiler's default search path, GCC inserts an extra comment - # between the delimiter and the define which causes a parsing error. - # https://github.com/mesonbuild/meson/issues/1726 - if host_machine.system() == 'netbsd' - # NetBSD's zlib doesn't is version 1.2.3 and doesn't have a - # ZLIB_VER_MAJOR, but it does have a ZLIB_VERSION (which is a string), so - # check the first non-quote character of that. - ver = cc.get_define('ZLIB_VERSION', prefix : '#include ')[1] - assert(ver == '1', 'ZLIB_VERSION (major) value is "@0@" instead of "1"'.format(ver)) - else - ver = cc.get_define('ZLIB_VER_MAJOR', prefix : '#include ') - assert(ver == '1', 'ZLIB_VER_MAJOR value is "@0@" instead of "1"'.format(ver)) - endif - endif - - # Check that an undefined value is empty. - have = cc.get_define('MESON_FAIL_VALUE') - assert(have == '', 'MESON_FAIL_VALUE value is "@0@" instead of ""'.format(have)) - - # This is used in the test_preprocessor_checks_CPPFLAGS() unit test. - have = cc.get_define('MESON_TEST_DEFINE_VALUE') - expect = get_option('MESON_TEST_DEFINE_VALUE') - assert(have == expect, 'MESON_TEST_DEFINE_VALUE value is "@0@" instead of "@1@"'.format(have, expect)) - - run_1665_test = false - if meson.is_cross_build() - # Can't use an empty array as a fallback here because of - # https://github.com/mesonbuild/meson/issues/1481 - lang_args = meson.get_cross_property(lang + '_args', []) - if lang_args.length() != 0 - foreach lang_arg : lang_args - if lang_arg.contains('MESON_TEST_ISSUE_1665') - run_1665_test = true - endif - endforeach - endif - endif - - if run_1665_test - have = cc.get_define('MESON_TEST_ISSUE_1665') - assert(have == '1', 'MESON_TEST_ISSUE_1665 value is "@0@" instead of "1"'.format(have)) - endif - - have = cc.get_define('TEST_VERSION_STR', - prefix : '#include ', include_directories: include_directories('.')) - assert(have == '"6.0.0"', 'TEST_VERSION_STR value is "@0@" instead of ""6.0.0""'.format(have)) - - concat_examples = { - 'TEST_CONCAT_1': '"abcdef"', - 'TEST_CONCAT_2': '1', - 'TEST_CONCAT_3': '1 2 3', - 'TEST_CONCAT_4': '"ab" 1 "cd"', - 'TEST_CONCAT_5': '"ab\"cd"', - 'TEST_CONCAT_6': '"ab\" \"cd"', - } - foreach def,expected : concat_examples - have = cc.get_define(def, - prefix : '#include ', include_directories: include_directories('.')) - assert(have == expected, '@0@ value is "@1@" instead of "@2@"'.format(def, have, expected)) - endforeach -endforeach diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/137 get define/meson_options.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/137 get define/meson_options.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/137 get define/meson_options.txt" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/137 get define/meson_options.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -option('MESON_TEST_DEFINE_VALUE', type : 'string', value : '') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/138 c cpp and asm/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/138 c cpp and asm/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/138 c cpp and asm/main.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/138 c cpp and asm/main.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -#include - -int get_retval(void); - -int main(int argc, char **argv) { - printf("C seems to be working.\n"); - return get_retval(); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/138 c cpp and asm/main.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/138 c cpp and asm/main.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/138 c cpp and asm/main.cpp" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/138 c cpp and asm/main.cpp" 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -#include - -extern "C" { - int get_retval(void); - int get_cval(void); -} - -int main(int argc, char **argv) { - std::cout << "C++ seems to be working." << std::endl; - return get_retval(); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/138 c cpp and asm/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/138 c cpp and asm/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/138 c cpp and asm/meson.build" 2018-12-09 16:30:59.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/138 c cpp and asm/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -project('c cpp and asm', 'c', 'cpp') - -cpu = host_machine.cpu_family() -cc = meson.get_compiler('c') - -supported_cpus = ['arm', 'x86', 'x86_64'] - -if not supported_cpus.contains(cpu) - error('MESON_SKIP_TEST unsupported cpu:' + cpu) -endif - -if meson.get_compiler('c').get_argument_syntax() == 'msvc' - error('MESON_SKIP_TEST MSVC can\'t compile assembly') -endif - -if cc.symbols_have_underscore_prefix() - add_project_arguments('-DMESON_TEST__UNDERSCORE_SYMBOL', language: 'c') -endif - -test('test-c-asm', executable('c-asm', ['main.c', 'retval-' + cpu + '.S'])) -test('test-cpp-asm', executable('cpp-asm', ['main.cpp', 'retval-' + cpu + '.S'])) -test('test-c-cpp-asm', executable('c-cpp-asm', ['somelib.c', 'main.cpp', 'retval-' + cpu + '.S'])) -test('test-cpp-c-asm', executable('cpp-c-asm', ['main.cpp', 'somelib.c', 'retval-' + cpu + '.S'])) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/138 c cpp and asm/retval-arm.S" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/138 c cpp and asm/retval-arm.S" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/138 c cpp and asm/retval-arm.S" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/138 c cpp and asm/retval-arm.S" 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -#include "symbol-underscore.h" - -.text -.globl SYMBOL_NAME(get_retval) -# ifdef __linux__ -.type get_retval, %function -#endif - -SYMBOL_NAME(get_retval): - mov r0, #0 - mov pc, lr diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/138 c cpp and asm/retval-x86_64.S" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/138 c cpp and asm/retval-x86_64.S" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/138 c cpp and asm/retval-x86_64.S" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/138 c cpp and asm/retval-x86_64.S" 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -#include "symbol-underscore.h" - -.text -.globl SYMBOL_NAME(get_retval) -# ifdef __linux__ -.type get_retval, %function -#endif - -SYMBOL_NAME(get_retval): - xorl %eax, %eax - retq diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/138 c cpp and asm/retval-x86.S" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/138 c cpp and asm/retval-x86.S" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/138 c cpp and asm/retval-x86.S" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/138 c cpp and asm/retval-x86.S" 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -#include "symbol-underscore.h" - -.text -.globl SYMBOL_NAME(get_retval) -/* Only supported on Linux with GAS */ -# ifdef __linux__ -.type get_retval, %function -#endif - -SYMBOL_NAME(get_retval): - xorl %eax, %eax - retl diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/138 c cpp and asm/somelib.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/138 c cpp and asm/somelib.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/138 c cpp and asm/somelib.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/138 c cpp and asm/somelib.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -int get_cval (void) { - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/138 c cpp and asm/symbol-underscore.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/138 c cpp and asm/symbol-underscore.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/138 c cpp and asm/symbol-underscore.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/138 c cpp and asm/symbol-underscore.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#if defined(MESON_TEST__UNDERSCORE_SYMBOL) -# define SYMBOL_NAME(name) _##name -#else -# define SYMBOL_NAME(name) name -#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/138 compute int/config.h.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/138 compute int/config.h.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/138 compute int/config.h.in" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/138 compute int/config.h.in" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,4 @@ +#define INTSIZE @INTSIZE@ +#define FOOBAR_IN_CONFIG_H @FOOBAR@ +#define MAXINT @MAXINT@ +#define MININT @MININT@ diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/138 compute int/foobar.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/138 compute int/foobar.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/138 compute int/foobar.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/138 compute int/foobar.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,6 @@ +#ifndef __FOOBAR_H__ +#define __FOOBAR_H__ + +#define FOOBAR_IN_FOOBAR_H 10 + +#endif /*__FOOBAR_H__*/ diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/138 compute int/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/138 compute int/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/138 compute int/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/138 compute int/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,43 @@ +project('compute int', 'c', 'cpp') + +inc = include_directories('.') + +# Test with C +cc = meson.get_compiler('c') + +intsize = cc.compute_int('sizeof(int)', low : 1, high : 16, guess : 4) +foobar = cc.compute_int('FOOBAR_IN_FOOBAR_H', prefix : '#include "foobar.h"', include_directories : inc) +maxint = cc.compute_int('INT_MAX', prefix: '#include ') +minint = cc.compute_int('INT_MIN', prefix: '#include ') + +cd = configuration_data() +cd.set('INTSIZE', intsize) +cd.set('FOOBAR', foobar) +cd.set('CONFIG', 'config.h') +cd.set('MAXINT', maxint) +cd.set('MININT', minint) +configure_file(input : 'config.h.in', output : 'config.h', configuration : cd) +s = configure_file(input : 'prog.c.in', output : 'prog.c', configuration : cd) + +e = executable('prog', s) +test('compute int test', e) + +# Test with C++ +cpp = meson.get_compiler('cpp') + +intsize = cpp.compute_int('sizeof(int)') +foobar = cpp.compute_int('FOOBAR_IN_FOOBAR_H', prefix : '#include "foobar.h"', include_directories : inc) +maxint = cpp.compute_int('INT_MAX', prefix: '#include ') +minint = cpp.compute_int('INT_MIN', prefix: '#include ') + +cdpp = configuration_data() +cdpp.set('INTSIZE', intsize) +cdpp.set('FOOBAR', foobar) +cdpp.set('CONFIG', 'config.hpp') +cdpp.set('MAXINT', maxint) +cdpp.set('MININT', minint) +configure_file(input : 'config.h.in', output : 'config.hpp', configuration : cdpp) +spp = configure_file(input : 'prog.c.in', output : 'prog.cc', configuration : cdpp) + +epp = executable('progpp', spp) +test('compute int test c++', epp) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/138 compute int/prog.c.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/138 compute int/prog.c.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/138 compute int/prog.c.in" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/138 compute int/prog.c.in" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,25 @@ +#include "@CONFIG@" +#include +#include +#include +#include "foobar.h" + +int main(int argc, char **argv) { + if(INTSIZE != sizeof(int)) { + fprintf(stderr, "Mismatch: computed int size %d, actual size %d.\n", INTSIZE, (int)sizeof(int)); + return 1; + } + if(FOOBAR_IN_CONFIG_H != FOOBAR_IN_FOOBAR_H) { + fprintf(stderr, "Mismatch: computed int %d, should be %d.\n", FOOBAR_IN_CONFIG_H, FOOBAR_IN_FOOBAR_H); + return 1; + } + if(MAXINT != INT_MAX) { + fprintf(stderr, "Mismatch: computed max int %d, should be %d.\n", MAXINT, INT_MAX); + return 1; + } + if(MININT != INT_MIN) { + fprintf(stderr, "Mismatch: computed min int %d, should be %d.\n", MININT, INT_MIN); + return 1; + } + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/139 compute int/config.h.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/139 compute int/config.h.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/139 compute int/config.h.in" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/139 compute int/config.h.in" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -#define INTSIZE @INTSIZE@ -#define FOOBAR_IN_CONFIG_H @FOOBAR@ -#define MAXINT @MAXINT@ -#define MININT @MININT@ diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/139 compute int/foobar.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/139 compute int/foobar.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/139 compute int/foobar.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/139 compute int/foobar.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#ifndef __FOOBAR_H__ -#define __FOOBAR_H__ - -#define FOOBAR_IN_FOOBAR_H 10 - -#endif /*__FOOBAR_H__*/ diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/139 compute int/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/139 compute int/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/139 compute int/meson.build" 2018-12-09 16:31:01.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/139 compute int/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -project('compute int', 'c', 'cpp') - -inc = include_directories('.') - -# Test with C -cc = meson.get_compiler('c') - -intsize = cc.compute_int('sizeof(int)', low : 1, high : 16, guess : 4) -foobar = cc.compute_int('FOOBAR_IN_FOOBAR_H', prefix : '#include "foobar.h"', include_directories : inc) -maxint = cc.compute_int('INT_MAX', prefix: '#include ') -minint = cc.compute_int('INT_MIN', prefix: '#include ') - -cd = configuration_data() -cd.set('INTSIZE', intsize) -cd.set('FOOBAR', foobar) -cd.set('CONFIG', 'config.h') -cd.set('MAXINT', maxint) -cd.set('MININT', minint) -configure_file(input : 'config.h.in', output : 'config.h', configuration : cd) -s = configure_file(input : 'prog.c.in', output : 'prog.c', configuration : cd) - -e = executable('prog', s) -test('compute int test', e) - -# Test with C++ -cpp = meson.get_compiler('cpp') - -intsize = cpp.compute_int('sizeof(int)') -foobar = cpp.compute_int('FOOBAR_IN_FOOBAR_H', prefix : '#include "foobar.h"', include_directories : inc) -maxint = cpp.compute_int('INT_MAX', prefix: '#include ') -minint = cpp.compute_int('INT_MIN', prefix: '#include ') - -cdpp = configuration_data() -cdpp.set('INTSIZE', intsize) -cdpp.set('FOOBAR', foobar) -cdpp.set('CONFIG', 'config.hpp') -cdpp.set('MAXINT', maxint) -cdpp.set('MININT', minint) -configure_file(input : 'config.h.in', output : 'config.hpp', configuration : cdpp) -spp = configure_file(input : 'prog.c.in', output : 'prog.cc', configuration : cdpp) - -epp = executable('progpp', spp) -test('compute int test c++', epp) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/139 compute int/prog.c.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/139 compute int/prog.c.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/139 compute int/prog.c.in" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/139 compute int/prog.c.in" 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -#include "@CONFIG@" -#include -#include -#include -#include "foobar.h" - -int main(int argc, char **argv) { - if(INTSIZE != sizeof(int)) { - fprintf(stderr, "Mismatch: computed int size %d, actual size %d.\n", INTSIZE, (int)sizeof(int)); - return 1; - } - if(FOOBAR_IN_CONFIG_H != FOOBAR_IN_FOOBAR_H) { - fprintf(stderr, "Mismatch: computed int %d, should be %d.\n", FOOBAR_IN_CONFIG_H, FOOBAR_IN_FOOBAR_H); - return 1; - } - if(MAXINT != INT_MAX) { - fprintf(stderr, "Mismatch: computed max int %d, should be %d.\n", MAXINT, INT_MAX); - return 1; - } - if(MININT != INT_MIN) { - fprintf(stderr, "Mismatch: computed min int %d, should be %d.\n", MININT, INT_MIN); - return 1; - } - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/139 custom target object output/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/139 custom target object output/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/139 custom target object output/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/139 custom target object output/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,16 @@ +project('custom target object output', 'c') + +comp = find_program('obj_generator.py') + +if host_machine.system() == 'windows' + outputname = '@BASENAME@.obj' +else + outputname = '@BASENAME@.o' +endif + +cc = meson.get_compiler('c').cmd_array().get(-1) + +subdir('objdir') +subdir('progdir') + +test('objgen', e) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/139 custom target object output/objdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/139 custom target object output/objdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/139 custom target object output/objdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/139 custom target object output/objdir/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +# Generate an object file manually. +object = custom_target('object', + input : 'source.c', + output : outputname, + command : [comp, cc, '@INPUT@', '@OUTPUT@']) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/139 custom target object output/objdir/source.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/139 custom target object output/objdir/source.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/139 custom target object output/objdir/source.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/139 custom target object output/objdir/source.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,3 @@ +int func1_in_obj() { + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/139 custom target object output/obj_generator.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/139 custom target object output/obj_generator.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/139 custom target object output/obj_generator.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/139 custom target object output/obj_generator.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 + +# Mimic a binary that generates an object file (e.g. windres). + +import sys, subprocess + +if __name__ == '__main__': + if len(sys.argv) != 4: + print(sys.argv[0], 'compiler input_file output_file') + sys.exit(1) + compiler = sys.argv[1] + ifile = sys.argv[2] + ofile = sys.argv[3] + if compiler.endswith('cl'): + cmd = [compiler, '/nologo', '/MDd', '/Fo' + ofile, '/c', ifile] + else: + cmd = [compiler, '-c', ifile, '-o', ofile] + sys.exit(subprocess.call(cmd)) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/139 custom target object output/progdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/139 custom target object output/progdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/139 custom target object output/progdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/139 custom target object output/progdir/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +e = executable('prog', 'prog.c', object) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/139 custom target object output/progdir/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/139 custom target object output/progdir/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/139 custom target object output/progdir/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/139 custom target object output/progdir/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +int func1_in_obj(); + +int main(int argc, char **argv) { + return func1_in_obj(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/c/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/c/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/c/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/c/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -1,8 +1,14 @@ cc = meson.get_compiler('c') cc_id = cc.get_id() + if cc_id == 'lcc' error('MESON_SKIP_TEST: Elbrus compiler does not support PCH.') endif +# PGI compiler only supports PCH for C++ +if cc_id == 'pgi' + subdir_done() +endif + exe = executable('prog', 'prog.c', -c_pch : ['pch/prog_pch.c', 'pch/prog.h']) +c_pch : 'pch/prog.h') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/c/pch/prog.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/c/pch/prog.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/c/pch/prog.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/c/pch/prog.h" 2019-02-07 09:08:59.000000000 +0000 @@ -1 +1,6 @@ +#ifndef PROG_H +// Header guards for PCH confuse msvc in some situations. +// Using them here makes sure we handle this correctly. +#define PROG_H #include +#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/c/pch/prog_pch.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/c/pch/prog_pch.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/c/pch/prog_pch.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/c/pch/prog_pch.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#if !defined(_MSC_VER) -#error "This file is only for use with MSVC." -#endif - -#include "prog.h" diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/cpp/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/cpp/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/cpp/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/cpp/meson.build" 2019-03-06 20:48:10.000000000 +0000 @@ -1 +1 @@ -exe = executable('prog', 'prog.cc', cpp_pch : ['pch/prog.hh', 'pch/prog_pch.cc']) +exe = executable('prog', 'prog.cc', cpp_pch : 'pch/prog.hh') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/cpp/pch/prog_pch.cc" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/cpp/pch/prog_pch.cc" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/cpp/pch/prog_pch.cc" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/cpp/pch/prog_pch.cc" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#if !defined(_MSC_VER) -#error "This file is only for use with MSVC." -#endif - -#include "prog.hh" diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/cpp/prog.cc" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/cpp/prog.cc" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/cpp/prog.cc" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/cpp/prog.cc" 2019-11-28 17:37:44.000000000 +0000 @@ -1,8 +1,11 @@ +// Note: if using PGI compilers, you will need to add #include "prog.hh" +// even though you're using precompiled headers. void func() { std::cout << "This is a function that fails to compile if iostream is not included." << std::endl; } int main(int argc, char **argv) { + func(); return 0; } diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/generated/gen_custom.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/generated/gen_custom.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/generated/gen_custom.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/generated/gen_custom.py" 2019-02-13 18:47:00.000000000 +0000 @@ -0,0 +1,5 @@ +#!/usr/bin/env python3 +import sys + +with open(sys.argv[1], 'w') as f: + f.write("#define FOO 0") diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/generated/generated_generator.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/generated/generated_generator.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/generated/generated_generator.in" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/generated/generated_generator.in" 2019-02-13 18:47:00.000000000 +0000 @@ -0,0 +1 @@ +#define BAR 0 diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/generated/gen_generator.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/generated/gen_generator.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/generated/gen_generator.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/generated/gen_generator.py" 2019-02-13 18:47:00.000000000 +0000 @@ -0,0 +1,7 @@ +#!/usr/bin/env python3 +import sys + +with open(sys.argv[1]) as f: + content = f.read() +with open(sys.argv[2], 'w') as f: + f.write(content) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/generated/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/generated/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/generated/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/generated/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,22 @@ +cc = meson.get_compiler('c') +cc_id = cc.get_id() + +if cc_id == 'lcc' + error('MESON_SKIP_TEST: Elbrus compiler does not support PCH.') +endif + +# PGI compiler only supports PCH for C++ +if cc_id == 'pgi' + subdir_done() +endif + +generated_customTarget = custom_target('makeheader', + output: 'generated_customTarget.h', + command : [find_program('gen_custom.py'), '@OUTPUT0@']) + +generated_generator = generator(find_program('gen_generator.py'), + output: '@BASENAME@.h', + arguments: ['@INPUT@', '@OUTPUT@']) + +exe = executable('prog', 'prog.c', generated_customTarget, generated_generator.process('generated_generator.in'), + c_pch: 'pch/prog.h') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/generated/pch/prog.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/generated/pch/prog.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/generated/pch/prog.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/generated/pch/prog.h" 2019-02-13 18:47:00.000000000 +0000 @@ -0,0 +1,2 @@ +#include "generated_customTarget.h" +#include "generated_generator.h" diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/generated/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/generated/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/generated/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/generated/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,6 @@ +// No includes here, they need to come from the PCH + +int main(int argc, char **argv) { + return FOO + BAR; +} + diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/meson.build" 2018-12-09 16:28:59.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -1,7 +1,18 @@ -project('pch test', 'c', 'cpp') +project('pch test', 'c', 'cpp', + meson_version: '>= 0.46.0') + +cc = meson.get_compiler('c') +cc_id = cc.get_id() + +if cc_id == 'pgi' + error('MESON_SKIP_TEST: PGI compiler does support PCH, however, PGI cannot tolerate spaces in the --pch_dir path and Meson run_project_tests.py uses spaces in temporary build path names. If this test is run individually with no spaces in build path, it will pass.') +endif subdir('c') subdir('cpp') +subdir('generated') +subdir('userDefined') +subdir('withIncludeDirectories') if meson.backend() == 'xcode' warning('Xcode backend only supports one precompiled header per target. Skipping "mixed" which has various precompiled headers.') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/mixed/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/mixed/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/mixed/meson.build" 2018-12-09 14:27:16.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/mixed/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -1,17 +1,14 @@ +cc = meson.get_compiler('c') +cc_id = cc.get_id() + +# PGI compiler only supports PCH for C++ +if cc_id == 'pgi' + subdir_done() +endif + exe = executable( 'prog', files('main.cc', 'func.c'), - c_pch : ['pch/func.h', 'pch/func_pch.c'], - cpp_pch : ['pch/main_pch.cc', 'pch/main.h'], + c_pch : ['pch/func.h'], + cpp_pch : ['pch/main.h'], ) - -# test pch when only a header is given (not supported by msvc) -cc = meson.get_compiler('c') -if not ['msvc', 'clang-cl'].contains(cc.get_id()) - exe2 = executable( - 'prog2', - files('main.cc', 'func.c'), - c_pch : 'pch/func.h', - cpp_pch : 'pch/main.h', - ) -endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/mixed/pch/func_pch.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/mixed/pch/func_pch.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/mixed/pch/func_pch.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/mixed/pch/func_pch.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include"func.h" diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/mixed/pch/main_pch.cc" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/mixed/pch/main_pch.cc" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/mixed/pch/main_pch.cc" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/mixed/pch/main_pch.cc" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include"main.h" diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/userDefined/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/userDefined/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/userDefined/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/userDefined/meson.build" 2019-03-06 20:48:10.000000000 +0000 @@ -0,0 +1,10 @@ +cc = meson.get_compiler('c') +cc_id = cc.get_id() + +# User supplied PCH implementation should override the auto +# generated one. PCH implementations are only supported for +# msvc and generally should not be used at all. Support for +# them is only kept for backwards compatibility. +if cc_id == 'msvc' + exe = executable('prog', 'prog.c', c_pch : ['pch/pch.h', 'pch/pch.c']) +endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/userDefined/pch/pch.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/userDefined/pch/pch.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/userDefined/pch/pch.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/userDefined/pch/pch.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +#include "pch.h" + +int foo() { + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/userDefined/pch/pch.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/userDefined/pch/pch.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/userDefined/pch/pch.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/userDefined/pch/pch.h" 2019-03-06 20:48:10.000000000 +0000 @@ -0,0 +1 @@ +int foo(); diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/userDefined/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/userDefined/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/userDefined/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/userDefined/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,8 @@ +// No includes here, they need to come from the PCH + +int main(int argc, char **argv) { + // Method is implemented in pch.c. + // This makes sure that we can properly handle user defined + // pch implementation files and not only auto-generated ones. + return foo(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/withIncludeDirectories/include/lib/lib.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/withIncludeDirectories/include/lib/lib.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/withIncludeDirectories/include/lib/lib.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/withIncludeDirectories/include/lib/lib.h" 2019-02-13 18:47:00.000000000 +0000 @@ -0,0 +1 @@ +#include diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/withIncludeDirectories/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/withIncludeDirectories/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/withIncludeDirectories/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/withIncludeDirectories/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,15 @@ +cc = meson.get_compiler('c') +cc_id = cc.get_id() + +if cc_id == 'lcc' + error('MESON_SKIP_TEST: Elbrus compiler does not support PCH.') +endif + +# PGI compiler only supports PCH for C++ +if cc_id == 'pgi' + subdir_done() +endif + +exe = executable('prog', 'prog.c', + include_directories: 'include', + c_pch : 'pch/prog.h') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/withIncludeDirectories/pch/prog.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/withIncludeDirectories/pch/prog.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/withIncludeDirectories/pch/prog.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/withIncludeDirectories/pch/prog.h" 2019-02-13 18:47:00.000000000 +0000 @@ -0,0 +1 @@ +#include diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/withIncludeDirectories/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/withIncludeDirectories/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/13 pch/withIncludeDirectories/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/13 pch/withIncludeDirectories/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,10 @@ +// No includes here, they need to come from the PCH + +void func() { + fprintf(stdout, "This is a function that fails if stdio is not #included.\n"); +} + +int main(int argc, char **argv) { + return 0; +} + diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/140 custom target object output/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/140 custom target object output/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/140 custom target object output/meson.build" 2018-12-09 16:30:59.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/140 custom target object output/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -project('custom target object output', 'c') - -comp = find_program('obj_generator.py') - -if host_machine.system() == 'windows' - outputname = '@BASENAME@.obj' -else - outputname = '@BASENAME@.o' -endif - -cc = meson.get_compiler('c').cmd_array().get(-1) - -subdir('objdir') -subdir('progdir') - -test('objgen', e) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/140 custom target object output/objdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/140 custom target object output/objdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/140 custom target object output/objdir/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/140 custom target object output/objdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -# Generate an object file manually. -object = custom_target('object', - input : 'source.c', - output : outputname, - command : [comp, cc, '@INPUT@', '@OUTPUT@']) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/140 custom target object output/objdir/source.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/140 custom target object output/objdir/source.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/140 custom target object output/objdir/source.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/140 custom target object output/objdir/source.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -int func1_in_obj() { - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/140 custom target object output/obj_generator.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/140 custom target object output/obj_generator.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/140 custom target object output/obj_generator.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/140 custom target object output/obj_generator.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -#!/usr/bin/env python3 - -# Mimic a binary that generates an object file (e.g. windres). - -import sys, subprocess - -if __name__ == '__main__': - if len(sys.argv) != 4: - print(sys.argv[0], 'compiler input_file output_file') - sys.exit(1) - compiler = sys.argv[1] - ifile = sys.argv[2] - ofile = sys.argv[3] - if compiler.endswith('cl'): - cmd = [compiler, '/nologo', '/MDd', '/Fo' + ofile, '/c', ifile] - else: - cmd = [compiler, '-c', ifile, '-o', ofile] - sys.exit(subprocess.call(cmd)) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/140 custom target object output/progdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/140 custom target object output/progdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/140 custom target object output/progdir/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/140 custom target object output/progdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -e = executable('prog', 'prog.c', object) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/140 custom target object output/progdir/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/140 custom target object output/progdir/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/140 custom target object output/progdir/prog.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/140 custom target object output/progdir/prog.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -int func1_in_obj(); - -int main(int argc, char **argv) { - return func1_in_obj(); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/140 empty build file/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/140 empty build file/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/140 empty build file/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/140 empty build file/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +project('subdir with empty meson.build test', 'c') +subdir('subdir') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/141 empty build file/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/141 empty build file/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/141 empty build file/meson.build" 2018-12-09 16:31:01.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/141 empty build file/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -project('subdir with empty meson.build test', 'c') -subdir('subdir') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/141 whole archive/exe/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/141 whole archive/exe/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/141 whole archive/exe/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/141 whole archive/exe/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +exe = executable('prog', '../prog.c', link_with : sh_func2_linked_func1) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/141 whole archive/exe2/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/141 whole archive/exe2/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/141 whole archive/exe2/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/141 whole archive/exe2/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +exe2 = executable('prog2', '../prog.c', link_with : sh_only_link_whole) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/141 whole archive/exe3/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/141 whole archive/exe3/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/141 whole archive/exe3/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/141 whole archive/exe3/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +exe3 = executable('prog3', '../prog.c', link_with : sh_func2_dep_func1) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/141 whole archive/exe4/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/141 whole archive/exe4/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/141 whole archive/exe4/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/141 whole archive/exe4/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +exe4 = executable('prog4', '../prog.c', link_with : sh_func2_transdep_func1) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/141 whole archive/func1.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/141 whole archive/func1.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/141 whole archive/func1.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/141 whole archive/func1.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,7 @@ +#define BUILDING_DLL + +#include + +int func1() { + return 42; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/141 whole archive/func2.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/141 whole archive/func2.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/141 whole archive/func2.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/141 whole archive/func2.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,7 @@ +#define BUILDING_DLL + +#include + +int func2() { + return 42; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/141 whole archive/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/141 whole archive/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/141 whole archive/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/141 whole archive/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,50 @@ +project('whole archive', 'c') + +add_project_arguments('-I' + meson.source_root(), language : 'c') + +cc = meson.get_compiler('c') + +if cc.get_id() == 'msvc' + if cc.version().version_compare('<19') + error('MESON_SKIP_TEST link_whole only works on VS2015 or newer.') + endif +endif + +# Test 1: link_whole keeps all symbols +# Make static func1 +subdir('st_func1') +# Make shared func2 linking whole func1 archive +subdir('sh_func2_linked_func1') +# Link exe with shared library only +subdir('exe') +# Test that both func1 and func2 are accessible from shared library +test('prog', exe) + +# Test 2: link_whole can be used instead of source list, see #2180 +# Make static func2 +subdir('st_func2') +# Link both func1 and func2 into same shared library +# which does not have any sources other than 2 static libraries +subdir('sh_only_link_whole') +# Link exe2 with shared library only +subdir('exe2') +# Test that both func1 and func2 are accessible from shared library +test('prog2', exe2) + +# Test 3: link_whole can be used in declare_dependency() +func1_dep = declare_dependency(link_whole : [st_func1]) +# Use dependency to link func1 into shared library +subdir('sh_func2_dep_func1') +# Link exe3 with shared library +subdir('exe3') +# Test that both func1 and func2 are accessible from shared library +test('prog3', exe3) + +# Test 4: link_whole can be used in transitive declare_dependency() +func1_trans_dep = declare_dependency(dependencies : func1_dep) +# Use transitive dependency to link func1 into shared library +subdir('sh_func2_transdep_func1') +# Link exe4 with shared library +subdir('exe4') +# Test that both func1 and func2 are accessible from shared library +test('prog4', exe4) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/141 whole archive/mylib.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/141 whole archive/mylib.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/141 whole archive/mylib.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/141 whole archive/mylib.h" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,21 @@ +#pragma once + +/* Both funcs here for simplicity. */ + +#if defined _WIN32 || defined __CYGWIN__ +#if defined BUILDING_DLL + #define DLL_PUBLIC __declspec(dllexport) +#else + #define DLL_PUBLIC __declspec(dllimport) +#endif +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif + +int DLL_PUBLIC func1(); +int DLL_PUBLIC func2(); diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/141 whole archive/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/141 whole archive/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/141 whole archive/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/141 whole archive/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +#include + +int main(int argc, char **argv) { + return func1() - func2(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/141 whole archive/sh_func2_dep_func1/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/141 whole archive/sh_func2_dep_func1/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/141 whole archive/sh_func2_dep_func1/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/141 whole archive/sh_func2_dep_func1/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,4 @@ +# Same as sh_func2_linked_func1, # func2.c does not depend on func1(), +# so without link_whole compiler would throw func1() away. +# This is the same version of the test with a dependency object instead. +sh_func2_dep_func1 = shared_library('sh_func2_dep_func1', '../func2.c', dependencies : func1_dep) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/141 whole archive/sh_func2_linked_func1/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/141 whole archive/sh_func2_linked_func1/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/141 whole archive/sh_func2_linked_func1/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/141 whole archive/sh_func2_linked_func1/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +# Nothing in func2.c uses func1, so the linker would throw it +# away and thus linking the exe would fail. +sh_func2_linked_func1 = shared_library('sh_func2_linked_func1', '../func2.c', link_whole : st_func1) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/141 whole archive/sh_func2_transdep_func1/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/141 whole archive/sh_func2_transdep_func1/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/141 whole archive/sh_func2_transdep_func1/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/141 whole archive/sh_func2_transdep_func1/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,6 @@ +# Same as sh_func2_dep_func1 but dependency is transitive. +# func2.c does not have any reference to func1() so without link_whole compiler +# should throw func1() out. +sh_func2_transdep_func1 = shared_library( + 'sh_func2_transdep_func1', '../func2.c', + dependencies : func1_trans_dep) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/141 whole archive/sh_only_link_whole/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/141 whole archive/sh_only_link_whole/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/141 whole archive/sh_only_link_whole/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/141 whole archive/sh_only_link_whole/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +sh_only_link_whole = shared_library('sh_only_link_whole', link_whole : [st_func1, st_func2]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/141 whole archive/st_func1/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/141 whole archive/st_func1/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/141 whole archive/st_func1/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/141 whole archive/st_func1/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +st_func1 = static_library('st_func1', '../func1.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/141 whole archive/st_func2/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/141 whole archive/st_func2/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/141 whole archive/st_func2/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/141 whole archive/st_func2/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +st_func2 = static_library('st_func2', '../func2.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 C and CPP link/foobar.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 C and CPP link/foobar.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 C and CPP link/foobar.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 C and CPP link/foobar.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,27 @@ +/* Copyright © 2017 Dylan Baker + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "foo.h" +#include "foo.hpp" +#include "foobar.h" + +int get_number_index (void) { + return 1; +} + +void mynumbers(int nums[]) { + nums[0] = forty_two(); + nums[1] = six_one(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 C and CPP link/foobar.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 C and CPP link/foobar.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 C and CPP link/foobar.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 C and CPP link/foobar.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,16 @@ +/* Copyright © 2017 Dylan Baker + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +void mynumbers(int nums[]); diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 C and CPP link/foo.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 C and CPP link/foo.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 C and CPP link/foo.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 C and CPP link/foo.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,19 @@ +/* Copyright © 2017 Dylan Baker + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "foo.h" + +int forty_two(void) { + return 42; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 C and CPP link/foo.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 C and CPP link/foo.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 C and CPP link/foo.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 C and CPP link/foo.cpp" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,34 @@ +/* Copyright © 2017 Dylan Baker + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include + +const int cnums[] = {0, 61}; + +/* Provided by foobar.c */ +extern "C" int get_number_index (void); + +template +std::vector makeVector(const T (&data)[N]) +{ + return std::vector(data, data+N); +} + +namespace { + std::vector numbers = makeVector(cnums); +} + +extern "C" int six_one(void) { + return numbers[get_number_index ()]; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 C and CPP link/foo.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 C and CPP link/foo.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 C and CPP link/foo.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 C and CPP link/foo.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,16 @@ +/* Copyright © 2017 Dylan Baker + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +int forty_two(void); diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 C and CPP link/foo.hpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 C and CPP link/foo.hpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 C and CPP link/foo.hpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 C and CPP link/foo.hpp" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,24 @@ +/* Copyright © 2017 Dylan Baker + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifdef __cplusplus +extern "C" { +#endif + +int six_one(void); + +#ifdef __cplusplus +} +#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 C and CPP link/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 C and CPP link/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 C and CPP link/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 C and CPP link/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,123 @@ +# Copyright © 2017 Dylan Baker +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +project('C and C++ static link test', ['c', 'cpp']) + +# Verify that adding link arguments works. +add_global_link_arguments('', language : 'c') +add_project_link_arguments('', language : 'c') + +libc = static_library('cfoo', ['foo.c', 'foo.h']) + +# Test that linking C libs to external static C++ libs uses the C++ linker +# Since we can't depend on the test system to provide this, we create one +# ourselves at configure time and then 'find' it with cxx.find_library(). +cxx = meson.get_compiler('cpp') + +if cxx.get_argument_syntax() == 'msvc' + if cxx.get_id() == 'msvc' + static_linker = find_program('lib') + elif cxx.get_id() == 'clang-cl' + static_linker = find_program('llvm-lib') + elif cxx.get_id() == 'intel-cl' + static_linker = find_program('xilib') + else + error('unable to determine static linker to use with this compiler') + endif + compile_cmd = ['/c', '@INPUT@', '/Fo@OUTPUT@'] + stlib_cmd = [static_linker, '/OUT:@OUTPUT@', '@INPUT@'] +else + picflag = [] + if not ['darwin', 'windows'].contains(host_machine.system()) + picflag = ['-fPIC'] + endif + compile_cmd = ['-c', picflag, '@INPUT@', '-o', '@OUTPUT@'] + stlib_cmd = ['ar', 'csr', '@OUTPUT@', '@INPUT@'] +endif + +foo_cpp_o = configure_file( + input : 'foo.cpp', + output : 'foo.cpp.o', + command : cxx.cmd_array() + compile_cmd) + +configure_file( + input : foo_cpp_o, + output : 'libstcppext.a', + command : stlib_cmd) + +libstcppext = cxx.find_library('stcppext', dirs : meson.current_build_dir()) +lib_type_name = libstcppext.type_name() +assert(lib_type_name == 'library', 'type name is ' + lib_type_name) + +libfooext = shared_library( + 'fooext', + ['foobar.c', 'foobar.h'], + link_with : libc, + dependencies : libstcppext, +) + +# Test that linking C libs to internal static C++ libs uses the C++ linker +libcpp = static_library('cppfoo', ['foo.cpp', 'foo.hpp']) + +libfoo = shared_library( + 'foo', + ['foobar.c', 'foobar.h'], + link_with : [libc, libcpp], +) + +# Test that link_whole is also honored +# +# VS2010 lacks the /WHOLEARCHIVE option that later versions of MSVC support, so +# don't run this tests on that backend. +if not (cxx.get_id() == 'msvc' and cxx.version().version_compare('<19')) + libfoowhole = shared_library( + 'foowhole', + ['foobar.c', 'foobar.h'], + link_whole : [libc, libcpp], + ) +endif + +# Test sublinking (linking C and C++, then linking that to C) +libfoo_static = static_library( + 'foo_static', + ['foobar.c', 'foobar.h'], + link_with : [libc, libcpp], +) + +libsub = shared_library( + 'sub', + ['sub.c', 'sub.h'], + link_with : libfoo_static, +) + +if not (cxx.get_id() == 'msvc' and cxx.version().version_compare('<19')) + libsubwhole = shared_library( + 'subwhole', + ['sub.c', 'sub.h'], + link_whole : libfoo_static, + ) +endif + +# Test that it really is recursive +libsub_static = static_library( + 'sub_static', + ['sub.c', 'sub.h'], + link_with : libfoo_static, +) + +libsubsub = shared_library( + 'subsub', + ['dummy.c'], + link_with : libsub_static, +) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 C and CPP link/sub.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 C and CPP link/sub.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 C and CPP link/sub.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 C and CPP link/sub.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,19 @@ +/* Copyright © 2017 Dylan Baker + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "sub.h" + +float a_half(void) { + return .5; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 C and CPP link/sub.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 C and CPP link/sub.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 C and CPP link/sub.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 C and CPP link/sub.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,16 @@ +/* Copyright © 2017 Dylan Baker + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +float a_half(void); diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 whole archive/exe/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 whole archive/exe/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 whole archive/exe/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 whole archive/exe/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -exe = executable('prog', '../prog.c', link_with : sh_func2_linked_func1) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 whole archive/exe2/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 whole archive/exe2/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 whole archive/exe2/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 whole archive/exe2/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -exe2 = executable('prog2', '../prog.c', link_with : sh_only_link_whole) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 whole archive/exe3/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 whole archive/exe3/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 whole archive/exe3/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 whole archive/exe3/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -exe3 = executable('prog3', '../prog.c', link_with : sh_func2_dep_func1) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 whole archive/exe4/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 whole archive/exe4/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 whole archive/exe4/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 whole archive/exe4/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -exe4 = executable('prog4', '../prog.c', link_with : sh_func2_transdep_func1) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 whole archive/func1.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 whole archive/func1.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 whole archive/func1.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 whole archive/func1.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -#define BUILDING_DLL - -#include - -int func1() { - return 42; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 whole archive/func2.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 whole archive/func2.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 whole archive/func2.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 whole archive/func2.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -#define BUILDING_DLL - -#include - -int func2() { - return 42; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 whole archive/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 whole archive/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 whole archive/meson.build" 2018-12-09 16:31:03.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 whole archive/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ -project('whole archive', 'c') - -add_project_arguments('-I' + meson.source_root(), language : 'c') - -cc = meson.get_compiler('c') - -if cc.get_id() == 'msvc' - if cc.version().version_compare('<19') - error('MESON_SKIP_TEST link_whole only works on VS2015 or newer.') - endif -endif - -# Test 1: link_whole keeps all symbols -# Make static func1 -subdir('st_func1') -# Make shared func2 linking whole func1 archive -subdir('sh_func2_linked_func1') -# Link exe with shared library only -subdir('exe') -# Test that both func1 and func2 are accessible from shared library -test('prog', exe) - -# Test 2: link_whole can be used instead of source list, see #2180 -# Make static func2 -subdir('st_func2') -# Link both func1 and func2 into same shared library -# which does not have any sources other than 2 static libraries -subdir('sh_only_link_whole') -# Link exe2 with shared library only -subdir('exe2') -# Test that both func1 and func2 are accessible from shared library -test('prog2', exe2) - -# Test 3: link_whole can be used in declare_dependency() -func1_dep = declare_dependency(link_whole : [st_func1]) -# Use dependency to link func1 into shared library -subdir('sh_func2_dep_func1') -# Link exe3 with shared library -subdir('exe3') -# Test that both func1 and func2 are accessible from shared library -test('prog3', exe3) - -# Test 4: link_whole can be used in transitive declare_dependency() -func1_trans_dep = declare_dependency(dependencies : func1_dep) -# Use transitive dependency to link func1 into shared library -subdir('sh_func2_transdep_func1') -# Link exe4 with shared library -subdir('exe4') -# Test that both func1 and func2 are accessible from shared library -test('prog4', exe4) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 whole archive/mylib.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 whole archive/mylib.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 whole archive/mylib.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 whole archive/mylib.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -#pragma once - -/* Both funcs here for simplicity. */ - -#if defined _WIN32 || defined __CYGWIN__ -#if defined BUILDING_DLL - #define DLL_PUBLIC __declspec(dllexport) -#else - #define DLL_PUBLIC __declspec(dllimport) -#endif -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif - -int DLL_PUBLIC func1(); -int DLL_PUBLIC func2(); diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 whole archive/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 whole archive/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 whole archive/prog.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 whole archive/prog.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#include - -int main(int argc, char **argv) { - return func1() - func2(); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 whole archive/sh_func2_dep_func1/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 whole archive/sh_func2_dep_func1/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 whole archive/sh_func2_dep_func1/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 whole archive/sh_func2_dep_func1/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -# Same as sh_func2_linked_func1, # func2.c does not depend on func1(), -# so without link_whole compiler would throw func1() away. -# This is the same version of the test with a dependency object instead. -sh_func2_dep_func1 = shared_library('sh_func2_dep_func1', '../func2.c', dependencies : func1_dep) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 whole archive/sh_func2_linked_func1/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 whole archive/sh_func2_linked_func1/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 whole archive/sh_func2_linked_func1/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 whole archive/sh_func2_linked_func1/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -# Nothing in func2.c uses func1, so the linker would throw it -# away and thus linking the exe would fail. -sh_func2_linked_func1 = shared_library('sh_func2_linked_func1', '../func2.c', link_whole : st_func1) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 whole archive/sh_func2_transdep_func1/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 whole archive/sh_func2_transdep_func1/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 whole archive/sh_func2_transdep_func1/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 whole archive/sh_func2_transdep_func1/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -# Same as sh_func2_dep_func1 but dependency is transitive. -# func2.c does not have any reference to func1() so without link_whole compiler -# should throw func1() out. -sh_func2_transdep_func1 = shared_library( - 'sh_func2_transdep_func1', '../func2.c', - dependencies : func1_trans_dep) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 whole archive/sh_only_link_whole/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 whole archive/sh_only_link_whole/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 whole archive/sh_only_link_whole/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 whole archive/sh_only_link_whole/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -sh_only_link_whole = shared_library('sh_only_link_whole', link_whole : [st_func1, st_func2]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 whole archive/st_func1/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 whole archive/st_func1/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 whole archive/st_func1/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 whole archive/st_func1/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -st_func1 = static_library('st_func1', '../func1.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 whole archive/st_func2/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 whole archive/st_func2/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/142 whole archive/st_func2/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/142 whole archive/st_func2/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -st_func2 = static_library('st_func2', '../func2.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/143 C and CPP link/foobar.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/143 C and CPP link/foobar.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/143 C and CPP link/foobar.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/143 C and CPP link/foobar.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -/* Copyright © 2017 Dylan Baker - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "foo.h" -#include "foo.hpp" -#include "foobar.h" - -int get_number_index (void) { - return 1; -} - -void mynumbers(int nums[]) { - nums[0] = forty_two(); - nums[1] = six_one(); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/143 C and CPP link/foobar.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/143 C and CPP link/foobar.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/143 C and CPP link/foobar.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/143 C and CPP link/foobar.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -/* Copyright © 2017 Dylan Baker - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -void mynumbers(int nums[]); diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/143 C and CPP link/foo.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/143 C and CPP link/foo.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/143 C and CPP link/foo.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/143 C and CPP link/foo.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -/* Copyright © 2017 Dylan Baker - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "foo.h" - -int forty_two(void) { - return 42; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/143 C and CPP link/foo.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/143 C and CPP link/foo.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/143 C and CPP link/foo.cpp" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/143 C and CPP link/foo.cpp" 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -/* Copyright © 2017 Dylan Baker - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include - -const int cnums[] = {0, 61}; - -/* Provided by foobar.c */ -extern "C" int get_number_index (void); - -template -std::vector makeVector(const T (&data)[N]) -{ - return std::vector(data, data+N); -} - -namespace { - std::vector numbers = makeVector(cnums); -} - -extern "C" int six_one(void) { - return numbers[get_number_index ()]; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/143 C and CPP link/foo.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/143 C and CPP link/foo.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/143 C and CPP link/foo.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/143 C and CPP link/foo.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -/* Copyright © 2017 Dylan Baker - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -int forty_two(void); diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/143 C and CPP link/foo.hpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/143 C and CPP link/foo.hpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/143 C and CPP link/foo.hpp" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/143 C and CPP link/foo.hpp" 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -/* Copyright © 2017 Dylan Baker - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifdef __cplusplus -extern "C" { -#endif - -int six_one(void); - -#ifdef __cplusplus -} -#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/143 C and CPP link/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/143 C and CPP link/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/143 C and CPP link/meson.build" 2018-12-09 16:31:04.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/143 C and CPP link/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,117 +0,0 @@ -# Copyright © 2017 Dylan Baker -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -project('C and C++ static link test', ['c', 'cpp']) - -# Verify that adding link arguments works. -add_global_link_arguments('', language : 'c') -add_project_link_arguments('', language : 'c') - -libc = static_library('cfoo', ['foo.c', 'foo.h']) - -# Test that linking C libs to external static C++ libs uses the C++ linker -# Since we can't depend on the test system to provide this, we create one -# ourselves at configure time and then 'find' it with cxx.find_library(). -cxx = meson.get_compiler('cpp') - -if cxx.get_argument_syntax() == 'msvc' - if cxx.get_id() == 'msvc' - static_linker = find_program('lib') - elif cxx.get_id() == 'clang-cl' - static_linker = find_program('llvm-lib') - else - error('unable to determine static linker to use with this compiler') - endif - compile_cmd = ['/c', '@INPUT@', '/Fo@OUTPUT@'] - stlib_cmd = [static_linker, '/OUT:@OUTPUT@', '@INPUT@'] -else - compile_cmd = ['-c', '-fPIC', '@INPUT@', '-o', '@OUTPUT@'] - stlib_cmd = ['ar', 'csr', '@OUTPUT@', '@INPUT@'] -endif - -foo_cpp_o = configure_file( - input : 'foo.cpp', - output : 'foo.cpp.o', - command : cxx.cmd_array() + compile_cmd) - -configure_file( - input : foo_cpp_o, - output : 'libstcppext.a', - command : stlib_cmd) - -libstcppext = cxx.find_library('stcppext', dirs : meson.current_build_dir()) -lib_type_name = libstcppext.type_name() -assert(lib_type_name == 'library', 'type name is ' + lib_type_name) - -libfooext = shared_library( - 'fooext', - ['foobar.c', 'foobar.h'], - link_with : libc, - dependencies : libstcppext, -) - -# Test that linking C libs to internal static C++ libs uses the C++ linker -libcpp = static_library('cppfoo', ['foo.cpp', 'foo.hpp']) - -libfoo = shared_library( - 'foo', - ['foobar.c', 'foobar.h'], - link_with : [libc, libcpp], -) - -# Test that link_whole is also honored -# -# VS2010 lacks the /WHOLEARCHIVE option that later versions of MSVC support, so -# don't run this tests on that backend. -if not (cxx.get_id() == 'msvc' and cxx.version().version_compare('<19')) - libfoowhole = shared_library( - 'foowhole', - ['foobar.c', 'foobar.h'], - link_whole : [libc, libcpp], - ) -endif - -# Test sublinking (linking C and C++, then linking that to C) -libfoo_static = static_library( - 'foo_static', - ['foobar.c', 'foobar.h'], - link_with : [libc, libcpp], -) - -libsub = shared_library( - 'sub', - ['sub.c', 'sub.h'], - link_with : libfoo_static, -) - -if not (cxx.get_id() == 'msvc' and cxx.version().version_compare('<19')) - libsubwhole = shared_library( - 'subwhole', - ['sub.c', 'sub.h'], - link_whole : libfoo_static, - ) -endif - -# Test that it really is recursive -libsub_static = static_library( - 'sub_static', - ['sub.c', 'sub.h'], - link_with : libfoo_static, -) - -libsubsub = shared_library( - 'subsub', - ['dummy.c'], - link_with : libsub_static, -) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/143 C and CPP link/sub.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/143 C and CPP link/sub.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/143 C and CPP link/sub.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/143 C and CPP link/sub.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -/* Copyright © 2017 Dylan Baker - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "sub.h" - -float a_half(void) { - return .5; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/143 C and CPP link/sub.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/143 C and CPP link/sub.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/143 C and CPP link/sub.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/143 C and CPP link/sub.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -/* Copyright © 2017 Dylan Baker - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -float a_half(void); diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/143 mesonintrospect from scripts/check_env.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/143 mesonintrospect from scripts/check_env.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/143 mesonintrospect from scripts/check_env.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/143 mesonintrospect from scripts/check_env.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 + +import os +import sys +import shlex + +do_print = False + +if len(sys.argv) > 1: + do_print = bool(sys.argv[1]) + +if 'MESONINTROSPECT' not in os.environ: + raise RuntimeError('MESONINTROSPECT not found') + +mesonintrospect = os.environ['MESONINTROSPECT'] + +introspect_arr = shlex.split(mesonintrospect) + +# print(mesonintrospect) +# print(introspect_arr) + +some_executable = introspect_arr[0] + +if not os.path.isfile(some_executable): + raise RuntimeError('{!r} does not exist'.format(mesonintrospect)) + +if do_print: + print(some_executable, end='') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/143 mesonintrospect from scripts/check_introspection.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/143 mesonintrospect from scripts/check_introspection.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/143 mesonintrospect from scripts/check_introspection.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/143 mesonintrospect from scripts/check_introspection.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 + +import os +import shlex +import subprocess + + +if 'MESONINTROSPECT' not in os.environ: + raise RuntimeError('MESONINTROSPECT not found') +if 'MESON_BUILD_ROOT' not in os.environ: + raise RuntimeError('MESON_BUILD_ROOT not found') + +mesonintrospect = os.environ['MESONINTROSPECT'] +introspect_arr = shlex.split(mesonintrospect) + +buildroot = os.environ['MESON_BUILD_ROOT'] + +subprocess.check_output([*introspect_arr, '--all', buildroot]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/143 mesonintrospect from scripts/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/143 mesonintrospect from scripts/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/143 mesonintrospect from scripts/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/143 mesonintrospect from scripts/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,14 @@ +project('mesonintrospect from scripts', 'c') + +python = import('python3').find_python() + +ret = run_command(python, ['check_env.py', '1']) +if ret.returncode() == 0 + find_program(ret.stdout()) +else + message(ret.stdout()) + message(ret.stderr()) +endif + +meson.add_postconf_script('check_introspection.py') +meson.add_install_script('check_env.py') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/144 custom target multiple outputs/generator.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/144 custom target multiple outputs/generator.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/144 custom target multiple outputs/generator.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/144 custom target multiple outputs/generator.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,14 @@ +#!/usr/bin/env python3 + +import sys, os + +if len(sys.argv) != 3: + print(sys.argv[0], '', '') + +name = sys.argv[1] +odir = sys.argv[2] + +with open(os.path.join(odir, name + '.h'), 'w') as f: + f.write('int func();\n') +with open(os.path.join(odir, name + '.sh'), 'w') as f: + f.write('#!/bin/bash') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/144 custom target multiple outputs/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/144 custom target multiple outputs/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/144 custom target multiple outputs/installed_files.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/144 custom target multiple outputs/installed_files.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,6 @@ +usr/include/diff.h +usr/include/first.h +usr/bin/diff.sh +usr/bin/second.sh +opt/same.h +opt/same.sh diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/144 custom target multiple outputs/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/144 custom target multiple outputs/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/144 custom target multiple outputs/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/144 custom target multiple outputs/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,28 @@ +project('multiple outputs install', 'c') + +gen = find_program('generator.py') + +custom_target('different-install-dirs', + output : ['diff.h', 'diff.sh'], + command : [gen, 'diff', '@OUTDIR@'], + install : true, + install_dir : [join_paths(get_option('prefix'), get_option('includedir')), + join_paths(get_option('prefix'), get_option('bindir'))]) + +custom_target('same-install-dir', + output : ['same.h', 'same.sh'], + command : [gen, 'same', '@OUTDIR@'], + install : true, + install_dir : '/opt') + +custom_target('only-install-first', + output : ['first.h', 'first.sh'], + command : [gen, 'first', '@OUTDIR@'], + install : true, + install_dir : [join_paths(get_option('prefix'), get_option('includedir')), false]) + +custom_target('only-install-second', + output : ['second.h', 'second.sh'], + command : [gen, 'second', '@OUTDIR@'], + install : true, + install_dir : [false, join_paths(get_option('prefix'), get_option('bindir'))]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/144 mesonintrospect from scripts/check_env.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/144 mesonintrospect from scripts/check_env.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/144 mesonintrospect from scripts/check_env.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/144 mesonintrospect from scripts/check_env.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -#!/usr/bin/env python3 - -import os -import sys -import shlex - -do_print = False - -if len(sys.argv) > 1: - do_print = bool(sys.argv[1]) - -if 'MESONINTROSPECT' not in os.environ: - raise RuntimeError('MESONINTROSPECT not found') - -mesonintrospect = os.environ['MESONINTROSPECT'] - -introspect_arr = shlex.split(mesonintrospect) - -# print(mesonintrospect) -# print(introspect_arr) - -some_executable = introspect_arr[0] - -if not os.path.isfile(some_executable): - raise RuntimeError('{!r} does not exist'.format(mesonintrospect)) - -if do_print: - print(some_executable, end='') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/144 mesonintrospect from scripts/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/144 mesonintrospect from scripts/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/144 mesonintrospect from scripts/meson.build" 2018-12-09 16:31:05.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/144 mesonintrospect from scripts/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -project('mesonintrospect from scripts', 'c') - -python = import('python3').find_python() - -ret = run_command(python, ['check_env.py', '1']) -if ret.returncode() == 0 - find_program(ret.stdout()) -else - message(ret.stdout()) - message(ret.stderr()) -endif - -meson.add_postconf_script('check_env.py') -meson.add_install_script('check_env.py') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/145 custom target multiple outputs/generator.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/145 custom target multiple outputs/generator.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/145 custom target multiple outputs/generator.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/145 custom target multiple outputs/generator.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -#!/usr/bin/env python3 - -import sys, os - -if len(sys.argv) != 3: - print(sys.argv[0], '', '') - -name = sys.argv[1] -odir = sys.argv[2] - -with open(os.path.join(odir, name + '.h'), 'w') as f: - f.write('int func();\n') -with open(os.path.join(odir, name + '.sh'), 'w') as f: - f.write('#!/bin/bash') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/145 custom target multiple outputs/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/145 custom target multiple outputs/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/145 custom target multiple outputs/installed_files.txt" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/145 custom target multiple outputs/installed_files.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -usr/include/diff.h -usr/include/first.h -usr/bin/diff.sh -usr/bin/second.sh -opt/same.h -opt/same.sh diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/145 custom target multiple outputs/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/145 custom target multiple outputs/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/145 custom target multiple outputs/meson.build" 2018-12-09 16:31:06.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/145 custom target multiple outputs/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -project('multiple outputs install', 'c') - -gen = find_program('generator.py') - -custom_target('different-install-dirs', - output : ['diff.h', 'diff.sh'], - command : [gen, 'diff', '@OUTDIR@'], - install : true, - install_dir : [join_paths(get_option('prefix'), get_option('includedir')), - join_paths(get_option('prefix'), get_option('bindir'))]) - -custom_target('same-install-dir', - output : ['same.h', 'same.sh'], - command : [gen, 'same', '@OUTDIR@'], - install : true, - install_dir : '/opt') - -custom_target('only-install-first', - output : ['first.h', 'first.sh'], - command : [gen, 'first', '@OUTDIR@'], - install : true, - install_dir : [join_paths(get_option('prefix'), get_option('includedir')), false]) - -custom_target('only-install-second', - output : ['second.h', 'second.sh'], - command : [gen, 'second', '@OUTDIR@'], - install : true, - install_dir : [false, join_paths(get_option('prefix'), get_option('bindir'))]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/145 special characters/check_quoting.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/145 special characters/check_quoting.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/145 special characters/check_quoting.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/145 special characters/check_quoting.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 + +import sys + +expected = { + 'newline': '\n', + 'dollar': '$', + 'colon': ':', + 'space': ' ', + 'multi1': ' ::$$ ::$$', + 'multi2': ' ::$$\n\n \n\n::$$', +} + +output = None + +for arg in sys.argv[1:]: + try: + name, value = arg.split('=', 1) + except ValueError: + output = arg + continue + + if expected[name] != value: + raise RuntimeError('{!r} is {!r} but should be {!r}'.format(name, value, expected[name])) + +if output is not None: + with open(output, 'w') as f: + f.write('Success!') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/145 special characters/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/145 special characters/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/145 special characters/installed_files.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/145 special characters/installed_files.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +usr/share/result +usr/share/result2 diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/145 special characters/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/145 special characters/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/145 special characters/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/145 special characters/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,37 @@ +project('ninja special characters' ,'c') + +python = import('python3').find_python() + +# Without newlines, this should appear directly in build.ninja. +gen = custom_target('gen', + command : [ + python, + files('check_quoting.py'), + 'dollar=$', + 'colon=:', + 'space= ', + '''multi1= ::$$ ::$$''', + '@OUTPUT@'], + output : 'result', + install : true, + install_dir : get_option('datadir')) + +# With newlines, this should go through the exe wrapper. +gen2 = custom_target('gen2', + command : [ + python, + files('check_quoting.py'), + '''newline= +''', + 'dollar=$', + 'colon=:', + 'space= ', + '''multi2= ::$$ + + + +::$$''', + '@OUTPUT@'], + output : 'result2', + install : true, + install_dir : get_option('datadir')) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/146 nested links/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/146 nested links/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/146 nested links/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/146 nested links/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,8 @@ +project('test', 'c') + +libxserver_dri3 = [] +libxserver = [ libxserver_dri3 ] + +executable('Xephyr', 'xephyr.c', link_with: [ libxserver ]) + +executable('Zephyr', 'xephyr.c', link_args: [[], []]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/146 nested links/xephyr.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/146 nested links/xephyr.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/146 nested links/xephyr.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/146 nested links/xephyr.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,3 @@ +int main() { + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/146 special characters/check_quoting.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/146 special characters/check_quoting.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/146 special characters/check_quoting.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/146 special characters/check_quoting.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -#!/usr/bin/env python3 - -import sys - -expected = { - 'newline': '\n', - 'dollar': '$', - 'colon': ':', - 'space': ' ', - 'multi1': ' ::$$ ::$$', - 'multi2': ' ::$$\n\n \n\n::$$', -} - -output = None - -for arg in sys.argv[1:]: - try: - name, value = arg.split('=', 1) - except ValueError: - output = arg - continue - - if expected[name] != value: - raise RuntimeError('{!r} is {!r} but should be {!r}'.format(name, value, expected[name])) - -if output is not None: - with open(output, 'w') as f: - f.write('Success!') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/146 special characters/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/146 special characters/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/146 special characters/installed_files.txt" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/146 special characters/installed_files.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -usr/share/result -usr/share/result2 diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/146 special characters/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/146 special characters/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/146 special characters/meson.build" 2018-12-09 16:31:07.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/146 special characters/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -project('ninja special characters' ,'c') - -python = import('python3').find_python() - -# Without newlines, this should appear directly in build.ninja. -gen = custom_target('gen', - command : [ - python, - files('check_quoting.py'), - 'dollar=$', - 'colon=:', - 'space= ', - '''multi1= ::$$ ::$$''', - '@OUTPUT@'], - output : 'result', - install : true, - install_dir : get_option('datadir')) - -# With newlines, this should go through the exe wrapper. -gen2 = custom_target('gen2', - command : [ - python, - files('check_quoting.py'), - '''newline= -''', - 'dollar=$', - 'colon=:', - 'space= ', - '''multi2= ::$$ - - - -::$$''', - '@OUTPUT@'], - output : 'result2', - install : true, - install_dir : get_option('datadir')) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/147 list of file sources/foo" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/147 list of file sources/foo" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/147 list of file sources/foo" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/147 list of file sources/foo" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +some text diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/147 list of file sources/gen.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/147 list of file sources/gen.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/147 list of file sources/gen.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/147 list of file sources/gen.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,7 @@ +import shutil +import sys + +if __name__ == '__main__': + if len(sys.argv) != 3: + raise Exception('Requires exactly 2 args') + shutil.copy2(sys.argv[1], sys.argv[2]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/147 list of file sources/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/147 list of file sources/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/147 list of file sources/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/147 list of file sources/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,12 @@ +project('test', 'c') + +mod_py = import('python3') +python = mod_py.find_python() + +test_target = custom_target( + 'test_target', + input : [files('gen.py'), files('foo')], + output : 'bar', + command : [python, '@INPUT0@', '@INPUT1@', '@OUTPUT@'], + build_by_default : true, +) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/147 nested links/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/147 nested links/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/147 nested links/meson.build" 2018-12-09 16:31:08.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/147 nested links/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -project('test', 'c') - -libxserver_dri3 = [] -libxserver = [ libxserver_dri3 ] - -executable('Xephyr', 'xephyr.c', link_with: [ libxserver ]) - -executable('Zephyr', 'xephyr.c', link_args: [[], []]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/147 nested links/xephyr.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/147 nested links/xephyr.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/147 nested links/xephyr.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/147 nested links/xephyr.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -int main() { - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/148 link depends custom target/foo.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/148 link depends custom target/foo.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/148 link depends custom target/foo.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/148 link depends custom target/foo.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,15 @@ +#include + +int main() { + const char *fn = DEPFILE; + FILE *f = fopen(fn, "r"); + if (!f) { + printf("could not open %s", fn); + return 1; + } + else { + printf("successfully opened %s", fn); + } + + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/148 link depends custom target/make_file.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/148 link depends custom target/make_file.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/148 link depends custom target/make_file.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/148 link depends custom target/make_file.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +#!/usr/bin/env python3 +import sys + +with open(sys.argv[1], 'w') as f: + print('# this file does nothing', file=f) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/148 link depends custom target/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/148 link depends custom target/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/148 link depends custom target/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/148 link depends custom target/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,19 @@ +project('link_depends_custom_target', 'c') + +if meson.backend().startswith('vs') + # FIXME: Broken on the VS backends + error('MESON_SKIP_TEST see https://github.com/mesonbuild/meson/issues/1799') +endif + +cmd = find_program('make_file.py') + +dep_file = custom_target('gen_dep', + command: [cmd, '@OUTPUT@'], + output: 'dep_file') + +exe = executable('foo', 'foo.c', + link_depends: dep_file, + c_args: ['-DDEPFILE="' + dep_file.full_path()+ '"']) + +# check that dep_file exists, which means that link_depends target ran +test('runtest', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/148 list of file sources/foo" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/148 list of file sources/foo" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/148 list of file sources/foo" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/148 list of file sources/foo" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -some text diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/148 list of file sources/gen.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/148 list of file sources/gen.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/148 list of file sources/gen.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/148 list of file sources/gen.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -import shutil -import sys - -if __name__ == '__main__': - if len(sys.argv) != 3: - raise Exception('Requires exactly 2 args') - shutil.copy2(sys.argv[1], sys.argv[2]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/148 list of file sources/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/148 list of file sources/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/148 list of file sources/meson.build" 2018-12-09 16:31:09.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/148 list of file sources/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -project('test', 'c') - -mod_py = import('python3') -python = mod_py.find_python() - -test_target = custom_target( - 'test_target', - input : [files('gen.py'), files('foo')], - output : 'bar', - command : [python, '@INPUT0@', '@INPUT1@', '@OUTPUT@'], - build_by_default : true, -) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 link depends custom target/foo.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 link depends custom target/foo.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 link depends custom target/foo.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 link depends custom target/foo.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -#include - -int main() { - const char *fn = DEPFILE; - FILE *f = fopen(fn, "r"); - if (!f) { - printf("could not open %s", fn); - return 1; - } - else { - printf("successfully opened %s", fn); - } - - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 link depends custom target/make_file.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 link depends custom target/make_file.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 link depends custom target/make_file.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 link depends custom target/make_file.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#!/usr/bin/env python3 -import sys - -with open(sys.argv[1], 'w') as f: - print('# this file does nothing', file=f) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 link depends custom target/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 link depends custom target/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 link depends custom target/meson.build" 2018-12-09 16:31:09.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 link depends custom target/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -project('link_depends_custom_target', 'c') - -if meson.backend().startswith('vs') - # FIXME: Broken on the VS backends - error('MESON_SKIP_TEST see https://github.com/mesonbuild/meson/issues/1799') -endif - -cmd = find_program('make_file.py') - -dep_file = custom_target('gen_dep', - command: [cmd, '@OUTPUT@'], - output: 'dep_file') - -exe = executable('foo', 'foo.c', - link_depends: dep_file, - c_args: ['-DDEPFILE="' + dep_file.full_path()+ '"']) - -# check that dep_file exists, which means that link_depends target ran -test('runtest', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/3rdorderdeps/lib.c.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/3rdorderdeps/lib.c.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/3rdorderdeps/lib.c.in" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/3rdorderdeps/lib.c.in" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,8 @@ +#include "../lib.h" + +int get_@DEPENDENCY@dep_value (void); + +SYMBOL_EXPORT +int get_@LIBTYPE@@DEPENDENCY@dep_value (void) { + return get_@DEPENDENCY@dep_value (); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/3rdorderdeps/main.c.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/3rdorderdeps/main.c.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/3rdorderdeps/main.c.in" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/3rdorderdeps/main.c.in" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,16 @@ +#include + +#include "../lib.h" + +SYMBOL_IMPORT int get_@LIBTYPE@@DEPENDENCY@dep_value (void); + +int main(int argc, char *argv[]) { + int val; + + val = get_@LIBTYPE@@DEPENDENCY@dep_value (); + if (val != @VALUE@) { + printf("@LIBTYPE@@DEPENDENCY@ was %i instead of @VALUE@\n", val); + return -1; + } + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/3rdorderdeps/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/3rdorderdeps/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/3rdorderdeps/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/3rdorderdeps/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,49 @@ +dep3_libs = [] + +# Permutate all combinations of shared and static libraries up to three levels +# executable -> shared -> static -> shared (etc) +foreach dep2 : ['sh', 'st'] + foreach dep1 : ['sh', 'st'] + foreach libtype : ['sh', 'st'] + name = libtype + dep1 + dep2 + if dep2 == 'sh' + libret = 1 + elif dep2 == 'st' + libret = 2 + else + error('Unknown dep2 "@0@"'.format(dep2)) + endif + + if libtype == 'sh' + target = 'shared_library' + build_args = [] + elif libtype == 'st' + target = 'static_library' + build_args = ['-DMESON_STATIC_BUILD'] + else + error('Unknown libtype "@0@"'.format(libtype)) + endif + + cdata = configuration_data() + cdata.set('DEPENDENCY', dep1 + dep2) + cdata.set('LIBTYPE', libtype) + cdata.set('VALUE', libret) + + lib_c = configure_file(input : 'lib.c.in', + output : name + '-lib.c', + configuration : cdata) + dep = get_variable(dep1 + dep2 + 'dep') + dep3_lib = build_target(name, lib_c, link_with : dep, + target_type : target, + c_args : build_args) + dep3_libs += [dep3_lib] + + main_c = configure_file(input : 'main.c.in', + output : name + '-main.c', + configuration : cdata) + dep3_bin = executable(name, main_c, link_with : dep3_lib, + c_args : build_args) + test(name + 'test', dep3_bin) + endforeach + endforeach +endforeach diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/circular/lib1.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/circular/lib1.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/circular/lib1.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/circular/lib1.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,6 @@ +int get_st2_prop (void); +int get_st3_prop (void); + +int get_st1_value (void) { + return get_st2_prop () + get_st3_prop (); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/circular/lib2.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/circular/lib2.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/circular/lib2.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/circular/lib2.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,6 @@ +int get_st1_prop (void); +int get_st3_prop (void); + +int get_st2_value (void) { + return get_st1_prop () + get_st3_prop (); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/circular/lib3.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/circular/lib3.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/circular/lib3.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/circular/lib3.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,6 @@ +int get_st1_prop (void); +int get_st2_prop (void); + +int get_st3_value (void) { + return get_st1_prop () + get_st2_prop (); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/circular/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/circular/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/circular/main.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/circular/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,28 @@ +#include + +#include "../lib.h" + +int get_st1_value (void); +int get_st2_value (void); +int get_st3_value (void); + +int main(int argc, char *argv[]) { + int val; + + val = get_st1_value (); + if (val != 5) { + printf("st1 value was %i instead of 5\n", val); + return -1; + } + val = get_st2_value (); + if (val != 4) { + printf("st2 value was %i instead of 4\n", val); + return -2; + } + val = get_st3_value (); + if (val != 3) { + printf("st3 value was %i instead of 3\n", val); + return -3; + } + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/circular/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/circular/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/circular/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/circular/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +st1 = static_library('st1', 'lib1.c', 'prop1.c') +st2 = static_library('st2', 'lib2.c', 'prop2.c') +st3 = static_library('st3', 'lib3.c', 'prop3.c') + +test('circular', executable('circular', 'main.c', link_with : [st1, st2, st3])) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/circular/prop1.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/circular/prop1.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/circular/prop1.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/circular/prop1.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +int get_st1_prop (void) { + return 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/circular/prop2.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/circular/prop2.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/circular/prop2.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/circular/prop2.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +int get_st2_prop (void) { + return 2; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/circular/prop3.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/circular/prop3.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/circular/prop3.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/circular/prop3.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +int get_st3_prop (void) { + return 3; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/edge-cases/libsto.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/edge-cases/libsto.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/edge-cases/libsto.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/edge-cases/libsto.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,8 @@ +#include "../lib.h" + +int get_builto_value (void); + +SYMBOL_EXPORT +int get_stodep_value (void) { + return get_builto_value (); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/edge-cases/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/edge-cases/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/edge-cases/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/edge-cases/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,9 @@ +# Test https://github.com/mesonbuild/meson/issues/2096 +# Note that removing 'shnodep' from link_with: makes the error go away because +# then it is added after the static library is added to the link command. +test('shared-static', executable('shstexe', 'shstmain.c', link_with : [shnodep, stshdep])) + +# Static library that needs a symbol defined in an object file. This already +# works, but good to add a test case early. +stodep = static_library('stodep', 'libsto.c') +test('stodep', executable('stodep', 'stomain.c', 'stobuilt.c', link_with : stodep)) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/edge-cases/shstmain.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/edge-cases/shstmain.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/edge-cases/shstmain.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/edge-cases/shstmain.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,16 @@ +#include + +#include "../lib.h" + +int get_stshdep_value (void); + +int main(int argc, char *argv[]) { + int val; + + val = get_stshdep_value (); + if (val != 1) { + printf("st1 value was %i instead of 1\n", val); + return -1; + } + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/edge-cases/stobuilt.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/edge-cases/stobuilt.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/edge-cases/stobuilt.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/edge-cases/stobuilt.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,7 @@ +#include "../lib.h" + + +SYMBOL_EXPORT +int get_builto_value (void) { + return 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/edge-cases/stomain.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/edge-cases/stomain.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/edge-cases/stomain.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/edge-cases/stomain.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,16 @@ +#include + +#include "../lib.h" + +int get_stodep_value (void); + +int main(int argc, char *argv[]) { + int val; + + val = get_stodep_value (); + if (val != 1) { + printf("st1 value was %i instead of 1\n", val); + return -1; + } + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/lib.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/lib.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/lib.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/lib.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,17 @@ +#if defined _WIN32 + #ifdef MESON_STATIC_BUILD + #define SYMBOL_EXPORT + #define SYMBOL_IMPORT + #else + #define SYMBOL_IMPORT __declspec(dllimport) + #define SYMBOL_EXPORT __declspec(dllexport) + #endif +#else + #define SYMBOL_IMPORT + #if defined __GNUC__ + #define SYMBOL_EXPORT __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define SYMBOL_EXPORT + #endif +#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/main.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,46 @@ +#include + +#include "lib.h" + +int get_stnodep_value (void); +int get_stshdep_value (void); +int get_ststdep_value (void); +SYMBOL_IMPORT int get_shnodep_value (void); +SYMBOL_IMPORT int get_shshdep_value (void); +SYMBOL_IMPORT int get_shstdep_value (void); + +int main(int argc, char *argv[]) { + int val; + + val = get_shnodep_value (); + if (val != 1) { + printf("shnodep was %i instead of 1\n", val); + return -1; + } + val = get_stnodep_value (); + if (val != 2) { + printf("stnodep was %i instead of 2\n", val); + return -2; + } + val = get_shshdep_value (); + if (val != 1) { + printf("shshdep was %i instead of 1\n", val); + return -3; + } + val = get_shstdep_value (); + if (val != 2) { + printf("shstdep was %i instead of 2\n", val); + return -4; + } + val = get_stshdep_value (); + if (val != 1) { + printf("shstdep was %i instead of 1\n", val); + return -5; + } + val = get_ststdep_value (); + if (val != 2) { + printf("ststdep was %i instead of 2\n", val); + return -6; + } + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,29 @@ +project('recursive dependencies', 'c') + +# Test that you can link a shared executable to: +# - A shared library with no other deps +subdir('shnodep') +# - A static library with no other deps +subdir('stnodep') +# - A shared library with a shared library dep +subdir('shshdep') +# - A shared library with a static library dep +subdir('shstdep') +# - A static library with a shared library dep +subdir('stshdep') +# - A static library with a static library dep +subdir('ststdep') + +test('alldeps', + executable('alldeps', 'main.c', + link_with : [shshdep, shstdep, ststdep, stshdep])) + +# More combinations of static and shared libraries +subdir('3rdorderdeps') + +# Circular dependencies between static libraries +# This requires the use of --start/end-group with GNU ld +subdir('circular') + +# Various edge cases that have been reported +subdir('edge-cases') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/shnodep/lib.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/shnodep/lib.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/shnodep/lib.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/shnodep/lib.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,6 @@ +#include "../lib.h" + +SYMBOL_EXPORT +int get_shnodep_value (void) { + return 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/shnodep/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/shnodep/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/shnodep/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/shnodep/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +shnodep = shared_library('shnodep', 'lib.c', version: '0.0.0') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/shshdep/lib.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/shshdep/lib.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/shshdep/lib.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/shshdep/lib.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,8 @@ +#include "../lib.h" + +int get_shnodep_value (void); + +SYMBOL_EXPORT +int get_shshdep_value (void) { + return get_shnodep_value (); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/shshdep/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/shshdep/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/shshdep/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/shshdep/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +shshdep = shared_library('shshdep', 'lib.c', link_with : shnodep) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/shstdep/lib.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/shstdep/lib.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/shstdep/lib.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/shstdep/lib.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,8 @@ +#include "../lib.h" + +int get_stnodep_value (void); + +SYMBOL_EXPORT +int get_shstdep_value (void) { + return get_stnodep_value (); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/shstdep/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/shstdep/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/shstdep/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/shstdep/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +shstdep = shared_library('shstdep', 'lib.c', link_with : stnodep) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/stnodep/lib.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/stnodep/lib.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/stnodep/lib.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/stnodep/lib.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,6 @@ +#include "../lib.h" + +SYMBOL_EXPORT +int get_stnodep_value (void) { + return 2; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/stnodep/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/stnodep/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/stnodep/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/stnodep/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +stnodep = static_library('stnodep', 'lib.c', + c_args : '-DMESON_STATIC_BUILD') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/stshdep/lib.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/stshdep/lib.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/stshdep/lib.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/stshdep/lib.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,8 @@ +#include "../lib.h" + +int get_shnodep_value (void); + +SYMBOL_EXPORT +int get_stshdep_value (void) { + return get_shnodep_value (); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/stshdep/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/stshdep/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/stshdep/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/stshdep/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +stshdep = static_library('stshdep', 'lib.c', link_with : shnodep, + c_args : '-DMESON_STATIC_BUILD') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/ststdep/lib.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/ststdep/lib.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/ststdep/lib.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/ststdep/lib.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,8 @@ +#include "../lib.h" + +int get_stnodep_value (void); + +SYMBOL_EXPORT +int get_ststdep_value (void) { + return get_stnodep_value (); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/ststdep/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/ststdep/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/149 recursive linking/ststdep/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/149 recursive linking/ststdep/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +ststdep = static_library('ststdep', 'lib.c', link_with : stnodep, + c_args : '-DMESON_STATIC_BUILD') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/14 configure file/check_inputs.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/14 configure file/check_inputs.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/14 configure file/check_inputs.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/14 configure file/check_inputs.py" 2019-09-28 23:52:33.000000000 +0000 @@ -0,0 +1,14 @@ +#!/usr/bin/env python3 + +import sys +from pathlib import Path + +files = [Path(f) for f in sys.argv[1:]] +names = [f.name for f in files] + +assert names == ['check_inputs.txt', 'prog.c', 'prog.c', 'prog2.c', 'prog4.c', 'prog5.c'] +for f in files[1:]: + assert f.exists() + +with files[0].open('w') as ofile: + ofile.write("#define ZERO_RESULT 0\n") diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/14 configure file/generator-deps.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/14 configure file/generator-deps.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/14 configure file/generator-deps.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/14 configure file/generator-deps.py" 2019-10-06 17:01:35.000000000 +0000 @@ -0,0 +1,19 @@ +#!/usr/bin/env python3 + +import sys, os +from pathlib import Path + +if len(sys.argv) != 3: + print("Wrong amount of parameters.") + +build_dir = Path(os.environ['MESON_BUILD_ROOT']) +subdir = Path(os.environ['MESON_SUBDIR']) +outputf = Path(sys.argv[1]) + +with outputf.open('w') as ofile: + ofile.write("#define ZERO_RESULT 0\n") + +depf = Path(sys.argv[2]) +if not depf.exists(): + with depf.open('w') as ofile: + ofile.write("{}: depfile\n".format(outputf.name)) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/14 configure file/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/14 configure file/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/14 configure file/meson.build" 2018-12-09 16:28:59.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/14 configure file/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -57,6 +57,17 @@ error('Error running command: @0@\n@1@'.format(ret.stdout(), ret.stderr())) endif +genscript2deps = '@0@/generator-deps.py'.format(meson.current_source_dir()) +ofile2deps = '@0@/config2deps.h'.format(meson.current_build_dir()) +outf = configure_file( + output : 'config2deps.h', + depfile : 'depfile.d', + command : [genprog, genscript2deps, ofile2deps, '@DEPFILE@']) +ret = run_command(check_file, outf) +if ret.returncode() != 0 + error('Error running command: @0@\n@1@'.format(ret.stdout(), ret.stderr())) +endif + found_script = find_program('generator.py') # More configure_file tests in here subdir('subdir') @@ -141,6 +152,19 @@ install_dir : '', configuration : conf) +# test install_dir : false (deprecated) +cfile = configure_file(input : 'config.h.in', + output : 'do_not_get_installed_please.h', + install_dir : false, + configuration : conf) + +# test intsall_dir with install: false +cfile = configure_file(input : 'config.h.in', + output : 'do_not_get_installed_in_install_dir.h', + install : false, + install_dir : 'share/appdir', + configuration : conf) + # Test escaping with cmake format conf7 = configuration_data() conf7.set('var1', 'foo') @@ -270,3 +294,9 @@ ) test('test9', executable('prog9', 'prog9.c')) + +check_inputs = find_program('check_inputs.py') +configure_file(output : 'check_inputs.txt', + input : ['prog.c', files('prog2.c', 'prog4.c')], + command : [check_inputs, '@OUTPUT@', '@INPUT0@', '@INPUT@', files('prog5.c')] +) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 library at root/lib.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 library at root/lib.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 library at root/lib.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 library at root/lib.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,6 @@ +#if defined _WIN32 || defined __CYGWIN__ +__declspec(dllexport) +#endif +int fn(void) { + return -1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 library at root/main/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 library at root/main/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 library at root/main/main.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 library at root/main/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +extern int fn(void); + +int main() { + return 1 + fn(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 library at root/main/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 library at root/main/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 library at root/main/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 library at root/main/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +exe = executable('main', 'main.c', link_with : lib) +test('stuff works', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 library at root/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 library at root/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 library at root/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 library at root/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +project('lib@root', 'c') +lib = shared_library('lib', 'lib.c') +subdir('main') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/3rdorderdeps/lib.c.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/3rdorderdeps/lib.c.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/3rdorderdeps/lib.c.in" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/3rdorderdeps/lib.c.in" 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -#include "../lib.h" - -int get_@DEPENDENCY@dep_value (void); - -SYMBOL_EXPORT -int get_@LIBTYPE@@DEPENDENCY@dep_value (void) { - return get_@DEPENDENCY@dep_value (); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/3rdorderdeps/main.c.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/3rdorderdeps/main.c.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/3rdorderdeps/main.c.in" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/3rdorderdeps/main.c.in" 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -#include - -#include "../lib.h" - -SYMBOL_IMPORT int get_@LIBTYPE@@DEPENDENCY@dep_value (void); - -int main(int argc, char *argv[]) { - int val; - - val = get_@LIBTYPE@@DEPENDENCY@dep_value (); - if (val != @VALUE@) { - printf("@LIBTYPE@@DEPENDENCY@ was %i instead of @VALUE@\n", val); - return -1; - } - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/3rdorderdeps/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/3rdorderdeps/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/3rdorderdeps/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/3rdorderdeps/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ -dep3_libs = [] - -# Permutate all combinations of shared and static libraries up to three levels -# executable -> shared -> static -> shared (etc) -foreach dep2 : ['sh', 'st'] - foreach dep1 : ['sh', 'st'] - foreach libtype : ['sh', 'st'] - name = libtype + dep1 + dep2 - if dep2 == 'sh' - libret = 1 - elif dep2 == 'st' - libret = 2 - else - error('Unknown dep2 "@0@"'.format(dep2)) - endif - - if libtype == 'sh' - target = 'shared_library' - build_args = [] - elif libtype == 'st' - target = 'static_library' - build_args = ['-DMESON_STATIC_BUILD'] - else - error('Unknown libtype "@0@"'.format(libtype)) - endif - - cdata = configuration_data() - cdata.set('DEPENDENCY', dep1 + dep2) - cdata.set('LIBTYPE', libtype) - cdata.set('VALUE', libret) - - lib_c = configure_file(input : 'lib.c.in', - output : name + '-lib.c', - configuration : cdata) - dep = get_variable(dep1 + dep2 + 'dep') - dep3_lib = build_target(name, lib_c, link_with : dep, - target_type : target, - c_args : build_args) - dep3_libs += [dep3_lib] - - main_c = configure_file(input : 'main.c.in', - output : name + '-main.c', - configuration : cdata) - dep3_bin = executable(name, main_c, link_with : dep3_lib, - c_args : build_args) - test(name + 'test', dep3_bin) - endforeach - endforeach -endforeach diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/circular/lib1.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/circular/lib1.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/circular/lib1.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/circular/lib1.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -int get_st2_prop (void); -int get_st3_prop (void); - -int get_st1_value (void) { - return get_st2_prop () + get_st3_prop (); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/circular/lib2.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/circular/lib2.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/circular/lib2.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/circular/lib2.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -int get_st1_prop (void); -int get_st3_prop (void); - -int get_st2_value (void) { - return get_st1_prop () + get_st3_prop (); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/circular/lib3.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/circular/lib3.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/circular/lib3.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/circular/lib3.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -int get_st1_prop (void); -int get_st2_prop (void); - -int get_st3_value (void) { - return get_st1_prop () + get_st2_prop (); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/circular/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/circular/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/circular/main.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/circular/main.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -#include - -#include "../lib.h" - -int get_st1_value (void); -int get_st2_value (void); -int get_st3_value (void); - -int main(int argc, char *argv[]) { - int val; - - val = get_st1_value (); - if (val != 5) { - printf("st1 value was %i instead of 5\n", val); - return -1; - } - val = get_st2_value (); - if (val != 4) { - printf("st2 value was %i instead of 4\n", val); - return -2; - } - val = get_st3_value (); - if (val != 3) { - printf("st3 value was %i instead of 3\n", val); - return -3; - } - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/circular/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/circular/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/circular/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/circular/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -st1 = static_library('st1', 'lib1.c', 'prop1.c') -st2 = static_library('st2', 'lib2.c', 'prop2.c') -st3 = static_library('st3', 'lib3.c', 'prop3.c') - -test('circular', executable('circular', 'main.c', link_with : [st1, st2, st3])) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/circular/prop1.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/circular/prop1.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/circular/prop1.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/circular/prop1.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -int get_st1_prop (void) { - return 1; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/circular/prop2.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/circular/prop2.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/circular/prop2.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/circular/prop2.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -int get_st2_prop (void) { - return 2; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/circular/prop3.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/circular/prop3.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/circular/prop3.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/circular/prop3.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -int get_st3_prop (void) { - return 3; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/edge-cases/libsto.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/edge-cases/libsto.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/edge-cases/libsto.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/edge-cases/libsto.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -#include "../lib.h" - -int get_builto_value (void); - -SYMBOL_EXPORT -int get_stodep_value (void) { - return get_builto_value (); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/edge-cases/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/edge-cases/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/edge-cases/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/edge-cases/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -# Test https://github.com/mesonbuild/meson/issues/2096 -# Note that removing 'shnodep' from link_with: makes the error go away because -# then it is added after the static library is added to the link command. -test('shared-static', executable('shstexe', 'shstmain.c', link_with : [shnodep, stshdep])) - -# Static library that needs a symbol defined in an object file. This already -# works, but good to add a test case early. -stodep = static_library('stodep', 'libsto.c') -test('stodep', executable('stodep', 'stomain.c', 'stobuilt.c', link_with : stodep)) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/edge-cases/shstmain.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/edge-cases/shstmain.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/edge-cases/shstmain.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/edge-cases/shstmain.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -#include - -#include "../lib.h" - -int get_stshdep_value (void); - -int main(int argc, char *argv[]) { - int val; - - val = get_stshdep_value (); - if (val != 1) { - printf("st1 value was %i instead of 1\n", val); - return -1; - } - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/edge-cases/stobuilt.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/edge-cases/stobuilt.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/edge-cases/stobuilt.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/edge-cases/stobuilt.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -#include "../lib.h" - - -SYMBOL_EXPORT -int get_builto_value (void) { - return 1; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/edge-cases/stomain.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/edge-cases/stomain.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/edge-cases/stomain.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/edge-cases/stomain.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -#include - -#include "../lib.h" - -int get_stodep_value (void); - -int main(int argc, char *argv[]) { - int val; - - val = get_stodep_value (); - if (val != 1) { - printf("st1 value was %i instead of 1\n", val); - return -1; - } - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/lib.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/lib.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/lib.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/lib.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -#if defined _WIN32 - #ifdef MESON_STATIC_BUILD - #define SYMBOL_EXPORT - #define SYMBOL_IMPORT - #else - #define SYMBOL_IMPORT __declspec(dllimport) - #define SYMBOL_EXPORT __declspec(dllexport) - #endif -#else - #define SYMBOL_IMPORT - #if defined __GNUC__ - #define SYMBOL_EXPORT __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define SYMBOL_EXPORT - #endif -#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/main.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/main.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -#include - -#include "lib.h" - -int get_stnodep_value (void); -int get_stshdep_value (void); -int get_ststdep_value (void); -SYMBOL_IMPORT int get_shnodep_value (void); -SYMBOL_IMPORT int get_shshdep_value (void); -SYMBOL_IMPORT int get_shstdep_value (void); - -int main(int argc, char *argv[]) { - int val; - - val = get_shnodep_value (); - if (val != 1) { - printf("shnodep was %i instead of 1\n", val); - return -1; - } - val = get_stnodep_value (); - if (val != 2) { - printf("stnodep was %i instead of 2\n", val); - return -2; - } - val = get_shshdep_value (); - if (val != 1) { - printf("shshdep was %i instead of 1\n", val); - return -3; - } - val = get_shstdep_value (); - if (val != 2) { - printf("shstdep was %i instead of 2\n", val); - return -4; - } - val = get_stshdep_value (); - if (val != 1) { - printf("shstdep was %i instead of 1\n", val); - return -5; - } - val = get_ststdep_value (); - if (val != 2) { - printf("ststdep was %i instead of 2\n", val); - return -6; - } - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/meson.build" 2018-12-09 16:31:13.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -project('recursive dependencies', 'c') - -# Test that you can link a shared executable to: -# - A shared library with no other deps -subdir('shnodep') -# - A static library with no other deps -subdir('stnodep') -# - A shared library with a shared library dep -subdir('shshdep') -# - A shared library with a static library dep -subdir('shstdep') -# - A static library with a shared library dep -subdir('stshdep') -# - A static library with a static library dep -subdir('ststdep') - -test('alldeps', - executable('alldeps', 'main.c', - link_with : [shshdep, shstdep, ststdep, stshdep])) - -# More combinations of static and shared libraries -subdir('3rdorderdeps') - -# Circular dependencies between static libraries -# This requires the use of --start/end-group with GNU ld -subdir('circular') - -# Various edge cases that have been reported -subdir('edge-cases') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/shnodep/lib.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/shnodep/lib.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/shnodep/lib.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/shnodep/lib.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#include "../lib.h" - -SYMBOL_EXPORT -int get_shnodep_value (void) { - return 1; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/shnodep/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/shnodep/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/shnodep/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/shnodep/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -shnodep = shared_library('shnodep', 'lib.c', version: '0.0.0') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/shshdep/lib.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/shshdep/lib.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/shshdep/lib.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/shshdep/lib.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -#include "../lib.h" - -int get_shnodep_value (void); - -SYMBOL_EXPORT -int get_shshdep_value (void) { - return get_shnodep_value (); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/shshdep/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/shshdep/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/shshdep/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/shshdep/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -shshdep = shared_library('shshdep', 'lib.c', link_with : shnodep) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/shstdep/lib.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/shstdep/lib.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/shstdep/lib.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/shstdep/lib.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -#include "../lib.h" - -int get_stnodep_value (void); - -SYMBOL_EXPORT -int get_shstdep_value (void) { - return get_stnodep_value (); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/shstdep/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/shstdep/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/shstdep/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/shstdep/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -shstdep = shared_library('shstdep', 'lib.c', link_with : stnodep) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/stnodep/lib.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/stnodep/lib.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/stnodep/lib.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/stnodep/lib.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#include "../lib.h" - -SYMBOL_EXPORT -int get_stnodep_value (void) { - return 2; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/stnodep/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/stnodep/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/stnodep/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/stnodep/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -stnodep = static_library('stnodep', 'lib.c', - c_args : '-DMESON_STATIC_BUILD') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/stshdep/lib.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/stshdep/lib.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/stshdep/lib.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/stshdep/lib.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -#include "../lib.h" - -int get_shnodep_value (void); - -SYMBOL_EXPORT -int get_stshdep_value (void) { - return get_shnodep_value (); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/stshdep/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/stshdep/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/stshdep/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/stshdep/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -stshdep = static_library('stshdep', 'lib.c', link_with : shnodep, - c_args : '-DMESON_STATIC_BUILD') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/ststdep/lib.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/ststdep/lib.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/ststdep/lib.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/ststdep/lib.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -#include "../lib.h" - -int get_stnodep_value (void); - -SYMBOL_EXPORT -int get_ststdep_value (void) { - return get_stnodep_value (); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/ststdep/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/ststdep/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/150 recursive linking/ststdep/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/150 recursive linking/ststdep/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -ststdep = static_library('ststdep', 'lib.c', link_with : stnodep, - c_args : '-DMESON_STATIC_BUILD') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/151 library at root/lib.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/151 library at root/lib.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/151 library at root/lib.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/151 library at root/lib.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#if defined _WIN32 || defined __CYGWIN__ -__declspec(dllexport) -#endif -int fn(void) { - return -1; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/151 library at root/main/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/151 library at root/main/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/151 library at root/main/main.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/151 library at root/main/main.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -extern int fn(void); - -int main() { - return 1 + fn(); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/151 library at root/main/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/151 library at root/main/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/151 library at root/main/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/151 library at root/main/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -exe = executable('main', 'main.c', link_with : lib) -test('stuff works', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/151 library at root/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/151 library at root/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/151 library at root/meson.build" 2018-12-09 16:31:12.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/151 library at root/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -project('lib@root', 'c') -lib = shared_library('lib', 'lib.c') -subdir('main') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/151 simd/fallback.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/151 simd/fallback.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/151 simd/fallback.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/151 simd/fallback.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,8 @@ +#include + +void increment_fallback(float arr[4]) { + int i; + for(i=0; i<4; i++) { + arr[i]++; + } +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/151 simd/include/simdheader.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/151 simd/include/simdheader.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/151 simd/include/simdheader.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/151 simd/include/simdheader.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +#pragma once + +#define I_CAN_HAZ_SIMD diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/151 simd/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/151 simd/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/151 simd/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/151 simd/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,44 @@ +project('simd', 'c') + +simd = import('unstable-simd') + +cc = meson.get_compiler('c') + +cdata = configuration_data() + +if not meson.is_cross_build() and host_machine.cpu_family() == 'arm' and cc.get_id() == 'clang' + message('Adding -march=armv7 because assuming that this build happens on Raspbian.') + message('Its Clang seems to be misconfigured and does not support NEON by default.') + add_project_arguments('-march=armv7', language : 'c') +endif + +if cc.get_id() == 'msvc' and cc.version().version_compare('<17') + error('MESON_SKIP_TEST VS2010 produces broken binaries on x86.') +endif + +# FIXME add [a, b] = function() +rval = simd.check('mysimds', + mmx : 'simd_mmx.c', + sse : 'simd_sse.c', + sse2 : 'simd_sse2.c', + sse3 : 'simd_sse3.c', + ssse3 : 'simd_ssse3.c', + sse41 : 'simd_sse41.c', + sse42 : 'simd_sse42.c', + avx : 'simd_avx.c', + avx2 : 'simd_avx2.c', + neon : 'simd_neon.c', + compiler : cc, + include_directories : include_directories('include')) + +simdlibs = rval[0] +cdata.merge_from(rval[1]) + +configure_file(output : 'simdconfig.h', + configuration : cdata) + +p = executable('simdtest', 'simdchecker.c', 'fallback.c', + link_with : simdlibs) + +test('simdtest', p) + diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/151 simd/simd_avx2.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/151 simd/simd_avx2.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/151 simd/simd_avx2.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/151 simd/simd_avx2.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,42 @@ +#include +#include +#include + +/* + * FIXME add proper runtime detection for VS. + */ + +#ifdef _MSC_VER +#include +int avx2_available() { + return 0; +} +#else +#include +#include + +#if defined(__APPLE__) +int avx2_available() { return 0; } +#else +int avx2_available() { + return __builtin_cpu_supports("avx2"); +} +#endif +#endif + +void increment_avx2(float arr[4]) { + double darr[4]; + darr[0] = arr[0]; + darr[1] = arr[1]; + darr[2] = arr[2]; + darr[3] = arr[3]; + __m256d val = _mm256_loadu_pd(darr); + __m256d one = _mm256_set1_pd(1.0); + __m256d result = _mm256_add_pd(val, one); + _mm256_storeu_pd(darr, result); + one = _mm256_permute4x64_pd(one, 66); /* A no-op, just here to use AVX2. */ + arr[0] = (float)darr[0]; + arr[1] = (float)darr[1]; + arr[2] = (float)darr[2]; + arr[3] = (float)darr[3]; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/151 simd/simd_avx.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/151 simd/simd_avx.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/151 simd/simd_avx.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/151 simd/simd_avx.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,49 @@ +#include + +#ifndef I_CAN_HAZ_SIMD +#error The correct internal header was not used +#endif + +#include +#include +#include + +#ifdef _MSC_VER +#include +int avx_available() { + return 1; +} +#else +#include +#include + +#ifdef __APPLE__ +/* + * Apple ships a broken __builtin_cpu_supports and + * some machines in the CI farm seem to be too + * old to have AVX so just always return 0 here. + */ +int avx_available() { return 0; } +#else + +int avx_available() { + return __builtin_cpu_supports("avx"); +} +#endif +#endif + +void increment_avx(float arr[4]) { + double darr[4]; + darr[0] = arr[0]; + darr[1] = arr[1]; + darr[2] = arr[2]; + darr[3] = arr[3]; + __m256d val = _mm256_loadu_pd(darr); + __m256d one = _mm256_set1_pd(1.0); + __m256d result = _mm256_add_pd(val, one); + _mm256_storeu_pd(darr, result); + arr[0] = (float)darr[0]; + arr[1] = (float)darr[1]; + arr[2] = (float)darr[2]; + arr[3] = (float)darr[3]; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/151 simd/simdchecker.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/151 simd/simdchecker.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/151 simd/simdchecker.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/151 simd/simdchecker.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,143 @@ +#include +#include +#include + +typedef void (*simd_func)(float*); + +int check_simd_implementation(float *four, + const float *four_initial, + const char *simd_type, + const float *expected, + simd_func fptr, + const int blocksize) { + int rv = 0; + memcpy(four, four_initial, blocksize*sizeof(float)); + printf("Using %s.\n", simd_type); + fptr(four); + for(int i=0; i + +#ifdef _MSC_VER +#define ALIGN_16 __declspec(align(16)) +#else +#include +#define ALIGN_16 alignas(16) +#endif + + +/* Yes, I do know that arr[4] decays into a pointer + * as a function argument. Don't do this in real code + * but for this test it is ok. + */ + +void increment_fallback(float arr[4]); + +#if HAVE_MMX +int mmx_available(); +void increment_mmx(float arr[4]); +#endif + +#if HAVE_SSE +int sse_available(); +void increment_sse(float arr[4]); +#endif + +#if HAVE_SSE2 +int sse2_available(); +void increment_sse2(float arr[4]); +#endif + +#if HAVE_SSE3 +int sse3_available(); +void increment_sse3(float arr[4]); +#endif + +#if HAVE_SSSE3 +int ssse3_available(); +void increment_ssse3(float arr[4]); +#endif + +#if HAVE_SSE41 +int sse41_available(); +void increment_sse41(float arr[4]); +#endif + +#if HAVE_SSE42 +int sse42_available(); +void increment_sse42(float arr[4]); +#endif + +#if HAVE_AVX +int avx_available(); +void increment_avx(float arr[4]); +#endif + +#if HAVE_AVX2 +int avx2_available(); +void increment_avx2(float arr[4]); +#endif + +#if HAVE_NEON +int neon_available(); +void increment_neon(float arr[4]); +#endif + +#if HAVE_ALTIVEC +int altivec_available(); +void increment_altivec(float arr[4]); +#endif + +/* And so on. */ diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/151 simd/simd_mmx.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/151 simd/simd_mmx.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/151 simd/simd_mmx.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/151 simd/simd_mmx.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,67 @@ +#include +#include + +#include + +#ifdef _MSC_VER +#include +int mmx_available() { + return 1; +} +/* Contrary to MSDN documentation, MMX intrinsics + * just plain don't work. + */ +void increment_mmx(float arr[4]) { + arr[0]++; + arr[1]++; + arr[2]++; + arr[3]++; +} +#elif defined(__MINGW32__) +int mmx_available() { + return 1; +} +/* MinGW does not seem to ship with MMX or it is broken. + */ +void increment_mmx(float arr[4]) { + arr[0]++; + arr[1]++; + arr[2]++; + arr[3]++; +} +#else +#include +#include + +#if defined(__APPLE__) +int mmx_available() { return 1; } +#else +int mmx_available() { + return __builtin_cpu_supports("mmx"); +} +#endif +void increment_mmx(float arr[4]) { + /* Super ugly but we know that values in arr are always small + * enough to fit in int16; + */ + int i; + __m64 packed = _mm_set_pi16(arr[3], arr[2], arr[1], arr[0]); + __m64 incr = _mm_set1_pi16(1); + __m64 result = _mm_add_pi16(packed, incr); + /* Should be + * int64_t unpacker = _m_to_int64(result); + * but it does not exist on 32 bit platforms for some reason. + */ + int64_t unpacker = (int64_t)(result); + _mm_empty(); + for(i=0; i<4; i++) { + /* This fails on GCC 8 when optimizations are enabled. + * Disable it. Patches welcome to fix this. + arr[i] = (float)(unpacker & ((1<<16)-1)); + unpacker >>= 16; + */ + arr[i] += 1.0f; + } +} + +#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/151 simd/simd_neon.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/151 simd/simd_neon.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/151 simd/simd_neon.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/151 simd/simd_neon.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,20 @@ +#include +#include + +#include +#include + +int neon_available() { + return 1; /* Incorrect, but I don't know how to check this properly. */ +} + +void increment_neon(float arr[4]) { + float32x2_t a1, a2, one; + a1 = vld1_f32(arr); + a2 = vld1_f32(&arr[2]); + one = vdup_n_f32(1.0); + a1 = vadd_f32(a1, one); + a2 = vadd_f32(a2, one); + vst1_f32(arr, a1); + vst1_f32(&arr[2], a2); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/151 simd/simd_sse2.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/151 simd/simd_sse2.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/151 simd/simd_sse2.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/151 simd/simd_sse2.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,37 @@ +#include +#include +#include + +#ifdef _MSC_VER +int sse2_available() { + return 1; +} + +#else +#include +#include + +#if defined(__APPLE__) +int sse2_available() { return 1; } +#else +int sse2_available() { + return __builtin_cpu_supports("sse2"); +} +#endif +#endif + +void increment_sse2(float arr[4]) { + ALIGN_16 double darr[4]; + __m128d val1 = _mm_set_pd(arr[0], arr[1]); + __m128d val2 = _mm_set_pd(arr[2], arr[3]); + __m128d one = _mm_set_pd(1.0, 1.0); + __m128d result = _mm_add_pd(val1, one); + _mm_store_pd(darr, result); + result = _mm_add_pd(val2, one); + _mm_store_pd(&darr[2], result); + arr[0] = (float)darr[1]; + arr[1] = (float)darr[0]; + arr[2] = (float)darr[3]; + arr[3] = (float)darr[2]; +} + diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/151 simd/simd_sse3.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/151 simd/simd_sse3.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/151 simd/simd_sse3.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/151 simd/simd_sse3.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,38 @@ +#include +#include + +#ifdef _MSC_VER +#include +int sse3_available() { + return 1; +} +#else + +#include +#include +#include + +#if defined(__APPLE__) +int sse3_available() { return 1; } +#else +int sse3_available() { + return __builtin_cpu_supports("sse3"); +} +#endif +#endif + +void increment_sse3(float arr[4]) { + ALIGN_16 double darr[4]; + __m128d val1 = _mm_set_pd(arr[0], arr[1]); + __m128d val2 = _mm_set_pd(arr[2], arr[3]); + __m128d one = _mm_set_pd(1.0, 1.0); + __m128d result = _mm_add_pd(val1, one); + _mm_store_pd(darr, result); + result = _mm_add_pd(val2, one); + _mm_store_pd(&darr[2], result); + result = _mm_hadd_pd(val1, val2); /* This does nothing. Only here so we use an SSE3 instruction. */ + arr[0] = (float)darr[1]; + arr[1] = (float)darr[0]; + arr[2] = (float)darr[3]; + arr[3] = (float)darr[2]; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/151 simd/simd_sse41.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/151 simd/simd_sse41.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/151 simd/simd_sse41.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/151 simd/simd_sse41.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,40 @@ +#include +#include + +#include + +#ifdef _MSC_VER +#include + +int sse41_available() { + return 1; +} + +#else +#include +#include + +#if defined(__APPLE__) +int sse41_available() { return 1; } +#else +int sse41_available() { + return __builtin_cpu_supports("sse4.1"); +} +#endif +#endif + +void increment_sse41(float arr[4]) { + ALIGN_16 double darr[4]; + __m128d val1 = _mm_set_pd(arr[0], arr[1]); + __m128d val2 = _mm_set_pd(arr[2], arr[3]); + __m128d one = _mm_set_pd(1.0, 1.0); + __m128d result = _mm_add_pd(val1, one); + result = _mm_ceil_pd(result); /* A no-op, only here to use a SSE4.1 intrinsic. */ + _mm_store_pd(darr, result); + result = _mm_add_pd(val2, one); + _mm_store_pd(&darr[2], result); + arr[0] = (float)darr[1]; + arr[1] = (float)darr[0]; + arr[2] = (float)darr[3]; + arr[3] = (float)darr[2]; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/151 simd/simd_sse42.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/151 simd/simd_sse42.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/151 simd/simd_sse42.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/151 simd/simd_sse42.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,43 @@ +#include +#include +#include + +#ifdef _MSC_VER +#include + +int sse42_available() { + return 1; +} + +#else + +#include +#include + +#ifdef __APPLE__ +int sse42_available() { + return 1; +} +#else +int sse42_available() { + return __builtin_cpu_supports("sse4.2"); +} +#endif + +#endif + +void increment_sse42(float arr[4]) { + ALIGN_16 double darr[4]; + __m128d val1 = _mm_set_pd(arr[0], arr[1]); + __m128d val2 = _mm_set_pd(arr[2], arr[3]); + __m128d one = _mm_set_pd(1.0, 1.0); + __m128d result = _mm_add_pd(val1, one); + _mm_store_pd(darr, result); + result = _mm_add_pd(val2, one); + _mm_store_pd(&darr[2], result); + _mm_crc32_u32(42, 99); /* A no-op, only here to use an SSE4.2 instruction. */ + arr[0] = (float)darr[1]; + arr[1] = (float)darr[0]; + arr[2] = (float)darr[3]; + arr[3] = (float)darr[2]; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/151 simd/simd_sse.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/151 simd/simd_sse.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/151 simd/simd_sse.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/151 simd/simd_sse.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,29 @@ +#include +#include + +#ifdef _MSC_VER +#include +int sse_available() { + return 1; +} +#else + +#include +#include +#include + +#if defined(__APPLE__) +int sse_available() { return 1; } +#else +int sse_available() { + return __builtin_cpu_supports("sse"); +} +#endif +#endif + +void increment_sse(float arr[4]) { + __m128 val = _mm_load_ps(arr); + __m128 one = _mm_set_ps1(1.0); + __m128 result = _mm_add_ps(val, one); + _mm_storeu_ps(arr, result); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/151 simd/simd_ssse3.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/151 simd/simd_ssse3.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/151 simd/simd_ssse3.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/151 simd/simd_ssse3.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,48 @@ +#include +#include + +#include +#include + +#ifdef _MSC_VER +#include + +int ssse3_available() { + return 1; +} + +#else + +#include +#include + +int ssse3_available() { +#ifdef __APPLE__ + return 1; +#elif defined(__clang__) + /* https://github.com/numpy/numpy/issues/8130 */ + return __builtin_cpu_supports("sse4.1"); +#else + return __builtin_cpu_supports("ssse3"); +#endif +} + +#endif + +void increment_ssse3(float arr[4]) { + ALIGN_16 double darr[4]; + __m128d val1 = _mm_set_pd(arr[0], arr[1]); + __m128d val2 = _mm_set_pd(arr[2], arr[3]); + __m128d one = _mm_set_pd(1.0, 1.0); + __m128d result = _mm_add_pd(val1, one); + __m128i tmp1, tmp2; + tmp1 = tmp2 = _mm_set1_epi16(0); + _mm_store_pd(darr, result); + result = _mm_add_pd(val2, one); + _mm_store_pd(&darr[2], result); + tmp1 = _mm_hadd_epi32(tmp1, tmp2); /* This does nothing. Only here so we use an SSSE3 instruction. */ + arr[0] = (float)darr[1]; + arr[1] = (float)darr[0]; + arr[2] = (float)darr[3]; + arr[3] = (float)darr[2]; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/152 shared module resolving symbol in executable/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/152 shared module resolving symbol in executable/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/152 shared module resolving symbol in executable/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/152 shared module resolving symbol in executable/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,20 @@ +project('shared module resolving symbol in executable', 'c') + +# The shared module contains a reference to the symbol 'func_from_executable', +# which is always provided by the executable which loads it. This symbol can be +# resolved at run-time by an ELF loader. But when building PE/COFF objects, all +# symbols must be resolved at link-time, so an implib is generated for the +# executable, and the shared module linked with it. +# +# See testcase 125 for an example of the more complex portability gymnastics +# required if we do not know (at link-time) what provides the symbol. + +cc = meson.get_compiler('c') +if cc.get_id() == 'pgi' + error('MESON_SKIP_TEST PGI has its own unique set of macros that would need to be handled') +endif + +dl = meson.get_compiler('c').find_library('dl', required: false) +e = executable('prog', 'prog.c', dependencies: dl, export_dynamic: true) +m = shared_module('module', 'module.c', link_with: e) +test('test', e, args: m.full_path()) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/152 shared module resolving symbol in executable/module.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/152 shared module resolving symbol in executable/module.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/152 shared module resolving symbol in executable/module.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/152 shared module resolving symbol in executable/module.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,16 @@ +#if defined _WIN32 || defined __CYGWIN__ + #define DLL_PUBLIC __declspec(dllexport) +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif + +extern int func_from_executable(void); + +int DLL_PUBLIC func(void) { + return func_from_executable(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/152 shared module resolving symbol in executable/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/152 shared module resolving symbol in executable/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/152 shared module resolving symbol in executable/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/152 shared module resolving symbol in executable/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,60 @@ +#include +#include +#ifdef _WIN32 +#include +#else +#include +#endif + +#if defined _WIN32 || defined __CYGWIN__ + #define DLL_PUBLIC __declspec(dllexport) +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif + +typedef int (*fptr) (void); + +int DLL_PUBLIC +func_from_executable(void) +{ + return 42; +} + +int +main (int argc, char **argv) +{ + int expected, actual; + fptr importedfunc; + +#ifdef _WIN32 + HMODULE h = LoadLibraryA(argv[1]); +#else + void *h = dlopen(argv[1], RTLD_NOW); +#endif + assert(h != NULL); + +#ifdef _WIN32 + importedfunc = (fptr) GetProcAddress (h, "func"); +#else + importedfunc = (fptr) dlsym(h, "func"); +#endif + assert(importedfunc != NULL); + assert(importedfunc != func_from_executable); + + actual = (*importedfunc)(); + expected = func_from_executable(); + assert(actual == expected); + +#ifdef _WIN32 + FreeLibrary(h); +#else + dlclose(h); +#endif + + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/152 simd/fallback.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/152 simd/fallback.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/152 simd/fallback.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/152 simd/fallback.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -#include - -void increment_fallback(float arr[4]) { - int i; - for(i=0; i<4; i++) { - arr[i]++; - } -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/152 simd/include/simdheader.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/152 simd/include/simdheader.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/152 simd/include/simdheader.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/152 simd/include/simdheader.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -#pragma once - -#define I_CAN_HAZ_SIMD diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/152 simd/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/152 simd/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/152 simd/meson.build" 2018-12-09 16:31:15.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/152 simd/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,44 +0,0 @@ -project('simd', 'c') - -simd = import('unstable-simd') - -cc = meson.get_compiler('c') - -cdata = configuration_data() - -if not meson.is_cross_build() and host_machine.cpu_family() == 'arm' and cc.get_id() == 'clang' - message('Adding -march=armv7 because assuming that this build happens on Raspbian.') - message('Its Clang seems to be misconfigured and does not support NEON by default.') - add_project_arguments('-march=armv7', language : 'c') -endif - -if cc.get_id() == 'msvc' and cc.version().version_compare('<17') - error('MESON_SKIP_TEST VS2010 produces broken binaries on x86.') -endif - -# FIXME add [a, b] = function() -rval = simd.check('mysimds', - mmx : 'simd_mmx.c', - sse : 'simd_sse.c', - sse2 : 'simd_sse2.c', - sse3 : 'simd_sse3.c', - ssse3 : 'simd_ssse3.c', - sse41 : 'simd_sse41.c', - sse42 : 'simd_sse42.c', - avx : 'simd_avx.c', - avx2 : 'simd_avx2.c', - neon : 'simd_neon.c', - compiler : cc, - include_directories : include_directories('include')) - -simdlibs = rval[0] -cdata.merge_from(rval[1]) - -configure_file(output : 'simdconfig.h', - configuration : cdata) - -p = executable('simdtest', 'simdchecker.c', 'fallback.c', - link_with : simdlibs) - -test('simdtest', p) - diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/152 simd/simd_avx2.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/152 simd/simd_avx2.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/152 simd/simd_avx2.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/152 simd/simd_avx2.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -#include -#include -#include - -/* - * FIXME add proper runtime detection for VS. - */ - -#ifdef _MSC_VER -#include -int avx2_available() { - return 0; -} -#else -#include -#include - -#if defined(__APPLE__) -int avx2_available() { return 0; } -#else -int avx2_available() { - return __builtin_cpu_supports("avx2"); -} -#endif -#endif - -void increment_avx2(float arr[4]) { - double darr[4]; - darr[0] = arr[0]; - darr[1] = arr[1]; - darr[2] = arr[2]; - darr[3] = arr[3]; - __m256d val = _mm256_loadu_pd(darr); - __m256d one = _mm256_set1_pd(1.0); - __m256d result = _mm256_add_pd(val, one); - _mm256_storeu_pd(darr, result); - one = _mm256_permute4x64_pd(one, 66); /* A no-op, just here to use AVX2. */ - arr[0] = (float)darr[0]; - arr[1] = (float)darr[1]; - arr[2] = (float)darr[2]; - arr[3] = (float)darr[3]; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/152 simd/simd_avx.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/152 simd/simd_avx.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/152 simd/simd_avx.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/152 simd/simd_avx.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ -#include - -#ifndef I_CAN_HAZ_SIMD -#error The correct internal header was not used -#endif - -#include -#include -#include - -#ifdef _MSC_VER -#include -int avx_available() { - return 1; -} -#else -#include -#include - -#ifdef __APPLE__ -/* - * Apple ships a broken __builtin_cpu_supports and - * some machines in the CI farm seem to be too - * old to have AVX so just always return 0 here. - */ -int avx_available() { return 0; } -#else - -int avx_available() { - return __builtin_cpu_supports("avx"); -} -#endif -#endif - -void increment_avx(float arr[4]) { - double darr[4]; - darr[0] = arr[0]; - darr[1] = arr[1]; - darr[2] = arr[2]; - darr[3] = arr[3]; - __m256d val = _mm256_loadu_pd(darr); - __m256d one = _mm256_set1_pd(1.0); - __m256d result = _mm256_add_pd(val, one); - _mm256_storeu_pd(darr, result); - arr[0] = (float)darr[0]; - arr[1] = (float)darr[1]; - arr[2] = (float)darr[2]; - arr[3] = (float)darr[3]; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/152 simd/simdchecker.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/152 simd/simdchecker.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/152 simd/simdchecker.c" 2018-12-09 14:27:16.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/152 simd/simdchecker.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,143 +0,0 @@ -#include -#include -#include - -typedef void (*simd_func)(float*); - -int check_simd_implementation(float *four, - const float *four_initial, - const char *simd_type, - const float *expected, - simd_func fptr, - const int blocksize) { - int rv = 0; - memcpy(four, four_initial, blocksize*sizeof(float)); - printf("Using %s.\n", simd_type); - fptr(four); - for(int i=0; i - -#ifdef _MSC_VER -#define ALIGN_16 __declspec(align(16)) -#else -#include -#define ALIGN_16 alignas(16) -#endif - - -/* Yes, I do know that arr[4] decays into a pointer - * as a function argument. Don't do this in real code - * but for this test it is ok. - */ - -void increment_fallback(float arr[4]); - -#if HAVE_MMX -int mmx_available(); -void increment_mmx(float arr[4]); -#endif - -#if HAVE_SSE -int sse_available(); -void increment_sse(float arr[4]); -#endif - -#if HAVE_SSE2 -int sse2_available(); -void increment_sse2(float arr[4]); -#endif - -#if HAVE_SSE3 -int sse3_available(); -void increment_sse3(float arr[4]); -#endif - -#if HAVE_SSSE3 -int ssse3_available(); -void increment_ssse3(float arr[4]); -#endif - -#if HAVE_SSE41 -int sse41_available(); -void increment_sse41(float arr[4]); -#endif - -#if HAVE_SSE42 -int sse42_available(); -void increment_sse42(float arr[4]); -#endif - -#if HAVE_AVX -int avx_available(); -void increment_avx(float arr[4]); -#endif - -#if HAVE_AVX2 -int avx2_available(); -void increment_avx2(float arr[4]); -#endif - -#if HAVE_NEON -int neon_available(); -void increment_neon(float arr[4]); -#endif - -#if HAVE_ALTIVEC -int altivec_available(); -void increment_altivec(float arr[4]); -#endif - -/* And so on. */ diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/152 simd/simd_mmx.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/152 simd/simd_mmx.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/152 simd/simd_mmx.c" 2018-12-09 19:42:08.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/152 simd/simd_mmx.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,67 +0,0 @@ -#include -#include - -#include - -#ifdef _MSC_VER -#include -int mmx_available() { - return 1; -} -/* Contrary to MSDN documentation, MMX intrinsics - * just plain don't work. - */ -void increment_mmx(float arr[4]) { - arr[0]++; - arr[1]++; - arr[2]++; - arr[3]++; -} -#elif defined(__MINGW32__) -int mmx_available() { - return 1; -} -/* MinGW does not seem to ship with MMX or it is broken. - */ -void increment_mmx(float arr[4]) { - arr[0]++; - arr[1]++; - arr[2]++; - arr[3]++; -} -#else -#include -#include - -#if defined(__APPLE__) -int mmx_available() { return 1; } -#else -int mmx_available() { - return __builtin_cpu_supports("mmx"); -} -#endif -void increment_mmx(float arr[4]) { - /* Super ugly but we know that values in arr are always small - * enough to fit in int16; - */ - int i; - __m64 packed = _mm_set_pi16(arr[3], arr[2], arr[1], arr[0]); - __m64 incr = _mm_set1_pi16(1); - __m64 result = _mm_add_pi16(packed, incr); - /* Should be - * int64_t unpacker = _m_to_int64(result); - * but it does not exist on 32 bit platforms for some reason. - */ - int64_t unpacker = (int64_t)(result); - _mm_empty(); - for(i=0; i<4; i++) { - /* This fails on GCC 8 when optimizations are enabled. - * Disable it. Patches welcome to fix this. - arr[i] = (float)(unpacker & ((1<<16)-1)); - unpacker >>= 16; - */ - arr[i] += 1.0f; - } -} - -#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/152 simd/simd_neon.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/152 simd/simd_neon.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/152 simd/simd_neon.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/152 simd/simd_neon.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -#include -#include - -#include -#include - -int neon_available() { - return 1; /* Incorrect, but I don't know how to check this properly. */ -} - -void increment_neon(float arr[4]) { - float32x2_t a1, a2, one; - a1 = vld1_f32(arr); - a2 = vld1_f32(&arr[2]); - one = vdup_n_f32(1.0); - a1 = vadd_f32(a1, one); - a2 = vadd_f32(a2, one); - vst1_f32(arr, a1); - vst1_f32(&arr[2], a2); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/152 simd/simd_sse2.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/152 simd/simd_sse2.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/152 simd/simd_sse2.c" 2018-12-09 14:27:16.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/152 simd/simd_sse2.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -#include -#include -#include - -#ifdef _MSC_VER -int sse2_available() { - return 1; -} - -#else -#include -#include - -#if defined(__APPLE__) -int sse2_available() { return 1; } -#else -int sse2_available() { - return __builtin_cpu_supports("sse2"); -} -#endif -#endif - -void increment_sse2(float arr[4]) { - ALIGN_16 double darr[4]; - __m128d val1 = _mm_set_pd(arr[0], arr[1]); - __m128d val2 = _mm_set_pd(arr[2], arr[3]); - __m128d one = _mm_set_pd(1.0, 1.0); - __m128d result = _mm_add_pd(val1, one); - _mm_store_pd(darr, result); - result = _mm_add_pd(val2, one); - _mm_store_pd(&darr[2], result); - arr[0] = (float)darr[1]; - arr[1] = (float)darr[0]; - arr[2] = (float)darr[3]; - arr[3] = (float)darr[2]; -} - diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/152 simd/simd_sse3.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/152 simd/simd_sse3.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/152 simd/simd_sse3.c" 2018-12-09 14:27:16.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/152 simd/simd_sse3.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -#include -#include - -#ifdef _MSC_VER -#include -int sse3_available() { - return 1; -} -#else - -#include -#include -#include - -#if defined(__APPLE__) -int sse3_available() { return 1; } -#else -int sse3_available() { - return __builtin_cpu_supports("sse3"); -} -#endif -#endif - -void increment_sse3(float arr[4]) { - ALIGN_16 double darr[4]; - __m128d val1 = _mm_set_pd(arr[0], arr[1]); - __m128d val2 = _mm_set_pd(arr[2], arr[3]); - __m128d one = _mm_set_pd(1.0, 1.0); - __m128d result = _mm_add_pd(val1, one); - _mm_store_pd(darr, result); - result = _mm_add_pd(val2, one); - _mm_store_pd(&darr[2], result); - result = _mm_hadd_pd(val1, val2); /* This does nothing. Only here so we use an SSE3 instruction. */ - arr[0] = (float)darr[1]; - arr[1] = (float)darr[0]; - arr[2] = (float)darr[3]; - arr[3] = (float)darr[2]; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/152 simd/simd_sse41.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/152 simd/simd_sse41.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/152 simd/simd_sse41.c" 2018-12-09 14:27:16.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/152 simd/simd_sse41.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -#include -#include - -#include - -#ifdef _MSC_VER -#include - -int sse41_available() { - return 1; -} - -#else -#include -#include - -#if defined(__APPLE__) -int sse41_available() { return 1; } -#else -int sse41_available() { - return __builtin_cpu_supports("sse4.1"); -} -#endif -#endif - -void increment_sse41(float arr[4]) { - ALIGN_16 double darr[4]; - __m128d val1 = _mm_set_pd(arr[0], arr[1]); - __m128d val2 = _mm_set_pd(arr[2], arr[3]); - __m128d one = _mm_set_pd(1.0, 1.0); - __m128d result = _mm_add_pd(val1, one); - result = _mm_ceil_pd(result); /* A no-op, only here to use a SSE4.1 intrinsic. */ - _mm_store_pd(darr, result); - result = _mm_add_pd(val2, one); - _mm_store_pd(&darr[2], result); - arr[0] = (float)darr[1]; - arr[1] = (float)darr[0]; - arr[2] = (float)darr[3]; - arr[3] = (float)darr[2]; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/152 simd/simd_sse42.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/152 simd/simd_sse42.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/152 simd/simd_sse42.c" 2018-12-09 14:27:16.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/152 simd/simd_sse42.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -#include -#include -#include - -#ifdef _MSC_VER -#include - -int sse42_available() { - return 1; -} - -#else - -#include -#include - -#ifdef __APPLE__ -int sse42_available() { - return 1; -} -#else -int sse42_available() { - return __builtin_cpu_supports("sse4.2"); -} -#endif - -#endif - -void increment_sse42(float arr[4]) { - ALIGN_16 double darr[4]; - __m128d val1 = _mm_set_pd(arr[0], arr[1]); - __m128d val2 = _mm_set_pd(arr[2], arr[3]); - __m128d one = _mm_set_pd(1.0, 1.0); - __m128d result = _mm_add_pd(val1, one); - _mm_store_pd(darr, result); - result = _mm_add_pd(val2, one); - _mm_store_pd(&darr[2], result); - _mm_crc32_u32(42, 99); /* A no-op, only here to use an SSE4.2 instruction. */ - arr[0] = (float)darr[1]; - arr[1] = (float)darr[0]; - arr[2] = (float)darr[3]; - arr[3] = (float)darr[2]; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/152 simd/simd_sse.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/152 simd/simd_sse.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/152 simd/simd_sse.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/152 simd/simd_sse.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -#include -#include - -#ifdef _MSC_VER -#include -int sse_available() { - return 1; -} -#else - -#include -#include -#include - -#if defined(__APPLE__) -int sse_available() { return 1; } -#else -int sse_available() { - return __builtin_cpu_supports("sse"); -} -#endif -#endif - -void increment_sse(float arr[4]) { - __m128 val = _mm_load_ps(arr); - __m128 one = _mm_set_ps1(1.0); - __m128 result = _mm_add_ps(val, one); - _mm_storeu_ps(arr, result); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/152 simd/simd_ssse3.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/152 simd/simd_ssse3.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/152 simd/simd_ssse3.c" 2018-12-09 14:27:16.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/152 simd/simd_ssse3.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,48 +0,0 @@ -#include -#include - -#include -#include - -#ifdef _MSC_VER -#include - -int ssse3_available() { - return 1; -} - -#else - -#include -#include - -int ssse3_available() { -#ifdef __APPLE__ - return 1; -#elif defined(__clang__) - /* https://github.com/numpy/numpy/issues/8130 */ - return __builtin_cpu_supports("sse4.1"); -#else - return __builtin_cpu_supports("ssse3"); -#endif -} - -#endif - -void increment_ssse3(float arr[4]) { - ALIGN_16 double darr[4]; - __m128d val1 = _mm_set_pd(arr[0], arr[1]); - __m128d val2 = _mm_set_pd(arr[2], arr[3]); - __m128d one = _mm_set_pd(1.0, 1.0); - __m128d result = _mm_add_pd(val1, one); - __m128i tmp1, tmp2; - tmp1 = tmp2 = _mm_set1_epi16(0); - _mm_store_pd(darr, result); - result = _mm_add_pd(val2, one); - _mm_store_pd(&darr[2], result); - tmp1 = _mm_hadd_epi32(tmp1, tmp2); /* This does nothing. Only here so we use an SSSE3 instruction. */ - arr[0] = (float)darr[1]; - arr[1] = (float)darr[0]; - arr[2] = (float)darr[3]; - arr[3] = (float)darr[2]; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/153 dotinclude/dotproc.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/153 dotinclude/dotproc.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/153 dotinclude/dotproc.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/153 dotinclude/dotproc.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,10 @@ +#include"stdio.h" + +#ifndef WRAPPER_INCLUDED +#error The wrapper stdio.h was not included. +#endif + +int main(int argc, char **argv) { + printf("Eventually I got printed.\n"); + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/153 dotinclude/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/153 dotinclude/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/153 dotinclude/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/153 dotinclude/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +project('dotinclude', 'c') + +executable('dotproc', 'dotproc.c', + implicit_include_directories : false) + diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/153 dotinclude/stdio.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/153 dotinclude/stdio.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/153 dotinclude/stdio.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/153 dotinclude/stdio.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,6 @@ +// There is no #pragma once because we _want_ to cause an eternal loop +// if this wrapper invokes itself. + +#define WRAPPER_INCLUDED + +#include diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/153 shared module resolving symbol in executable/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/153 shared module resolving symbol in executable/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/153 shared module resolving symbol in executable/meson.build" 2018-12-09 16:31:15.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/153 shared module resolving symbol in executable/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -project('shared module resolving symbol in executable', 'c') - -# The shared module contains a reference to the symbol 'func_from_executable', -# which is always provided by the executable which loads it. This symbol can be -# resolved at run-time by an ELF loader. But when building PE/COFF objects, all -# symbols must be resolved at link-time, so an implib is generated for the -# executable, and the shared module linked with it. -# -# See testcase 125 for an example of the more complex portability gymnastics -# required if we do not know (at link-time) what provides the symbol. - -dl = meson.get_compiler('c').find_library('dl', required: false) -e = executable('prog', 'prog.c', dependencies: dl, export_dynamic: true) -m = shared_module('module', 'module.c', link_with: e) -test('test', e, args: m.full_path()) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/153 shared module resolving symbol in executable/module.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/153 shared module resolving symbol in executable/module.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/153 shared module resolving symbol in executable/module.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/153 shared module resolving symbol in executable/module.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -#if defined _WIN32 || defined __CYGWIN__ - #define DLL_PUBLIC __declspec(dllexport) -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif - -extern int func_from_executable(void); - -int DLL_PUBLIC func(void) { - return func_from_executable(); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/153 shared module resolving symbol in executable/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/153 shared module resolving symbol in executable/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/153 shared module resolving symbol in executable/prog.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/153 shared module resolving symbol in executable/prog.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,60 +0,0 @@ -#include -#include -#ifdef _WIN32 -#include -#else -#include -#endif - -#if defined _WIN32 || defined __CYGWIN__ - #define DLL_PUBLIC __declspec(dllexport) -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif - -typedef int (*fptr) (void); - -int DLL_PUBLIC -func_from_executable(void) -{ - return 42; -} - -int -main (int argc, char **argv) -{ - int expected, actual; - fptr importedfunc; - -#ifdef _WIN32 - HMODULE h = LoadLibraryA(argv[1]); -#else - void *h = dlopen(argv[1], RTLD_NOW); -#endif - assert(h != NULL); - -#ifdef _WIN32 - importedfunc = (fptr) GetProcAddress (h, "func"); -#else - importedfunc = (fptr) dlsym(h, "func"); -#endif - assert(importedfunc != NULL); - assert(importedfunc != func_from_executable); - - actual = (*importedfunc)(); - expected = func_from_executable(); - assert(actual == expected); - -#ifdef _WIN32 - FreeLibrary(h); -#else - dlclose(h); -#endif - - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 dotinclude/dotproc.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 dotinclude/dotproc.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 dotinclude/dotproc.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 dotinclude/dotproc.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -#include"stdio.h" - -#ifndef WRAPPER_INCLUDED -#error The wrapper stdio.h was not included. -#endif - -int main(int argc, char **argv) { - printf("Eventually I got printed.\n"); - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 dotinclude/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 dotinclude/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 dotinclude/meson.build" 2018-12-09 16:31:16.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 dotinclude/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -project('dotinclude', 'c') - -executable('dotproc', 'dotproc.c', - implicit_include_directories : false) - diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 dotinclude/stdio.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 dotinclude/stdio.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 dotinclude/stdio.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 dotinclude/stdio.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -// There is no #pragma once because we _want_ to cause an eternal loop -// if this wrapper invokes itself. - -#define WRAPPER_INCLUDED - -#include diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 reserved targets/all/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 reserved targets/all/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 reserved targets/all/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 reserved targets/all/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +executable('test-all', '../test.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 reserved targets/benchmark/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 reserved targets/benchmark/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 reserved targets/benchmark/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 reserved targets/benchmark/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +executable('test-benchmark', '../test.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 reserved targets/clean/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 reserved targets/clean/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 reserved targets/clean/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 reserved targets/clean/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +executable('test-clean', '../test.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 reserved targets/clean-ctlist/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 reserved targets/clean-ctlist/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 reserved targets/clean-ctlist/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 reserved targets/clean-ctlist/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +executable('test-clean-ctlist', '../test.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 reserved targets/clean-gcda/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 reserved targets/clean-gcda/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 reserved targets/clean-gcda/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 reserved targets/clean-gcda/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +executable('test-clean-gcda', '../test.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 reserved targets/clean-gcno/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 reserved targets/clean-gcno/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 reserved targets/clean-gcno/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 reserved targets/clean-gcno/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +executable('test-clean-gcno', '../test.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 reserved targets/coverage/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 reserved targets/coverage/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 reserved targets/coverage/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 reserved targets/coverage/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +executable('test-coverage', '../test.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 reserved targets/coverage-html/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 reserved targets/coverage-html/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 reserved targets/coverage-html/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 reserved targets/coverage-html/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +executable('test-coverage-html', '../test.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 reserved targets/coverage-text/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 reserved targets/coverage-text/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 reserved targets/coverage-text/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 reserved targets/coverage-text/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +executable('test-coverage-text', '../test.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 reserved targets/coverage-xml/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 reserved targets/coverage-xml/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 reserved targets/coverage-xml/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 reserved targets/coverage-xml/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +executable('test-coverage-xml', '../test.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 reserved targets/dist/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 reserved targets/dist/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 reserved targets/dist/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 reserved targets/dist/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +executable('test-dist', '../test.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 reserved targets/distcheck/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 reserved targets/distcheck/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 reserved targets/distcheck/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 reserved targets/distcheck/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +executable('test-distcheck', '../test.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 reserved targets/install/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 reserved targets/install/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 reserved targets/install/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 reserved targets/install/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +executable('test-install', '../test.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 reserved targets/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 reserved targets/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 reserved targets/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 reserved targets/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,34 @@ +project('reserved target names', 'c') + # FIXME: Setting this causes it to leak to all other tests + #default_options : ['b_coverage=true'] + +subdir('all') +subdir('benchmark') +subdir('clean') +subdir('clean-ctlist') +subdir('clean-gcda') +subdir('clean-gcno') +subdir('coverage') +subdir('coverage-html') +subdir('coverage-text') +subdir('coverage-xml') +subdir('dist') +subdir('distcheck') +subdir('install') +# We don't have a 'PHONY' directory because Windows and OSX +# choke horribly when there are two entries with the same +# name but different case. +subdir('phony') +subdir('reconfigure') +subdir('scan-build') +subdir('test') +subdir('uninstall') + +subdir('runtarget') + +py3 = import('python3').find_python() + +custom_target('ctlist-test', output : 'out.txt', + command : [py3, '-c', 'print("")'], + capture : true, + build_by_default : true) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 reserved targets/phony/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 reserved targets/phony/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 reserved targets/phony/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 reserved targets/phony/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +executable('test-phony', '../test.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 reserved targets/reconfigure/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 reserved targets/reconfigure/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 reserved targets/reconfigure/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 reserved targets/reconfigure/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +executable('test-reconfigure', '../test.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 reserved targets/runtarget/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 reserved targets/runtarget/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 reserved targets/runtarget/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 reserved targets/runtarget/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +configure_file(output : 'config.h', configuration: configuration_data()) +run_target('runtarget', command : ['echo']) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 reserved targets/scan-build/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 reserved targets/scan-build/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 reserved targets/scan-build/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 reserved targets/scan-build/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +executable('test-scan-build', '../test.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 reserved targets/test/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 reserved targets/test/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 reserved targets/test/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 reserved targets/test/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +executable('test-test', '../test.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 reserved targets/test.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 reserved targets/test.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 reserved targets/test.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 reserved targets/test.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,3 @@ +int main(int argc, char *argv[]) { + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 reserved targets/uninstall/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 reserved targets/uninstall/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/154 reserved targets/uninstall/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/154 reserved targets/uninstall/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +executable('test-uninstall', '../test.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 duplicate source names/dir1/file.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 duplicate source names/dir1/file.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 duplicate source names/dir1/file.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 duplicate source names/dir1/file.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,16 @@ +extern int dir2; +extern int dir2_dir1; +extern int dir3; +extern int dir3_dir1; + +int main() { + if (dir2 != 20) + return 1; + if (dir2_dir1 != 21) + return 1; + if (dir3 != 30) + return 1; + if (dir3_dir1 != 31) + return 1; + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 duplicate source names/dir1/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 duplicate source names/dir1/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 duplicate source names/dir1/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 duplicate source names/dir1/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +sources += files('file.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 duplicate source names/dir2/dir1/file.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 duplicate source names/dir2/dir1/file.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 duplicate source names/dir2/dir1/file.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 duplicate source names/dir2/dir1/file.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +int dir2_dir1 = 21; diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 duplicate source names/dir2/file.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 duplicate source names/dir2/file.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 duplicate source names/dir2/file.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 duplicate source names/dir2/file.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +int dir2 = 20; diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 duplicate source names/dir2/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 duplicate source names/dir2/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 duplicate source names/dir2/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 duplicate source names/dir2/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +sources += files('file.c', 'dir1/file.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 duplicate source names/dir3/dir1/file.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 duplicate source names/dir3/dir1/file.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 duplicate source names/dir3/dir1/file.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 duplicate source names/dir3/dir1/file.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +int dir3_dir1 = 31; diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 duplicate source names/dir3/file.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 duplicate source names/dir3/file.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 duplicate source names/dir3/file.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 duplicate source names/dir3/file.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +int dir3 = 30; diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 duplicate source names/dir3/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 duplicate source names/dir3/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 duplicate source names/dir3/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 duplicate source names/dir3/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +lib = static_library('lib', 'file.c', 'dir1/file.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 duplicate source names/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 duplicate source names/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 duplicate source names/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 duplicate source names/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,7 @@ +project('proj', 'c') + +sources = [] +subdir('dir1') +subdir('dir2') +subdir('dir3') +executable('a.out', sources : sources, objects : lib.extract_all_objects()) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 reserved targets/all/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 reserved targets/all/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 reserved targets/all/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 reserved targets/all/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -executable('test-all', '../test.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 reserved targets/benchmark/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 reserved targets/benchmark/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 reserved targets/benchmark/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 reserved targets/benchmark/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -executable('test-benchmark', '../test.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 reserved targets/clean/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 reserved targets/clean/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 reserved targets/clean/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 reserved targets/clean/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -executable('test-clean', '../test.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 reserved targets/clean-ctlist/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 reserved targets/clean-ctlist/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 reserved targets/clean-ctlist/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 reserved targets/clean-ctlist/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -executable('test-clean-ctlist', '../test.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 reserved targets/clean-gcda/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 reserved targets/clean-gcda/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 reserved targets/clean-gcda/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 reserved targets/clean-gcda/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -executable('test-clean-gcda', '../test.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 reserved targets/clean-gcno/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 reserved targets/clean-gcno/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 reserved targets/clean-gcno/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 reserved targets/clean-gcno/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -executable('test-clean-gcno', '../test.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 reserved targets/coverage/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 reserved targets/coverage/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 reserved targets/coverage/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 reserved targets/coverage/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -executable('test-coverage', '../test.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 reserved targets/coverage-html/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 reserved targets/coverage-html/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 reserved targets/coverage-html/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 reserved targets/coverage-html/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -executable('test-coverage-html', '../test.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 reserved targets/coverage-text/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 reserved targets/coverage-text/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 reserved targets/coverage-text/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 reserved targets/coverage-text/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -executable('test-coverage-text', '../test.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 reserved targets/coverage-xml/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 reserved targets/coverage-xml/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 reserved targets/coverage-xml/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 reserved targets/coverage-xml/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -executable('test-coverage-xml', '../test.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 reserved targets/dist/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 reserved targets/dist/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 reserved targets/dist/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 reserved targets/dist/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -executable('test-dist', '../test.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 reserved targets/distcheck/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 reserved targets/distcheck/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 reserved targets/distcheck/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 reserved targets/distcheck/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -executable('test-distcheck', '../test.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 reserved targets/install/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 reserved targets/install/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 reserved targets/install/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 reserved targets/install/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -executable('test-install', '../test.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 reserved targets/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 reserved targets/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 reserved targets/meson.build" 2018-12-09 16:31:17.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 reserved targets/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -project('reserved target names', 'c') - # FIXME: Setting this causes it to leak to all other tests - #default_options : ['b_coverage=true'] - -subdir('all') -subdir('benchmark') -subdir('clean') -subdir('clean-ctlist') -subdir('clean-gcda') -subdir('clean-gcno') -subdir('coverage') -subdir('coverage-html') -subdir('coverage-text') -subdir('coverage-xml') -subdir('dist') -subdir('distcheck') -subdir('install') -# We don't have a 'PHONY' directory because Windows and OSX -# choke horribly when there are two entries with the same -# name but different case. -subdir('phony') -subdir('reconfigure') -subdir('scan-build') -subdir('test') -subdir('uninstall') - -subdir('runtarget') - -py3 = import('python3').find_python() - -custom_target('ctlist-test', output : 'out.txt', - command : [py3, '-c', 'print("")'], - capture : true, - build_by_default : true) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 reserved targets/phony/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 reserved targets/phony/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 reserved targets/phony/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 reserved targets/phony/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -executable('test-phony', '../test.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 reserved targets/reconfigure/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 reserved targets/reconfigure/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 reserved targets/reconfigure/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 reserved targets/reconfigure/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -executable('test-reconfigure', '../test.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 reserved targets/runtarget/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 reserved targets/runtarget/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 reserved targets/runtarget/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 reserved targets/runtarget/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -configure_file(output : 'config.h', configuration: configuration_data()) -run_target('runtarget', command : ['echo']) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 reserved targets/scan-build/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 reserved targets/scan-build/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 reserved targets/scan-build/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 reserved targets/scan-build/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -executable('test-scan-build', '../test.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 reserved targets/test/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 reserved targets/test/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 reserved targets/test/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 reserved targets/test/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -executable('test-test', '../test.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 reserved targets/test.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 reserved targets/test.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 reserved targets/test.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 reserved targets/test.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -int main(int argc, char *argv[]) { - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 reserved targets/uninstall/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 reserved targets/uninstall/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/155 reserved targets/uninstall/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/155 reserved targets/uninstall/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -executable('test-uninstall', '../test.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/156 duplicate source names/dir1/file.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/156 duplicate source names/dir1/file.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/156 duplicate source names/dir1/file.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/156 duplicate source names/dir1/file.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -extern int dir2; -extern int dir2_dir1; -extern int dir3; -extern int dir3_dir1; - -int main() { - if (dir2 != 20) - return 1; - if (dir2_dir1 != 21) - return 1; - if (dir3 != 30) - return 1; - if (dir3_dir1 != 31) - return 1; - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/156 duplicate source names/dir1/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/156 duplicate source names/dir1/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/156 duplicate source names/dir1/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/156 duplicate source names/dir1/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -sources += files('file.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/156 duplicate source names/dir2/dir1/file.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/156 duplicate source names/dir2/dir1/file.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/156 duplicate source names/dir2/dir1/file.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/156 duplicate source names/dir2/dir1/file.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -int dir2_dir1 = 21; diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/156 duplicate source names/dir2/file.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/156 duplicate source names/dir2/file.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/156 duplicate source names/dir2/file.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/156 duplicate source names/dir2/file.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -int dir2 = 20; diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/156 duplicate source names/dir2/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/156 duplicate source names/dir2/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/156 duplicate source names/dir2/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/156 duplicate source names/dir2/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -sources += files('file.c', 'dir1/file.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/156 duplicate source names/dir3/dir1/file.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/156 duplicate source names/dir3/dir1/file.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/156 duplicate source names/dir3/dir1/file.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/156 duplicate source names/dir3/dir1/file.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -int dir3_dir1 = 31; diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/156 duplicate source names/dir3/file.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/156 duplicate source names/dir3/file.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/156 duplicate source names/dir3/file.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/156 duplicate source names/dir3/file.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -int dir3 = 30; diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/156 duplicate source names/dir3/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/156 duplicate source names/dir3/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/156 duplicate source names/dir3/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/156 duplicate source names/dir3/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -lib = static_library('lib', 'file.c', 'dir1/file.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/156 duplicate source names/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/156 duplicate source names/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/156 duplicate source names/meson.build" 2018-12-09 16:31:18.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/156 duplicate source names/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -project('proj', 'c') - -sources = [] -subdir('dir1') -subdir('dir2') -subdir('dir3') -executable('a.out', sources : sources, objects : lib.extract_all_objects()) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/156 index customtarget/check_args.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/156 index customtarget/check_args.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/156 index customtarget/check_args.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/156 index customtarget/check_args.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,18 @@ +#!python3 + +import sys +from pathlib import Path + +def main(): + if len(sys.argv) != 2: + print(sys.argv) + return 1 + if sys.argv[1] != 'gen.c': + print(sys.argv) + return 2 + Path('foo').touch() + + return 0 + +if __name__ == '__main__': + sys.exit(main()) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/156 index customtarget/gen_sources.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/156 index customtarget/gen_sources.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/156 index customtarget/gen_sources.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/156 index customtarget/gen_sources.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,49 @@ +# Copyright © 2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import argparse +import textwrap + +HEADER = textwrap.dedent('''\ + void stringify(int foo, char * buffer); + ''') + +CODE = textwrap.dedent('''\ + #include + + #ifndef WORKS + # error "This shouldn't have been included" + #endif + + void stringify(int foo, char * buffer) { + sprintf(buffer, "%i", foo); + } + ''') + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument('--header') + parser.add_argument('--code') + args = parser.parse_args() + + with open(args.header, 'w') as f: + f.write(HEADER) + + with open(args.code, 'w') as f: + f.write(CODE) + + +if __name__ == '__main__': + main() diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/156 index customtarget/lib.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/156 index customtarget/lib.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/156 index customtarget/lib.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/156 index customtarget/lib.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,20 @@ +/* Copyright © 2017 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "gen.h" + +void func(char * buffer) { + stringify(1, buffer); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/156 index customtarget/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/156 index customtarget/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/156 index customtarget/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/156 index customtarget/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,80 @@ +# Copyright © 2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +project('custom_target_index', 'c', default_options : 'c_std=c89') + +py_mod = import('python3') +prog_python = py_mod.find_python() + +gen = custom_target( + 'gen.[ch]', + input : 'gen_sources.py', + output : ['gen.c', 'gen.h'], + command : [prog_python, '@INPUT@', '--header', '@OUTPUT1@', '--code', '@OUTPUT0@'], +) + +has_not_changed = false +if is_disabler(gen) + has_not_changed = true +else + has_not_changed = true +endif + +assert(has_not_changed, 'Custom target has changed.') + +assert(not is_disabler(gen), 'Custom target is a disabler.') + +lib = static_library( + 'libfoo', + ['lib.c', gen[1]], +) + +has_not_changed = false +if is_disabler(lib) + has_not_changed = true +else + has_not_changed = true +endif + +assert(has_not_changed, 'Static library has changed.') + +assert(not is_disabler(lib), 'Static library is a disabler.') + +custom_target( + 'foo', + input: gen[0], + output: 'foo', + command: [find_program('check_args.py'), '@INPUT@'], +) + +subdir('subdir') + +gen = disabler() + +assert(is_disabler(gen), 'Generator is not a disabler.') + +lib = static_library( + 'libfoo', + ['lib.c', gen[1]], +) + +assert(is_disabler(lib), 'Static library is not a disabler.') + +if lib.found() + lib_disabled = false +else + lib_disabled = true +endif + +assert(lib_disabled, 'Static library was not disabled.') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/156 index customtarget/subdir/foo.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/156 index customtarget/subdir/foo.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/156 index customtarget/subdir/foo.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/156 index customtarget/subdir/foo.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,22 @@ +/* Copyright © 2017 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "gen.h" + +int main(void) { + char buf[50]; + stringify(10, buf); + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/156 index customtarget/subdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/156 index customtarget/subdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/156 index customtarget/subdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/156 index customtarget/subdir/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,19 @@ +# Copyright © 2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +foo = executable( + 'foo', + ['foo.c', gen[0], gen[1]], + c_args : '-DWORKS', +) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/157 index customtarget/check_args.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/157 index customtarget/check_args.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/157 index customtarget/check_args.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/157 index customtarget/check_args.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -#!python3 - -import sys -from pathlib import Path - -def main(): - if len(sys.argv) != 2: - print(sys.argv) - return 1 - if sys.argv[1] != 'gen.c': - print(sys.argv) - return 2 - Path('foo').touch() - - return 0 - -if __name__ == '__main__': - sys.exit(main()) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/157 index customtarget/gen_sources.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/157 index customtarget/gen_sources.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/157 index customtarget/gen_sources.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/157 index customtarget/gen_sources.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ -# Copyright © 2017 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import argparse -import textwrap - -HEADER = textwrap.dedent('''\ - void stringify(int foo, char * buffer); - ''') - -CODE = textwrap.dedent('''\ - #include - - #ifndef WORKS - # error "This shouldn't have been included" - #endif - - void stringify(int foo, char * buffer) { - sprintf(buffer, "%i", foo); - } - ''') - - -def main(): - parser = argparse.ArgumentParser() - parser.add_argument('--header') - parser.add_argument('--code') - args = parser.parse_args() - - with open(args.header, 'w') as f: - f.write(HEADER) - - with open(args.code, 'w') as f: - f.write(CODE) - - -if __name__ == '__main__': - main() diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/157 index customtarget/lib.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/157 index customtarget/lib.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/157 index customtarget/lib.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/157 index customtarget/lib.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -/* Copyright © 2017 Intel Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "gen.h" - -void func(char * buffer) { - stringify(1, buffer); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/157 index customtarget/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/157 index customtarget/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/157 index customtarget/meson.build" 2018-12-09 16:31:19.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/157 index customtarget/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -# Copyright © 2017 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -project('custom_target_index', 'c', default_options : 'c_std=c89') - -py_mod = import('python3') -prog_python = py_mod.find_python() - -gen = custom_target( - 'gen.[ch]', - input : 'gen_sources.py', - output : ['gen.c', 'gen.h'], - command : [prog_python, '@INPUT@', '--header', '@OUTPUT1@', '--code', '@OUTPUT0@'], -) - -lib = static_library( - 'libfoo', - ['lib.c', gen[1]], -) - -custom_target( - 'foo', - input: gen[0], - output: 'foo', - command: [find_program('check_args.py'), '@INPUT@'], -) - -subdir('subdir') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/157 index customtarget/subdir/foo.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/157 index customtarget/subdir/foo.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/157 index customtarget/subdir/foo.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/157 index customtarget/subdir/foo.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ -/* Copyright © 2017 Intel Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "gen.h" - -int main(void) { - char buf[50]; - stringify(10, buf); - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/157 index customtarget/subdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/157 index customtarget/subdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/157 index customtarget/subdir/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/157 index customtarget/subdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -# Copyright © 2017 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -foo = executable( - 'foo', - ['foo.c', gen[0], gen[1]], - c_args : '-DWORKS', -) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/157 wrap file should not failed/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/157 wrap file should not failed/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/157 wrap file should not failed/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/157 wrap file should not failed/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,10 @@ +project('mainproj', 'c', + default_options : ['wrap_mode=nodownload'], +) + +subproject('zlib') +subproject('foo') + +executable('grabprog', files('src/subprojects/prog.c')) +executable('grabprog2', files('src/subprojects/foo/prog2.c')) +subdir('src') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/157 wrap file should not failed/src/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/157 wrap file should not failed/src/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/157 wrap file should not failed/src/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/157 wrap file should not failed/src/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +executable('grabprog3', files('subprojects/prog.c')) +executable('grabprog4', files('subprojects/foo/prog2.c')) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/157 wrap file should not failed/src/subprojects/foo/prog2.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/157 wrap file should not failed/src/subprojects/foo/prog2.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/157 wrap file should not failed/src/subprojects/foo/prog2.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/157 wrap file should not failed/src/subprojects/foo/prog2.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,7 @@ +#include + +int main(int argc, char **argv) { + printf("Do not have a file layout like this in your own projects.\n"); + printf("This is only to test that this works.\n"); + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/157 wrap file should not failed/src/subprojects/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/157 wrap file should not failed/src/subprojects/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/157 wrap file should not failed/src/subprojects/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/157 wrap file should not failed/src/subprojects/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,7 @@ +#include + +int main(int argc, char **argv) { + printf("Do not have a file layout like this in your own projects.\n"); + printf("This is only to test that this works.\n"); + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/157 wrap file should not failed/subprojects/foo-1.0/foo.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/157 wrap file should not failed/subprojects/foo-1.0/foo.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/157 wrap file should not failed/subprojects/foo-1.0/foo.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/157 wrap file should not failed/subprojects/foo-1.0/foo.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,3 @@ +int dummy_func() { + return 42; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/157 wrap file should not failed/subprojects/foo-1.0/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/157 wrap file should not failed/subprojects/foo-1.0/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/157 wrap file should not failed/subprojects/foo-1.0/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/157 wrap file should not failed/subprojects/foo-1.0/meson.build" 2019-10-06 17:01:35.000000000 +0000 @@ -0,0 +1,2 @@ +project('shared lib', 'c') +libfoo = shared_library('foo', 'foo.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/157 wrap file should not failed/subprojects/foo.wrap" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/157 wrap file should not failed/subprojects/foo.wrap" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/157 wrap file should not failed/subprojects/foo.wrap" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/157 wrap file should not failed/subprojects/foo.wrap" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,11 @@ +[wrap-file] +directory = foo-1.0 + +source_url = http://something.invalid +source_filename = foo-1.0.tar.xz +source_hash = ae5fc03185654f76b459db16ca25809703f8821aeb39a433902244bb479c4b79 +lead_directory_missing = true + +patch_url = https://something.invalid/patch +patch_filename = foo-1.0-patch.tar.xz +patch_hash = 8f2e286a4b190228d4e0c25ddc91195449cfb5e5c52006355838964b244037da Binary files /tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/157 wrap file should not failed/subprojects/packagecache/foo-1.0-patch.tar.xz and /tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/157 wrap file should not failed/subprojects/packagecache/foo-1.0-patch.tar.xz differ Binary files /tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/157 wrap file should not failed/subprojects/packagecache/foo-1.0.tar.xz and /tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/157 wrap file should not failed/subprojects/packagecache/foo-1.0.tar.xz differ diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/157 wrap file should not failed/subprojects/packagecache/zlib-1.2.8-8-wrap.zip" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/157 wrap file should not failed/subprojects/packagecache/zlib-1.2.8-8-wrap.zip" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/157 wrap file should not failed/subprojects/packagecache/zlib-1.2.8-8-wrap.zip" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/157 wrap file should not failed/subprojects/packagecache/zlib-1.2.8-8-wrap.zip" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +dummy diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/157 wrap file should not failed/subprojects/packagecache/zlib-1.2.8.tar.gz" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/157 wrap file should not failed/subprojects/packagecache/zlib-1.2.8.tar.gz" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/157 wrap file should not failed/subprojects/packagecache/zlib-1.2.8.tar.gz" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/157 wrap file should not failed/subprojects/packagecache/zlib-1.2.8.tar.gz" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +dummy diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/157 wrap file should not failed/subprojects/zlib-1.2.8/foo.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/157 wrap file should not failed/subprojects/zlib-1.2.8/foo.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/157 wrap file should not failed/subprojects/zlib-1.2.8/foo.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/157 wrap file should not failed/subprojects/zlib-1.2.8/foo.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,3 @@ +int dummy_func() { + return 42; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/157 wrap file should not failed/subprojects/zlib-1.2.8/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/157 wrap file should not failed/subprojects/zlib-1.2.8/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/157 wrap file should not failed/subprojects/zlib-1.2.8/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/157 wrap file should not failed/subprojects/zlib-1.2.8/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +project('shared lib', 'c') +shared_library('foo', 'foo.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/157 wrap file should not failed/subprojects/zlib.wrap" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/157 wrap file should not failed/subprojects/zlib.wrap" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/157 wrap file should not failed/subprojects/zlib.wrap" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/157 wrap file should not failed/subprojects/zlib.wrap" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,10 @@ +[wrap-file] +directory = zlib-1.2.8 + +source_url = http://zlib.net/fossils/zlib-1.2.8.tar.gz +source_filename = zlib-1.2.8.tar.gz +source_hash = 36658cb768a54c1d4dec43c3116c27ed893e88b02ecfcb44f2166f9c0b7f2a0d + +patch_url = https://wrapdb.mesonbuild.com/v1/projects/zlib/1.2.8/8/get_zip +patch_filename = zlib-1.2.8-8-wrap.zip +patch_hash = 17c52a0e0c59ce926d3959005d5cd8178c6c7e2c9a4a1304279a8320c955ac60 diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/158 includedir subproj/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/158 includedir subproj/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/158 includedir subproj/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/158 includedir subproj/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,9 @@ +project('include dir in subproj test', 'c') + + +subproject('inctest') + + +exe = executable('prog', 'prog.c') + +test('dummy', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/158 includedir subproj/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/158 includedir subproj/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/158 includedir subproj/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/158 includedir subproj/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,4 @@ + +int main(int argc, char **argv) { + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/158 includedir subproj/subprojects/inctest/include/incfile.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/158 includedir subproj/subprojects/inctest/include/incfile.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/158 includedir subproj/subprojects/inctest/include/incfile.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/158 includedir subproj/subprojects/inctest/include/incfile.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ + +/* file which is used in the subproject */ diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/158 includedir subproj/subprojects/inctest/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/158 includedir subproj/subprojects/inctest/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/158 includedir subproj/subprojects/inctest/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/158 includedir subproj/subprojects/inctest/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,13 @@ + +project('subproj with includedir', 'c') + + + +compile_check = ''' +#include "incfile.h" +''' + +if not meson.get_compiler('c').compiles(compile_check, name : 'include in subproj', + include_directories: include_directories('include')) + error('failed') +endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/158 wrap file should not failed/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/158 wrap file should not failed/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/158 wrap file should not failed/meson.build" 2018-12-09 16:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/158 wrap file should not failed/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -project('mainproj', 'c', - default_options : ['wrap_mode=nodownload'], -) - -subproject('zlib') -subproject('foo') - -executable('grabprog', files('src/subprojects/prog.c')) -executable('grabprog2', files('src/subprojects/foo/prog2.c')) -subdir('src') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/158 wrap file should not failed/src/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/158 wrap file should not failed/src/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/158 wrap file should not failed/src/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/158 wrap file should not failed/src/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -executable('grabprog3', files('subprojects/prog.c')) -executable('grabprog4', files('subprojects/foo/prog2.c')) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/158 wrap file should not failed/src/subprojects/foo/prog2.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/158 wrap file should not failed/src/subprojects/foo/prog2.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/158 wrap file should not failed/src/subprojects/foo/prog2.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/158 wrap file should not failed/src/subprojects/foo/prog2.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -#include - -int main(int argc, char **argv) { - printf("Do not have a file layout like this in your own projects.\n"); - printf("This is only to test that this works.\n"); - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/158 wrap file should not failed/src/subprojects/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/158 wrap file should not failed/src/subprojects/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/158 wrap file should not failed/src/subprojects/prog.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/158 wrap file should not failed/src/subprojects/prog.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -#include - -int main(int argc, char **argv) { - printf("Do not have a file layout like this in your own projects.\n"); - printf("This is only to test that this works.\n"); - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/158 wrap file should not failed/subprojects/foo-1.0/foo.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/158 wrap file should not failed/subprojects/foo-1.0/foo.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/158 wrap file should not failed/subprojects/foo-1.0/foo.c" 2018-10-18 01:50:02.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/158 wrap file should not failed/subprojects/foo-1.0/foo.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -int dummy_func() { - return 42; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/158 wrap file should not failed/subprojects/foo-1.0/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/158 wrap file should not failed/subprojects/foo-1.0/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/158 wrap file should not failed/subprojects/foo-1.0/meson.build" 2018-10-20 14:32:08.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/158 wrap file should not failed/subprojects/foo-1.0/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -project('shared lib', 'c') -libfoo = shared_library('foo', 'foo.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/158 wrap file should not failed/subprojects/foo.wrap" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/158 wrap file should not failed/subprojects/foo.wrap" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/158 wrap file should not failed/subprojects/foo.wrap" 2018-12-09 14:27:16.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/158 wrap file should not failed/subprojects/foo.wrap" 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -[wrap-file] -directory = foo-1.0 - -source_url = http://something.invalid -source_filename = foo-1.0.tar.xz -source_hash = ae5fc03185654f76b459db16ca25809703f8821aeb39a433902244bb479c4b79 -lead_directory_missing = true - -patch_url = https://something.invalid/patch -patch_filename = foo-1.0-patch.tar.xz -patch_hash = 8f2e286a4b190228d4e0c25ddc91195449cfb5e5c52006355838964b244037da Binary files /tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/158 wrap file should not failed/subprojects/packagecache/foo-1.0-patch.tar.xz and /tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/158 wrap file should not failed/subprojects/packagecache/foo-1.0-patch.tar.xz differ Binary files /tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/158 wrap file should not failed/subprojects/packagecache/foo-1.0.tar.xz and /tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/158 wrap file should not failed/subprojects/packagecache/foo-1.0.tar.xz differ diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/158 wrap file should not failed/subprojects/packagecache/zlib-1.2.8-8-wrap.zip" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/158 wrap file should not failed/subprojects/packagecache/zlib-1.2.8-8-wrap.zip" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/158 wrap file should not failed/subprojects/packagecache/zlib-1.2.8-8-wrap.zip" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/158 wrap file should not failed/subprojects/packagecache/zlib-1.2.8-8-wrap.zip" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -dummy diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/158 wrap file should not failed/subprojects/packagecache/zlib-1.2.8.tar.gz" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/158 wrap file should not failed/subprojects/packagecache/zlib-1.2.8.tar.gz" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/158 wrap file should not failed/subprojects/packagecache/zlib-1.2.8.tar.gz" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/158 wrap file should not failed/subprojects/packagecache/zlib-1.2.8.tar.gz" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -dummy diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/158 wrap file should not failed/subprojects/zlib-1.2.8/foo.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/158 wrap file should not failed/subprojects/zlib-1.2.8/foo.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/158 wrap file should not failed/subprojects/zlib-1.2.8/foo.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/158 wrap file should not failed/subprojects/zlib-1.2.8/foo.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -int dummy_func() { - return 42; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/158 wrap file should not failed/subprojects/zlib-1.2.8/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/158 wrap file should not failed/subprojects/zlib-1.2.8/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/158 wrap file should not failed/subprojects/zlib-1.2.8/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/158 wrap file should not failed/subprojects/zlib-1.2.8/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -project('shared lib', 'c') -shared_library('foo', 'foo.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/158 wrap file should not failed/subprojects/zlib.wrap" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/158 wrap file should not failed/subprojects/zlib.wrap" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/158 wrap file should not failed/subprojects/zlib.wrap" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/158 wrap file should not failed/subprojects/zlib.wrap" 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -[wrap-file] -directory = zlib-1.2.8 - -source_url = http://zlib.net/fossils/zlib-1.2.8.tar.gz -source_filename = zlib-1.2.8.tar.gz -source_hash = 36658cb768a54c1d4dec43c3116c27ed893e88b02ecfcb44f2166f9c0b7f2a0d - -patch_url = https://wrapdb.mesonbuild.com/v1/projects/zlib/1.2.8/8/get_zip -patch_filename = zlib-1.2.8-8-wrap.zip -patch_hash = 17c52a0e0c59ce926d3959005d5cd8178c6c7e2c9a4a1304279a8320c955ac60 diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/159 includedir subproj/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/159 includedir subproj/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/159 includedir subproj/meson.build" 2018-12-09 16:31:21.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/159 includedir subproj/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -project('include dir in subproj test', 'c') - - -subproject('inctest') - - -exe = executable('prog', 'prog.c') - -test('dummy', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/159 includedir subproj/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/159 includedir subproj/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/159 includedir subproj/prog.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/159 includedir subproj/prog.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ - -int main(int argc, char **argv) { - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/159 includedir subproj/subprojects/inctest/include/incfile.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/159 includedir subproj/subprojects/inctest/include/incfile.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/159 includedir subproj/subprojects/inctest/include/incfile.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/159 includedir subproj/subprojects/inctest/include/incfile.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ - -/* file which is used in the subproject */ diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/159 includedir subproj/subprojects/inctest/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/159 includedir subproj/subprojects/inctest/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/159 includedir subproj/subprojects/inctest/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/159 includedir subproj/subprojects/inctest/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ - -project('subproj with includedir', 'c') - - - -compile_check = ''' -#include "incfile.h" -''' - -if not meson.get_compiler('c').compiles(compile_check, name : 'include in subproj', - include_directories: include_directories('include')) - error('failed') -endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/159 subproject dir name collision/a.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/159 subproject dir name collision/a.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/159 subproject dir name collision/a.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/159 subproject dir name collision/a.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,13 @@ +#include +char func_b(); +char func_c(); + +int main(int argc, char **argv) { + if(func_b() != 'b') { + return 1; + } + if(func_c() != 'c') { + return 2; + } + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/159 subproject dir name collision/custom_subproject_dir/B/b.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/159 subproject dir name collision/custom_subproject_dir/B/b.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/159 subproject dir name collision/custom_subproject_dir/B/b.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/159 subproject dir name collision/custom_subproject_dir/B/b.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,20 @@ +#include +char func_c(); + +#if defined _WIN32 || defined __CYGWIN__ +#define DLL_PUBLIC __declspec(dllexport) +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif + +char DLL_PUBLIC func_b() { + if(func_c() != 'c') { + exit(3); + } + return 'b'; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/159 subproject dir name collision/custom_subproject_dir/B/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/159 subproject dir name collision/custom_subproject_dir/B/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/159 subproject dir name collision/custom_subproject_dir/B/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/159 subproject dir name collision/custom_subproject_dir/B/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,4 @@ +project('B', 'c') +C = subproject('C') +c = C.get_variable('c') +b = shared_library('b', 'b.c', link_with : c) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/159 subproject dir name collision/custom_subproject_dir/C/c.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/159 subproject dir name collision/custom_subproject_dir/C/c.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/159 subproject dir name collision/custom_subproject_dir/C/c.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/159 subproject dir name collision/custom_subproject_dir/C/c.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,14 @@ +#if defined _WIN32 || defined __CYGWIN__ +#define DLL_PUBLIC __declspec(dllexport) +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif + +char DLL_PUBLIC func_c() { + return 'c'; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/159 subproject dir name collision/custom_subproject_dir/C/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/159 subproject dir name collision/custom_subproject_dir/C/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/159 subproject dir name collision/custom_subproject_dir/C/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/159 subproject dir name collision/custom_subproject_dir/C/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +project('C', 'c') +c = shared_library('c', 'c.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/159 subproject dir name collision/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/159 subproject dir name collision/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/159 subproject dir name collision/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/159 subproject dir name collision/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,12 @@ +project('A', 'c', subproject_dir:'custom_subproject_dir') + +B = subproject('B') +b = B.get_variable('b') + +C = subproject('C') +c = C.get_variable('c') + +subdir('other_subdir') + +a = executable('a', 'a.c', link_with : [b, c]) +test('a test', a) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/159 subproject dir name collision/other_subdir/custom_subproject_dir/other.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/159 subproject dir name collision/other_subdir/custom_subproject_dir/other.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/159 subproject dir name collision/other_subdir/custom_subproject_dir/other.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/159 subproject dir name collision/other_subdir/custom_subproject_dir/other.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,19 @@ +#include + +#if defined _WIN32 || defined __CYGWIN__ +#define DLL_PUBLIC __declspec(dllexport) +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif + +char DLL_PUBLIC func_b() { + if('c' != 'c') { + exit(3); + } + return 'b'; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/159 subproject dir name collision/other_subdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/159 subproject dir name collision/other_subdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/159 subproject dir name collision/other_subdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/159 subproject dir name collision/other_subdir/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +other = shared_library('other', 'custom_subproject_dir/other.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/160 config tool variable/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/160 config tool variable/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/160 config tool variable/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/160 config tool variable/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,31 @@ +# Copyright © 2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +project('config tool variable', 'cpp') + + +dep_llvm = dependency('llvm', method : 'config-tool', required : false) +if not dep_llvm.found() + error('MESON_SKIP_TEST LLVM not installed.') +endif + +includedir = dep_llvm.get_configtool_variable('includedir') +includedir = join_paths(includedir, 'llvm') +if host_machine.system() == 'windows' + cmd = run_command(['dir', includedir]) +else + cmd = run_command(['ls', includedir]) +endif + +assert(cmd.returncode() == 0, 'did not run successfully') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/160 subproject dir name collision/a.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/160 subproject dir name collision/a.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/160 subproject dir name collision/a.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/160 subproject dir name collision/a.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -#include -char func_b(); -char func_c(); - -int main(int argc, char **argv) { - if(func_b() != 'b') { - return 1; - } - if(func_c() != 'c') { - return 2; - } - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/160 subproject dir name collision/custom_subproject_dir/B/b.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/160 subproject dir name collision/custom_subproject_dir/B/b.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/160 subproject dir name collision/custom_subproject_dir/B/b.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/160 subproject dir name collision/custom_subproject_dir/B/b.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -#include -char func_c(); - -#if defined _WIN32 || defined __CYGWIN__ -#define DLL_PUBLIC __declspec(dllexport) -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif - -char DLL_PUBLIC func_b() { - if(func_c() != 'c') { - exit(3); - } - return 'b'; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/160 subproject dir name collision/custom_subproject_dir/B/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/160 subproject dir name collision/custom_subproject_dir/B/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/160 subproject dir name collision/custom_subproject_dir/B/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/160 subproject dir name collision/custom_subproject_dir/B/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -project('B', 'c') -C = subproject('C') -c = C.get_variable('c') -b = shared_library('b', 'b.c', link_with : c) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/160 subproject dir name collision/custom_subproject_dir/C/c.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/160 subproject dir name collision/custom_subproject_dir/C/c.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/160 subproject dir name collision/custom_subproject_dir/C/c.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/160 subproject dir name collision/custom_subproject_dir/C/c.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -#if defined _WIN32 || defined __CYGWIN__ -#define DLL_PUBLIC __declspec(dllexport) -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif - -char DLL_PUBLIC func_c() { - return 'c'; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/160 subproject dir name collision/custom_subproject_dir/C/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/160 subproject dir name collision/custom_subproject_dir/C/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/160 subproject dir name collision/custom_subproject_dir/C/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/160 subproject dir name collision/custom_subproject_dir/C/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -project('C', 'c') -c = shared_library('c', 'c.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/160 subproject dir name collision/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/160 subproject dir name collision/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/160 subproject dir name collision/meson.build" 2018-12-09 16:31:23.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/160 subproject dir name collision/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -project('A', 'c', subproject_dir:'custom_subproject_dir') - -B = subproject('B') -b = B.get_variable('b') - -C = subproject('C') -c = C.get_variable('c') - -subdir('other_subdir') - -a = executable('a', 'a.c', link_with : [b, c]) -test('a test', a) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/160 subproject dir name collision/other_subdir/custom_subproject_dir/other.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/160 subproject dir name collision/other_subdir/custom_subproject_dir/other.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/160 subproject dir name collision/other_subdir/custom_subproject_dir/other.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/160 subproject dir name collision/other_subdir/custom_subproject_dir/other.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -#include - -#if defined _WIN32 || defined __CYGWIN__ -#define DLL_PUBLIC __declspec(dllexport) -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif - -char DLL_PUBLIC func_b() { - if('c' != 'c') { - exit(3); - } - return 'b'; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/160 subproject dir name collision/other_subdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/160 subproject dir name collision/other_subdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/160 subproject dir name collision/other_subdir/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/160 subproject dir name collision/other_subdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -other = shared_library('other', 'custom_subproject_dir/other.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/161 config tool variable/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/161 config tool variable/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/161 config tool variable/meson.build" 2018-12-09 16:31:23.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/161 config tool variable/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -# Copyright © 2017 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -project('config tool variable', 'cpp') - - -dep_llvm = dependency('llvm', required : false) -if not dep_llvm.found() - error('MESON_SKIP_TEST LLVM not installed.') -endif - -includedir = dep_llvm.get_configtool_variable('includedir') -includedir = join_paths(includedir, 'llvm') -if host_machine.system() == 'windows' - cmd = run_command(['dir', includedir]) -else - cmd = run_command(['ls', includedir]) -endif - -assert(cmd.returncode() == 0, 'did not run successfully') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/161 custom target subdir depend files/copyfile.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/161 custom target subdir depend files/copyfile.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/161 custom target subdir depend files/copyfile.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/161 custom target subdir depend files/copyfile.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,6 @@ +#!/usr/bin/env python3 + +import sys +import shutil + +shutil.copyfile(sys.argv[1], sys.argv[2]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/161 custom target subdir depend files/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/161 custom target subdir depend files/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/161 custom target subdir depend files/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/161 custom target subdir depend files/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,7 @@ +project('custom target subdir depend files', 'c') + +copy = find_program('copyfile.py') + +subdir('subdir') + +executable('foo', foo_src) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/161 custom target subdir depend files/subdir/dep.dat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/161 custom target subdir depend files/subdir/dep.dat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/161 custom target subdir depend files/subdir/dep.dat" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/161 custom target subdir depend files/subdir/dep.dat" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +You can depend on this file. \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/161 custom target subdir depend files/subdir/foo.c.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/161 custom target subdir depend files/subdir/foo.c.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/161 custom target subdir depend files/subdir/foo.c.in" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/161 custom target subdir depend files/subdir/foo.c.in" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,6 @@ +#include + +int main() { + printf("foo is working.\n"); + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/161 custom target subdir depend files/subdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/161 custom target subdir depend files/subdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/161 custom target subdir depend files/subdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/161 custom target subdir depend files/subdir/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,6 @@ +foo_src = custom_target('foo_src', + depend_files : 'dep.dat', + input : 'foo.c.in', + output : 'foo.c', + command : [copy, '@INPUT@', '@OUTPUT@'] +) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/162 custom target subdir depend files/copyfile.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/162 custom target subdir depend files/copyfile.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/162 custom target subdir depend files/copyfile.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/162 custom target subdir depend files/copyfile.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#!/usr/bin/env python3 - -import sys -import shutil - -shutil.copyfile(sys.argv[1], sys.argv[2]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/162 custom target subdir depend files/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/162 custom target subdir depend files/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/162 custom target subdir depend files/meson.build" 2018-12-09 16:31:23.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/162 custom target subdir depend files/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -project('custom target subdir depend files', 'c') - -copy = find_program('copyfile.py') - -subdir('subdir') - -executable('foo', foo_src) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/162 custom target subdir depend files/subdir/dep.dat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/162 custom target subdir depend files/subdir/dep.dat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/162 custom target subdir depend files/subdir/dep.dat" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/162 custom target subdir depend files/subdir/dep.dat" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -You can depend on this file. \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/162 custom target subdir depend files/subdir/foo.c.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/162 custom target subdir depend files/subdir/foo.c.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/162 custom target subdir depend files/subdir/foo.c.in" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/162 custom target subdir depend files/subdir/foo.c.in" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#include - -int main() { - printf("foo is working.\n"); - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/162 custom target subdir depend files/subdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/162 custom target subdir depend files/subdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/162 custom target subdir depend files/subdir/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/162 custom target subdir depend files/subdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -foo_src = custom_target('foo_src', - depend_files : 'dep.dat', - input : 'foo.c.in', - output : 'foo.c', - command : [copy, '@INPUT@', '@OUTPUT@'] -) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/162 external program shebang parsing/input.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/162 external program shebang parsing/input.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/162 external program shebang parsing/input.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/162 external program shebang parsing/input.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +some stuff here diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/162 external program shebang parsing/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/162 external program shebang parsing/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/162 external program shebang parsing/main.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/162 external program shebang parsing/main.c" 2019-09-16 21:20:45.000000000 +0000 @@ -0,0 +1,72 @@ +#include +#include +#include +#include +#include +#include + +#ifdef _WIN32 + #include + #include +#else + #include +#endif + +/* Who cares about stack sizes in test programs anyway */ +#define LINE_LENGTH 4096 + +static int +intrp_copyfile (char * src, char * dest) +{ +#ifdef _WIN32 + if (!CopyFile (src, dest, FALSE)) + return 1; + return 0; +#else + return execlp ("cp", "cp", src, dest, NULL); +#endif +} + +static void +parser_get_line (FILE * f, char line[LINE_LENGTH]) +{ + if (!fgets (line, LINE_LENGTH, f)) + fprintf (stderr, "%s\n", strerror (errno)); +} + +int +main (int argc, char * argv[]) +{ + FILE *f = NULL; + char line[LINE_LENGTH]; + + if (argc != 4) { + fprintf (stderr, "Invalid number of arguments: %i\n", argc); + goto err; + } + + if ((f = fopen (argv[1], "r")) == NULL) { + fprintf (stderr, "%s\n", strerror (errno)); + goto err; + } + + parser_get_line (f, line); + + if (!line || line[0] != '#' || line[1] != '!') { + fprintf (stderr, "Invalid script\n"); + goto err; + } + + parser_get_line (f, line); + + if (!line || strncmp (line, "copy", 4) != 0) { + fprintf (stderr, "Syntax error: %s\n", line); + goto err; + } + + return intrp_copyfile (argv[2], argv[3]); + +err: + fclose (f); + return 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/162 external program shebang parsing/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/162 external program shebang parsing/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/162 external program shebang parsing/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/162 external program shebang parsing/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,21 @@ +project('shebang parsing', 'c') + +interpreter = executable('aninterp', 'main.c', native : true) + +cdata = configuration_data() +cdata.set('INTRP', interpreter.full_path()) + +f = configure_file(input : 'script.int.in', + output : 'script.int', + configuration : cdata) + +# Test that parsing a shebang with spaces works properly. See `man execve`, +# specifically the section on "Interpreter scripts" and the one under "NOTES". +script = find_program(f) + +custom_target('interpthis', + input : 'input.txt', + output : 'output.txt', + depends : interpreter, + command : [script, '@INPUT@', '@OUTPUT@'], + build_by_default : true) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/162 external program shebang parsing/script.int.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/162 external program shebang parsing/script.int.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/162 external program shebang parsing/script.int.in" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/162 external program shebang parsing/script.int.in" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +#!/usr/bin/env @INTRP@ +copy diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/163 disabler/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/163 disabler/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/163 disabler/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/163 disabler/meson.build" 2019-10-27 22:08:32.000000000 +0000 @@ -0,0 +1,125 @@ +project('dolphin option', 'c') + +d = disabler() + +full_path = d.full_path() +assert(is_disabler(full_path), 'Method call is not a disabler') + +d2 = dependency(d) +d3 = (d == d2) +d4 = d + 0 +d5 = d2 or true + +has_not_changed = false +if is_disabler(d) + has_not_changed = true +else + has_not_changed = true +endif +assert(has_not_changed, 'Disabler has changed.') + +assert(is_disabler(d), 'Disabler was not identified correctly.') +assert(is_disabler(d2), 'Function laundered disabler was not identified correctly.') +assert(is_disabler(d3), 'Disabler comparison should yield disabler.') +assert(is_disabler(d4), 'Disabler addition should yield disabler.') +assert(is_disabler(d5), 'Disabler logic op should yield disabler.') + +assert(d, 'Disabler did not cause this to be skipped.') +assert(d2, 'Function laundered disabler did not cause this to be skipped.') +assert(d3, 'Disabler comparison should yield disabler and thus this would not be called.') +assert(d4, 'Disabler addition should yield disabler and thus this would not be called.') +assert(d5, 'Disabler logic op should yield disabler and thus this would not be called.') + +number = 0 + +if d + number = 1 +else + number = 2 +endif + +has_not_changed = false +if is_disabler(number) + has_not_changed = true +else + has_not_changed = true +endif +assert(has_not_changed, 'Number has changed.') + +assert(not is_disabler(number), 'Number should not be a disabler.') +assert(number == 0, 'Plain if handled incorrectly, value should be 0 but is @0@'.format(number)) + +if d.found() + number = 1 +else + number = 2 +endif + +assert(number == 2, 'If found handled incorrectly, value should be 2 but is @0@'.format(number)) + +dep = dependency('notfounddep', required : false, disabler : true) +app = executable('myapp', 'notfound.c', dependencies : [dep]) +assert(is_disabler(app), 'App is not a disabler.') +app = executable('myapp', 'notfound.c', dependencies : [[dep]]) +assert(is_disabler(app), 'App is not a disabler.') + +cc = meson.get_compiler('c') +dep = cc.find_library('notfounddep', required : false, disabler : true) +app = executable('myapp', 'notfound.c', dependencies : [dep]) +assert(is_disabler(app), 'App is not a disabler.') + +dep = find_program('donotfindme', required : false, disabler : true) +app = executable('myapp', 'notfound.c', dependencies : [dep]) +assert(is_disabler(app), 'App is not a disabler.') + +has_not_changed = false +if is_disabler(app) + has_not_changed = true +else + has_not_changed = true +endif +assert(has_not_changed, 'App has changed.') + +if_is_disabled = true +if disabler() + if_is_disabled = false +else + if_is_disabled = false +endif +assert(if_is_disabled, 'Disabler in "if condition" must skip both blocks') + +if not disabler() + if_is_disabled = false +else + if_is_disabled = false +endif +assert(if_is_disabled, 'Disabler in "if not condition" must skip both blocks') + +if disabler() == 1 + if_is_disabled = false +else + if_is_disabled = false +endif +assert(if_is_disabled, 'Disabler in "if a==b" must skip both blocks') + +loops = 0 +disablers = 0 +foreach i : [true, disabler(), true] + loops += 1 + if is_disabler(i) + disablers += 1 + endif +endforeach +assert(loops == 3, 'Disabler in foreach array') +assert(disablers == 1, 'Disabler in foreach array') + +loops = 0 +disablers = 0 +foreach k, i : {'a': true, 'b': disabler(), 'c': true} + loops += 1 + if is_disabler(i) + disablers += 1 + endif +endforeach +assert(loops == 3, 'Disabler in foreach dict') +assert(disablers == 1, 'Disabler in foreach dict') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/163 external program shebang parsing/input.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/163 external program shebang parsing/input.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/163 external program shebang parsing/input.txt" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/163 external program shebang parsing/input.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -some stuff here diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/163 external program shebang parsing/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/163 external program shebang parsing/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/163 external program shebang parsing/main.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/163 external program shebang parsing/main.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,72 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#ifdef _WIN32 - #include - #include -#else - #include -#endif - -/* Who cares about stack sizes in test programs anyway */ -#define LINE_LENGTH 4096 - -static int -intrp_copyfile (char * src, char * dest) -{ -#ifdef _WIN32 - if (!CopyFile (src, dest, FALSE)) - return 1; - return 0; -#else - return execlp ("cp", "copyfile", src, dest, NULL); -#endif -} - -static void -parser_get_line (FILE * f, char line[LINE_LENGTH]) -{ - if (!fgets (line, LINE_LENGTH, f)) - fprintf (stderr, "%s\n", strerror (errno)); -} - -int -main (int argc, char * argv[]) -{ - FILE *f = NULL; - char line[LINE_LENGTH]; - - if (argc != 4) { - fprintf (stderr, "Invalid number of arguments: %i\n", argc); - goto err; - } - - if ((f = fopen (argv[1], "r")) == NULL) { - fprintf (stderr, "%s\n", strerror (errno)); - goto err; - } - - parser_get_line (f, line); - - if (!line || line[0] != '#' || line[1] != '!') { - fprintf (stderr, "Invalid script\n"); - goto err; - } - - parser_get_line (f, line); - - if (!line || strncmp (line, "copy", 4) != 0) { - fprintf (stderr, "Syntax error: %s\n", line); - goto err; - } - - return intrp_copyfile (argv[2], argv[3]); - -err: - fclose (f); - return 1; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/163 external program shebang parsing/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/163 external program shebang parsing/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/163 external program shebang parsing/meson.build" 2018-12-09 16:31:25.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/163 external program shebang parsing/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -project('shebang parsing', 'c') - -interpreter = executable('aninterp', 'main.c', native : true) - -cdata = configuration_data() -cdata.set('INTRP', interpreter.full_path()) - -f = configure_file(input : 'script.int.in', - output : 'script.int', - configuration : cdata) - -# Test that parsing a shebang with spaces works properly. See `man execve`, -# specifically the section on "Interpreter scripts" and the one under "NOTES". -script = find_program(f) - -custom_target('interpthis', - input : 'input.txt', - output : 'output.txt', - depends : interpreter, - command : [script, '@INPUT@', '@OUTPUT@'], - build_by_default : true) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/163 external program shebang parsing/script.int.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/163 external program shebang parsing/script.int.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/163 external program shebang parsing/script.int.in" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/163 external program shebang parsing/script.int.in" 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#!/usr/bin/env @INTRP@ -copy diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/164 array option/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/164 array option/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/164 array option/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/164 array option/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,17 @@ +# Copyright © 2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +project('array default options') + +assert(get_option('array') == ['foo', 'bar'], 'Default value for array is not equal to choices') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/164 array option/meson_options.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/164 array option/meson_options.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/164 array option/meson_options.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/164 array option/meson_options.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,19 @@ +# Copyright © 2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +option( + 'array', + type : 'array', + choices : ['foo', 'bar'], +) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/164 disabler/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/164 disabler/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/164 disabler/meson.build" 2018-12-09 16:31:26.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/164 disabler/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -project('dolphin option', 'c') - -d = disabler() - -d2 = dependency(d) -d3 = (d == d2) -d4 = d + 0 -d5 = d2 or true - -assert(d, 'Disabler did not cause this to be skipped.') -assert(d2, 'Function laundered disabler did not cause this to be skipped.') -assert(d3, 'Disabler comparison should yield disabler and thus this would not be called.') -assert(d4, 'Disabler addition should yield disabler and thus this would not be called.') -assert(d5, 'Disabler logic op should yield disabler and thus this would not be called.') - -number = 0 - -if d - number = 1 -else - number = 2 -endif - -assert(number == 0, 'Plain if handled incorrectly, value should be 0 but is @0@'.format(number)) - -if d.found() - number = 1 -else - number = 2 -endif - -assert(number == 2, 'If found handled incorrectly, value should be 2 but is @0@'.format(number)) - -dep = dependency('notfounddep', required : false, disabler : true) -app = executable('myapp', 'notfound.c', dependencies : [dep]) - -cc = meson.get_compiler('c') -dep = cc.find_library('notfounddep', required : false, disabler : true) -app = executable('myapp', 'notfound.c', dependencies : [dep]) - -dep = find_program('donotfindme', required : false, disabler : true) -app = executable('myapp', 'notfound.c', dependencies : [dep]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/165 array option/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/165 array option/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/165 array option/meson.build" 2018-12-09 16:31:26.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/165 array option/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -# Copyright © 2017 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -project('array default options') - -assert(get_option('array') == ['foo', 'bar'], 'Default value for array is not equal to choices') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/165 array option/meson_options.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/165 array option/meson_options.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/165 array option/meson_options.txt" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/165 array option/meson_options.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -# Copyright © 2017 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -option( - 'array', - type : 'array', - choices : ['foo', 'bar'], -) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/165 custom target template substitution/checkcopy.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/165 custom target template substitution/checkcopy.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/165 custom target template substitution/checkcopy.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/165 custom target template substitution/checkcopy.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,9 @@ +#!/usr/bin/env python3 + +import sys +import shutil + +if '@INPUT1@' in sys.argv[1]: + shutil.copyfile(sys.argv[2], sys.argv[3]) +else: + sys.exit('String @INPUT1@ not found in "{}"'.format(sys.argv[1])) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/165 custom target template substitution/foo.c.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/165 custom target template substitution/foo.c.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/165 custom target template substitution/foo.c.in" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/165 custom target template substitution/foo.c.in" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,6 @@ +#include + +int main() { + printf("foo is working.\n"); + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/165 custom target template substitution/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/165 custom target template substitution/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/165 custom target template substitution/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/165 custom target template substitution/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,17 @@ +project('custom target template substitution', 'c') + +check = find_program('checkcopy.py') + +config = configuration_data() + +config_file = configure_file(configuration : config, output : 'x@IN') + +# Check that substitution does not find @FOO@ and then misses @INPUT0@. +# Check the resulting x@INPUT1@ is not replaced. +foo = custom_target('runcheck', + input : [config_file, 'foo.c.in'], + output : 'foo.c', + command : [check, '-D@FOO@INPUT0@PUT1@', '@INPUT1@', '@OUTPUT@'] +) + +executable('foo', foo) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/166 custom target template substitution/checkcopy.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/166 custom target template substitution/checkcopy.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/166 custom target template substitution/checkcopy.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/166 custom target template substitution/checkcopy.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -#!/usr/bin/env python3 - -import sys -import shutil - -if '@INPUT1@' in sys.argv[1]: - shutil.copyfile(sys.argv[2], sys.argv[3]) -else: - sys.exit('String @INPUT1@ not found in "{}"'.format(sys.argv[1])) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/166 custom target template substitution/foo.c.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/166 custom target template substitution/foo.c.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/166 custom target template substitution/foo.c.in" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/166 custom target template substitution/foo.c.in" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#include - -int main() { - printf("foo is working.\n"); - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/166 custom target template substitution/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/166 custom target template substitution/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/166 custom target template substitution/meson.build" 2018-12-09 16:31:27.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/166 custom target template substitution/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -project('custom target template substitution', 'c') - -check = find_program('checkcopy.py') - -config = configuration_data() - -config_file = configure_file(configuration : config, output : 'x@IN') - -# Check that substitution does not find @FOO@ and then misses @INPUT0@. -# Check the resulting x@INPUT1@ is not replaced. -foo = custom_target('runcheck', - input : [config_file, 'foo.c.in'], - output : 'foo.c', - command : [check, '-D@FOO@INPUT0@PUT1@', '@INPUT1@', '@OUTPUT@'] -) - -executable('foo', foo) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/166 not-found dependency/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/166 not-found dependency/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/166 not-found dependency/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/166 not-found dependency/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,14 @@ +project('dep-test', 'c') + +dep = dependency('', required:false) +if dep.found() + error('not-found dependency was found') +endif + +assert(dep.type_name() == 'not-found', 'dependency should be of type "not-found" not ' + dep.type_name()) + +library('testlib', 'testlib.c', dependencies: [dep]) +subdir('sub', if_found: dep) + +subdep = dependency('', fallback: ['trivial', 'trivial_dep']) +missing = dependency('', fallback: ['missing', 'missing_dep'], required: false) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/166 not-found dependency/sub/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/166 not-found dependency/sub/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/166 not-found dependency/sub/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/166 not-found dependency/sub/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +error('should be disabled by subdir(if_found:)') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/166 not-found dependency/subprojects/trivial/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/166 not-found dependency/subprojects/trivial/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/166 not-found dependency/subprojects/trivial/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/166 not-found dependency/subprojects/trivial/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +project('trivial subproject', 'c') +trivial_lib = static_library('trivial', 'trivial.c', install: false) +trivial_dep = declare_dependency(link_with: trivial_lib) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/166 not-found dependency/subprojects/trivial/trivial.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/166 not-found dependency/subprojects/trivial/trivial.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/166 not-found dependency/subprojects/trivial/trivial.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/166 not-found dependency/subprojects/trivial/trivial.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,3 @@ +int subfunc() { + return 42; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/167 not-found dependency/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/167 not-found dependency/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/167 not-found dependency/meson.build" 2018-12-09 16:31:31.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/167 not-found dependency/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -project('dep-test', 'c') - -dep = dependency('', required:false) -if dep.found() - error('not-found dependency was found') -endif - -assert(dep.type_name() == 'not-found', 'dependency should be of type "not-found" not ' + dep.type_name()) - -library('testlib', 'testlib.c', dependencies: [dep]) -subdir('sub', if_found: dep) - -subdep = dependency('', fallback: ['trivial', 'trivial_dep']) -missing = dependency('', fallback: ['missing', 'missing_dep'], required: false) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/167 not-found dependency/sub/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/167 not-found dependency/sub/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/167 not-found dependency/sub/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/167 not-found dependency/sub/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -error('should be disabled by subdir(if_found:)') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/167 not-found dependency/subprojects/trivial/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/167 not-found dependency/subprojects/trivial/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/167 not-found dependency/subprojects/trivial/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/167 not-found dependency/subprojects/trivial/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -project('trivial subproject', 'c') -trivial_lib = static_library('trivial', 'trivial.c', install: false) -trivial_dep = declare_dependency(link_with: trivial_lib) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/167 not-found dependency/subprojects/trivial/trivial.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/167 not-found dependency/subprojects/trivial/trivial.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/167 not-found dependency/subprojects/trivial/trivial.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/167 not-found dependency/subprojects/trivial/trivial.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -int subfunc() { - return 42; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/167 subdir if_found/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/167 subdir if_found/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/167 subdir if_found/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/167 subdir if_found/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,11 @@ +project('subdir if found', 'c') + +found_dep = declare_dependency() +not_found_dep = dependency('nonexisting', required : false) + +subdir('nonexisting_dir', if_found : not_found_dep) + +variable = 3 + +subdir('subdir', if_found : found_dep) +assert(variable == 5, 'Subdir was not properly entered.') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/167 subdir if_found/subdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/167 subdir if_found/subdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/167 subdir if_found/subdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/167 subdir if_found/subdir/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +variable = 5 diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/168 default options prefix dependent defaults/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/168 default options prefix dependent defaults/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/168 default options prefix dependent defaults/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/168 default options prefix dependent defaults/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +project('default options prefix dependent defaults ', 'c', default_options : ['sharedstatedir=/sharedstate', 'prefix=/usr']) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/168 subdir if_found/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/168 subdir if_found/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/168 subdir if_found/meson.build" 2018-12-09 16:31:33.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/168 subdir if_found/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -project('subdir if found', 'c') - -found_dep = declare_dependency() -not_found_dep = dependency('nonexisting', required : false) - -subdir('nonexisting_dir', if_found : not_found_dep) - -variable = 3 - -subdir('subdir', if_found : found_dep) -assert(variable == 5, 'Subdir was not properly entered.') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/168 subdir if_found/subdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/168 subdir if_found/subdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/168 subdir if_found/subdir/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/168 subdir if_found/subdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -variable = 5 diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/169 default options prefix dependent defaults/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/169 default options prefix dependent defaults/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/169 default options prefix dependent defaults/meson.build" 2018-12-09 16:31:33.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/169 default options prefix dependent defaults/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -project('default options prefix dependent defaults ', 'c', default_options : ['sharedstatedir=/sharedstate', 'prefix=/usr']) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/169 dependency factory/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/169 dependency factory/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/169 dependency factory/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/169 dependency factory/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,51 @@ +project('dependency factory', 'c', meson_version : '>=0.40') + +dep = dependency('gl', method: 'pkg-config', required: false) +if dep.found() and dep.type_name() == 'pkgconfig' + dep.get_pkgconfig_variable('prefix') +endif + +dep = dependency('SDL2', method: 'pkg-config', required: false) +if dep.found() and dep.type_name() == 'pkgconfig' + dep.get_pkgconfig_variable('prefix') +endif + +dep = dependency('SDL2', method: 'config-tool', required: false) +if dep.found() and dep.type_name() == 'configtool' + dep.get_configtool_variable('prefix') +endif + +dep = dependency('Vulkan', method: 'pkg-config', required: false) +if dep.found() and dep.type_name() == 'pkgconfig' + dep.get_pkgconfig_variable('prefix') +endif + +dep = dependency('pcap', method: 'pkg-config', required: false) +if dep.found() and dep.type_name() == 'pkgconfig' + dep.get_pkgconfig_variable('prefix') +endif + +dep = dependency('pcap', method: 'config-tool', required: false) +if dep.found() and dep.type_name() == 'configtool' + dep.get_configtool_variable('prefix') +endif + +dep = dependency('cups', method: 'pkg-config', required: false) +if dep.found() and dep.type_name() == 'pkgconfig' + dep.get_pkgconfig_variable('prefix') +endif + +dep = dependency('cups', method: 'config-tool', required: false) +if dep.found() and dep.type_name() == 'configtool' + dep.get_configtool_variable('prefix') +endif + +dep = dependency('libwmf', method: 'pkg-config', required: false) +if dep.found() and dep.type_name() == 'pkgconfig' + dep.get_pkgconfig_variable('prefix') +endif + +dep = dependency('libwmf', method: 'config-tool', required: false) +if dep.found() and dep.type_name() == 'configtool' + dep.get_configtool_variable('prefix') +endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/170 dependency factory/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/170 dependency factory/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/170 dependency factory/meson.build" 2018-12-09 16:31:34.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/170 dependency factory/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ -project('dependency factory', meson_version : '>=0.40') - -dep = dependency('gl', method: 'pkg-config', required: false) -if dep.found() and dep.type_name() == 'pkgconfig' - dep.get_pkgconfig_variable('prefix') -endif - -dep = dependency('SDL2', method: 'pkg-config', required: false) -if dep.found() and dep.type_name() == 'pkgconfig' - dep.get_pkgconfig_variable('prefix') -endif - -dep = dependency('SDL2', method: 'config-tool', required: false) -if dep.found() and dep.type_name() == 'configtool' - dep.get_configtool_variable('prefix') -endif - -dep = dependency('Vulkan', method: 'pkg-config', required: false) -if dep.found() and dep.type_name() == 'pkgconfig' - dep.get_pkgconfig_variable('prefix') -endif - -dep = dependency('pcap', method: 'pkg-config', required: false) -if dep.found() and dep.type_name() == 'pkgconfig' - dep.get_pkgconfig_variable('prefix') -endif - -dep = dependency('pcap', method: 'config-tool', required: false) -if dep.found() and dep.type_name() == 'configtool' - dep.get_configtool_variable('prefix') -endif - -dep = dependency('cups', method: 'pkg-config', required: false) -if dep.found() and dep.type_name() == 'pkgconfig' - dep.get_pkgconfig_variable('prefix') -endif - -dep = dependency('cups', method: 'config-tool', required: false) -if dep.found() and dep.type_name() == 'configtool' - dep.get_configtool_variable('prefix') -endif - -dep = dependency('libwmf', method: 'pkg-config', required: false) -if dep.found() and dep.type_name() == 'pkgconfig' - dep.get_pkgconfig_variable('prefix') -endif - -dep = dependency('libwmf', method: 'config-tool', required: false) -if dep.found() and dep.type_name() == 'configtool' - dep.get_configtool_variable('prefix') -endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/170 get project license/bar.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/170 get project license/bar.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/170 get project license/bar.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/170 get project license/bar.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,6 @@ +#include + +int main(int argc, char **argv) { + printf("I'm a main project bar.\n"); + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/170 get project license/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/170 get project license/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/170 get project license/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/170 get project license/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,8 @@ +project('bar', 'c', license: 'Apache') + +executable('bar', 'bar.c') + +license = meson.project_license()[0] +if license != 'Apache' + error('The license should be Apache, but it is: ' + license) +endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/171 get project license/bar.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/171 get project license/bar.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/171 get project license/bar.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/171 get project license/bar.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#include - -int main(int argc, char **argv) { - printf("I'm a main project bar.\n"); - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/171 get project license/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/171 get project license/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/171 get project license/meson.build" 2018-12-09 16:31:36.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/171 get project license/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -project('bar', 'c', license: 'Apache') - -executable('bar', 'bar.c') - -license = meson.project_license()[0] -if license != 'Apache' - error('The license should be Apache, but it is: ' + license) -endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/171 yield/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/171 yield/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/171 yield/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/171 yield/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,7 @@ +project('yield_options', 'c') + +subproject('sub') + +assert(get_option('unshared_option') == 'one', 'Unshared option has wrong value in superproject.') +assert(get_option('shared_option') == 'two', 'Shared option has wrong value in superproject..') +assert(get_option('wrongtype_option') == 'three', 'Wrongtype option has wrong value in superproject..') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/171 yield/meson_options.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/171 yield/meson_options.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/171 yield/meson_options.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/171 yield/meson_options.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +option('unshared_option', type : 'string', value : 'one') +option('shared_option', type : 'string', value : 'two') +option('wrongtype_option', type : 'string', value : 'three') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/171 yield/subprojects/sub/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/171 yield/subprojects/sub/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/171 yield/subprojects/sub/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/171 yield/subprojects/sub/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +project('subbie', 'c') + +assert(get_option('unshared_option') == 'three', 'Unshared option has wrong value in subproject.') +assert(get_option('shared_option') == 'two', 'Shared option has wrong value in subproject.') +assert(get_option('wrongtype_option') == true, 'Wrongtype option has wrong value in subproject.') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/171 yield/subprojects/sub/meson_options.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/171 yield/subprojects/sub/meson_options.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/171 yield/subprojects/sub/meson_options.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/171 yield/subprojects/sub/meson_options.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +option('unshared_option', type : 'string', value : 'three', yield : false) +option('shared_option', type : 'string', value : 'four', yield : true) +option('wrongtype_option', type : 'boolean', value : true, yield : true) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/172 subproject nested subproject dirs/contrib/subprojects/alpha/a.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/172 subproject nested subproject dirs/contrib/subprojects/alpha/a.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/172 subproject nested subproject dirs/contrib/subprojects/alpha/a.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/172 subproject nested subproject dirs/contrib/subprojects/alpha/a.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,15 @@ +int func2(); + +#if defined _WIN32 || defined __CYGWIN__ + #define DLL_PUBLIC __declspec(dllexport) +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif + +int DLL_PUBLIC func() { return func2(); } + diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/172 subproject nested subproject dirs/contrib/subprojects/alpha/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/172 subproject nested subproject dirs/contrib/subprojects/alpha/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/172 subproject nested subproject dirs/contrib/subprojects/alpha/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/172 subproject nested subproject dirs/contrib/subprojects/alpha/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,4 @@ +project('alpha project', 'c', subproject_dir: 'var/subprojects') + +b = subproject('beta') +l = shared_library('a', 'a.c', link_with : b.get_variable('lb')) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/172 subproject nested subproject dirs/contrib/subprojects/alpha/var/subprojects/wrap_files_might_be_here" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/172 subproject nested subproject dirs/contrib/subprojects/alpha/var/subprojects/wrap_files_might_be_here" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/172 subproject nested subproject dirs/contrib/subprojects/alpha/var/subprojects/wrap_files_might_be_here" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/172 subproject nested subproject dirs/contrib/subprojects/alpha/var/subprojects/wrap_files_might_be_here" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ + diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/172 subproject nested subproject dirs/contrib/subprojects/beta/b.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/172 subproject nested subproject dirs/contrib/subprojects/beta/b.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/172 subproject nested subproject dirs/contrib/subprojects/beta/b.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/172 subproject nested subproject dirs/contrib/subprojects/beta/b.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,14 @@ +#if defined _WIN32 || defined __CYGWIN__ + #define DLL_PUBLIC __declspec(dllexport) +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif + +int DLL_PUBLIC func2() { + return 42; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/172 subproject nested subproject dirs/contrib/subprojects/beta/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/172 subproject nested subproject dirs/contrib/subprojects/beta/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/172 subproject nested subproject dirs/contrib/subprojects/beta/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/172 subproject nested subproject dirs/contrib/subprojects/beta/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,4 @@ +project('beta project', 'c') + +lb = shared_library('b', 'b.c') +notfound = dependency('', required : false) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/172 subproject nested subproject dirs/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/172 subproject nested subproject dirs/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/172 subproject nested subproject dirs/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/172 subproject nested subproject dirs/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,11 @@ +project('gamma project', 'c', subproject_dir: 'contrib/subprojects') + +a = subproject('alpha') +lib = a.get_variable('l') + +# Ensure that the dependency version is not checked for a not-found dependency +notfound = dependency('', version : '>=1.0', required : false, + fallback : ['beta', 'notfound']) + +exe = executable('prog', 'prog.c', link_with : lib) +test('basic', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/172 subproject nested subproject dirs/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/172 subproject nested subproject dirs/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/172 subproject nested subproject dirs/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/172 subproject nested subproject dirs/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +int func(); + +int main(int argc, char **argv) { + return func() == 42 ? 0 : 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/172 yield/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/172 yield/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/172 yield/meson.build" 2018-12-09 16:31:37.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/172 yield/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -project('yield_options', 'c') - -subproject('sub') - -assert(get_option('unshared_option') == 'one', 'Unshared option has wrong value in superproject.') -assert(get_option('shared_option') == 'two', 'Shared option has wrong value in superproject..') -assert(get_option('wrongtype_option') == 'three', 'Wrongtype option has wrong value in superproject..') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/172 yield/meson_options.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/172 yield/meson_options.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/172 yield/meson_options.txt" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/172 yield/meson_options.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -option('unshared_option', type : 'string', value : 'one') -option('shared_option', type : 'string', value : 'two') -option('wrongtype_option', type : 'string', value : 'three') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/172 yield/subprojects/sub/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/172 yield/subprojects/sub/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/172 yield/subprojects/sub/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/172 yield/subprojects/sub/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -project('subbie', 'c') - -assert(get_option('unshared_option') == 'three', 'Unshared option has wrong value in subproject.') -assert(get_option('shared_option') == 'two', 'Shared option has wrong value in subproject.') -assert(get_option('wrongtype_option') == true, 'Wrongtype option has wrong value in subproject.') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/172 yield/subprojects/sub/meson_options.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/172 yield/subprojects/sub/meson_options.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/172 yield/subprojects/sub/meson_options.txt" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/172 yield/subprojects/sub/meson_options.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -option('unshared_option', type : 'string', value : 'three', yield : false) -option('shared_option', type : 'string', value : 'four', yield : true) -option('wrongtype_option', type : 'boolean', value : true, yield : true) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/173 preserve gendir/base.inp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/173 preserve gendir/base.inp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/173 preserve gendir/base.inp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/173 preserve gendir/base.inp" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +base diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/173 preserve gendir/com/mesonbuild/subbie.inp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/173 preserve gendir/com/mesonbuild/subbie.inp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/173 preserve gendir/com/mesonbuild/subbie.inp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/173 preserve gendir/com/mesonbuild/subbie.inp" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +subbie diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/173 preserve gendir/genprog.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/173 preserve gendir/genprog.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/173 preserve gendir/genprog.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/173 preserve gendir/genprog.py" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,46 @@ +#!/usr/bin/env python3 + +import os, sys, argparse + +h_templ = '''#pragma once + +int %s(); +''' + +c_templ = '''#include"%s.h" + +int %s() { + return 0; +} +''' + +parser = argparse.ArgumentParser() +parser.add_argument('--searchdir', required=True) +parser.add_argument('--outdir', required=True) +parser.add_argument('ifiles', nargs='+') + +options = parser.parse_args() + +searchdir = options.searchdir +outdir = options.outdir +ifiles = options.ifiles + +rel_ofiles = [] + +for ifile in ifiles: + if not ifile.startswith(options.searchdir): + sys.exit('Input file %s does not start with search dir %s.' % (ifile, searchdir)) + rel_ofile = ifile[len(searchdir):] + if rel_ofile[0] == '/' or rel_ofile[0] == '\\': + rel_ofile = rel_ofile[1:] + rel_ofiles.append(os.path.splitext(rel_ofile)[0]) + +ofile_bases = [os.path.join(outdir, i) for i in rel_ofiles] + +for i, ifile_name in enumerate(ifiles): + proto_name = open(ifile_name).readline().strip() + h_out = ofile_bases[i] + '.h' + c_out = ofile_bases[i] + '.c' + os.makedirs(os.path.split(ofile_bases[i])[0], exist_ok=True) + open(h_out, 'w').write(h_templ % (proto_name)) + open(c_out, 'w').write(c_templ % (proto_name, proto_name)) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/173 preserve gendir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/173 preserve gendir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/173 preserve gendir/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/173 preserve gendir/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,13 @@ +project('preserve subdir', 'c') + +gprog = find_program('genprog.py') + +gen = generator(gprog, \ + output : ['@BASENAME@.c', '@BASENAME@.h'], + arguments : ['--searchdir=@CURRENT_SOURCE_DIR@', '--outdir=@BUILD_DIR@', '@INPUT@']) + +generated = gen.process('base.inp', 'com/mesonbuild/subbie.inp', + preserve_path_from : meson.current_source_dir()) + +e = executable('testprog', 'testprog.c', generated) +test('testprog', e) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/173 preserve gendir/testprog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/173 preserve gendir/testprog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/173 preserve gendir/testprog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/173 preserve gendir/testprog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,6 @@ +#include"base.h" +#include"com/mesonbuild/subbie.h" + +int main(int argc, char **argv) { + return base() + subbie(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/173 subproject nested subproject dirs/contrib/subprojects/alpha/a.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/173 subproject nested subproject dirs/contrib/subprojects/alpha/a.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/173 subproject nested subproject dirs/contrib/subprojects/alpha/a.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/173 subproject nested subproject dirs/contrib/subprojects/alpha/a.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -int func2(); - -#if defined _WIN32 || defined __CYGWIN__ - #define DLL_PUBLIC __declspec(dllexport) -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif - -int DLL_PUBLIC func() { return func2(); } - diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/173 subproject nested subproject dirs/contrib/subprojects/alpha/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/173 subproject nested subproject dirs/contrib/subprojects/alpha/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/173 subproject nested subproject dirs/contrib/subprojects/alpha/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/173 subproject nested subproject dirs/contrib/subprojects/alpha/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -project('alpha project', 'c', subproject_dir: 'var/subprojects') - -b = subproject('beta') -l = shared_library('a', 'a.c', link_with : b.get_variable('lb')) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/173 subproject nested subproject dirs/contrib/subprojects/alpha/var/subprojects/wrap_files_might_be_here" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/173 subproject nested subproject dirs/contrib/subprojects/alpha/var/subprojects/wrap_files_might_be_here" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/173 subproject nested subproject dirs/contrib/subprojects/alpha/var/subprojects/wrap_files_might_be_here" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/173 subproject nested subproject dirs/contrib/subprojects/alpha/var/subprojects/wrap_files_might_be_here" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ - diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/173 subproject nested subproject dirs/contrib/subprojects/beta/b.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/173 subproject nested subproject dirs/contrib/subprojects/beta/b.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/173 subproject nested subproject dirs/contrib/subprojects/beta/b.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/173 subproject nested subproject dirs/contrib/subprojects/beta/b.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -#if defined _WIN32 || defined __CYGWIN__ - #define DLL_PUBLIC __declspec(dllexport) -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif - -int DLL_PUBLIC func2() { - return 42; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/173 subproject nested subproject dirs/contrib/subprojects/beta/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/173 subproject nested subproject dirs/contrib/subprojects/beta/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/173 subproject nested subproject dirs/contrib/subprojects/beta/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/173 subproject nested subproject dirs/contrib/subprojects/beta/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -project('beta project', 'c') - -lb = shared_library('b', 'b.c') -notfound = dependency('', required : false) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/173 subproject nested subproject dirs/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/173 subproject nested subproject dirs/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/173 subproject nested subproject dirs/meson.build" 2018-12-09 16:31:39.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/173 subproject nested subproject dirs/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -project('gamma project', 'c', subproject_dir: 'contrib/subprojects') - -a = subproject('alpha') -lib = a.get_variable('l') - -# Ensure that the dependency version is not checked for a not-found dependency -notfound = dependency('', version : '>=1.0', required : false, - fallback : ['beta', 'notfound']) - -exe = executable('prog', 'prog.c', link_with : lib) -test('basic', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/173 subproject nested subproject dirs/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/173 subproject nested subproject dirs/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/173 subproject nested subproject dirs/prog.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/173 subproject nested subproject dirs/prog.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -int func(); - -int main(int argc, char **argv) { - return func() == 42 ? 0 : 1; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/174 preserve gendir/base.inp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/174 preserve gendir/base.inp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/174 preserve gendir/base.inp" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/174 preserve gendir/base.inp" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -base diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/174 preserve gendir/com/mesonbuild/subbie.inp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/174 preserve gendir/com/mesonbuild/subbie.inp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/174 preserve gendir/com/mesonbuild/subbie.inp" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/174 preserve gendir/com/mesonbuild/subbie.inp" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -subbie diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/174 preserve gendir/genprog.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/174 preserve gendir/genprog.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/174 preserve gendir/genprog.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/174 preserve gendir/genprog.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -#!/usr/bin/env python3 - -import os, sys, argparse - -h_templ = '''#pragma once - -int %s(); -''' - -c_templ = '''#include"%s.h" - -int %s() { - return 0; -} -''' - -parser = argparse.ArgumentParser() -parser.add_argument('--searchdir', required=True) -parser.add_argument('--outdir', required=True) -parser.add_argument('ifiles', nargs='+') - -options = parser.parse_args() - -searchdir = options.searchdir -outdir = options.outdir -ifiles = options.ifiles - -rel_ofiles = [] - -for ifile in ifiles: - if not ifile.startswith(options.searchdir): - sys.exit('Input file %s does not start with search dir %s.' % (ifile, searchdir)) - rel_ofile = ifile[len(searchdir):] - if rel_ofile[0] == '/' or rel_ofile[0] == '\\': - rel_ofile = rel_ofile[1:] - rel_ofiles.append(os.path.splitext(rel_ofile)[0]) - -ofile_bases = [os.path.join(outdir, i) for i in rel_ofiles] - -for i, ifile_name in enumerate(ifiles): - proto_name = open(ifile_name).readline().strip() - h_out = ofile_bases[i] + '.h' - c_out = ofile_bases[i] + '.c' - os.makedirs(os.path.split(ofile_bases[i])[0], exist_ok=True) - open(h_out, 'w').write(h_templ % (proto_name)) - open(c_out, 'w').write(c_templ % (proto_name, proto_name)) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/174 preserve gendir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/174 preserve gendir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/174 preserve gendir/meson.build" 2018-12-09 16:31:39.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/174 preserve gendir/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -project('preserve subdir', 'c') - -gprog = find_program('genprog.py') - -gen = generator(gprog, \ - output : ['@BASENAME@.c', '@BASENAME@.h'], - arguments : ['--searchdir=@CURRENT_SOURCE_DIR@', '--outdir=@BUILD_DIR@', '@INPUT@']) - -generated = gen.process('base.inp', 'com/mesonbuild/subbie.inp', - preserve_path_from : meson.current_source_dir()) - -e = executable('testprog', 'testprog.c', generated) -test('testprog', e) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/174 preserve gendir/testprog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/174 preserve gendir/testprog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/174 preserve gendir/testprog.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/174 preserve gendir/testprog.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#include"base.h" -#include"com/mesonbuild/subbie.h" - -int main(int argc, char **argv) { - return base() + subbie(); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/174 source in dep/bar.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/174 source in dep/bar.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/174 source in dep/bar.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/174 source in dep/bar.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +extern "C" int foo(); + +int main(int, char**) { + return foo() != 42; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/174 source in dep/foo.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/174 source in dep/foo.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/174 source in dep/foo.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/174 source in dep/foo.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,3 @@ +int foo() { + return 42; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/174 source in dep/generated/funname" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/174 source in dep/generated/funname" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/174 source in dep/generated/funname" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/174 source in dep/generated/funname" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +my_wonderful_function diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/174 source in dep/generated/genheader.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/174 source in dep/generated/genheader.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/174 source in dep/generated/genheader.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/174 source in dep/generated/genheader.py" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,17 @@ +#!/usr/bin/env python3 + +import sys + +ifile = sys.argv[1] +ofile = sys.argv[2] + +templ = '''#pragma once + +int %s() { + return 42; +} +''' + +funname = open(ifile).readline().strip() + +open(ofile, 'w').write(templ % funname) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/174 source in dep/generated/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/174 source in dep/generated/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/174 source in dep/generated/main.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/174 source in dep/generated/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +#include"funheader.h" + +int main(int argc, char **argv) { + return my_wonderful_function() != 42; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/174 source in dep/generated/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/174 source in dep/generated/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/174 source in dep/generated/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/174 source in dep/generated/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,12 @@ +fp = find_program('genheader.py') + +genh = custom_target('genh', + input : 'funname', + output : 'funheader.h', + command : [fp, '@INPUT@', '@OUTPUT@']) + +dep = declare_dependency(sources : [genh]) + +e = executable('genuser', 'main.c', + dependencies : dep) +test('genuser', e) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/174 source in dep/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/174 source in dep/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/174 source in dep/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/174 source in dep/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,8 @@ +project('foo', 'c', 'cpp') + +dep = declare_dependency(sources : 'foo.c') + +executable('bar', 'bar.cpp', + dependencies : dep) + +subdir('generated') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/175 generator link whole/export.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/175 generator link whole/export.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/175 generator link whole/export.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/175 generator link whole/export.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,18 @@ +#pragma once + +#if defined BUILDING_EMBEDDED + #define DLL_PUBLIC +#elif defined _WIN32 || defined __CYGWIN__ + #if defined BUILDING_DLL + #define DLL_PUBLIC __declspec(dllexport) + #else + #define DLL_PUBLIC __declspec(dllimport) + #endif +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/175 generator link whole/generator.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/175 generator link whole/generator.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/175 generator link whole/generator.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/175 generator link whole/generator.py" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,30 @@ +#!/usr/bin/env python3 + +import os +import os.path +import sys + + +def main(): + name = os.path.splitext(os.path.basename(sys.argv[1]))[0] + out = sys.argv[2] + hname = os.path.join(out, name + '.h') + cname = os.path.join(out, name + '.c') + print(os.getcwd(), hname) + with open(hname, 'w') as hfile: + hfile.write(''' +#pragma once +#include "export.h" +int DLL_PUBLIC {name}(); +'''.format(name=name)) + with open(cname, 'w') as cfile: + cfile.write(''' +#include "{name}.h" +int {name}() {{ + return {size}; +}} +'''.format(name=name, size=len(name))) + + +if __name__ == '__main__': + main() diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/175 generator link whole/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/175 generator link whole/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/175 generator link whole/main.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/175 generator link whole/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,11 @@ +#include "meson_test_function.h" + +#include + +int main() { + if (meson_test_function() != 19) { + printf("Bad meson_test_function()\n"); + return 1; + } + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/175 generator link whole/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/175 generator link whole/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/175 generator link whole/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/175 generator link whole/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,65 @@ +project('generator link_whole', 'c') + +cc = meson.get_compiler('c') +if cc.get_id() == 'msvc' + if cc.version().version_compare('<19') + error('MESON_SKIP_TEST link_whole only works on VS2015 or newer.') + endif +endif + +# This just generates foo.h and foo.c with int foo() defined. +gen_py = find_program('generator.py') +gen = generator(gen_py, + output: ['@BASENAME@.h', '@BASENAME@.c'], + arguments : ['@INPUT@', '@BUILD_DIR@']) + +# Test 1: link directly into executable +srcs = gen.process('meson_test_function.tmpl') +exe = executable('exe1', [srcs, 'main.c'], c_args : '-DBUILDING_EMBEDDED') +test('test1', exe) + +# Test 2: link into shared library and access from executable +srcs = gen.process('meson_test_function.tmpl') +shlib2 = shared_library('shlib2', [srcs], c_args : '-DBUILDING_DLL') +exe = executable('exe2', 'main.c', + link_with : shlib2, + include_directories : shlib2.private_dir_include(), +) +test('test2', exe) + +# Test 3: link into static library and access from executable +srcs = gen.process('meson_test_function.tmpl') +stlib3 = static_library('stlib3', [srcs], c_args : '-DBUILDING_EMBEDDED') +exe = executable('exe3', 'main.c', + c_args : '-DBUILDING_EMBEDDED', + link_with : stlib3, + include_directories : stlib3.private_dir_include(), +) +test('test3', exe) + +# Test 4: link into static library, link into shared +# and access from executable. To make sure static_library +# is not dropped use pull_meson_test_function helper. +srcs = gen.process('meson_test_function.tmpl') +stlib4 = static_library('stlib4', [srcs], c_args : '-DBUILDING_DLL') +shlib4 = shared_library('shlib4', 'pull_meson_test_function.c', + c_args : '-DBUILDING_DLL', + link_with : stlib4, + include_directories : stlib4.private_dir_include(), +) +exe = executable('exe4', 'main.c', + link_with : shlib4, + include_directories : stlib4.private_dir_include(), +) +test('test4', exe) + +# Test 5: link into static library, link_whole into shared +# and access from executable +srcs = gen.process('meson_test_function.tmpl') +stlib5 = static_library('stlib5', [srcs], c_args : '-DBUILDING_DLL') +shlib5 = shared_library('shlib5', link_whole : stlib5) +exe = executable('exe5', 'main.c', + link_with : shlib5, + include_directories : stlib5.private_dir_include(), +) +test('test5', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/175 generator link whole/pull_meson_test_function.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/175 generator link whole/pull_meson_test_function.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/175 generator link whole/pull_meson_test_function.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/175 generator link whole/pull_meson_test_function.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,6 @@ +#include "export.h" +#include "meson_test_function.h" + +int DLL_PUBLIC function_puller() { + return meson_test_function(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/175 source in dep/bar.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/175 source in dep/bar.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/175 source in dep/bar.cpp" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/175 source in dep/bar.cpp" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -extern "C" int foo(); - -int main(int, char**) { - return foo() != 42; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/175 source in dep/foo.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/175 source in dep/foo.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/175 source in dep/foo.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/175 source in dep/foo.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -int foo() { - return 42; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/175 source in dep/generated/funname" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/175 source in dep/generated/funname" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/175 source in dep/generated/funname" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/175 source in dep/generated/funname" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -my_wonderful_function diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/175 source in dep/generated/genheader.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/175 source in dep/generated/genheader.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/175 source in dep/generated/genheader.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/175 source in dep/generated/genheader.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -#!/usr/bin/env python3 - -import sys - -ifile = sys.argv[1] -ofile = sys.argv[2] - -templ = '''#pragma once - -int %s() { - return 42; -} -''' - -funname = open(ifile).readline().strip() - -open(ofile, 'w').write(templ % funname) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/175 source in dep/generated/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/175 source in dep/generated/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/175 source in dep/generated/main.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/175 source in dep/generated/main.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#include"funheader.h" - -int main(int argc, char **argv) { - return my_wonderful_function() != 42; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/175 source in dep/generated/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/175 source in dep/generated/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/175 source in dep/generated/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/175 source in dep/generated/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -fp = find_program('genheader.py') - -genh = custom_target('genh', - input : 'funname', - output : 'funheader.h', - command : [fp, '@INPUT@', '@OUTPUT@']) - -dep = declare_dependency(sources : [genh]) - -e = executable('genuser', 'main.c', - dependencies : dep) -test('genuser', e) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/175 source in dep/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/175 source in dep/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/175 source in dep/meson.build" 2018-12-09 16:31:42.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/175 source in dep/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -project('foo', 'c', 'cpp') - -dep = declare_dependency(sources : 'foo.c') - -executable('bar', 'bar.cpp', - dependencies : dep) - -subdir('generated') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/176 generator link whole/export.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/176 generator link whole/export.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/176 generator link whole/export.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/176 generator link whole/export.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -#pragma once - -#if defined BUILDING_EMBEDDED - #define DLL_PUBLIC -#elif defined _WIN32 || defined __CYGWIN__ - #if defined BUILDING_DLL - #define DLL_PUBLIC __declspec(dllexport) - #else - #define DLL_PUBLIC __declspec(dllimport) - #endif -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/176 generator link whole/generator.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/176 generator link whole/generator.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/176 generator link whole/generator.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/176 generator link whole/generator.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -#!/usr/bin/env python3 - -import os -import os.path -import sys - - -def main(): - name = os.path.splitext(os.path.basename(sys.argv[1]))[0] - out = sys.argv[2] - hname = os.path.join(out, name + '.h') - cname = os.path.join(out, name + '.c') - print(os.getcwd(), hname) - with open(hname, 'w') as hfile: - hfile.write(''' -#pragma once -#include "export.h" -int DLL_PUBLIC {name}(); -'''.format(name=name)) - with open(cname, 'w') as cfile: - cfile.write(''' -#include "{name}.h" -int {name}() {{ - return {size}; -}} -'''.format(name=name, size=len(name))) - - -if __name__ == '__main__': - main() diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/176 generator link whole/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/176 generator link whole/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/176 generator link whole/main.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/176 generator link whole/main.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -#include "meson_test_function.h" - -#include - -int main() { - if (meson_test_function() != 19) { - printf("Bad meson_test_function()\n"); - return 1; - } - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/176 generator link whole/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/176 generator link whole/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/176 generator link whole/meson.build" 2018-12-09 16:31:45.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/176 generator link whole/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,65 +0,0 @@ -project('generator link_whole', 'c') - -cc = meson.get_compiler('c') -if cc.get_id() == 'msvc' - if cc.version().version_compare('<19') - error('MESON_SKIP_TEST link_whole only works on VS2015 or newer.') - endif -endif - -# This just generates foo.h and foo.c with int foo() defined. -gen_py = find_program('generator.py') -gen = generator(gen_py, - output: ['@BASENAME@.h', '@BASENAME@.c'], - arguments : ['@INPUT@', '@BUILD_DIR@']) - -# Test 1: link directly into executable -srcs = gen.process('meson_test_function.tmpl') -exe = executable('exe1', [srcs, 'main.c'], c_args : '-DBUILDING_EMBEDDED') -test('test1', exe) - -# Test 2: link into shared library and access from executable -srcs = gen.process('meson_test_function.tmpl') -shlib2 = shared_library('shlib2', [srcs], c_args : '-DBUILDING_DLL') -exe = executable('exe2', 'main.c', - link_with : shlib2, - include_directories : shlib2.private_dir_include(), -) -test('test2', exe) - -# Test 3: link into static library and access from executable -srcs = gen.process('meson_test_function.tmpl') -stlib3 = static_library('stlib3', [srcs], c_args : '-DBUILDING_EMBEDDED') -exe = executable('exe3', 'main.c', - c_args : '-DBUILDING_EMBEDDED', - link_with : stlib3, - include_directories : stlib3.private_dir_include(), -) -test('test3', exe) - -# Test 4: link into static library, link into shared -# and access from executable. To make sure static_library -# is not dropped use pull_meson_test_function helper. -srcs = gen.process('meson_test_function.tmpl') -stlib4 = static_library('stlib4', [srcs], c_args : '-DBUILDING_DLL') -shlib4 = shared_library('shlib4', 'pull_meson_test_function.c', - c_args : '-DBUILDING_DLL', - link_with : stlib4, - include_directories : stlib4.private_dir_include(), -) -exe = executable('exe4', 'main.c', - link_with : shlib4, - include_directories : stlib4.private_dir_include(), -) -test('test4', exe) - -# Test 5: link into static library, link_whole into shared -# and access from executable -srcs = gen.process('meson_test_function.tmpl') -stlib5 = static_library('stlib5', [srcs], c_args : '-DBUILDING_DLL') -shlib5 = shared_library('shlib5', link_whole : stlib5) -exe = executable('exe5', 'main.c', - link_with : shlib5, - include_directories : stlib5.private_dir_include(), -) -test('test5', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/176 generator link whole/pull_meson_test_function.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/176 generator link whole/pull_meson_test_function.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/176 generator link whole/pull_meson_test_function.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/176 generator link whole/pull_meson_test_function.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#include "export.h" -#include "meson_test_function.h" - -int DLL_PUBLIC function_puller() { - return meson_test_function(); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/176 initial c_args/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/176 initial c_args/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/176 initial c_args/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/176 initial c_args/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,7 @@ +project('options', 'c') + +# Test passing c_args and c_link_args options from the command line. +assert(get_option('c_args') == ['-funroll-loops'], + 'Incorrect value for c_args option.') +assert(get_option('c_link_args') == ['-Dtest_harmless_but_useless_link_arg'], + 'Incorrect value for c_link_args option.') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/176 initial c_args/test_args.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/176 initial c_args/test_args.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/176 initial c_args/test_args.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/176 initial c_args/test_args.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,4 @@ +# This file is not read by meson itself, but by the test framework. +# It is not possible to pass arguments to meson from a file. +['-Dc_args=-march=native', '-Dc_args=-funroll-loops', + '-Dc_link_args=-Dtest_harmless_but_useless_link_arg'] diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/177 identical target name in subproject flat layout/foo.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/177 identical target name in subproject flat layout/foo.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/177 identical target name in subproject flat layout/foo.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/177 identical target name in subproject flat layout/foo.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +int meson_test_main_foo(void) { return 10; } diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/177 identical target name in subproject flat layout/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/177 identical target name in subproject flat layout/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/177 identical target name in subproject flat layout/main.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/177 identical target name in subproject flat layout/main.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,16 @@ +#include + +int meson_test_main_foo(void); +int meson_test_subproj_foo(void); + +int main(void) { + if (meson_test_main_foo() != 10) { + printf("Failed meson_test_main_foo\n"); + return 1; + } + if (meson_test_subproj_foo() != 20) { + printf("Failed meson_test_subproj_foo\n"); + return 1; + } + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/177 identical target name in subproject flat layout/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/177 identical target name in subproject flat layout/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/177 identical target name in subproject flat layout/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/177 identical target name in subproject flat layout/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,11 @@ +project('subproject targets', 'c') + +# Idea behind this test is to create targets with identical name +# but different output files. We can do this by choosing different +# name_prefix of libraries. Target id does not depend on name_prefix. + +main_foo = static_library('foo', 'foo.c', name_prefix : 'main') +subproj_foo = subproject('subproj').get_variable('foo') + +exe = executable('prog', 'main.c', link_with : [main_foo, subproj_foo]) +test('main test', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/177 identical target name in subproject flat layout/subprojects/subproj/foo.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/177 identical target name in subproject flat layout/subprojects/subproj/foo.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/177 identical target name in subproject flat layout/subprojects/subproj/foo.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/177 identical target name in subproject flat layout/subprojects/subproj/foo.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +int meson_test_subproj_foo(void) { return 20; } diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/177 identical target name in subproject flat layout/subprojects/subproj/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/177 identical target name in subproject flat layout/subprojects/subproj/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/177 identical target name in subproject flat layout/subprojects/subproj/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/177 identical target name in subproject flat layout/subprojects/subproj/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +project('subproj', 'c') + +foo = static_library('foo', 'foo.c', name_prefix : 'subproj') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/177 initial c_args/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/177 initial c_args/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/177 initial c_args/meson.build" 2018-12-09 16:31:45.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/177 initial c_args/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -project('options', 'c') - -# Test passing c_args and c_link_args options from the command line. -assert(get_option('c_args') == ['-funroll-loops'], - 'Incorrect value for c_args option.') -assert(get_option('c_link_args') == ['-random_linker_option'], - 'Incorrect value for c_link_args option.') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/177 initial c_args/test_args.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/177 initial c_args/test_args.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/177 initial c_args/test_args.txt" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/177 initial c_args/test_args.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -# This file is not read by meson itself, but by the test framework. -# It is not possible to pass arguments to meson from a file. -['-Dc_args=-march=native', '-Dc_args=-funroll-loops', - '-Dc_link_args=-random_linker_option'] diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/178 as-needed/config.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/178 as-needed/config.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/178 as-needed/config.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/178 as-needed/config.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,14 @@ +#if defined _WIN32 || defined __CYGWIN__ + #if defined BUILDING_DLL + #define DLL_PUBLIC __declspec(dllexport) + #else + #define DLL_PUBLIC __declspec(dllimport) + #endif +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/178 as-needed/libA.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/178 as-needed/libA.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/178 as-needed/libA.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/178 as-needed/libA.cpp" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,7 @@ +#define BUILDING_DLL + +#include "libA.h" + +namespace meson_test_as_needed { + DLL_PUBLIC bool linked = false; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/178 as-needed/libA.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/178 as-needed/libA.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/178 as-needed/libA.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/178 as-needed/libA.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +#include "config.h" + +namespace meson_test_as_needed { + DLL_PUBLIC extern bool linked; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/178 as-needed/libB.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/178 as-needed/libB.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/178 as-needed/libB.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/178 as-needed/libB.cpp" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,19 @@ +#include "libA.h" + +#undef DLL_PUBLIC +#define BUILDING_DLL +#include "config.h" + +namespace meson_test_as_needed { + namespace { + bool set_linked() { + linked = true; + return true; + } + bool stub = set_linked(); + } + + DLL_PUBLIC int libB_unused_func() { + return 0; + } +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/178 as-needed/main.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/178 as-needed/main.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/178 as-needed/main.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/178 as-needed/main.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,7 @@ +#include + +#include "libA.h" + +int main() { + return !meson_test_as_needed::linked ? EXIT_SUCCESS : EXIT_FAILURE; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/178 as-needed/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/178 as-needed/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/178 as-needed/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/178 as-needed/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,13 @@ +project('as-needed test', 'cpp') + +# Idea behind this test is to have -Wl,--as-needed prune +# away unneeded linkages, which would otherwise cause global +# static initialiser side-effects to set a boolean to true. + +# Credits for portable ISO C++ idea go to sarum9in + +libA = library('A', 'libA.cpp') +libB = library('B', 'libB.cpp', link_with : libA) + +main_exe = executable('C', 'main.cpp', link_with : [libA, libB]) +test('main test', main_exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/178 identical target name in subproject flat layout/foo.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/178 identical target name in subproject flat layout/foo.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/178 identical target name in subproject flat layout/foo.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/178 identical target name in subproject flat layout/foo.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -int meson_test_main_foo(void) { return 10; } diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/178 identical target name in subproject flat layout/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/178 identical target name in subproject flat layout/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/178 identical target name in subproject flat layout/main.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/178 identical target name in subproject flat layout/main.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -#include - -int meson_test_main_foo(void); -int meson_test_subproj_foo(void); - -int main(void) { - if (meson_test_main_foo() != 10) { - printf("Failed meson_test_main_foo\n"); - return 1; - } - if (meson_test_subproj_foo() != 20) { - printf("Failed meson_test_subproj_foo\n"); - return 1; - } - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/178 identical target name in subproject flat layout/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/178 identical target name in subproject flat layout/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/178 identical target name in subproject flat layout/meson.build" 2018-12-09 16:31:45.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/178 identical target name in subproject flat layout/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -project('subproject targets', 'c') - -# Idea behind this test is to create targets with identical name -# but different output files. We can do this by choosing different -# name_prefix of libraries. Target id does not depend on name_prefix. - -main_foo = static_library('foo', 'foo.c', name_prefix : 'main') -subproj_foo = subproject('subproj').get_variable('foo') - -exe = executable('prog', 'main.c', link_with : [main_foo, subproj_foo]) -test('main test', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/178 identical target name in subproject flat layout/subprojects/subproj/foo.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/178 identical target name in subproject flat layout/subprojects/subproj/foo.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/178 identical target name in subproject flat layout/subprojects/subproj/foo.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/178 identical target name in subproject flat layout/subprojects/subproj/foo.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -int meson_test_subproj_foo(void) { return 20; } diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/178 identical target name in subproject flat layout/subprojects/subproj/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/178 identical target name in subproject flat layout/subprojects/subproj/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/178 identical target name in subproject flat layout/subprojects/subproj/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/178 identical target name in subproject flat layout/subprojects/subproj/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -project('subproj', 'c') - -foo = static_library('foo', 'foo.c', name_prefix : 'subproj') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/179 as-needed/config.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/179 as-needed/config.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/179 as-needed/config.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/179 as-needed/config.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -#if defined _WIN32 || defined __CYGWIN__ - #if defined BUILDING_DLL - #define DLL_PUBLIC __declspec(dllexport) - #else - #define DLL_PUBLIC __declspec(dllimport) - #endif -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/179 as-needed/libA.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/179 as-needed/libA.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/179 as-needed/libA.cpp" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/179 as-needed/libA.cpp" 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -#define BUILDING_DLL - -#include "libA.h" - -namespace meson_test_as_needed { - DLL_PUBLIC bool linked = false; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/179 as-needed/libA.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/179 as-needed/libA.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/179 as-needed/libA.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/179 as-needed/libA.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#include "config.h" - -namespace meson_test_as_needed { - DLL_PUBLIC extern bool linked; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/179 as-needed/libB.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/179 as-needed/libB.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/179 as-needed/libB.cpp" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/179 as-needed/libB.cpp" 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -#include "libA.h" - -#undef DLL_PUBLIC -#define BUILDING_DLL -#include "config.h" - -namespace meson_test_as_needed { - namespace { - bool set_linked() { - linked = true; - return true; - } - bool stub = set_linked(); - } - - DLL_PUBLIC int libB_unused_func() { - return 0; - } -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/179 as-needed/main.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/179 as-needed/main.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/179 as-needed/main.cpp" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/179 as-needed/main.cpp" 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -#include - -#include "libA.h" - -int main() { - return !meson_test_as_needed::linked ? EXIT_SUCCESS : EXIT_FAILURE; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/179 as-needed/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/179 as-needed/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/179 as-needed/meson.build" 2018-12-09 16:31:48.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/179 as-needed/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -project('as-needed test', 'cpp') - -# Idea behind this test is to have -Wl,--as-needed prune -# away unneeded linkages, which would otherwise cause global -# static initialiser side-effects to set a boolean to true. - -# Credits for portable ISO C++ idea go to sarum9in - -libA = library('A', 'libA.cpp') -libB = library('B', 'libB.cpp', link_with : libA) - -main_exe = executable('C', 'main.cpp', link_with : [libA, libB]) -test('main test', main_exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/179 ndebug if-release enabled/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/179 ndebug if-release enabled/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/179 ndebug if-release enabled/main.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/179 ndebug if-release enabled/main.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,15 @@ +#include +#include + +int meson_test_side_effect = EXIT_FAILURE; + +int meson_test_set_side_effect(void) { + meson_test_side_effect = EXIT_SUCCESS; + return 1; +} + +int main(void) { + // meson_test_side_effect is set only if assert is executed + assert(meson_test_set_side_effect()); + return meson_test_side_effect; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/179 ndebug if-release enabled/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/179 ndebug if-release enabled/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/179 ndebug if-release enabled/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/179 ndebug if-release enabled/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,7 @@ +project('ndebug enabled', 'c', + default_options : [ + 'buildtype=debugoptimized', + 'b_ndebug=if-release', + ]) + +test('exe', executable('main', 'main.c')) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/180 ndebug if-release disabled/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/180 ndebug if-release disabled/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/180 ndebug if-release disabled/main.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/180 ndebug if-release disabled/main.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,7 @@ +#include +#include + +int main(void) { + assert(0); + return EXIT_SUCCESS; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/180 ndebug if-release disabled/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/180 ndebug if-release disabled/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/180 ndebug if-release disabled/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/180 ndebug if-release disabled/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,7 @@ +project('ndebug disabled', 'c', + default_options : [ + 'buildtype=release', + 'b_ndebug=if-release', + ]) + +test('exe', executable('main', 'main.c')) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/180 ndebug if-release enabled/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/180 ndebug if-release enabled/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/180 ndebug if-release enabled/main.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/180 ndebug if-release enabled/main.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -#include -#include - -int meson_test_side_effect = EXIT_FAILURE; - -int meson_test_set_side_effect(void) { - meson_test_side_effect = EXIT_SUCCESS; - return 1; -} - -int main(void) { - // meson_test_side_effect is set only if assert is executed - assert(meson_test_set_side_effect()); - return meson_test_side_effect; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/180 ndebug if-release enabled/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/180 ndebug if-release enabled/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/180 ndebug if-release enabled/meson.build" 2018-12-09 16:31:49.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/180 ndebug if-release enabled/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -project('ndebug enabled', 'c', - default_options : [ - 'buildtype=debugoptimized', - 'b_ndebug=if-release', - ]) - -test('exe', executable('main', 'main.c')) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/181 ndebug if-release disabled/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/181 ndebug if-release disabled/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/181 ndebug if-release disabled/main.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/181 ndebug if-release disabled/main.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -#include -#include - -int main(void) { - assert(0); - return EXIT_SUCCESS; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/181 ndebug if-release disabled/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/181 ndebug if-release disabled/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/181 ndebug if-release disabled/meson.build" 2018-12-09 16:31:49.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/181 ndebug if-release disabled/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -project('ndebug disabled', 'c', - default_options : [ - 'buildtype=release', - 'b_ndebug=if-release', - ]) - -test('exe', executable('main', 'main.c')) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/181 subproject version/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/181 subproject version/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/181 subproject version/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/181 subproject version/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,10 @@ +project('subproject version', 'c', + version : '2.3.4', + license: 'mylicense') + +subproject('a') + +liba_dep = dependency('a', + fallback: ['a', 'liba_dep'], + version: ['>= 0.30.0', '!= 0.99.0']) + diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/181 subproject version/subprojects/a/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/181 subproject version/subprojects/a/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/181 subproject version/subprojects/a/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/181 subproject version/subprojects/a/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +project('mysubproject', 'c', + version : '1.0.0', + license : 'sublicense') + +liba_dep = declare_dependency (version : '1.0.0') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/182 subdir_done/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/182 subdir_done/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/182 subdir_done/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/182 subdir_done/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,12 @@ +# Should run, even though main.cpp does not exist and we call error in the last line. +# subdir_done jumps to end, so both lines are not executed. + +project('example exit', 'cpp') + +if true + subdir_done() +endif + +executable('main', 'main.cpp') +error('Unreachable') + diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/182 subproject version/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/182 subproject version/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/182 subproject version/meson.build" 2018-12-09 16:31:49.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/182 subproject version/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -project('subproject version', 'c', - version : '2.3.4', - license: 'mylicense') - -subproject('a') - -liba_dep = dependency('a', - fallback: ['a', 'liba_dep'], - version: ['>= 0.30.0', '!= 0.99.0']) - diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/182 subproject version/subprojects/a/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/182 subproject version/subprojects/a/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/182 subproject version/subprojects/a/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/182 subproject version/subprojects/a/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -project('mysubproject', 'c', - version : '1.0.0', - license : 'sublicense') - -liba_dep = declare_dependency (version : '1.0.0') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/183 bothlibraries/libfile.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/183 bothlibraries/libfile.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/183 bothlibraries/libfile.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/183 bothlibraries/libfile.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,7 @@ +#include "mylib.h" + +DO_EXPORT int retval = 42; + +DO_EXPORT int func() { + return retval; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/183 bothlibraries/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/183 bothlibraries/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/183 bothlibraries/main.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/183 bothlibraries/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,8 @@ +#include "mylib.h" + +DO_IMPORT int func(); +DO_IMPORT int retval; + +int main(int argc, char **arg) { + return func() == retval ? 0 : 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/183 bothlibraries/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/183 bothlibraries/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/183 bothlibraries/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/183 bothlibraries/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,25 @@ +project('both libraries linking test', 'c') + +both_libs = both_libraries('mylib', 'libfile.c') +exe_shared = executable('prog-shared', 'main.c', link_with : both_libs.get_shared_lib()) +exe_static = executable('prog-static', 'main.c', + c_args : ['-DSTATIC_COMPILATION'], + link_with : both_libs.get_static_lib()) +exe_both = executable('prog-both', 'main.c', link_with : both_libs) + +test('runtest-shared', exe_shared) +test('runtest-static', exe_static) +test('runtest-both', exe_both) + +# Same as above, but using build_target() +both_libs2 = build_target('mylib2', 'libfile.c', target_type: 'both_libraries') +exe_shared2 = executable('prog-shared2', 'main.c', + link_with : both_libs2.get_shared_lib()) +exe_static2 = executable('prog-static2', 'main.c', + c_args : ['-DSTATIC_COMPILATION'], + link_with : both_libs2.get_static_lib()) +exe_both2 = executable('prog-both2', 'main.c', link_with : both_libs2) + +test('runtest-shared-2', exe_shared2) +test('runtest-static-2', exe_static2) +test('runtest-both-2', exe_both2) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/183 bothlibraries/mylib.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/183 bothlibraries/mylib.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/183 bothlibraries/mylib.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/183 bothlibraries/mylib.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,13 @@ +#pragma once + +#ifdef _WIN32 + #ifdef STATIC_COMPILATION + #define DO_IMPORT extern + #else + #define DO_IMPORT __declspec(dllimport) + #endif + #define DO_EXPORT __declspec(dllexport) +#else + #define DO_IMPORT extern + #define DO_EXPORT +#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/183 subdir_done/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/183 subdir_done/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/183 subdir_done/meson.build" 2018-12-09 16:31:55.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/183 subdir_done/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -# Should run, even though main.cpp does not exist and we call error in the last line. -# subdir_done jumps to end, so both lines are not executed. - -project('example exit', 'cpp') - -if true - subdir_done() -endif - -executable('main', 'main.cpp') -error('Unreachable') - diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/184 bothlibraries/libfile.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/184 bothlibraries/libfile.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/184 bothlibraries/libfile.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/184 bothlibraries/libfile.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -#include "mylib.h" - -DO_EXPORT int retval = 42; - -DO_EXPORT int func() { - return retval; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/184 bothlibraries/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/184 bothlibraries/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/184 bothlibraries/main.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/184 bothlibraries/main.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -#include "mylib.h" - -DO_IMPORT int func(); -DO_IMPORT int retval; - -int main(int argc, char **arg) { - return func() == retval ? 0 : 1; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/184 bothlibraries/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/184 bothlibraries/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/184 bothlibraries/meson.build" 2018-12-09 16:31:56.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/184 bothlibraries/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -project('both libraries linking test', 'c') - -both_libs = both_libraries('mylib', 'libfile.c') -exe_shared = executable('prog-shared', 'main.c', link_with : both_libs.get_shared_lib()) -exe_static = executable('prog-static', 'main.c', - c_args : ['-DSTATIC_COMPILATION'], - link_with : both_libs.get_static_lib()) -exe_both = executable('prog-both', 'main.c', link_with : both_libs) - -test('runtest-shared', exe_shared) -test('runtest-static', exe_static) -test('runtest-both', exe_both) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/184 bothlibraries/mylib.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/184 bothlibraries/mylib.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/184 bothlibraries/mylib.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/184 bothlibraries/mylib.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -#pragma once - -#ifdef _WIN32 - #ifdef STATIC_COMPILATION - #define DO_IMPORT extern - #else - #define DO_IMPORT __declspec(dllimport) - #endif - #define DO_EXPORT __declspec(dllexport) -#else - #define DO_IMPORT extern - #define DO_EXPORT -#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/184 escape and unicode/file.c.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/184 escape and unicode/file.c.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/184 escape and unicode/file.c.in" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/184 escape and unicode/file.c.in" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +#include +const char* does_it_work() { + printf("{NAME}\n"); + return "yes it does"; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/184 escape and unicode/file.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/184 escape and unicode/file.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/184 escape and unicode/file.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/184 escape and unicode/file.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,10 @@ +#!/usr/bin/env python3 + +import sys +import os + +with open(sys.argv[1]) as fh: + content = fh.read().replace("{NAME}", sys.argv[2]) + +with open(os.path.join(sys.argv[3]), 'w', errors='replace') as fh: + fh.write(content) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/184 escape and unicode/find.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/184 escape and unicode/find.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/184 escape and unicode/find.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/184 escape and unicode/find.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,9 @@ +#!/usr/bin/env python3 + +import os +import sys + +for fh in os.listdir('.'): + if os.path.isfile(fh): + if fh.endswith('.c'): + sys.stdout.write(fh + '\0') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/184 escape and unicode/fun.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/184 escape and unicode/fun.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/184 escape and unicode/fun.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/184 escape and unicode/fun.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,3 @@ +int a_fun() { + return 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/184 escape and unicode/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/184 escape and unicode/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/184 escape and unicode/main.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/184 escape and unicode/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,12 @@ +#include + +const char* does_it_work(); + +int a_fun(); + +int main() { + if(strcmp(does_it_work(), "yes it does") != 0) { + return -a_fun(); + } + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/184 escape and unicode/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/184 escape and unicode/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/184 escape and unicode/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/184 escape and unicode/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,38 @@ +project('180 escape', 'c') + +gen = generator(find_program('file.py'), arguments:['@INPUT@', 'erd\u0151', '@OUTPUT@'], output: '@BASENAME@') + +gen_file = gen.process('file.c.in') + +find_file_list = run_command(find_program('find.py')) +assert(find_file_list.returncode() == 0, 'Didn\'t find any files.') + +# Strings should support both octal \ooo and hex \xhh encodings + +found_files_oct = [] +foreach l : find_file_list.stdout().strip('\0').split('\000') + found_files_oct += [files(l)] +endforeach + +test('first', executable('first', found_files_oct + [gen_file])) + +found_files_hex = [] +foreach l : find_file_list.stdout().strip('\x00').split('\x00') + found_files_hex += [files(l)] +endforeach + +test('second', executable('second', found_files_hex + [gen_file])) + +# Unrecognized and malformed escape sequences are literal + +malformed = [ + [ '\c', 'c' ], + [ '\Uabcdefghi', 'Uabcdefghi'], + [ '\u123 ', 'u123 '], + [ '\xqr', 'xqr'], +] + +foreach m : malformed + assert(m[0].endswith(m[1]), 'bad escape sequence had unexpected end') + assert(m[0].startswith('\\'), 'bad escape sequence had unexpected start') +endforeach diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/185 escape and unicode/file.c.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/185 escape and unicode/file.c.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/185 escape and unicode/file.c.in" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/185 escape and unicode/file.c.in" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#include -const char* does_it_work() { - printf("{NAME}\n"); - return "yes it does"; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/185 escape and unicode/file.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/185 escape and unicode/file.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/185 escape and unicode/file.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/185 escape and unicode/file.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -#!/usr/bin/env python3 - -import sys -import os - -with open(sys.argv[1]) as fh: - content = fh.read().replace("{NAME}", sys.argv[2]) - -with open(os.path.join(sys.argv[3]), 'w') as fh: - fh.write(content) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/185 escape and unicode/find.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/185 escape and unicode/find.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/185 escape and unicode/find.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/185 escape and unicode/find.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -#!/usr/bin/env python3 - -import os -import sys - -for fh in os.listdir('.'): - if os.path.isfile(fh): - if fh.endswith('.c'): - sys.stdout.write(fh + '\0') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/185 escape and unicode/fun.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/185 escape and unicode/fun.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/185 escape and unicode/fun.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/185 escape and unicode/fun.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -int a_fun() { - return 1; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/185 escape and unicode/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/185 escape and unicode/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/185 escape and unicode/main.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/185 escape and unicode/main.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -#include - -const char* does_it_work(); - -int a_fun(); - -int main() { - if(strcmp(does_it_work(), "yes it does") != 0) { - return -a_fun(); - } - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/185 escape and unicode/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/185 escape and unicode/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/185 escape and unicode/meson.build" 2018-12-09 16:31:56.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/185 escape and unicode/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -project('180 escape', 'c') - -gen = generator(find_program('file.py'), arguments:['@INPUT@', 'erd\u0151', '@OUTPUT@'], output: '@BASENAME@') - -gen_file = gen.process('file.c.in') - -find_file_list = run_command(find_program('find.py')) -assert(find_file_list.returncode() == 0, 'Didn\'t find any files.') - -# Strings should support both octal \ooo and hex \xhh encodings - -found_files_oct = [] -foreach l : find_file_list.stdout().strip('\0').split('\000') - found_files_oct += [files(l)] -endforeach - -test('first', executable('first', found_files_oct + [gen_file])) - -found_files_hex = [] -foreach l : find_file_list.stdout().strip('\x00').split('\x00') - found_files_hex += [files(l)] -endforeach - -test('second', executable('second', found_files_hex + [gen_file])) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/185 has link arg/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/185 has link arg/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/185 has link arg/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/185 has link arg/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,47 @@ +project('has link arg', 'c', 'cpp') + +cc = meson.get_compiler('c') +cpp = meson.get_compiler('cpp') + +if cc.get_argument_syntax() == 'msvc' + is_arg = '/OPT:REF' + useless = '/DEBUG' + isnt_arg = '/iambroken' +else + is_arg = '-Wl,-L/tmp' + useless = '-Wl,-L/usr' + isnt_arg = '-Wl,-iambroken' +endif + +assert(cc.has_link_argument(is_arg), 'Arg that should have worked does not work.') +assert(cpp.has_link_argument(is_arg), 'Arg that should have worked does not work.') + +if cc.get_id() != 'pgi' +assert(not cc.has_link_argument(isnt_arg), 'Arg that should be broken is not.') +assert(not cpp.has_link_argument(isnt_arg), 'Arg that should be broken is not.') + +assert(cc.get_supported_link_arguments([is_arg, isnt_arg, useless]) == [is_arg, useless], 'Arg filtering returned different result.') +assert(cpp.get_supported_link_arguments([is_arg, isnt_arg, useless]) == [is_arg, useless], 'Arg filtering returned different result.') + +# Have useless at the end to ensure that the search goes from front to back. +l1 = cc.first_supported_link_argument([isnt_arg, is_arg, isnt_arg, useless]) +l2 = cc.first_supported_link_argument(isnt_arg, isnt_arg, isnt_arg) + +assert(l1.length() == 1, 'First supported returned wrong result.') +assert(l1.get(0) == is_arg, 'First supported returned wrong argument.') +assert(l2.length() == 0, 'First supported did not return empty array.') + +l1 = cpp.first_supported_link_argument([isnt_arg, is_arg, isnt_arg, useless]) +l2 = cpp.first_supported_link_argument(isnt_arg, isnt_arg, isnt_arg) + +assert(l1.length() == 1, 'First supported returned wrong result.') +assert(l1.get(0) == is_arg, 'First supported returned wrong argument.') +assert(l2.length() == 0, 'First supported did not return empty array.') + +assert(not cc.has_multi_link_arguments([isnt_arg, is_arg]), 'Arg that should be broken is not.') + +assert(not cc.has_link_argument('-Wl,-z,nodelete42'), 'Did not detect wrong -z linker argument') +endif + +assert(cc.has_multi_link_arguments(is_arg), 'Arg that should have worked does not work.') +assert(cc.has_multi_link_arguments([useless, is_arg]), 'Arg that should have worked does not work.') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/186 has link arg/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/186 has link arg/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/186 has link arg/meson.build" 2018-12-09 16:31:58.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/186 has link arg/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,44 +0,0 @@ -project('has link arg', 'c', 'cpp') - -cc = meson.get_compiler('c') -cpp = meson.get_compiler('cpp') - -if cc.get_argument_syntax() == 'msvc' - is_arg = '/OPT:REF' - useless = '/DEBUG' - isnt_arg = '/iambroken' -else - is_arg = '-Wl,-Lfoo' - useless = '-Wl,-Lbar' - isnt_arg = '-Wl,-iambroken' -endif - -assert(cc.has_link_argument(is_arg), 'Arg that should have worked does not work.') -assert(not cc.has_link_argument(isnt_arg), 'Arg that should be broken is not.') - -assert(cpp.has_link_argument(is_arg), 'Arg that should have worked does not work.') -assert(not cpp.has_link_argument(isnt_arg), 'Arg that should be broken is not.') - -assert(cc.get_supported_link_arguments([is_arg, isnt_arg, useless]) == [is_arg, useless], 'Arg filtering returned different result.') -assert(cpp.get_supported_link_arguments([is_arg, isnt_arg, useless]) == [is_arg, useless], 'Arg filtering returned different result.') - -# Have useless at the end to ensure that the search goes from front to back. -l1 = cc.first_supported_link_argument([isnt_arg, is_arg, isnt_arg, useless]) -l2 = cc.first_supported_link_argument(isnt_arg, isnt_arg, isnt_arg) - -assert(l1.length() == 1, 'First supported returned wrong result.') -assert(l1.get(0) == is_arg, 'First supported returned wrong argument.') -assert(l2.length() == 0, 'First supported did not return empty array.') - -l1 = cpp.first_supported_link_argument([isnt_arg, is_arg, isnt_arg, useless]) -l2 = cpp.first_supported_link_argument(isnt_arg, isnt_arg, isnt_arg) - -assert(l1.length() == 1, 'First supported returned wrong result.') -assert(l1.get(0) == is_arg, 'First supported returned wrong argument.') -assert(l2.length() == 0, 'First supported did not return empty array.') - -assert(not cc.has_multi_link_arguments([isnt_arg, is_arg]), 'Arg that should be broken is not.') -assert(cc.has_multi_link_arguments(is_arg), 'Arg that should have worked does not work.') -assert(cc.has_multi_link_arguments([useless, is_arg]), 'Arg that should have worked does not work.') - -assert(not cc.has_link_argument('-Wl,-z,nodelete42'), 'Did not detect wrong -z linker argument') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/186 same target name flat layout/foo.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/186 same target name flat layout/foo.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/186 same target name flat layout/foo.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/186 same target name flat layout/foo.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +int meson_test_main_foo(void) { return 10; } diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/186 same target name flat layout/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/186 same target name flat layout/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/186 same target name flat layout/main.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/186 same target name flat layout/main.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,16 @@ +#include + +int meson_test_main_foo(void); +int meson_test_subproj_foo(void); + +int main(void) { + if (meson_test_main_foo() != 10) { + printf("Failed meson_test_main_foo\n"); + return 1; + } + if (meson_test_subproj_foo() != 20) { + printf("Failed meson_test_subproj_foo\n"); + return 1; + } + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/186 same target name flat layout/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/186 same target name flat layout/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/186 same target name flat layout/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/186 same target name flat layout/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,11 @@ +project('subdir targets', 'c') + +# Idea behind this test is to create targets with identical name +# but different output files. We can do this by choosing different +# name_prefix of libraries. Target id does not depend on name_prefix. + +main_foo = static_library('foo', 'foo.c', name_prefix : 'main') +subdir('subdir') # defines subdir_foo + +exe = executable('prog', 'main.c', link_with : [main_foo, subdir_foo]) +test('main test', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/186 same target name flat layout/subdir/foo.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/186 same target name flat layout/subdir/foo.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/186 same target name flat layout/subdir/foo.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/186 same target name flat layout/subdir/foo.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +int meson_test_subproj_foo(void) { return 20; } diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/186 same target name flat layout/subdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/186 same target name flat layout/subdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/186 same target name flat layout/subdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/186 same target name flat layout/subdir/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +subdir_foo = static_library('foo', 'foo.c', name_prefix : 'subdir') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/187 find override/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/187 find override/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/187 find override/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/187 find override/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,12 @@ +project('find program override', 'c') + +gencodegen = find_program('gencodegen', required : false) + +assert(not gencodegen.found(), 'gencodegen is an internal program, should not be found') + +# Test the check-if-found-else-override workflow +if not gencodegen.found() + subdir('subdir') +endif + +subdir('otherdir') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/187 find override/otherdir/main2.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/187 find override/otherdir/main2.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/187 find override/otherdir/main2.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/187 find override/otherdir/main2.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +int number_returner(); + +int main(int argc, char **argv) { + return number_returner() == 100 ? 0 : 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/187 find override/otherdir/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/187 find override/otherdir/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/187 find override/otherdir/main.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/187 find override/otherdir/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +int be_seeing_you(); + +int main(int argc, char **argv) { + return be_seeing_you() == 6 ? 0 : 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/187 find override/otherdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/187 find override/otherdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/187 find override/otherdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/187 find override/otherdir/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,26 @@ +gen = find_program('codegen') # Should use overridden value set in "subdir". + +src = custom_target('arrival', + input : 'source.desc', + output : 'file.c', + command : [gen, '@INPUT@', '@OUTPUT@'] + ) + +e = executable('six', 'main.c', src) + +test('six', e) + +# The same again, but this time with a program that was genererated +# with configure_file. + +gen = find_program('gencodegen') + +src = custom_target('hundred', + input : 'source2.desc', + output : 'file2.c', + command : [gen, '@INPUT@', '@OUTPUT@'] + ) + +e = executable('hundred', 'main2.c', src) + +test('hundred', e) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/187 find override/otherdir/source2.desc" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/187 find override/otherdir/source2.desc" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/187 find override/otherdir/source2.desc" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/187 find override/otherdir/source2.desc" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +number_returner diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/187 find override/otherdir/source.desc" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/187 find override/otherdir/source.desc" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/187 find override/otherdir/source.desc" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/187 find override/otherdir/source.desc" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +be_seeing_you diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/187 find override/subdir/converter.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/187 find override/subdir/converter.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/187 find override/subdir/converter.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/187 find override/subdir/converter.py" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,15 @@ +#!/usr/bin/env python3 + +import sys +import pathlib + +[ifilename, ofilename] = sys.argv[1:3] + +ftempl = '''int %s() { + return 6; +} +''' + +d = pathlib.Path(ifilename).read_text().split('\n')[0].strip() + +pathlib.Path(ofilename).write_text(ftempl % d) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/187 find override/subdir/gencodegen.py.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/187 find override/subdir/gencodegen.py.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/187 find override/subdir/gencodegen.py.in" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/187 find override/subdir/gencodegen.py.in" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,15 @@ +#!/usr/bin/env python3 + +import sys +import pathlib + +[ifilename, ofilename] = sys.argv[1:3] + +ftempl = '''int %s() { + return @NUMBER@; +} +''' + +d = pathlib.Path(ifilename).read_text().split('\n')[0].strip() + +pathlib.Path(ofilename).write_text(ftempl % d) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/187 find override/subdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/187 find override/subdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/187 find override/subdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/187 find override/subdir/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,14 @@ +x = find_program('converter.py') + +meson.override_find_program('codegen', x) + +# Override a command with a generated script + +cdata = configuration_data() + +cdata.set('NUMBER', 100) +numprog = configure_file(input : 'gencodegen.py.in', + output : 'gencodegen.py', + configuration : cdata) + +meson.override_find_program('gencodegen', numprog) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/187 same target name flat layout/foo.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/187 same target name flat layout/foo.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/187 same target name flat layout/foo.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/187 same target name flat layout/foo.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -int meson_test_main_foo(void) { return 10; } diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/187 same target name flat layout/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/187 same target name flat layout/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/187 same target name flat layout/main.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/187 same target name flat layout/main.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -#include - -int meson_test_main_foo(void); -int meson_test_subproj_foo(void); - -int main(void) { - if (meson_test_main_foo() != 10) { - printf("Failed meson_test_main_foo\n"); - return 1; - } - if (meson_test_subproj_foo() != 20) { - printf("Failed meson_test_subproj_foo\n"); - return 1; - } - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/187 same target name flat layout/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/187 same target name flat layout/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/187 same target name flat layout/meson.build" 2018-12-09 16:31:58.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/187 same target name flat layout/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -project('subdir targets', 'c') - -# Idea behind this test is to create targets with identical name -# but different output files. We can do this by choosing different -# name_prefix of libraries. Target id does not depend on name_prefix. - -main_foo = static_library('foo', 'foo.c', name_prefix : 'main') -subdir('subdir') # defines subdir_foo - -exe = executable('prog', 'main.c', link_with : [main_foo, subdir_foo]) -test('main test', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/187 same target name flat layout/subdir/foo.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/187 same target name flat layout/subdir/foo.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/187 same target name flat layout/subdir/foo.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/187 same target name flat layout/subdir/foo.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -int meson_test_subproj_foo(void) { return 20; } diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/187 same target name flat layout/subdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/187 same target name flat layout/subdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/187 same target name flat layout/subdir/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/187 same target name flat layout/subdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -subdir_foo = static_library('foo', 'foo.c', name_prefix : 'subdir') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/188 find override/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/188 find override/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/188 find override/meson.build" 2018-12-09 16:32:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/188 find override/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -project('find program override', 'c') - -gencodegen = find_program('gencodegen', required : false) - -assert(not gencodegen.found(), 'gencodegen is an internal program, should not be found') - -# Test the check-if-found-else-override workflow -if not gencodegen.found() - subdir('subdir') -endif - -subdir('otherdir') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/188 find override/otherdir/main2.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/188 find override/otherdir/main2.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/188 find override/otherdir/main2.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/188 find override/otherdir/main2.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -int number_returner(); - -int main(int argc, char **argv) { - return number_returner() == 100 ? 0 : 1; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/188 find override/otherdir/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/188 find override/otherdir/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/188 find override/otherdir/main.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/188 find override/otherdir/main.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -int be_seeing_you(); - -int main(int argc, char **argv) { - return be_seeing_you() == 6 ? 0 : 1; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/188 find override/otherdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/188 find override/otherdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/188 find override/otherdir/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/188 find override/otherdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -gen = find_program('codegen') # Should use overridden value set in "subdir". - -src = custom_target('arrival', - input : 'source.desc', - output : 'file.c', - command : [gen, '@INPUT@', '@OUTPUT@'] - ) - -e = executable('six', 'main.c', src) - -test('six', e) - -# The same again, but this time with a program that was genererated -# with configure_file. - -gen = find_program('gencodegen') - -src = custom_target('hundred', - input : 'source2.desc', - output : 'file2.c', - command : [gen, '@INPUT@', '@OUTPUT@'] - ) - -e = executable('hundred', 'main2.c', src) - -test('hundred', e) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/188 find override/otherdir/source2.desc" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/188 find override/otherdir/source2.desc" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/188 find override/otherdir/source2.desc" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/188 find override/otherdir/source2.desc" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -number_returner diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/188 find override/otherdir/source.desc" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/188 find override/otherdir/source.desc" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/188 find override/otherdir/source.desc" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/188 find override/otherdir/source.desc" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -be_seeing_you diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/188 find override/subdir/converter.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/188 find override/subdir/converter.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/188 find override/subdir/converter.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/188 find override/subdir/converter.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -#!/usr/bin/env python3 - -import sys -import pathlib - -[ifilename, ofilename] = sys.argv[1:3] - -ftempl = '''int %s() { - return 6; -} -''' - -d = pathlib.Path(ifilename).read_text().split('\n')[0].strip() - -pathlib.Path(ofilename).write_text(ftempl % d) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/188 find override/subdir/gencodegen.py.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/188 find override/subdir/gencodegen.py.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/188 find override/subdir/gencodegen.py.in" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/188 find override/subdir/gencodegen.py.in" 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -#!/usr/bin/env python3 - -import sys -import pathlib - -[ifilename, ofilename] = sys.argv[1:3] - -ftempl = '''int %s() { - return @NUMBER@; -} -''' - -d = pathlib.Path(ifilename).read_text().split('\n')[0].strip() - -pathlib.Path(ofilename).write_text(ftempl % d) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/188 find override/subdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/188 find override/subdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/188 find override/subdir/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/188 find override/subdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -x = find_program('converter.py') - -meson.override_find_program('codegen', x) - -# Override a command with a generated script - -cdata = configuration_data() - -cdata.set('NUMBER', 100) -numprog = configure_file(input : 'gencodegen.py.in', - output : 'gencodegen.py', - configuration : cdata) - -meson.override_find_program('gencodegen', numprog) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/188 partial dependency/declare_dependency/headers/foo.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/188 partial dependency/declare_dependency/headers/foo.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/188 partial dependency/declare_dependency/headers/foo.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/188 partial dependency/declare_dependency/headers/foo.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,16 @@ +/* Copyright © 2018 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#error "Included C sources that shouldn't be." diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/188 partial dependency/declare_dependency/headers/foo.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/188 partial dependency/declare_dependency/headers/foo.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/188 partial dependency/declare_dependency/headers/foo.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/188 partial dependency/declare_dependency/headers/foo.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,16 @@ +/* Copyright © 2018 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +int foo(void); diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/188 partial dependency/declare_dependency/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/188 partial dependency/declare_dependency/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/188 partial dependency/declare_dependency/main.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/188 partial dependency/declare_dependency/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,25 @@ +/* Copyright © 2018 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "foo.h" + +int main() { + int a = foo(); + if (a == 1) { + return 0; + } else { + return 1; + } +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/188 partial dependency/declare_dependency/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/188 partial dependency/declare_dependency/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/188 partial dependency/declare_dependency/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/188 partial dependency/declare_dependency/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,32 @@ +# Copyright © 2018 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +dec_sub_dep = declare_dependency( + include_directories : include_directories('headers'), +) + +dec_dep = declare_dependency( + sources : files('headers/foo.c'), + dependencies : dec_sub_dep, +) + +sub_dep = dec_dep.partial_dependency(includes : true) + +dec_exe = executable( + 'declare_dep', + files('main.c', 'other.c'), + dependencies : sub_dep, +) + +test('Declare Dependency', dec_exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/188 partial dependency/declare_dependency/other.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/188 partial dependency/declare_dependency/other.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/188 partial dependency/declare_dependency/other.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/188 partial dependency/declare_dependency/other.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,20 @@ +/* Copyright © 2018 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "foo.h" + +int foo(void) { + return 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/188 partial dependency/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/188 partial dependency/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/188 partial dependency/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/188 partial dependency/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,17 @@ +# Copyright © 2018 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +project('partial dependency', ['c', 'cpp']) + +subdir('declare_dependency') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/189 openmp/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/189 openmp/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/189 openmp/main.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/189 openmp/main.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,16 @@ +#include +#include + +int main(void) { +#ifdef _OPENMP + if (omp_get_max_threads() == 2) { + return 0; + } else { + printf("Max threads is %d not 2.\n", omp_get_max_threads()); + return 1; + } +#else + printf("_OPENMP is not defined; is OpenMP compilation working?\n"); + return 1; +#endif +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/189 openmp/main.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/189 openmp/main.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/189 openmp/main.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/189 openmp/main.cpp" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,16 @@ +#include +#include + +int main(void) { +#ifdef _OPENMP + if (omp_get_max_threads() == 2) { + return 0; + } else { + std::cout << "Max threads is " << omp_get_max_threads() << " not 2." << std::endl; + return 1; + } +#else + printf("_OPENMP is not defined; is OpenMP compilation working?\n"); + return 1; +#endif +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/189 openmp/main.f90" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/189 openmp/main.f90" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/189 openmp/main.f90" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/189 openmp/main.f90" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,9 @@ +use, intrinsic :: iso_fortran_env, only: stderr=>error_unit +use omp_lib + +if (omp_get_max_threads() /= 2) then + write(stderr, *) 'Max Fortran threads is', omp_get_max_threads(), 'not 2.' + stop 1 +endif + +end program diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/189 openmp/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/189 openmp/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/189 openmp/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/189 openmp/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,58 @@ +project('openmp', 'c') + +cc = meson.get_compiler('c') +if cc.get_id() == 'gcc' and cc.version().version_compare('<4.2.0') + error('MESON_SKIP_TEST gcc is too old to support OpenMP.') +endif +if cc.get_id() == 'clang' and cc.version().version_compare('<3.7.0') + error('MESON_SKIP_TEST clang is too old to support OpenMP.') +endif +if cc.get_id() == 'msvc' and cc.version().version_compare('<17') + error('MESON_SKIP_TEST msvc is too old to support OpenMP.') +endif +if cc.get_id() == 'clang-cl' + error('MESON_SKIP_TEST clang-cl does not support OpenMP.') +endif +if cc.get_id() == 'clang' and host_machine.system() == 'windows' + error('MESON_SKIP_TEST Windows clang does not support OpenMP.') +endif +if host_machine.system() == 'darwin' + error('MESON_SKIP_TEST macOS does not support OpenMP.') +endif + +openmp = dependency('openmp') +env = environment() +env.set('OMP_NUM_THREADS', '2') + +exec = executable('exec', + 'main.c', + dependencies : [openmp]) +test('OpenMP C', exec, env : env) + +if not(build_machine.system() == 'windows' and cc.get_id() == 'pgi') + if add_languages('cpp', required : false) + execpp = executable('execpp', + 'main.cpp', + dependencies : [openmp]) + test('OpenMP C++', execpp, env : env) + endif +endif + +if add_languages('fortran', required : false) + # Mixing compilers (msvc/clang with gfortran) does not seem to work on Windows. + if build_machine.system() != 'windows' or cc.get_id() == 'gnu' + exef = executable('exef', + 'main.f90', + dependencies : [openmp]) + test('OpenMP Fortran', exef, env : env) + + openmp_f = dependency('openmp', language : 'fortran') + exe_f = executable('exe_f', + 'main.f90', + dependencies : [openmp_f]) + test('OpenMP Fortran-specific', exe_f, env : env) + endif +endif + +# Check we can apply a version constraint +dependency('openmp', version: '>=@0@'.format(openmp.version())) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/189 partial dependency/declare_dependency/headers/foo.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/189 partial dependency/declare_dependency/headers/foo.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/189 partial dependency/declare_dependency/headers/foo.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/189 partial dependency/declare_dependency/headers/foo.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -/* Copyright © 2018 Intel Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#error "Included C sources that shouldn't be." diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/189 partial dependency/declare_dependency/headers/foo.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/189 partial dependency/declare_dependency/headers/foo.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/189 partial dependency/declare_dependency/headers/foo.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/189 partial dependency/declare_dependency/headers/foo.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -/* Copyright © 2018 Intel Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -int foo(void); diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/189 partial dependency/declare_dependency/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/189 partial dependency/declare_dependency/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/189 partial dependency/declare_dependency/main.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/189 partial dependency/declare_dependency/main.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -/* Copyright © 2018 Intel Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "foo.h" - -int main() { - int a = foo(); - if (a == 1) { - return 0; - } else { - return 1; - } -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/189 partial dependency/declare_dependency/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/189 partial dependency/declare_dependency/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/189 partial dependency/declare_dependency/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/189 partial dependency/declare_dependency/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -# Copyright © 2018 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -dec_dep = declare_dependency( - sources : files('headers/foo.c'), - include_directories : include_directories('headers'), -) - -sub_dep = dec_dep.partial_dependency(includes : true) - -dec_exe = executable( - 'declare_dep', - files('main.c', 'other.c'), - dependencies : sub_dep, -) - -test('Declare Dependency', dec_exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/189 partial dependency/declare_dependency/other.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/189 partial dependency/declare_dependency/other.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/189 partial dependency/declare_dependency/other.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/189 partial dependency/declare_dependency/other.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -/* Copyright © 2018 Intel Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "foo.h" - -int foo(void) { - return 1; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/189 partial dependency/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/189 partial dependency/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/189 partial dependency/meson.build" 2018-12-09 16:32:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/189 partial dependency/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -# Copyright © 2018 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -project('partial dependency', ['c', 'cpp']) - -subdir('declare_dependency') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/190 openmp/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/190 openmp/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/190 openmp/main.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/190 openmp/main.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -#include -#include - -int main(void) { -#ifdef _OPENMP - if (omp_get_max_threads() == 2) { - return 0; - } else { - printf("Max threads is %d not 2.\n", omp_get_max_threads()); - return 1; - } -#else - printf("_OPENMP is not defined; is OpenMP compilation working?\n"); - return 1; -#endif -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/190 openmp/main.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/190 openmp/main.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/190 openmp/main.cpp" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/190 openmp/main.cpp" 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -#include -#include - -int main(void) { -#ifdef _OPENMP - if (omp_get_max_threads() == 2) { - return 0; - } else { - std::cout << "Max threads is " << omp_get_max_threads() << " not 2." << std::endl; - return 1; - } -#else - printf("_OPENMP is not defined; is OpenMP compilation working?\n"); - return 1; -#endif -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/190 openmp/main.f90" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/190 openmp/main.f90" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/190 openmp/main.f90" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/190 openmp/main.f90" 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -program main - if (omp_get_max_threads() .eq. 2) then - stop 0 - else - print *, 'Max threads is', omp_get_max_threads(), 'not 2.' - stop 1 - endif -end program main diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/190 openmp/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/190 openmp/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/190 openmp/meson.build" 2018-12-09 16:32:03.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/190 openmp/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -project('openmp', 'c', 'cpp') - -cc = meson.get_compiler('c') -if cc.get_id() == 'gcc' and cc.version().version_compare('<4.2.0') - error('MESON_SKIP_TEST gcc is too old to support OpenMP.') -endif -if cc.get_id() == 'clang' and cc.version().version_compare('<3.7.0') - error('MESON_SKIP_TEST clang is too old to support OpenMP.') -endif -if cc.get_id() == 'msvc' and cc.version().version_compare('<17') - error('MESON_SKIP_TEST msvc is too old to support OpenMP.') -endif -if cc.get_id() == 'clang-cl' - error('MESON_SKIP_TEST clang-cl does not support OpenMP.') -endif -if host_machine.system() == 'darwin' - error('MESON_SKIP_TEST macOS does not support OpenMP.') -endif - -openmp = dependency('openmp') - -exec = executable('exec', - 'main.c', - dependencies : [openmp]) - -execpp = executable('execpp', - 'main.cpp', - dependencies : [openmp]) - -env = environment() -env.set('OMP_NUM_THREADS', '2') - -test('OpenMP C', exec, env : env) -test('OpenMP C++', execpp, env : env) - - -if add_languages('fortran', required : false) - exef = executable('exef', - 'main.f90', - dependencies : [openmp]) - - test('OpenMP Fortran', execpp, env : env) -endif - -# Check we can apply a version constraint -dependency('openmp', version: '>=@0@'.format(openmp.version())) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/190 same target name/file.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/190 same target name/file.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/190 same target name/file.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/190 same target name/file.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,3 @@ +int func() { + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/190 same target name/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/190 same target name/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/190 same target name/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/190 same target name/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,4 @@ +project('same name', 'c') + +static_library('foo', 'file.c') +subdir('sub') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/190 same target name/sub/file2.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/190 same target name/sub/file2.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/190 same target name/sub/file2.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/190 same target name/sub/file2.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,3 @@ +int func() { + return 5; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/190 same target name/sub/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/190 same target name/sub/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/190 same target name/sub/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/190 same target name/sub/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +static_library('foo', 'file2.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/191 same target name/file.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/191 same target name/file.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/191 same target name/file.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/191 same target name/file.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -int func() { - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/191 same target name/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/191 same target name/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/191 same target name/meson.build" 2018-12-09 16:32:03.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/191 same target name/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -project('same name', 'c') - -static_library('foo', 'file.c') -subdir('sub') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/191 same target name/sub/file2.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/191 same target name/sub/file2.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/191 same target name/sub/file2.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/191 same target name/sub/file2.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -int func() { - return 5; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/191 same target name/sub/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/191 same target name/sub/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/191 same target name/sub/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/191 same target name/sub/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -static_library('foo', 'file2.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/191 test depends/gen.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/191 test depends/gen.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/191 test depends/gen.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/191 test depends/gen.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 + +import sys + + +def main(): + with open(sys.argv[1], 'w') as out: + out.write(sys.argv[2]) + out.write('\n') + + +if __name__ == '__main__': + main() diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/191 test depends/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/191 test depends/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/191 test depends/main.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/191 test depends/main.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +int main(void) { return 0; } diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/191 test depends/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/191 test depends/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/191 test depends/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/191 test depends/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,26 @@ +project('test depends', 'c') + +gen = find_program('gen.py') + +custom_dep = custom_target('custom_dep', + build_by_default : false, + output : 'custom_dep.txt', + command : [gen, '@OUTPUT@', 'custom_dep'], +) + +exe_dep = executable('exe_dep', 'main.c', + build_by_default : false, +) + +test_prog = find_program('test.py') +test('string dependencies', test_prog, + args : [ + # This is declared for convenience, + # real use case might have some obscure method + # to find these dependencies, e.g. automatic plugin loading. + 'custom_dep.txt', + exe_dep.full_path(), + ], + depends : [custom_dep, exe_dep], + workdir : meson.current_build_dir(), +) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/191 test depends/test.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/191 test depends/test.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/191 test depends/test.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/191 test depends/test.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,20 @@ +#!/usr/bin/env python3 + +import os +import os.path +import sys + + +def main(): + print('Looking in:', os.getcwd()) + not_found = list() + for f in sys.argv[1:]: + if not os.path.exists(f): + not_found.append(f) + if not_found: + print('Not found:', ', '.join(not_found)) + sys.exit(1) + + +if __name__ == '__main__': + main() diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/192 args flattening/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/192 args flattening/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/192 args flattening/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/192 args flattening/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,29 @@ +project('args flattening') + +arr = get_variable('does-not-exist', ['bar', 'baz']) + +assert(arr == ['bar', 'baz'], 'get_variable with array fallback is broken') + +set_variable('arr', ['bar', 'baz']) + +assert(arr == ['bar', 'baz'], 'set_variable(array) is broken') + +conf = configuration_data() + +conf.set('foo', ['bar', 'baz']) + +assert(conf.get('foo') == ['bar', 'baz'], 'configuration_data.set(array) is broken') + +arr = conf.get('does-not-exist', ['bar', 'baz']) + +assert(arr == ['bar', 'baz'], 'configuration_data.get with array fallback is broken') + +arr = meson.get_cross_property('does-not-exist', ['bar', 'baz']) + +assert(arr == ['bar', 'baz'], 'meson.get_cross_property with array fallback is broken') + +# Test deprecated behaviour + +conf.set(['foo', 'bar']) + +message(conf.get('foo')) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/192 test depends/gen.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/192 test depends/gen.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/192 test depends/gen.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/192 test depends/gen.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -#!/usr/bin/env python3 - -import sys - - -def main(): - with open(sys.argv[1], 'w') as out: - out.write(sys.argv[2]) - out.write('\n') - - -if __name__ == '__main__': - main() diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/192 test depends/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/192 test depends/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/192 test depends/main.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/192 test depends/main.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -int main(void) { return 0; } diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/192 test depends/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/192 test depends/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/192 test depends/meson.build" 2018-12-09 16:32:04.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/192 test depends/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -project('test depends', 'c') - -gen = find_program('gen.py') - -custom_dep = custom_target('custom_dep', - build_by_default : false, - output : 'custom_dep.txt', - command : [gen, '@OUTPUT@', 'custom_dep'], -) - -exe_dep = executable('exe_dep', 'main.c', - build_by_default : false, -) - -test_prog = find_program('test.py') -test('string dependencies', test_prog, - args : [ - # This is declared for convenience, - # real use case might have some obscure method - # to find these dependencies, e.g. automatic plugin loading. - 'custom_dep.txt', - exe_dep.full_path(), - ], - depends : [custom_dep, exe_dep], - workdir : meson.current_build_dir(), -) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/192 test depends/test.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/192 test depends/test.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/192 test depends/test.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/192 test depends/test.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 - -import os -import os.path -import sys - - -def main(): - print('Looking in:', os.getcwd()) - not_found = list() - for f in sys.argv[1:]: - if not os.path.exists(f): - not_found.append(f) - if not_found: - print('Not found:', ', '.join(not_found)) - sys.exit(1) - - -if __name__ == '__main__': - main() diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/193 args flattening/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/193 args flattening/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/193 args flattening/meson.build" 2018-12-09 16:32:05.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/193 args flattening/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -project('args flattening') - -arr = get_variable('does-not-exist', ['bar', 'baz']) - -assert(arr == ['bar', 'baz'], 'get_variable with array fallback is broken') - -set_variable('arr', ['bar', 'baz']) - -assert(arr == ['bar', 'baz'], 'set_variable(array) is broken') - -conf = configuration_data() - -conf.set('foo', ['bar', 'baz']) - -assert(conf.get('foo') == ['bar', 'baz'], 'configuration_data.set(array) is broken') - -arr = conf.get('does-not-exist', ['bar', 'baz']) - -assert(arr == ['bar', 'baz'], 'configuration_data.get with array fallback is broken') - -arr = meson.get_cross_property('does-not-exist', ['bar', 'baz']) - -assert(arr == ['bar', 'baz'], 'meson.get_cross_property with array fallback is broken') - -# Test deprecated behaviour - -conf.set(['foo', 'bar']) - -message(conf.get('foo')) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/193 dict/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/193 dict/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/193 dict/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/193 dict/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,35 @@ +project('dict test', 'c') + +dict = {'foo' : 'bar', + 'baz' : 'foo', + 'foo bar': 'baz'} + +exe = executable('prog', sources : ['prog.c']) + +i = 0 + +foreach key, value : dict + test('dict test @0@'.format(key), exe, + args : [dict[key], value]) + i += 1 +endforeach + +assert(i == 3, 'There should be three elements in that dictionary') + +empty_dict = {} + +foreach key, value : empty_dict + assert(false, 'This dict should be empty') +endforeach + +d1 = empty_dict + {'a' : 'b'} +assert(d1 == {'a' : 'b'}, 'dict addition is not working') + +d2 = d1 + {'a' : 'b2', 'c' : 'd'} +assert(d2 == {'a' : 'b2', 'c' : 'd'}, 'dict addition is not working') +assert(d1 == {'a' : 'b'}, 'dict should be immutable') + +d3 = d2 +d3 += {'e' : 'f'} +assert(d3 == {'a' : 'b2', 'c' : 'd', 'e' : 'f'}, 'dict plusassign is not working') +assert(d2 == {'a' : 'b2', 'c' : 'd'}, 'dict should be immutable') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/193 dict/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/193 dict/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/193 dict/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/193 dict/prog.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,8 @@ +#include + +int main(int argc, char **argv) { + if (argc != 3) + return 1; + + return strcmp(argv[1], argv[2]); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/194 check header/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/194 check header/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/194 check header/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/194 check header/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,48 @@ +project('check header', 'c', 'cpp') + +host_system = host_machine.system() + +non_existant_header = 'ouagadougou.h' + +# Copy it into the builddir to ensure that it isn't found even if it's there +configure_file(input : non_existant_header, + output : non_existant_header, + copy: true) + +fallback = '' + +foreach comp : [meson.get_compiler('c'), meson.get_compiler('cpp')] + assert(comp.check_header('stdio.h', prefix : fallback), 'Stdio missing.') + + # stdio.h doesn't actually need stdlib.h, but just test that setting the + # prefix does not result in an error. + assert(comp.check_header('stdio.h', prefix : '#include ' + fallback), + 'Stdio missing.') + + # Test that check_header behaves differently than has_header. The second + # check without windows.h will fail with check_header. + # We only do this check on MSVC because MinGW often defines its own wrappers + # that pre-include windows.h + if comp.get_id() == 'msvc' + assert(comp.check_header('XInput.h', prefix : '#include ' + fallback), + 'XInput.h should not be missing on Windows') + assert(not comp.check_header('XInput.h'), 'XInput.h needs windows.h') + endif + + # Test that the following GCC bug doesn't happen: + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80005 + # https://github.com/mesonbuild/meson/issues/1458 + if host_system == 'linux' + assert(comp.check_header('linux/socket.h', prefix : fallback), + 'Could not find ') + if comp.has_header('intrin.h', prefix : fallback) + assert(not comp.check_header('intrin.h'), + 'intrin.h should not be usable on linux') + endif + endif + + # This header exists in the source and the builddir, but we still must not + # find it since we are looking in the system directories. + assert(not comp.check_header(non_existant_header, prefix : fallback), + 'Found non-existant header.') +endforeach diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/194 check header/ouagadougou.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/194 check header/ouagadougou.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/194 check header/ouagadougou.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/194 check header/ouagadougou.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +#define OMG_THIS_SHOULDNT_BE_FOUND diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/194 dict/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/194 dict/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/194 dict/meson.build" 2018-12-09 16:32:06.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/194 dict/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -project('dict test', 'c') - -dict = {'foo' : 'bar', - 'baz' : 'foo', - 'foo bar': 'baz'} - -exe = executable('prog', sources : ['prog.c']) - -i = 0 - -foreach key, value : dict - test('dict test @0@'.format(key), exe, - args : [dict[key], value]) - i += 1 -endforeach - -assert(i == 3, 'There should be three elements in that dictionary') - -empty_dict = {} - -foreach key, value : empty_dict - assert(false, 'This dict should be empty') -endforeach - -d1 = empty_dict + {'a' : 'b'} -assert(d1 == {'a' : 'b'}, 'dict addition is not working') - -d2 = d1 + {'a' : 'b2', 'c' : 'd'} -assert(d2 == {'a' : 'b2', 'c' : 'd'}, 'dict addition is not working') -assert(d1 == {'a' : 'b'}, 'dict should be immutable') - -d3 = d2 -d3 += {'e' : 'f'} -assert(d3 == {'a' : 'b2', 'c' : 'd', 'e' : 'f'}, 'dict plusassign is not working') -assert(d2 == {'a' : 'b2', 'c' : 'd'}, 'dict should be immutable') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/194 dict/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/194 dict/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/194 dict/prog.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/194 dict/prog.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -#include - -int main(int argc, char **argv) { - if (argc != 3) - return 1; - - return strcmp(argv[1], argv[2]); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/195 check header/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/195 check header/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/195 check header/meson.build" 2018-12-09 16:32:07.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/195 check header/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,48 +0,0 @@ -project('check header', 'c', 'cpp') - -host_system = host_machine.system() - -non_existant_header = 'ouagadougou.h' - -# Copy it into the builddir to ensure that it isn't found even if it's there -configure_file(input : non_existant_header, - output : non_existant_header, - copy: true) - -fallback = '' - -foreach comp : [meson.get_compiler('c'), meson.get_compiler('cpp')] - assert(comp.check_header('stdio.h', prefix : fallback), 'Stdio missing.') - - # stdio.h doesn't actually need stdlib.h, but just test that setting the - # prefix does not result in an error. - assert(comp.check_header('stdio.h', prefix : '#include ' + fallback), - 'Stdio missing.') - - # Test that check_header behaves differently than has_header. The second - # check without windows.h will fail with check_header. - # We only do this check on MSVC because MinGW often defines its own wrappers - # that pre-include windows.h - if comp.get_id() == 'msvc' - assert(comp.check_header('XInput.h', prefix : '#include ' + fallback), - 'XInput.h should not be missing on Windows') - assert(not comp.check_header('XInput.h'), 'XInput.h needs windows.h') - endif - - # Test that the following GCC bug doesn't happen: - # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80005 - # https://github.com/mesonbuild/meson/issues/1458 - if host_system == 'linux' - assert(comp.check_header('linux/socket.h', prefix : fallback), - 'Could not find ') - if comp.has_header('intrin.h', prefix : fallback) - assert(not comp.check_header('intrin.h'), - 'intrin.h should not be usable on linux') - endif - endif - - # This header exists in the source and the builddir, but we still must not - # find it since we are looking in the system directories. - assert(not comp.check_header(non_existant_header, prefix : fallback), - 'Found non-existant header.') -endforeach diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/195 check header/ouagadougou.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/195 check header/ouagadougou.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/195 check header/ouagadougou.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/195 check header/ouagadougou.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#define OMG_THIS_SHOULDNT_BE_FOUND diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/195 install_mode/config.h.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/195 install_mode/config.h.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/195 install_mode/config.h.in" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/195 install_mode/config.h.in" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +#define MESSAGE "@var@" +#define OTHER "@other@" "@second@" "@empty@" + +#mesondefine BE_TRUE +#mesondefine SHOULD_BE_UNDEF diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/195 install_mode/data_source.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/195 install_mode/data_source.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/195 install_mode/data_source.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/195 install_mode/data_source.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +This is a text only input file. diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/195 install_mode/foo.1" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/195 install_mode/foo.1" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/195 install_mode/foo.1" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/195 install_mode/foo.1" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +this is a man page of foo.1 its contents are irrelevant diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/195 install_mode/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/195 install_mode/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/195 install_mode/installed_files.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/195 install_mode/installed_files.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,10 @@ +usr/bin/runscript.sh +usr/bin/trivialprog?exe +?msvc:usr/bin/trivialprog.pdb +usr/include/config.h +usr/include/rootdir.h +usr/libtest/libstat.a +usr/share/man/man1/foo.1 +usr/share/sub1/second.dat +usr/share/sub2/stub +usr/subdir/data.dat diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/195 install_mode/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/195 install_mode/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/195 install_mode/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/195 install_mode/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,59 @@ +project('install_mode test', 'c', + default_options : ['install_umask=027', 'libdir=libtest']) + +if build_machine.system() == 'windows' + error('MESON_SKIP_TEST: install_mode test requires a Unix-like OS') +endif + +# confirm no regressions in install_data +install_data('runscript.sh', + install_dir : get_option('bindir'), + install_mode : ['rwxr-sr-x', 'root', 0]) + +# confirm no regressions in install_subdir +install_subdir('sub1', + install_dir : 'share', + install_mode : ['rwxr-x--t', 'root']) + +install_subdir('sub2', + install_dir : 'share') + +# test install_mode in configure_file +conf = configuration_data() +conf.set('var', 'mystring') +conf.set('other', 'string 2') +conf.set('second', ' bonus') +conf.set('BE_TRUE', true) +configure_file(input : 'config.h.in', + output : 'config.h', + configuration : conf, + install_dir : 'include', + install_mode : 'rw-rwSr--') + +# test install_mode in custom_target +custom_target('bindat', + output : 'data.dat', + input : 'data_source.txt', + command : ['cp', '@INPUT@', '@OUTPUT@'], + install : true, + install_dir : 'subdir', + install_mode : 'rw-rwSr--') + +# test install_mode in install_headers +install_headers('rootdir.h', + install_mode : 'r--r--r-T') + +# test install_mode in install_man +install_man('foo.1', + install_mode : 'r--r--r-T') + +# test install_mode in executable +executable('trivialprog', + sources : 'trivial.c', + install : true, + install_mode : ['rwxr-sr-x', 'root', 'root']) + +# test install_mode in static_library +static_library('stat', 'stat.c', + install : true, + install_mode : ['rw---Sr--']) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/195 install_mode/rootdir.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/195 install_mode/rootdir.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/195 install_mode/rootdir.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/195 install_mode/rootdir.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +/* This header goes to include dir root. */ + +int root_func(); diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/195 install_mode/runscript.sh" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/195 install_mode/runscript.sh" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/195 install_mode/runscript.sh" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/195 install_mode/runscript.sh" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "Runscript" diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/195 install_mode/stat.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/195 install_mode/stat.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/195 install_mode/stat.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/195 install_mode/stat.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1 @@ +int func() { return 933; } diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/195 install_mode/sub1/second.dat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/195 install_mode/sub1/second.dat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/195 install_mode/sub1/second.dat" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/195 install_mode/sub1/second.dat" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +Test that multiple install_subdirs meld their results. \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/195 install_mode/trivial.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/195 install_mode/trivial.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/195 install_mode/trivial.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/195 install_mode/trivial.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,6 @@ +#include + +int main(int argc, char **argv) { + printf("Trivial test is working.\n"); + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/196 install_mode/config.h.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/196 install_mode/config.h.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/196 install_mode/config.h.in" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/196 install_mode/config.h.in" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#define MESSAGE "@var@" -#define OTHER "@other@" "@second@" "@empty@" - -#mesondefine BE_TRUE -#mesondefine SHOULD_BE_UNDEF diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/196 install_mode/data_source.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/196 install_mode/data_source.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/196 install_mode/data_source.txt" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/196 install_mode/data_source.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -This is a text only input file. diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/196 install_mode/foo.1" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/196 install_mode/foo.1" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/196 install_mode/foo.1" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/196 install_mode/foo.1" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -this is a man page of foo.1 its contents are irrelevant diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/196 install_mode/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/196 install_mode/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/196 install_mode/installed_files.txt" 2018-12-09 14:27:16.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/196 install_mode/installed_files.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -usr/bin/runscript.sh -usr/bin/trivialprog?exe -?msvc:usr/bin/trivialprog.pdb -usr/include/config.h -usr/include/rootdir.h -usr/libtest/libstat.a -usr/share/man/man1/foo.1 -usr/share/sub1/second.dat -usr/share/sub2/stub -usr/subdir/data.dat diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/196 install_mode/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/196 install_mode/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/196 install_mode/meson.build" 2018-12-09 16:32:08.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/196 install_mode/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,55 +0,0 @@ -project('install_mode test', 'c', - default_options : ['install_umask=027', 'libdir=libtest']) - -# confirm no regressions in install_data -install_data('runscript.sh', - install_dir : get_option('bindir'), - install_mode : ['rwxr-sr-x', 'root', 0]) - -# confirm no regressions in install_subdir -install_subdir('sub1', - install_dir : 'share', - install_mode : ['rwxr-x--t', 'root']) - -install_subdir('sub2', - install_dir : 'share') - -# test install_mode in configure_file -conf = configuration_data() -conf.set('var', 'mystring') -conf.set('other', 'string 2') -conf.set('second', ' bonus') -conf.set('BE_TRUE', true) -configure_file(input : 'config.h.in', - output : 'config.h', - configuration : conf, - install_dir : 'include', - install_mode : 'rw-rwSr--') - -# test install_mode in custom_target -custom_target('bindat', - output : 'data.dat', - input : 'data_source.txt', - command : ['cp', '@INPUT@', '@OUTPUT@'], - install : true, - install_dir : 'subdir', - install_mode : 'rw-rwSr--') - -# test install_mode in install_headers -install_headers('rootdir.h', - install_mode : 'r--r--r-T') - -# test install_mode in install_man -install_man('foo.1', - install_mode : 'r--r--r-T') - -# test install_mode in executable -executable('trivialprog', - sources : 'trivial.c', - install : true, - install_mode : ['rwxr-sr-x', 'root', 'root']) - -# test install_mode in static_library -static_library('stat', 'stat.c', - install : true, - install_mode : ['rw---Sr--']) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/196 install_mode/rootdir.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/196 install_mode/rootdir.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/196 install_mode/rootdir.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/196 install_mode/rootdir.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -/* This header goes to include dir root. */ - -int root_func(); diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/196 install_mode/runscript.sh" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/196 install_mode/runscript.sh" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/196 install_mode/runscript.sh" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/196 install_mode/runscript.sh" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -#!/bin/sh - -echo "Runscript" diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/196 install_mode/stat.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/196 install_mode/stat.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/196 install_mode/stat.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/196 install_mode/stat.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -int func() { return 933; } diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/196 install_mode/sub1/second.dat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/196 install_mode/sub1/second.dat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/196 install_mode/sub1/second.dat" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/196 install_mode/sub1/second.dat" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Test that multiple install_subdirs meld their results. \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/196 install_mode/trivial.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/196 install_mode/trivial.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/196 install_mode/trivial.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/196 install_mode/trivial.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#include - -int main(int argc, char **argv) { - printf("Trivial test is working.\n"); - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/196 subproject array version/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/196 subproject array version/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/196 subproject array version/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/196 subproject array version/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +project('master', 'c') + +x = subproject('foo', version : ['>=1.0.0', '<2.0']) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/196 subproject array version/subprojects/foo/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/196 subproject array version/subprojects/foo/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/196 subproject array version/subprojects/foo/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/196 subproject array version/subprojects/foo/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +project('foo', 'c', version : '1.0.0') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/197 feature option/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/197 feature option/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/197 feature option/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/197 feature option/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,47 @@ +project('feature user option', 'c') + +feature_opts = get_option('auto_features') +required_opt = get_option('required') +optional_opt = get_option('optional') +disabled_opt = get_option('disabled') + +assert(not feature_opts.enabled(), 'Should be auto option') +assert(not feature_opts.disabled(), 'Should be auto option') +assert(feature_opts.auto(), 'Should be auto option') + +assert(required_opt.enabled(), 'Should be enabled option') +assert(not required_opt.disabled(), 'Should be enabled option') +assert(not required_opt.auto(), 'Should be enabled option') + +assert(not optional_opt.enabled(), 'Should be auto option') +assert(not optional_opt.disabled(), 'Should be auto option') +assert(optional_opt.auto(), 'Should be auto option') + +assert(not disabled_opt.enabled(), 'Should be disabled option') +assert(disabled_opt.disabled(), 'Should be disabled option') +assert(not disabled_opt.auto(), 'Should be disabled option') + +dep = dependency('threads', required : required_opt) +assert(dep.found(), 'Should find required "threads" dep') + +dep = dependency('threads', required : optional_opt) +assert(dep.found(), 'Should find optional "threads" dep') + +dep = dependency('threads', required : disabled_opt) +assert(not dep.found(), 'Should not find disabled "threads" dep') + +dep = dependency('notfounddep', required : optional_opt) +assert(not dep.found(), 'Should not find optional "notfounddep" dep') + +dep = dependency('notfounddep', required : disabled_opt) +assert(not dep.found(), 'Should not find disabled "notfounddep" dep') + +cc = meson.get_compiler('c') +lib = cc.find_library('m', required : disabled_opt) +assert(not lib.found(), 'Should not find "m" library') + +cp = find_program('cp', required : disabled_opt) +assert(not cp.found(), 'Should not find "cp" program') + +found = add_languages('cpp', required : disabled_opt) +assert(not found, 'Should not find "cpp" language') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/197 feature option/meson_options.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/197 feature option/meson_options.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/197 feature option/meson_options.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/197 feature option/meson_options.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +option('required', type : 'feature', value : 'enabled', description : 'An required feature') +option('optional', type : 'feature', value : 'auto', description : 'An optional feature') +option('disabled', type : 'feature', value : 'disabled', description : 'A disabled feature') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/197 subproject array version/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/197 subproject array version/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/197 subproject array version/meson.build" 2018-12-09 16:32:08.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/197 subproject array version/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -project('master', 'c') - -x = subproject('foo', version : ['>=1.0.0', '<2.0']) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/197 subproject array version/subprojects/foo/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/197 subproject array version/subprojects/foo/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/197 subproject array version/subprojects/foo/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/197 subproject array version/subprojects/foo/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -project('foo', 'c', version : '1.0.0') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/198 feature option/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/198 feature option/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/198 feature option/meson.build" 2018-12-09 16:32:10.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/198 feature option/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ -project('feature user option', 'c') - -feature_opts = get_option('auto_features') -required_opt = get_option('required') -optional_opt = get_option('optional') -disabled_opt = get_option('disabled') - -assert(not feature_opts.enabled(), 'Should be auto option') -assert(not feature_opts.disabled(), 'Should be auto option') -assert(feature_opts.auto(), 'Should be auto option') - -assert(required_opt.enabled(), 'Should be enabled option') -assert(not required_opt.disabled(), 'Should be enabled option') -assert(not required_opt.auto(), 'Should be enabled option') - -assert(not optional_opt.enabled(), 'Should be auto option') -assert(not optional_opt.disabled(), 'Should be auto option') -assert(optional_opt.auto(), 'Should be auto option') - -assert(not disabled_opt.enabled(), 'Should be disabled option') -assert(disabled_opt.disabled(), 'Should be disabled option') -assert(not disabled_opt.auto(), 'Should be disabled option') - -dep = dependency('threads', required : required_opt) -assert(dep.found(), 'Should find required "threads" dep') - -dep = dependency('threads', required : optional_opt) -assert(dep.found(), 'Should find optional "threads" dep') - -dep = dependency('threads', required : disabled_opt) -assert(not dep.found(), 'Should not find disabled "threads" dep') - -dep = dependency('notfounddep', required : optional_opt) -assert(not dep.found(), 'Should not find optional "notfounddep" dep') - -dep = dependency('notfounddep', required : disabled_opt) -assert(not dep.found(), 'Should not find disabled "notfounddep" dep') - -cc = meson.get_compiler('c') -lib = cc.find_library('m', required : disabled_opt) -assert(not lib.found(), 'Should not find "m" library') - -cp = find_program('cp', required : disabled_opt) -assert(not cp.found(), 'Should not find "cp" program') - -found = add_languages('cpp', required : disabled_opt) -assert(not found, 'Should not find "cpp" language') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/198 feature option/meson_options.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/198 feature option/meson_options.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/198 feature option/meson_options.txt" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/198 feature option/meson_options.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -option('required', type : 'feature', value : 'enabled', description : 'An required feature') -option('optional', type : 'feature', value : 'auto', description : 'An optional feature') -option('disabled', type : 'feature', value : 'disabled', description : 'A disabled feature') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/198 feature option disabled/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/198 feature option disabled/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/198 feature option disabled/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/198 feature option disabled/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,23 @@ +project('feature user option', 'c', + default_options : ['auto_features=disabled']) + +feature_opts = get_option('auto_features') +required_opt = get_option('required') +optional_opt = get_option('optional') +disabled_opt = get_option('disabled') + +assert(not feature_opts.enabled(), 'Should be disabled option') +assert(feature_opts.disabled(), 'Should be disabled option') +assert(not feature_opts.auto(), 'Should be disabled option') + +assert(required_opt.enabled(), 'Should be enabled option') +assert(not required_opt.disabled(), 'Should be enabled option') +assert(not required_opt.auto(), 'Should be enabled option') + +assert(not optional_opt.enabled(), 'Auto feature should be disabled') +assert(optional_opt.disabled(), 'Auto feature should be disabled') +assert(not optional_opt.auto(), 'Auto feature should be disabled') + +assert(not disabled_opt.enabled(), 'Should be disabled option') +assert(disabled_opt.disabled(), 'Should be disabled option') +assert(not disabled_opt.auto(), 'Should be disabled option') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/198 feature option disabled/meson_options.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/198 feature option disabled/meson_options.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/198 feature option disabled/meson_options.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/198 feature option disabled/meson_options.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +option('required', type : 'feature', value : 'enabled', description : 'An required feature') +option('optional', type : 'feature', value : 'auto', description : 'An optional feature') +option('disabled', type : 'feature', value : 'disabled', description : 'A disabled feature') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/199 feature option disabled/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/199 feature option disabled/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/199 feature option disabled/meson.build" 2018-12-09 16:32:11.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/199 feature option disabled/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -project('feature user option', 'c', - default_options : ['auto_features=disabled']) - -feature_opts = get_option('auto_features') -required_opt = get_option('required') -optional_opt = get_option('optional') -disabled_opt = get_option('disabled') - -assert(not feature_opts.enabled(), 'Should be disabled option') -assert(feature_opts.disabled(), 'Should be disabled option') -assert(not feature_opts.auto(), 'Should be disabled option') - -assert(required_opt.enabled(), 'Should be enabled option') -assert(not required_opt.disabled(), 'Should be enabled option') -assert(not required_opt.auto(), 'Should be enabled option') - -assert(not optional_opt.enabled(), 'Auto feature should be disabled') -assert(optional_opt.disabled(), 'Auto feature should be disabled') -assert(not optional_opt.auto(), 'Auto feature should be disabled') - -assert(not disabled_opt.enabled(), 'Should be disabled option') -assert(disabled_opt.disabled(), 'Should be disabled option') -assert(not disabled_opt.auto(), 'Should be disabled option') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/199 feature option disabled/meson_options.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/199 feature option disabled/meson_options.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/199 feature option disabled/meson_options.txt" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/199 feature option disabled/meson_options.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -option('required', type : 'feature', value : 'enabled', description : 'An required feature') -option('optional', type : 'feature', value : 'auto', description : 'An optional feature') -option('disabled', type : 'feature', value : 'disabled', description : 'A disabled feature') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/199 static threads/lib1.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/199 static threads/lib1.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/199 static threads/lib1.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/199 static threads/lib1.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,13 @@ +#if defined _WIN32 +#include +#else +#include +#endif + +void *f(void) { +#if defined _WIN32 + return CreateThread; +#else + return pthread_create; +#endif +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/199 static threads/lib2.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/199 static threads/lib2.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/199 static threads/lib2.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/199 static threads/lib2.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +extern void *f(void); + +void *g(void) { + return f(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/199 static threads/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/199 static threads/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/199 static threads/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/199 static threads/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,13 @@ +project('threads', 'c') + +thread_dep = dependency('threads') + + +lib1 = static_library('lib1', 'lib1.c', + dependencies : thread_dep) + +lib2 = static_library('lib2', 'lib2.c', + link_with : lib1) + +executable('prog', 'prog.c', + link_with : lib2) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/199 static threads/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/199 static threads/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/199 static threads/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/199 static threads/prog.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,6 @@ +extern void *g(void); + +int main(void) { + g(); + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/19 includedir/src/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/19 includedir/src/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/19 includedir/src/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/19 includedir/src/meson.build" 2019-02-07 09:08:55.000000000 +0000 @@ -1,2 +1,5 @@ exe = executable('prog', 'prog.c', 'func.c', include_directories : inc) test('inc test', exe) + +exe2 = executable('prog2', 'prog.c', 'func.c', include_directories : [['../include']]) +test('inc test 2', exe2) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/1 trivial/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/1 trivial/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/1 trivial/meson.build" 2018-12-09 16:28:45.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/1 trivial/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -6,9 +6,12 @@ #this is a comment sources = 'trivial.c' -if meson.get_compiler('c').get_id() == 'intel' +cc = meson.get_compiler('c') +if cc.get_id() == 'intel' # Error out if the -std=xxx option is incorrect add_project_arguments('-diag-error', '10159', language : 'c') +elif cc.get_id() == 'intel-cl' + add_project_arguments('/Qdiag-error:10159', language : 'c') endif if meson.is_cross_build() @@ -19,3 +22,13 @@ exe = executable('trivialprog', sources : sources) test('runtest', exe) # This is a comment + +has_not_changed = false +if is_disabler(exe) + has_not_changed = true +else + has_not_changed = true +endif +assert(has_not_changed, 'Executable has changed.') + +assert(not is_disabler(exe), 'Executable is a disabler.') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/200 generator in subdir/com/mesonbuild/genprog.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/200 generator in subdir/com/mesonbuild/genprog.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/200 generator in subdir/com/mesonbuild/genprog.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/200 generator in subdir/com/mesonbuild/genprog.py" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,46 @@ +#!/usr/bin/env python3 + +import os, sys, argparse + +h_templ = '''#pragma once + +int %s(); +''' + +c_templ = '''#include"%s.h" + +int %s() { + return 0; +} +''' + +parser = argparse.ArgumentParser() +parser.add_argument('--searchdir', required=True) +parser.add_argument('--outdir', required=True) +parser.add_argument('ifiles', nargs='+') + +options = parser.parse_args() + +searchdir = options.searchdir +outdir = options.outdir +ifiles = options.ifiles + +rel_ofiles = [] + +for ifile in ifiles: + if not ifile.startswith(options.searchdir): + sys.exit('Input file %s does not start with search dir %s.' % (ifile, searchdir)) + rel_ofile = ifile[len(searchdir):] + if rel_ofile[0] == '/' or rel_ofile[0] == '\\': + rel_ofile = rel_ofile[1:] + rel_ofiles.append(os.path.splitext(rel_ofile)[0]) + +ofile_bases = [os.path.join(outdir, i) for i in rel_ofiles] + +for i, ifile_name in enumerate(ifiles): + proto_name = open(ifile_name).readline().strip() + h_out = ofile_bases[i] + '.h' + c_out = ofile_bases[i] + '.c' + os.makedirs(os.path.split(ofile_bases[i])[0], exist_ok=True) + open(h_out, 'w').write(h_templ % (proto_name)) + open(c_out, 'w').write(c_templ % (proto_name, proto_name)) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/200 generator in subdir/com/mesonbuild/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/200 generator in subdir/com/mesonbuild/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/200 generator in subdir/com/mesonbuild/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/200 generator in subdir/com/mesonbuild/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,10 @@ +gprog = find_program('genprog.py') + +gen = generator(gprog, \ + output : ['@BASENAME@.c', '@BASENAME@.h'], + arguments : ['--searchdir=@CURRENT_SOURCE_DIR@', '--outdir=@BUILD_DIR@', '@INPUT@']) + +generated = gen.process('subbie.inp') + +e = executable('testprog', 'testprog.c', generated) +test('testprog', e) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/200 generator in subdir/com/mesonbuild/subbie.inp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/200 generator in subdir/com/mesonbuild/subbie.inp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/200 generator in subdir/com/mesonbuild/subbie.inp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/200 generator in subdir/com/mesonbuild/subbie.inp" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +subbie diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/200 generator in subdir/com/mesonbuild/testprog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/200 generator in subdir/com/mesonbuild/testprog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/200 generator in subdir/com/mesonbuild/testprog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/200 generator in subdir/com/mesonbuild/testprog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +#include"subbie.h" + +int main(int argc, char **argv) { + return subbie(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/200 generator in subdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/200 generator in subdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/200 generator in subdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/200 generator in subdir/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +project('generator in subdir', 'c') + +subdir('com/mesonbuild') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/200 static threads/lib1.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/200 static threads/lib1.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/200 static threads/lib1.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/200 static threads/lib1.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -#if defined _WIN32 -#include -#else -#include -#endif - -void *f(void) { -#if defined _WIN32 - return CreateThread; -#else - return pthread_create; -#endif -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/200 static threads/lib2.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/200 static threads/lib2.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/200 static threads/lib2.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/200 static threads/lib2.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -extern void *f(void); - -void *g(void) { - return f(); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/200 static threads/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/200 static threads/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/200 static threads/meson.build" 2018-12-09 16:32:12.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/200 static threads/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -project('threads', 'c') - -thread_dep = dependency('threads') - - -lib1 = static_library('lib1', 'lib1.c', - dependencies : thread_dep) - -lib2 = static_library('lib2', 'lib2.c', - link_with : lib1) - -executable('prog', 'prog.c', - link_with : lib2) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/200 static threads/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/200 static threads/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/200 static threads/prog.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/200 static threads/prog.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -extern void *g(void); - -int main(void) { - g(); - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/201 generator in subdir/com/mesonbuild/genprog.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/201 generator in subdir/com/mesonbuild/genprog.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/201 generator in subdir/com/mesonbuild/genprog.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/201 generator in subdir/com/mesonbuild/genprog.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -#!/usr/bin/env python3 - -import os, sys, argparse - -h_templ = '''#pragma once - -int %s(); -''' - -c_templ = '''#include"%s.h" - -int %s() { - return 0; -} -''' - -parser = argparse.ArgumentParser() -parser.add_argument('--searchdir', required=True) -parser.add_argument('--outdir', required=True) -parser.add_argument('ifiles', nargs='+') - -options = parser.parse_args() - -searchdir = options.searchdir -outdir = options.outdir -ifiles = options.ifiles - -rel_ofiles = [] - -for ifile in ifiles: - if not ifile.startswith(options.searchdir): - sys.exit('Input file %s does not start with search dir %s.' % (ifile, searchdir)) - rel_ofile = ifile[len(searchdir):] - if rel_ofile[0] == '/' or rel_ofile[0] == '\\': - rel_ofile = rel_ofile[1:] - rel_ofiles.append(os.path.splitext(rel_ofile)[0]) - -ofile_bases = [os.path.join(outdir, i) for i in rel_ofiles] - -for i, ifile_name in enumerate(ifiles): - proto_name = open(ifile_name).readline().strip() - h_out = ofile_bases[i] + '.h' - c_out = ofile_bases[i] + '.c' - os.makedirs(os.path.split(ofile_bases[i])[0], exist_ok=True) - open(h_out, 'w').write(h_templ % (proto_name)) - open(c_out, 'w').write(c_templ % (proto_name, proto_name)) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/201 generator in subdir/com/mesonbuild/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/201 generator in subdir/com/mesonbuild/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/201 generator in subdir/com/mesonbuild/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/201 generator in subdir/com/mesonbuild/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -gprog = find_program('genprog.py') - -gen = generator(gprog, \ - output : ['@BASENAME@.c', '@BASENAME@.h'], - arguments : ['--searchdir=@CURRENT_SOURCE_DIR@', '--outdir=@BUILD_DIR@', '@INPUT@']) - -generated = gen.process('subbie.inp') - -e = executable('testprog', 'testprog.c', generated) -test('testprog', e) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/201 generator in subdir/com/mesonbuild/subbie.inp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/201 generator in subdir/com/mesonbuild/subbie.inp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/201 generator in subdir/com/mesonbuild/subbie.inp" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/201 generator in subdir/com/mesonbuild/subbie.inp" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -subbie diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/201 generator in subdir/com/mesonbuild/testprog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/201 generator in subdir/com/mesonbuild/testprog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/201 generator in subdir/com/mesonbuild/testprog.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/201 generator in subdir/com/mesonbuild/testprog.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#include"subbie.h" - -int main(int argc, char **argv) { - return subbie(); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/201 generator in subdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/201 generator in subdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/201 generator in subdir/meson.build" 2018-12-09 16:32:12.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/201 generator in subdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -project('generator in subdir', 'c') - -subdir('com/mesonbuild') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/201 override with exe/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/201 override with exe/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/201 override with exe/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/201 override with exe/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,15 @@ +project('myexe', 'c') +sub = subproject('sub') +prog = find_program('foobar') +custom1 = custom_target('custom1', + build_by_default : true, + input : [], + output : 'main1.c', + command : [prog, '@OUTPUT@']) +gen = generator(prog, + output : '@BASENAME@.c', + arguments : ['@OUTPUT@']) +custom2 = gen.process('main2.input') + +executable('e1', custom1) +executable('e2', custom2) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/201 override with exe/subprojects/sub/foobar.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/201 override with exe/subprojects/sub/foobar.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/201 override with exe/subprojects/sub/foobar.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/201 override with exe/subprojects/sub/foobar.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,12 @@ +#include +#include + +int main(int argc, char* argv[]) { + FILE *f = fopen(argv[1], "w"); + const char msg[] = "int main(void) {return 0;}\n"; + size_t w = fwrite(msg, 1, sizeof(msg) - 1, f); + assert(w == sizeof(msg) - 1); + int r = fclose(f); + assert(r == 0); + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/201 override with exe/subprojects/sub/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/201 override with exe/subprojects/sub/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/201 override with exe/subprojects/sub/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/201 override with exe/subprojects/sub/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +project('sub', 'c') +foobar = executable('foobar', 'foobar.c', native : true) +meson.override_find_program('foobar', foobar) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/202 override with exe/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/202 override with exe/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/202 override with exe/meson.build" 2018-12-09 16:32:14.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/202 override with exe/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -project('myexe', 'c') -sub = subproject('sub') -prog = find_program('foobar') -custom1 = custom_target('custom1', - build_by_default : true, - input : [], - output : 'main1.c', - command : [prog, '@OUTPUT@']) -gen = generator(prog, - output : '@BASENAME@.c', - arguments : ['@OUTPUT@']) -custom2 = gen.process('main2.input') - -executable('e1', custom1) -executable('e2', custom2) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/202 override with exe/subprojects/sub/foobar.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/202 override with exe/subprojects/sub/foobar.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/202 override with exe/subprojects/sub/foobar.c" 2018-10-31 09:31:57.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/202 override with exe/subprojects/sub/foobar.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -#include -#include - -int main(int argc, char* argv[]) { - FILE *f = fopen(argv[1], "w"); - const char msg[] = "int main(void) {return 0;}\n"; - size_t w = fwrite(msg, 1, sizeof(msg) - 1, f); - assert(w == sizeof(msg) - 1); - int r = fclose(f); - assert(r == 0); - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/202 override with exe/subprojects/sub/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/202 override with exe/subprojects/sub/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/202 override with exe/subprojects/sub/meson.build" 2018-10-31 09:31:57.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/202 override with exe/subprojects/sub/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -project('sub', 'c') -foobar = executable('foobar', 'foobar.c', native : true) -meson.override_find_program('foobar', foobar) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/202 subproject with features/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/202 subproject with features/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/202 subproject with features/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/202 subproject with features/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,17 @@ +project('proj', 'c') + +auto_subproj = subproject('sub', required: get_option('use-subproject')) +assert(auto_subproj.found(), 'Subproject should always be buildable and thus found') + +auto_dep = dependency('', fallback: ['sub', 'libSub'], required: true) +assert(auto_dep.found() == true, 'Subproject is required and foundable, dependency should be found.') + +disabled_subproj = subproject('disabled_sub', required: get_option('disabled-subproject')) +assert(disabled_subproj.found() == false, 'Disabled subproject should be NOT found') + +disabled_dep = dependency('', fallback: ['disabled_sub', 'libSub'], required: false) +assert(disabled_dep.found() == false, 'Subprojetc was disabled, it should never be built.') +nothing = executable('nothing', 'nothing.c', dependencies: [disabled_dep]) + +subproj_with_missing_dep = subproject('auto_sub_with_missing_dep', required: get_option('auto-sub-with-missing-dep')) +assert(subproj_with_missing_dep.found() == false, 'Subproject with required=auto and missing dependency should be NOT found') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/202 subproject with features/meson_options.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/202 subproject with features/meson_options.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/202 subproject with features/meson_options.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/202 subproject with features/meson_options.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +option('use-subproject', type : 'feature', value : 'auto') +option('disabled-subproject', type : 'feature', value : 'disabled') +option('auto-sub-with-missing-dep', type : 'feature', value : 'auto') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/202 subproject with features/nothing.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/202 subproject with features/nothing.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/202 subproject with features/nothing.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/202 subproject with features/nothing.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,4 @@ +int main(int argc, char const *argv[]) +{ + return 0; +} \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/202 subproject with features/subprojects/auto_sub_with_missing_dep/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/202 subproject with features/subprojects/auto_sub_with_missing_dep/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/202 subproject with features/subprojects/auto_sub_with_missing_dep/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/202 subproject with features/subprojects/auto_sub_with_missing_dep/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +project('sub', 'c') + +dependency('no_way_this_exists', required: true) \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/202 subproject with features/subprojects/disabled_sub/lib/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/202 subproject with features/subprojects/disabled_sub/lib/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/202 subproject with features/subprojects/disabled_sub/lib/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/202 subproject with features/subprojects/disabled_sub/lib/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +lib = static_library('sub', 'sub.c') + +libSub = declare_dependency(include_directories: include_directories('.'), link_with: lib) \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/202 subproject with features/subprojects/disabled_sub/lib/sub.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/202 subproject with features/subprojects/disabled_sub/lib/sub.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/202 subproject with features/subprojects/disabled_sub/lib/sub.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/202 subproject with features/subprojects/disabled_sub/lib/sub.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +#include "sub.h" + +int sub() { + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/202 subproject with features/subprojects/disabled_sub/lib/sub.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/202 subproject with features/subprojects/disabled_sub/lib/sub.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/202 subproject with features/subprojects/disabled_sub/lib/sub.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/202 subproject with features/subprojects/disabled_sub/lib/sub.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,6 @@ +#ifndef SUB_H +#define SUB_H + +int sub(); + +#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/202 subproject with features/subprojects/disabled_sub/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/202 subproject with features/subprojects/disabled_sub/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/202 subproject with features/subprojects/disabled_sub/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/202 subproject with features/subprojects/disabled_sub/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +project('disabled_sub', 'c') + +subdir('lib') \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/202 subproject with features/subprojects/sub/lib/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/202 subproject with features/subprojects/sub/lib/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/202 subproject with features/subprojects/sub/lib/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/202 subproject with features/subprojects/sub/lib/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +lib = static_library('sub', 'sub.c') +libSub = declare_dependency(include_directories: include_directories('.'), link_with: lib) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/202 subproject with features/subprojects/sub/lib/sub.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/202 subproject with features/subprojects/sub/lib/sub.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/202 subproject with features/subprojects/sub/lib/sub.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/202 subproject with features/subprojects/sub/lib/sub.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +#include "sub.h" + +int sub() { + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/202 subproject with features/subprojects/sub/lib/sub.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/202 subproject with features/subprojects/sub/lib/sub.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/202 subproject with features/subprojects/sub/lib/sub.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/202 subproject with features/subprojects/sub/lib/sub.h" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,6 @@ +#ifndef SUB_H +#define SUB_H + +int sub(); + +#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/202 subproject with features/subprojects/sub/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/202 subproject with features/subprojects/sub/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/202 subproject with features/subprojects/sub/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/202 subproject with features/subprojects/sub/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +project('sub', 'c') + +subdir('lib') \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/203 function attributes/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/203 function attributes/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/203 function attributes/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/203 function attributes/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,111 @@ +# Copyright © 2017-2018 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +project('gcc func attributes', ['c', 'cpp']) + +# For msvc these will fail because msvc doesn't support __attribute__, for +# Clang and GCC, they should pass. +c = meson.get_compiler('c') +cpp = meson.get_compiler('cpp') + +if c.get_id() == 'pgi' + error('MESON_SKIP_TEST: PGI supports its own set of features, will need a seperate list for PGI to test it.') +endif + +expected_result = not ['msvc', 'clang-cl', 'intel-cl'].contains(c.get_id()) + +# Q: Why is ifunc not in this list or any of the below lists? +# A: It's too damn hard to figure out if you actually support it, since it +# requires both compiler and libc support, and there isn't a good way to +# figure that out except by running the code we're trying to test. +attributes = [ + 'aligned', + 'alloc_size', + 'always_inline', + 'cold', + 'const', + 'constructor', + 'constructor_priority', + 'deprecated', + 'destructor', + 'flatten', + 'format', + 'format_arg', + 'gnu_inline', + 'hot', + 'malloc', + 'noinline', + 'nonnull', + 'noreturn', + 'nothrow', + 'pure', + 'unused', + 'used', + 'warn_unused_result', + 'weak', +] + +if c.get_id() != 'intel' + # not supported by icc as of 19.0.0 + attributes += 'weakref' +endif + +# These are unsupported on darwin with apple clang 9.1.0 +if host_machine.system() != 'darwin' + attributes += 'alias' + attributes += 'visibility' +endif + +if ['gcc', 'intel'].contains(c.get_id()) + # not supported by clang as of 5.0.0 (at least up to 6.0.1) + attributes += 'artificial' + attributes += 'error' + attributes += 'externally_visible' + attributes += 'leaf' + attributes += 'noclone' + attributes += 'optimize' + attributes += 'warning' + + if c.get_id() == 'gcc' and c.version().version_compare('>= 7.0.0') + attributes += 'fallthrough' + endif +endif + + +foreach a : attributes + x = c.has_function_attribute(a) + assert(x == expected_result, '@0@: @1@'.format(c.get_id(), a)) + x = cpp.has_function_attribute(a) + assert(x == expected_result, '@0@: @1@'.format(cpp.get_id(), a)) +endforeach + +win_expect = ['windows', 'cygwin'].contains(host_machine.system()) +foreach a : ['dllexport', 'dllimport'] + assert(c.has_function_attribute(a) == win_expect, + '@0@: @1@'.format(c.get_id(), a)) + assert(cpp.has_function_attribute(a) == win_expect, + '@0@: @1@'.format(cpp.get_id(), a)) +endforeach + +message('checking get_supported_function_attributes') +if not ['msvc', 'clang-cl', 'intel-cl'].contains(c.get_id()) + multi_expected = attributes +else + multi_expected = [] +endif + +multi_check = c.get_supported_function_attributes(attributes) +assert(multi_check == multi_expected, 'get_supported_function_arguments works (C)') +multi_check = cpp.get_supported_function_attributes(attributes) +assert(multi_check == multi_expected, 'get_supported_function_arguments works (C++)') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/203 subproject with features/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/203 subproject with features/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/203 subproject with features/meson.build" 2018-12-09 16:32:15.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/203 subproject with features/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -project('proj', 'c') - -auto_subproj = subproject('sub', required: get_option('use-subproject')) -assert(auto_subproj.found(), 'Subproject should always be buildable and thus found') - -auto_dep = dependency('', fallback: ['sub', 'libSub'], required: true) -assert(auto_dep.found() == true, 'Subproject is required and foundable, dependency should be found.') - -disabled_subproj = subproject('disabled_sub', required: get_option('disabled-subproject')) -assert(disabled_subproj.found() == false, 'Disabled subproject should be NOT found') - -disabled_dep = dependency('', fallback: ['disabled_sub', 'libSub'], required: false) -assert(disabled_dep.found() == false, 'Subprojetc was disabled, it should never be built.') -nothing = executable('nothing', 'nothing.c', dependencies: [disabled_dep]) - -subproj_with_missing_dep = subproject('auto_sub_with_missing_dep', required: get_option('auto-sub-with-missing-dep')) -assert(subproj_with_missing_dep.found() == false, 'Subproject with required=auto and missing dependency should be NOT found') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/203 subproject with features/meson_options.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/203 subproject with features/meson_options.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/203 subproject with features/meson_options.txt" 2018-10-31 09:31:57.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/203 subproject with features/meson_options.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -option('use-subproject', type : 'feature', value : 'auto') -option('disabled-subproject', type : 'feature', value : 'disabled') -option('auto-sub-with-missing-dep', type : 'feature', value : 'auto') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/203 subproject with features/nothing.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/203 subproject with features/nothing.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/203 subproject with features/nothing.c" 2018-10-31 09:31:57.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/203 subproject with features/nothing.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -int main(int argc, char const *argv[]) -{ - return 0; -} \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/203 subproject with features/subprojects/auto_sub_with_missing_dep/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/203 subproject with features/subprojects/auto_sub_with_missing_dep/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/203 subproject with features/subprojects/auto_sub_with_missing_dep/meson.build" 2018-10-31 09:31:57.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/203 subproject with features/subprojects/auto_sub_with_missing_dep/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -project('sub', 'c') - -dependency('no_way_this_exists', required: true) \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/203 subproject with features/subprojects/disabled_sub/lib/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/203 subproject with features/subprojects/disabled_sub/lib/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/203 subproject with features/subprojects/disabled_sub/lib/meson.build" 2018-10-31 09:31:57.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/203 subproject with features/subprojects/disabled_sub/lib/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -lib = static_library('sub', 'sub.c') - -libSub = declare_dependency(include_directories: include_directories('.'), link_with: lib) \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/203 subproject with features/subprojects/disabled_sub/lib/sub.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/203 subproject with features/subprojects/disabled_sub/lib/sub.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/203 subproject with features/subprojects/disabled_sub/lib/sub.c" 2018-10-31 09:31:57.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/203 subproject with features/subprojects/disabled_sub/lib/sub.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#include "sub.h" - -int sub() { - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/203 subproject with features/subprojects/disabled_sub/lib/sub.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/203 subproject with features/subprojects/disabled_sub/lib/sub.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/203 subproject with features/subprojects/disabled_sub/lib/sub.h" 2018-10-31 09:31:57.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/203 subproject with features/subprojects/disabled_sub/lib/sub.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#ifndef SUB_H -#define SUB_H - -int sub(); - -#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/203 subproject with features/subprojects/disabled_sub/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/203 subproject with features/subprojects/disabled_sub/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/203 subproject with features/subprojects/disabled_sub/meson.build" 2018-10-31 09:31:57.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/203 subproject with features/subprojects/disabled_sub/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -project('disabled_sub', 'c') - -subdir('lib') \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/203 subproject with features/subprojects/sub/lib/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/203 subproject with features/subprojects/sub/lib/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/203 subproject with features/subprojects/sub/lib/meson.build" 2018-10-31 09:31:57.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/203 subproject with features/subprojects/sub/lib/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -lib = static_library('sub', 'sub.c') -libSub = declare_dependency(include_directories: include_directories('.'), link_with: lib) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/203 subproject with features/subprojects/sub/lib/sub.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/203 subproject with features/subprojects/sub/lib/sub.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/203 subproject with features/subprojects/sub/lib/sub.c" 2018-10-31 09:31:57.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/203 subproject with features/subprojects/sub/lib/sub.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#include "sub.h" - -int sub() { - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/203 subproject with features/subprojects/sub/lib/sub.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/203 subproject with features/subprojects/sub/lib/sub.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/203 subproject with features/subprojects/sub/lib/sub.h" 2018-10-31 09:31:57.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/203 subproject with features/subprojects/sub/lib/sub.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#ifndef SUB_H -#define SUB_H - -int sub(); - -#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/203 subproject with features/subprojects/sub/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/203 subproject with features/subprojects/sub/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/203 subproject with features/subprojects/sub/meson.build" 2018-10-31 09:31:57.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/203 subproject with features/subprojects/sub/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -project('sub', 'c') - -subdir('lib') \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/204 broken subproject/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/204 broken subproject/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/204 broken subproject/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/204 broken subproject/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +project('test broken subproject') +subproject('broken', required : false) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/204 broken subproject/subprojects/broken/broken.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/204 broken subproject/subprojects/broken/broken.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/204 broken subproject/subprojects/broken/broken.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/204 broken subproject/subprojects/broken/broken.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +#error This must not compile diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/204 broken subproject/subprojects/broken/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/204 broken subproject/subprojects/broken/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/204 broken subproject/subprojects/broken/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/204 broken subproject/subprojects/broken/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,4 @@ +project('broken', 'c') + +executable('app', 'broken.c') +assert(false, 'This subproject must fail') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/204 function attributes/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/204 function attributes/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/204 function attributes/meson.build" 2018-12-09 16:32:22.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/204 function attributes/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,107 +0,0 @@ -# Copyright © 2017-2018 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -project('gcc func attributes', ['c', 'cpp']) - -# For msvc these will fail because msvc doesn't support __attribute__, for -# Clang and GCC, they should pass. -c = meson.get_compiler('c') -cpp = meson.get_compiler('cpp') - -expected_result = not ['msvc', 'clang-cl'].contains(c.get_id()) - -# Q: Why is ifunc not in this list or any of the below lists? -# A: It's too damn hard to figure out if you actually support it, since it -# requires both compiler and libc support, and there isn't a good way to -# figure that out except by running the code we're trying to test. -attributes = [ - 'aligned', - 'alloc_size', - 'always_inline', - 'cold', - 'const', - 'constructor', - 'constructor_priority', - 'deprecated', - 'destructor', - 'flatten', - 'format', - 'format_arg', - 'gnu_inline', - 'hot', - 'malloc', - 'noinline', - 'nonnull', - 'noreturn', - 'nothrow', - 'pure', - 'unused', - 'used', - 'warn_unused_result', - 'weak', -] - -if c.get_id() != 'intel' - # not supported by icc as of 19.0.0 - attributes += 'weakref' -endif - -# These are unsupported on darwin with apple clang 9.1.0 -if host_machine.system() != 'darwin' - attributes += 'alias' - attributes += 'visibility' -endif - -if ['gcc', 'intel'].contains(c.get_id()) - # not supported by clang as of 5.0.0 (at least up to 6.0.1) - attributes += 'artificial' - attributes += 'error' - attributes += 'externally_visible' - attributes += 'leaf' - attributes += 'noclone' - attributes += 'optimize' - attributes += 'warning' - - if c.get_id() == 'gcc' and c.version().version_compare('>= 7.0.0') - attributes += 'fallthrough' - endif -endif - - -foreach a : attributes - x = c.has_function_attribute(a) - assert(x == expected_result, '@0@: @1@'.format(c.get_id(), a)) - x = cpp.has_function_attribute(a) - assert(x == expected_result, '@0@: @1@'.format(cpp.get_id(), a)) -endforeach - -win_expect = ['windows', 'cygwin'].contains(host_machine.system()) -foreach a : ['dllexport', 'dllimport'] - assert(c.has_function_attribute(a) == win_expect, - '@0@: @1@'.format(c.get_id(), a)) - assert(cpp.has_function_attribute(a) == win_expect, - '@0@: @1@'.format(cpp.get_id(), a)) -endforeach - -message('checking get_supported_function_attributes') -if not ['msvc', 'clang-cl'].contains(c.get_id()) - multi_expected = attributes -else - multi_expected = [] -endif - -multi_check = c.get_supported_function_attributes(attributes) -assert(multi_check == multi_expected, 'get_supported_function_arguments works (C)') -multi_check = cpp.get_supported_function_attributes(attributes) -assert(multi_check == multi_expected, 'get_supported_function_arguments works (C++)') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/205 argument syntax/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/205 argument syntax/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/205 argument syntax/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/205 argument syntax/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,19 @@ +project( + 'argument syntax', + ['c'], +) + +cc = meson.get_compiler('c') + +if ['gcc', 'lcc', 'clang', 'intel'].contains(cc.get_id()) + expected = 'gcc' +elif ['msvc', 'clang-cl', 'intel-cl'].contains(cc.get_id()) + expected = 'msvc' +else + # It's possible that other compilers end up here that shouldn't + expected = 'other' +endif + +assert(cc.get_argument_syntax() == expected, + 'Wrong output for compiler @0@. expected @1@ but got @2@'.format( + cc.get_id(), expected, cc.get_argument_syntax())) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/205 broken subproject/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/205 broken subproject/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/205 broken subproject/meson.build" 2018-12-09 16:32:16.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/205 broken subproject/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -project('test broken subproject') -subproject('broken', required : false) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/205 broken subproject/subprojects/broken/broken.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/205 broken subproject/subprojects/broken/broken.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/205 broken subproject/subprojects/broken/broken.c" 2018-12-09 14:27:16.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/205 broken subproject/subprojects/broken/broken.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#error This must not compile diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/205 broken subproject/subprojects/broken/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/205 broken subproject/subprojects/broken/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/205 broken subproject/subprojects/broken/meson.build" 2018-12-09 14:27:16.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/205 broken subproject/subprojects/broken/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -project('broken', 'c') - -executable('app', 'broken.c') -assert(false, 'This subproject must fail') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/206 argument syntax/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/206 argument syntax/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/206 argument syntax/meson.build" 2018-12-09 16:32:18.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/206 argument syntax/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -project( - 'argument syntax', - ['c'], -) - -cc = meson.get_compiler('c') - -if ['gcc', 'lcc', 'clang'].contains(cc.get_id()) - expected = 'gcc' -elif ['msvc', 'clang-cl'].contains(cc.get_id()) - expected = 'msvc' -elif cc.get_id() == 'intel' - if host_machine.system() == 'windows' - expected = 'msvc' - else - expected = 'gcc' - endif -else - # It's possible that other compilers end up here that shouldn't - expected = 'other' -endif - -assert(cc.get_argument_syntax() == expected, - 'Wrong output for compiler @0@. expected @1@ but got @2@'.format( - cc.get_id(), expected, cc.get_argument_syntax())) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/206 install name_prefix name_suffix/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/206 install name_prefix name_suffix/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/206 install name_prefix name_suffix/installed_files.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/206 install name_prefix name_suffix/installed_files.txt" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,15 @@ +?msvc:usr/bin/baz.pdb +?msvc:usr/bin/bowcorge.pdb +?msvc:usr/bin/foo.pdb +?msvc:usr/lib/baz.pdb +?msvc:usr/lib/bowcorge.pdb +?msvc:usr/lib/foo.pdb +usr/?lib/bowcorge.stern +usr/lib/?libbaz.cheese +usr/lib/bar.a +usr/lib/bowcorge?implib +usr/lib/bowgrault.stern +usr/lib/foo?implib +usr/lib/foo?so +usr/lib/libbaz?implib +usr/lib/libqux.cheese diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/206 install name_prefix name_suffix/libfile.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/206 install name_prefix name_suffix/libfile.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/206 install name_prefix name_suffix/libfile.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/206 install name_prefix name_suffix/libfile.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,14 @@ +#if defined _WIN32 || defined __CYGWIN__ + #define DLL_PUBLIC __declspec(dllexport) +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif + +int DLL_PUBLIC func() { + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/206 install name_prefix name_suffix/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/206 install name_prefix name_suffix/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/206 install name_prefix name_suffix/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/206 install name_prefix name_suffix/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,10 @@ +project('library with name_prefix name_suffix test', 'c') + +shared_library('foo', 'libfile.c', name_prefix: '', install : true) +static_library('bar', 'libfile.c', name_prefix: '', install : true) + +shared_library('baz', 'libfile.c', name_suffix: 'cheese', install : true) +static_library('qux', 'libfile.c', name_suffix: 'cheese', install : true) + +shared_library('corge', 'libfile.c', name_prefix: 'bow', name_suffix: 'stern', install : true) +static_library('grault', 'libfile.c', name_prefix: 'bow', name_suffix: 'stern', install : true) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/207 install name_prefix name_suffix/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/207 install name_prefix name_suffix/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/207 install name_prefix name_suffix/installed_files.txt" 2018-12-09 14:27:16.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/207 install name_prefix name_suffix/installed_files.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -?msvc:usr/bin/baz.pdb -?msvc:usr/bin/bowcorge.pdb -?msvc:usr/bin/foo.pdb -?msvc:usr/lib/baz.pdb -?msvc:usr/lib/bowcorge.pdb -?msvc:usr/lib/foo.pdb -usr/?lib/bowcorge.stern -usr/lib/?libbaz.cheese -usr/lib/bar.a -usr/lib/bowcorge?implib -usr/lib/bowgrault.stern -usr/lib/foo?implib -usr/lib/foo?so -usr/lib/libbaz?implib -usr/lib/libqux.cheese diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/207 install name_prefix name_suffix/libfile.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/207 install name_prefix name_suffix/libfile.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/207 install name_prefix name_suffix/libfile.c" 2018-12-09 14:27:16.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/207 install name_prefix name_suffix/libfile.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -#if defined _WIN32 || defined __CYGWIN__ - #define DLL_PUBLIC __declspec(dllexport) -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif - -int DLL_PUBLIC func() { - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/207 install name_prefix name_suffix/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/207 install name_prefix name_suffix/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/207 install name_prefix name_suffix/meson.build" 2018-12-09 16:32:19.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/207 install name_prefix name_suffix/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -project('library with name_prefix name_suffix test', 'c') - -shared_library('foo', 'libfile.c', name_prefix: '', install : true) -static_library('bar', 'libfile.c', name_prefix: '', install : true) - -shared_library('baz', 'libfile.c', name_suffix: 'cheese', install : true) -static_library('qux', 'libfile.c', name_suffix: 'cheese', install : true) - -shared_library('corge', 'libfile.c', name_prefix: 'bow', name_suffix: 'stern', install : true) -static_library('grault', 'libfile.c', name_prefix: 'bow', name_suffix: 'stern', install : true) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/207 kwarg entry/inc/prog.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/207 kwarg entry/inc/prog.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/207 kwarg entry/inc/prog.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/207 kwarg entry/inc/prog.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +#pragma once + +#define MESSAGE "Hello there.\n" diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/207 kwarg entry/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/207 kwarg entry/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/207 kwarg entry/installed_files.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/207 kwarg entry/installed_files.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +usr/bin/prog?exe +?msvc:usr/bin/prog.pdb diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/207 kwarg entry/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/207 kwarg entry/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/207 kwarg entry/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/207 kwarg entry/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,7 @@ +project('kwarg', 'c') + +default_kwargs = {'install': true, + 'include_directories': include_directories('inc')} + +executable('prog', 'prog.c', + kwargs: default_kwargs) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/207 kwarg entry/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/207 kwarg entry/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/207 kwarg entry/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/207 kwarg entry/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,7 @@ +#include +#include + +int main(int argc, char **argv) { + printf(MESSAGE); + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/208 custom target build by default/docgen.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/208 custom target build by default/docgen.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/208 custom target build by default/docgen.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/208 custom target build by default/docgen.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,12 @@ +#!/usr/bin/env python3 + +import os +import sys + +out = sys.argv[1] + +os.mkdir(out) + +for name in ('a', 'b', 'c'): + with open(os.path.join(out, name + '.txt'), 'w') as f: + f.write(name) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/208 custom target build by default/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/208 custom target build by default/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/208 custom target build by default/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/208 custom target build by default/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,10 @@ +project('custom-target-dir-install', 'c') + +docgen = find_program('docgen.py') + +custom_target('docgen', + output : 'html', + command : [docgen, '@OUTPUT@'], + install : true, + build_by_default : false, + install_dir : join_paths(get_option('datadir'), 'doc/testpkgname')) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/208 kwarg entry/inc/prog.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/208 kwarg entry/inc/prog.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/208 kwarg entry/inc/prog.h" 2018-12-09 14:27:23.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/208 kwarg entry/inc/prog.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -#pragma once - -#define MESSAGE "Hello there.\n" diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/208 kwarg entry/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/208 kwarg entry/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/208 kwarg entry/installed_files.txt" 2018-12-09 14:27:23.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/208 kwarg entry/installed_files.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -usr/bin/prog?exe -?msvc:usr/bin/prog.pdb diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/208 kwarg entry/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/208 kwarg entry/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/208 kwarg entry/meson.build" 2018-12-09 16:32:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/208 kwarg entry/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -project('kwarg', 'c') - -default_kwargs = {'install': true, - 'include_directories': include_directories('inc')} - -executable('prog', 'prog.c', - kwargs: default_kwargs) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/208 kwarg entry/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/208 kwarg entry/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/208 kwarg entry/prog.c" 2018-12-09 14:27:23.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/208 kwarg entry/prog.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -#include -#include - -int main(int argc, char **argv) { - printf(MESSAGE); - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/209 find_library and headers/foo.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/209 find_library and headers/foo.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/209 find_library and headers/foo.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/209 find_library and headers/foo.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +#define VAL 42 diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/209 find_library and headers/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/209 find_library and headers/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/209 find_library and headers/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/209 find_library and headers/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,23 @@ +project('find library and headers', 'c') + +cc = meson.get_compiler('c') + +if not cc.find_library('z', required : false).found() + error('MESON_SKIP_TEST: zlib not found.') +endif + +lib = cc.find_library('z', + has_headers : 'foo.h', + required : false) +assert(not lib.found(), 'Header should be missing') + +lib = cc.find_library('z', + has_headers : 'foo.h', + header_include_directories : include_directories('.')) +assert(lib.found(), 'Header should be found') + +lib = cc.find_library('z', + has_headers : ['foo.h', 'bar.h'], + header_include_directories : include_directories('.'), + required : false) +assert(not lib.found(), 'One header should be missing') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/210 line continuation/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/210 line continuation/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/210 line continuation/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/210 line continuation/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,17 @@ +project('line continuation') + +a = 1 +b = 2 + +c = a \ ++b +assert(c == 3, 'Line continuation is not working') + +d = a + \ + b +assert(d == 3, 'Line continuation is not working') + +if a == 1 and \ + b == 3 + error('Line continuation in "if" condition is not working') +endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/211 cmake module/cmake_project/CMakeLists.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/211 cmake module/cmake_project/CMakeLists.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/211 cmake module/cmake_project/CMakeLists.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/211 cmake module/cmake_project/CMakeLists.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,4 @@ +cmake_minimum_required(VERSION 2.8) +project(cmakeMeson C) + +find_package(cmakeModule REQUIRED) \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/211 cmake module/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/211 cmake module/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/211 cmake module/installed_files.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/211 cmake module/installed_files.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +usr/lib/cmake/cmakeModule/cmakeModuleConfig.cmake +usr/lib/cmake/cmakeModule/cmakeModuleConfigVersion.cmake \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/211 cmake module/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/211 cmake module/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/211 cmake module/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/211 cmake module/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,31 @@ +project('cmakeModule', 'c', version: '1.0.0') + +if build_machine.system() == 'cygwin' + error('MESON_SKIP_TEST CMake is broken on Cygwin.') +endif + +cmake_bin = find_program('cmake', required: false) +if not cmake_bin.found() + error('MESON_SKIP_TEST CMake not installed.') +endif + +cc = meson.get_compiler('c') +if cc.get_id() == 'clang-cl' and meson.backend() == 'ninja' and build_machine.system() == 'windows' + error('MESON_SKIP_TEST CMake installation nor operational for vs2017 clangclx64ninja') +endif + +cmake = import('cmake') + +cmake.write_basic_package_version_file(version: '0.0.1', + name: 'cmakeModule', +) + +conf = configuration_data() +conf.set('MYVAR', 'my variable value') +conf.set_quoted('MYQUOTEDVAR', 'my quoted variable value') + +cmake.configure_package_config_file( + input: 'projectConfig.cmake.in', + name: 'cmakeModule', + configuration: conf, +) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/211 cmake module/projectConfig.cmake.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/211 cmake module/projectConfig.cmake.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/211 cmake module/projectConfig.cmake.in" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/211 cmake module/projectConfig.cmake.in" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,4 @@ +@PACKAGE_INIT@ + +set(MYVAR "@MYVAR@") +set(MYQUOTEDVAR @MYQUOTEDVAR@) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/212 native file path override/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/212 native file path override/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/212 native file path override/installed_files.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/212 native file path override/installed_files.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +usr/custom_bindir/main?exe +?msvc:usr/custom_bindir/main.pdb diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/212 native file path override/main.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/212 native file path override/main.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/212 native file path override/main.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/212 native file path override/main.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +#include + +int main() { + std::cout << "Hello world!" << std::endl; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/212 native file path override/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/212 native file path override/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/212 native file path override/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/212 native file path override/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,7 @@ +project('native file install dir override', 'cpp') + +if meson.is_cross_build() + error('MESON_SKIP_TEST cannot test native build rules in cross build') +endif + +executable('main', 'main.cpp', install : true) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/212 native file path override/nativefile.ini" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/212 native file path override/nativefile.ini" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/212 native file path override/nativefile.ini" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/212 native file path override/nativefile.ini" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +[paths] +bindir = 'custom_bindir' diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/213 tap tests/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/213 tap tests/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/213 tap tests/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/213 tap tests/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,10 @@ +project('test features', 'c') + +tester = executable('tester', 'tester.c') +test('pass', tester, args : ['ok'], protocol: 'tap') +test('fail', tester, args : ['not ok'], should_fail: true, protocol: 'tap') +test('xfail', tester, args : ['not ok # todo'], protocol: 'tap') +test('xpass', tester, args : ['ok # todo'], should_fail: true, protocol: 'tap') +test('skip', tester, args : ['ok # skip'], protocol: 'tap') +test('skip failure', tester, args : ['not ok # skip'], should_fail: true, protocol: 'tap') +test('no tests', tester, args : ['1..0 # skip'], protocol: 'tap') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/213 tap tests/tester.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/213 tap tests/tester.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/213 tap tests/tester.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/213 tap tests/tester.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,10 @@ +#include + +int main(int argc, char **argv) { + if (argc != 2) { + fprintf(stderr, "Incorrect number of arguments, got %i\n", argc); + return 1; + } + puts(argv[1]); + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/214 warning level 0/main.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/214 warning level 0/main.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/214 warning level 0/main.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/214 warning level 0/main.cpp" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,12 @@ +#include + +#define PROJECT_NAME "demo" + +int main(int argc, char **argv) { + if(argc != 1) { + std::cout << argv[0] << "takes no arguments.\n"; + return 1; + } + std::cout << "This is project " << PROJECT_NAME << ".\n"; + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/214 warning level 0/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/214 warning level 0/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/214 warning level 0/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/214 warning level 0/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +project('warning_level', 'cpp', default_options : ['warning_level=0']) + +exe = executable('main', 'main.cpp', install : false) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/215 link custom/custom_stlib.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/215 link custom/custom_stlib.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/215 link custom/custom_stlib.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/215 link custom/custom_stlib.py" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,73 @@ +#!/usr/bin/env python3 + +import shutil, sys, subprocess, argparse, pathlib + +parser = argparse.ArgumentParser() + +parser.add_argument('--private-dir', required=True) +parser.add_argument('-o', required=True) +parser.add_argument('cmparr', nargs='+') + +contents = '''#include + +void flob() { + printf("Now flobbing.\\n"); +} +''' + +def generate_lib_gnulike(outfile, c_file, private_dir, compiler_array): + if shutil.which('ar'): + static_linker = 'ar' + elif shutil.which('llvm-ar'): + static_linker = 'llvm-ar' + elif shutil.which('gcc-ar'): + static_linker = 'gcc-ar' + else: + sys.exit('Could not detect a static linker.') + o_file = c_file.with_suffix('.o') + compile_cmd = compiler_array + ['-c', '-g', '-O2', '-o', str(o_file), str(c_file)] + subprocess.check_call(compile_cmd) + out_file = pathlib.Path(outfile) + if out_file.exists(): + out_file.unlink() + link_cmd = [static_linker, 'csr', outfile, str(o_file)] + subprocess.check_call(link_cmd) + return 0 + + +def generate_lib_msvc(outfile, c_file, private_dir, compiler_array): + static_linker = 'lib' + o_file = c_file.with_suffix('.obj') + compile_cmd = compiler_array + ['/MDd', + '/nologo', + '/ZI', + '/Ob0', + '/Od', + '/c', + '/Fo' + str(o_file), + str(c_file)] + subprocess.check_call(compile_cmd) + out_file = pathlib.Path(outfile) + if out_file.exists(): + out_file.unlink() + link_cmd = [static_linker, + '/nologo', + '/OUT:' + str(outfile), + str(o_file)] + subprocess.check_call(link_cmd) + return 0 + +def generate_lib(outfile, private_dir, compiler_array): + private_dir = pathlib.Path(private_dir) + if not private_dir.exists(): + private_dir.mkdir() + c_file = private_dir / 'flob.c' + c_file.write_text(contents) + for i in compiler_array: + if (i.endswith('cl') or i.endswith('cl.exe')) and 'clang-cl' not in i: + return generate_lib_msvc(outfile, c_file, private_dir, compiler_array) + return generate_lib_gnulike(outfile, c_file, private_dir, compiler_array) + +if __name__ == '__main__': + options = parser.parse_args() + sys.exit(generate_lib(options.o, options.private_dir, options.cmparr)) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/215 link custom/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/215 link custom/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/215 link custom/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/215 link custom/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,57 @@ +project('linkcustom', 'c') + +# This would require passing the static linker to the build script or having +# it detect it by itself. I'm too lazy to implement it now and it is not +# really needed for testing that custom targets work. It is the responsibility +# of the custom target to produce things in the correct format. +assert(not meson.is_cross_build(), + 'MESON_SKIP_TEST cross checking not implemented.') + +cc = meson.get_compiler('c') +genprog = find_program('custom_stlib.py') + +clib = custom_target('linkcustom', + output: 'libflob.a', + command: [genprog, + '-o', '@OUTPUT@', + '--private-dir', '@PRIVATE_DIR@'] + cc.cmd_array()) + +# custom_target tests + +exe = executable('prog', 'prog.c', link_with: clib) +test('linkcustom', exe) + +d = declare_dependency(link_with: clib) + +exe2 = executable('prog2', 'prog.c', dependencies: d) +test('linkcustom2', exe2) + +# Link whole tests + +exe3 = executable('prog3', 'prog.c', link_whole: clib) +test('linkwhole', exe) + +d2 = declare_dependency(link_whole: clib) + +exe4 = executable('prog4', 'prog.c', dependencies: d2) +test('linkwhole2', exe2) + +# custom_target[i] tests + +exe_i = executable('prog_i', 'prog.c', link_with: clib[0]) +test('linkcustom', exe_i) + +d_i = declare_dependency(link_with: clib[0]) + +exe2_i = executable('prog2_i', 'prog.c', dependencies: d_i) +test('linkcustom2_i', exe2_i) + +# Link whole tests + +exe3_i = executable('prog3_i', 'prog.c', link_whole: clib[0]) +test('linkwhole', exe) + +d2_i = declare_dependency(link_whole: clib[0]) + +exe4_i = executable('prog4_i', 'prog.c', dependencies: d2_i) +test('linkwhole2_i', exe2_i) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/215 link custom/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/215 link custom/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/215 link custom/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/215 link custom/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,6 @@ +void flob(); + +int main(int argc, char **argv) { + flob(); + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/216 link custom_i single from multiple/generate_conflicting_stlibs.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/216 link custom_i single from multiple/generate_conflicting_stlibs.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/216 link custom_i single from multiple/generate_conflicting_stlibs.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/216 link custom_i single from multiple/generate_conflicting_stlibs.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,90 @@ +#!/usr/bin/env python3 + +import shutil, sys, subprocess, argparse, pathlib + +parser = argparse.ArgumentParser() + +parser.add_argument('--private-dir', required=True) +parser.add_argument('-o', nargs='+', required=True) +parser.add_argument('cmparr', nargs='+') + +contents = [''' +int flob() { + return 0; +} +''', ''' +int flob() { + return 1; +} +'''] + +def generate_lib_gnulike(outfile, c_file, private_dir, compiler_array): + if shutil.which('ar'): + static_linker = 'ar' + elif shutil.which('llvm-ar'): + static_linker = 'llvm-ar' + elif shutil.which('gcc-ar'): + static_linker = 'gcc-ar' + else: + sys.exit('Could not detect a static linker.') + o_file = c_file.with_suffix('.o') + compile_cmd = compiler_array + ['-c', '-g', '-O2', '-o', str(o_file), str(c_file)] + subprocess.check_call(compile_cmd) + out_file = pathlib.Path(outfile) + if out_file.exists(): + out_file.unlink() + link_cmd = [static_linker, 'csr', outfile, str(o_file)] + subprocess.check_call(link_cmd) + return 0 + + +def generate_lib_msvc(outfile, c_file, private_dir, compiler_array): + static_linker = 'lib' + o_file = c_file.with_suffix('.obj') + compile_cmd = compiler_array + ['/MDd', + '/nologo', + '/ZI', + '/Ob0', + '/Od', + '/c', + '/Fo' + str(o_file), + str(c_file)] + subprocess.check_call(compile_cmd) + out_file = pathlib.Path(outfile) + if out_file.exists(): + out_file.unlink() + link_cmd = [static_linker, + '/nologo', + '/OUT:' + str(outfile), + str(o_file)] + subprocess.check_call(link_cmd) + return 0 + +def generate_lib(outfiles, private_dir, compiler_array): + private_dir = pathlib.Path(private_dir) + if not private_dir.exists(): + private_dir.mkdir() + + for i, content in enumerate(contents): + c_file = private_dir / ('flob_' + str(i + 1) + '.c') + c_file.write_text(content) + outfile = outfiles[i] + + cl_found = False + for cl_arg in compiler_array: + if (cl_arg.endswith('cl') or cl_arg.endswith('cl.exe')) and 'clang-cl' not in cl_arg: + ret = generate_lib_msvc(outfile, c_file, private_dir, compiler_array) + if ret > 0: + return ret + else: + cl_found = True + break + if not cl_found: + ret = generate_lib_gnulike(outfile, c_file, private_dir, compiler_array) + if ret > 0: + return ret + return 0 + +if __name__ == '__main__': + options = parser.parse_args() + sys.exit(generate_lib(options.o, options.private_dir, options.cmparr)) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/216 link custom_i single from multiple/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/216 link custom_i single from multiple/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/216 link custom_i single from multiple/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/216 link custom_i single from multiple/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,37 @@ +project('linkcustom', 'c') + +# This would require passing the static linker to the build script or having +# it detect it by itself. I'm too lazy to implement it now and it is not +# really needed for testing that custom targets work. It is the responsibility +# of the custom target to produce things in the correct format. +assert(not meson.is_cross_build(), + 'MESON_SKIP_TEST cross checking not implemented.') + +cc = meson.get_compiler('c') +genprog = find_program('generate_conflicting_stlibs.py') + +clib = custom_target('linkcustom', + output: ['libflob_1.a', 'libflob_2.a'], + command: [genprog, + '-o', '@OUTPUT@', + '--private-dir', '@PRIVATE_DIR@'] + cc.cmd_array()) + +clib_2 = clib[1] + +exe = executable('prog', 'prog.c', link_with: clib_2) +test('linkcustom', exe) + +d = declare_dependency(link_with: clib_2) + +exe2 = executable('prog2', 'prog.c', dependencies: d) +test('linkcustom2', exe2) + +# Link whole tests + +exe3 = executable('prog3', 'prog.c', link_whole: clib_2) +test('linkwhole', exe) + +d2 = declare_dependency(link_whole: clib_2) + +exe4 = executable('prog4', 'prog.c', dependencies: d2) +test('linkwhole2', exe2) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/216 link custom_i single from multiple/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/216 link custom_i single from multiple/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/216 link custom_i single from multiple/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/216 link custom_i single from multiple/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +int flob(); + +int main(int argc, char **argv) { + return (flob() == 1 ? 0 : 1); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/217 link custom_i multiple from multiple/generate_stlibs.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/217 link custom_i multiple from multiple/generate_stlibs.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/217 link custom_i multiple from multiple/generate_stlibs.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/217 link custom_i multiple from multiple/generate_stlibs.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,92 @@ +#!/usr/bin/env python3 + +import shutil, sys, subprocess, argparse, pathlib + +parser = argparse.ArgumentParser() + +parser.add_argument('--private-dir', required=True) +parser.add_argument('-o', nargs='+', required=True) +parser.add_argument('cmparr', nargs='+') + +contents = ['''#include + +void flob_1() { + printf("Now flobbing #1.\\n"); +} +''', '''#include + +void flob_2() { + printf("Now flobbing #2.\\n"); +} +'''] + +def generate_lib_gnulike(outfile, c_file, private_dir, compiler_array): + if shutil.which('ar'): + static_linker = 'ar' + elif shutil.which('llvm-ar'): + static_linker = 'llvm-ar' + elif shutil.which('gcc-ar'): + static_linker = 'gcc-ar' + else: + sys.exit('Could not detect a static linker.') + o_file = c_file.with_suffix('.o') + compile_cmd = compiler_array + ['-c', '-g', '-O2', '-o', str(o_file), str(c_file)] + subprocess.check_call(compile_cmd) + out_file = pathlib.Path(outfile) + if out_file.exists(): + out_file.unlink() + link_cmd = [static_linker, 'csr', outfile, str(o_file)] + subprocess.check_call(link_cmd) + return 0 + + +def generate_lib_msvc(outfile, c_file, private_dir, compiler_array): + static_linker = 'lib' + o_file = c_file.with_suffix('.obj') + compile_cmd = compiler_array + ['/MDd', + '/nologo', + '/ZI', + '/Ob0', + '/Od', + '/c', + '/Fo' + str(o_file), + str(c_file)] + subprocess.check_call(compile_cmd) + out_file = pathlib.Path(outfile) + if out_file.exists(): + out_file.unlink() + link_cmd = [static_linker, + '/nologo', + '/OUT:' + str(outfile), + str(o_file)] + subprocess.check_call(link_cmd) + return 0 + +def generate_lib(outfiles, private_dir, compiler_array): + private_dir = pathlib.Path(private_dir) + if not private_dir.exists(): + private_dir.mkdir() + + for i, content in enumerate(contents): + c_file = private_dir / ('flob_' + str(i + 1) + '.c') + c_file.write_text(content) + outfile = outfiles[i] + + cl_found = False + for cl_arg in compiler_array: + if (cl_arg.endswith('cl') or cl_arg.endswith('cl.exe')) and 'clang-cl' not in cl_arg: + ret = generate_lib_msvc(outfile, c_file, private_dir, compiler_array) + if ret > 0: + return ret + else: + cl_found = True + break + if not cl_found: + ret = generate_lib_gnulike(outfile, c_file, private_dir, compiler_array) + if ret > 0: + return ret + return 0 + +if __name__ == '__main__': + options = parser.parse_args() + sys.exit(generate_lib(options.o, options.private_dir, options.cmparr)) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/217 link custom_i multiple from multiple/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/217 link custom_i multiple from multiple/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/217 link custom_i multiple from multiple/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/217 link custom_i multiple from multiple/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,37 @@ +project('linkcustom', 'c') + +# This would require passing the static linker to the build script or having +# it detect it by itself. I'm too lazy to implement it now and it is not +# really needed for testing that custom targets work. It is the responsibility +# of the custom target to produce things in the correct format. +assert(not meson.is_cross_build(), + 'MESON_SKIP_TEST cross checking not implemented.') + +cc = meson.get_compiler('c') +genprog = find_program('generate_stlibs.py') + +clib = custom_target('linkcustom', + output: ['libflob_1.a', 'libflob_2.a'], + command: [genprog, + '-o', '@OUTPUT@', + '--private-dir', '@PRIVATE_DIR@'] + cc.cmd_array()) + +clibs = [clib[0], clib[1]] + +exe = executable('prog', 'prog.c', link_with: clibs) +test('linkcustom', exe) + +d = declare_dependency(link_with: clibs) + +exe2 = executable('prog2', 'prog.c', dependencies: d) +test('linkcustom2', exe2) + +# Link whole tests + +exe3 = executable('prog3', 'prog.c', link_whole: clibs) +test('linkwhole', exe) + +d2 = declare_dependency(link_whole: clibs) + +exe4 = executable('prog4', 'prog.c', dependencies: d2) +test('linkwhole2', exe2) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/217 link custom_i multiple from multiple/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/217 link custom_i multiple from multiple/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/217 link custom_i multiple from multiple/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/217 link custom_i multiple from multiple/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,8 @@ +void flob_1(); +void flob_2(); + +int main(int argc, char **argv) { + flob_1(); + flob_2(); + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/218 dependency get_variable method/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/218 dependency get_variable method/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/218 dependency get_variable method/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/218 dependency get_variable method/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,52 @@ +project( + 'dependency get_variable', + ['c', 'cpp'], +) + +# Just some string that nothing should return +default = 'asufoiqwjtl;adjfbpiuqwoehtl;ajdfl;ghal;sdjg' + +dep = dependency('zlib', method: 'pkg-config', required : false) +if not dep.found() + warning('Skipping pkg-config tests as zlib is not avialable or is not pkg-config') +else + # Test for regular pkg-config + # We don't know what the value will be, but we know it should be the same + dep = dependency('zlib', method : 'pkg-config') + assert(dep.get_pkgconfig_variable('prefix') == dep.get_variable(pkgconfig : 'prefix'), + 'Got different values from get_pkgconfig_variable and get_variable(pkgconfig: )') + assert(dep.get_variable(pkgconfig : default, default_value : default) == default, + 'pkg-config didnt get default when we should have.') + assert(dep.get_variable(pkgconfig : 'prefix', default_value : default) != default, + 'pkg-config got default when we shouldnt have.') +endif + +dep_ct = dependency('llvm', method : 'config-tool', required : false) +if not dep_ct.found() + warning('Skipping config-tool tests as llvm is not available or llvm-config was not found.') +else + assert(dep_ct.get_configtool_variable('has-rtti') == dep_ct.get_variable(configtool : 'has-rtti'), + 'Got different values from get_configtool_variable and get_variable(configtool: )') + assert(dep_ct.get_variable(configtool : default, default_value : default) == default, + 'config-tool didnt get default when we should have.') + assert(dep_ct.get_variable(configtool : 'has-rtti', default_value : default) != default, + 'config-tool got default when we shouldnt have.') +endif + +dep_cm = dependency('llvm', method : 'cmake', required : false) +if not dep_cm.found() + warning('Skipping cmake tests as llvm is not available via the cmake finder.') +else + if dep_ct.found() + assert((dep_cm.get_variable(cmake : 'LLVM_ENABLE_RTTI') == 'ON') == (dep_ct.get_variable(configtool : 'has-rtti') == 'YES'), + 'RTTI information for cmake and config tools disagree') + endif + assert(dep_cm.get_variable(cmake : default, default_value : default) == default, + 'cmake didnt get default when we should have.') + assert(dep_cm.get_variable(cmake : 'LLVM_ENABLE_RTTI', default_value : default) != default, + 'cmake config-tool got default when we shouldnt have.') +endif + +idep = declare_dependency() +assert(idep.get_variable(pkgconfig : 'foo', cmake : 'foo', configtool : 'foo', default_value : default) == default, + 'Got something other than default from an internal dependency') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/219 source set configuration_data/a.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/219 source set configuration_data/a.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/219 source set configuration_data/a.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/219 source set configuration_data/a.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,8 @@ +#include +#include "all.h" + +int main(void) +{ + if (p) abort(); + f(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/219 source set configuration_data/all.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/219 source set configuration_data/all.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/219 source set configuration_data/all.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/219 source set configuration_data/all.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,7 @@ +extern void f(void); +extern void g(void); +extern void h(void); +extern void undefined(void); + +/* No extern here to get a common symbol */ +void (*p)(void); diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/219 source set configuration_data/f.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/219 source set configuration_data/f.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/219 source set configuration_data/f.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/219 source set configuration_data/f.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +#include "all.h" + +void f(void) +{ +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/219 source set configuration_data/g.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/219 source set configuration_data/g.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/219 source set configuration_data/g.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/219 source set configuration_data/g.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,6 @@ +#include "all.h" + +void g(void) +{ + h(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/219 source set configuration_data/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/219 source set configuration_data/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/219 source set configuration_data/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/219 source set configuration_data/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,54 @@ +project('a', 'c') + +good = declare_dependency(link_with: static_library('good', 'g.c')) +bad = declare_dependency(link_args: 'nonexistent.a') +not_found = dependency('invalid', required: false) + +source_set = import('sourceset') + +sources = source_set.source_set() +sources.add(when: 'YES', if_false: ['nope.c']) +sources.add(when: 'YES1', if_true: files('a.c')) +subdir('subdir') +sources.add(when: 'NO', if_true: 'nope.c', if_false: ['f.c']) +sources.add(when: 'NO', if_true: bad, if_false: ['f.c']) + +sources.add(when: 'YES2', if_true: good) + +# dependencies as conditions +sources.add(when: not_found, if_true: 'nope.c') + +# test add_all +sources2 = source_set.source_set() +sources2.add(when: 'YES1', if_true: 'nope.c') +sources.add_all(when: 'NO', if_true: sources2) + +# test duplicate items +sources.add(when: 'YES1', if_true: files('a.c')) + +conf1 = configuration_data() +conf1.set10('YES', true) +conf1.set10('YES1', true) +conf1.set10('YES2', false) +conf1.set10('NO', false) +result1 = sources.apply(conf1) + +conf2 = configuration_data() +conf2.set10('YES', true) +conf2.set10('YES1', false) +conf2.set10('YES2', true) +conf2.set10('NO', false) +result2 = sources.apply(conf2) + +# Each target will recompile the objects +executable('first', sources: result1.sources(), dependencies: result1.dependencies()) +executable('second', sources: result2.sources(), dependencies: result2.dependencies()) + +# All target will use the same object files +if meson.is_unity() + message('Skipping extraction test because this is a Unity build.') +else + all_objs = static_library('all_objs', sources.all_sources()) + executable('first_via_lib', objects: all_objs.extract_objects(result1.sources()), dependencies: result1.dependencies()) + executable('second_via_lib', objects: all_objs.extract_objects(result2.sources()), dependencies: result2.dependencies()) +endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/219 source set configuration_data/nope.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/219 source set configuration_data/nope.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/219 source set configuration_data/nope.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/219 source set configuration_data/nope.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +#include "all.h" + +void (*p)(void) = undefined; diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/219 source set configuration_data/subdir/b.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/219 source set configuration_data/subdir/b.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/219 source set configuration_data/subdir/b.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/219 source set configuration_data/subdir/b.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,13 @@ +#include +#include "all.h" + +void h(void) +{ +} + +int main(void) +{ + if (p) abort(); + f(); + g(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/219 source set configuration_data/subdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/219 source set configuration_data/subdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/219 source set configuration_data/subdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/219 source set configuration_data/subdir/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +sources.add(when: ['YES2', good], if_true: [ files('b.c') ]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/21 global arg/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/21 global arg/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/21 global arg/meson.build" 2018-12-09 16:29:05.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/21 global arg/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -1,22 +1,23 @@ project('global arg test', 'cpp', 'c') -add_global_arguments('-DMYTHING', language : 'c') -add_global_arguments('-DMYCPPTHING', language : 'cpp') - -add_global_arguments('-DGLOBAL_NATIVE', language : 'c', native : true) -add_global_arguments('-DGLOBAL_CROSS', language : 'c', native : false) - -if meson.is_cross_build() - c_args = ['-DARG_CROSS'] -else - c_args = ['-DARG_NATIVE'] -endif - -add_global_arguments('-DMYCANDCPPTHING', language: ['c', 'cpp']) - -exe1 = executable('prog', 'prog.c', c_args : c_args) -exe2 = executable('prog2', 'prog.cc') +add_global_arguments('-DMYTHING', language : 'c', native : true) +add_global_arguments('-DMYTHING', language : 'c', native : false) +add_global_arguments('-DMYCPPTHING', language : 'cpp', native : true) +add_global_arguments('-DMYCPPTHING', language : 'cpp', native : false) + +add_global_arguments('-DGLOBAL_BUILD', language : 'c', native : true) +add_global_arguments('-DGLOBAL_HOST', language : 'c', native : false) + +build_c_args = ['-DARG_BUILD'] +c_args = ['-DARG_HOST'] + +add_global_arguments('-DMYCANDCPPTHING', language: ['c', 'cpp'], native: true) +add_global_arguments('-DMYCANDCPPTHING', language: ['c', 'cpp'], native: false) + +exe1 = executable('prog1', 'prog.c', c_args : build_c_args, native : true) +exe2 = executable('prog2', 'prog.c', c_args : c_args, native : false) +exe3 = executable('prog3', 'prog.cc') test('prog1', exe1) test('prog2', exe2) - +test('prog3', exe3) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/21 global arg/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/21 global arg/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/21 global arg/prog.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/21 global arg/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,48 +1,40 @@ #ifndef MYTHING -#error "Global argument not set" + #error "Global argument not set" #endif #ifdef MYCPPTHING -#error "Wrong global argument set" + #error "Wrong global argument set" #endif #ifndef MYCANDCPPTHING -#error "Global argument not set" + #error "Global argument not set" #endif -#ifdef GLOBAL_NATIVE - #ifndef ARG_NATIVE - #error "Global is native but arg_native is not set." - #endif +#if !defined(GLOBAL_HOST) && !defined(GLOBAL_BUILD) + #error "Neither global_host nor glogal_build is set." +#endif - #ifdef GLOBAL_CROSS - #error "Both global native and global cross set." - #endif -#else - #ifndef GLOBAL_CROSS - #error "Neither global_cross nor glogal_native is set." - #endif +#if defined(GLOBAL_HOST) && defined(GLOBAL_BUILD) + #error "Both global build and global host set." +#endif - #ifndef ARG_CROSS - #error "Global is cross but arg_cross is not set." +#ifdef GLOBAL_BUILD + #ifndef ARG_BUILD + #error "Global is build but arg_build is not set." #endif - #ifdef ARG_NATIVE - #error "Global is cross but arg_native is set." + #ifdef ARG_HOST + #error "Global is build but arg host is set." #endif #endif -#ifdef GLOBAL_CROSS - #ifndef ARG_CROSS - #error "Global is cross but arg_cross is not set." - #endif -#else - #ifdef ARG_CROSS - #error "Global is cross but arg_native is set." +#ifdef GLOBAL_HOST + #ifndef ARG_HOST + #error "Global is host but arg_host is not set." #endif - #ifdef ARG_CROSS - #error "Global is native but arg cross is set." + #ifdef ARG_BUILD + #error "Global is host but arg_build is set." #endif #endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/220 source set dictionary/a.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/220 source set dictionary/a.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/220 source set dictionary/a.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/220 source set dictionary/a.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,8 @@ +#include +#include "all.h" + +int main(void) +{ + if (p) abort(); + f(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/220 source set dictionary/all.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/220 source set dictionary/all.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/220 source set dictionary/all.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/220 source set dictionary/all.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,7 @@ +extern void f(void); +extern void g(void); +extern void h(void); +extern void undefined(void); + +/* No extern here to get a common symbol */ +void (*p)(void); diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/220 source set dictionary/f.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/220 source set dictionary/f.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/220 source set dictionary/f.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/220 source set dictionary/f.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +#include "all.h" + +void f(void) +{ +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/220 source set dictionary/g.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/220 source set dictionary/g.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/220 source set dictionary/g.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/220 source set dictionary/g.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,6 @@ +#include "all.h" + +void g(void) +{ + h(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/220 source set dictionary/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/220 source set dictionary/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/220 source set dictionary/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/220 source set dictionary/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,56 @@ +project('a', 'c') + +good = declare_dependency(link_with: static_library('good', 'g.c')) +bad = declare_dependency(link_args: 'nonexistent.a') +not_found = dependency('invalid', required: false) + +source_set = import('sourceset') + +sources = source_set.source_set() +sources.add(when: 'YES', if_false: ['nope.c']) +sources.add(when: 'YES1', if_true: files('a.c')) +subdir('subdir') +sources.add(when: 'NO', if_true: 'nope.c', if_false: ['f.c']) +sources.add(when: 'NO', if_true: bad, if_false: ['f.c']) + +sources.add(when: 'YES2', if_true: good) + +# dependencies as conditions +sources.add(when: not_found, if_true: 'nope.c') + +# test add_all +sources2 = source_set.source_set() +sources2.add(when: 'YES1', if_true: 'nope.c') +sources.add_all(when: 'NO', if_true: sources2) + +# test duplicate items +sources.add(when: 'YES1', if_true: files('a.c')) + +conf1 = { + 'YES': true, + 'YES1': true, + 'YES2': false, + 'NO': false, +} +result1 = sources.apply(conf1) + +conf2 = { + 'YES': true, + 'YES1': false, + 'YES2': true, + 'NO': false, +} +result2 = sources.apply(conf2) + +# Each target will recompile the objects +executable('first', sources: result1.sources(), dependencies: result1.dependencies()) +executable('second', sources: result2.sources(), dependencies: result2.dependencies()) + +# All target will use the same object files +if meson.is_unity() + message('Skipping extraction test because this is a Unity build.') +else + all_objs = static_library('all_objs', sources.all_sources()) + executable('first_via_lib', objects: all_objs.extract_objects(result1.sources()), dependencies: result1.dependencies()) + executable('second_via_lib', objects: all_objs.extract_objects(result2.sources()), dependencies: result2.dependencies()) +endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/220 source set dictionary/nope.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/220 source set dictionary/nope.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/220 source set dictionary/nope.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/220 source set dictionary/nope.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +#include "all.h" + +void (*p)(void) = undefined; diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/220 source set dictionary/subdir/b.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/220 source set dictionary/subdir/b.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/220 source set dictionary/subdir/b.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/220 source set dictionary/subdir/b.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,13 @@ +#include +#include "all.h" + +void h(void) +{ +} + +int main(void) +{ + if (p) abort(); + f(); + g(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/220 source set dictionary/subdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/220 source set dictionary/subdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/220 source set dictionary/subdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/220 source set dictionary/subdir/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +sources.add(when: ['YES2', good], if_true: [ files('b.c') ]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/221 source set custom target/a.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/221 source set custom target/a.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/221 source set custom target/a.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/221 source set custom target/a.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,7 @@ +#include "all.h" + +int main(void) +{ + f(); + g(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/221 source set custom target/all.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/221 source set custom target/all.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/221 source set custom target/all.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/221 source set custom target/all.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +extern void f(void); +extern void g(void); diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/221 source set custom target/cp.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/221 source set custom target/cp.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/221 source set custom target/cp.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/221 source set custom target/cp.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +#! /usr/bin/env python3 + +import sys +from shutil import copyfile +copyfile(*sys.argv[1:]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/221 source set custom target/f.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/221 source set custom target/f.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/221 source set custom target/f.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/221 source set custom target/f.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +#include "all.h" + +void f(void) +{ +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/221 source set custom target/g.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/221 source set custom target/g.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/221 source set custom target/g.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/221 source set custom target/g.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +#include "all.h" + +void g(void) +{ +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/221 source set custom target/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/221 source set custom target/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/221 source set custom target/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/221 source set custom target/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,28 @@ +# Try using sourceset with various kinds of generated sources + +project('a', 'c') + +cp = find_program('cp.py') + +source_set = import('sourceset') +sources = source_set.source_set() + +a_c = custom_target('gen-custom-target', + input: 'a.c', output: 'out_a.c', + command: [cp, '@INPUT@', '@OUTPUT@']) +sources.add(when: 'YES', if_true: a_c) +sources.add(when: 'YES', if_true: a_c[0]) + +f_c = configure_file(input: 'f.c', output: 'out_f.c', copy: true) +sources.add(when: 'YES', if_true: f_c) +sources.add(when: 'YES', if_true: f_c) + +gen = generator(cp, output: 'out_@PLAINNAME@', arguments: ['@INPUT@', '@OUTPUT@']) +g_c = gen.process(files('g.c')) +sources.add(when: 'YES', if_true: g_c) +sources.add(when: 'YES', if_true: g_c) + +conf1 = { 'YES': true, } +result1 = sources.apply(conf1) + +executable('first', sources: result1.sources(), dependencies: result1.dependencies()) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/boards/arm/aarch64.cc" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/boards/arm/aarch64.cc" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/boards/arm/aarch64.cc" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/boards/arm/aarch64.cc" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,8 @@ +#include "common.h" +#include + +void initialize_target() +{ + std::cout << ANSI_START << "some " << THE_TARGET + << " initialization" << ANSI_END << std::endl; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/boards/arm/arm32.cc" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/boards/arm/arm32.cc" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/boards/arm/arm32.cc" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/boards/arm/arm32.cc" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,8 @@ +#include "common.h" +#include + +void initialize_target() +{ + std::cout << ANSI_START << "a different " << THE_TARGET + << " initialization" << ANSI_END << std::endl; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/boards/arm/arm.cc" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/boards/arm/arm.cc" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/boards/arm/arm.cc" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/boards/arm/arm.cc" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,10 @@ +#include "arm.h" + +const char *ARMBoard::target() +{ + return THE_TARGET; +} + +void ARMBoard::some_arm_thing() +{ +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/boards/arm/arm.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/boards/arm/arm.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/boards/arm/arm.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/boards/arm/arm.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,12 @@ +#ifndef ARM_H +#define ARM_H 1 + +#include "common.h" + +struct ARMBoard: Board { + const char *target(); + void some_arm_thing(); +}; + + +#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/boards/arm/versatilepb.cc" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/boards/arm/versatilepb.cc" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/boards/arm/versatilepb.cc" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/boards/arm/versatilepb.cc" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,16 @@ +#include +#include "common.h" +#include "arm.h" + +struct VersatilePBBoard: ARMBoard { + void say_hello(); +}; + +void VersatilePBBoard::say_hello() +{ + some_arm_thing(); + std::cout << ANSI_START << "I am the versatilepb board" + << ANSI_END << std::endl; +} + +static VersatilePBBoard versatilepb; diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/boards/arm/virt.cc" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/boards/arm/virt.cc" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/boards/arm/virt.cc" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/boards/arm/virt.cc" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,16 @@ +#include +#include "common.h" +#include "arm.h" + +struct VirtBoard: ARMBoard { + void say_hello(); +}; + +void VirtBoard::say_hello() +{ + some_arm_thing(); + std::cout << ANSI_START << "I am the virt board" + << ANSI_END << std::endl; +} + +static VirtBoard virt; diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/boards/arm/xlnx_zcu102.cc" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/boards/arm/xlnx_zcu102.cc" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/boards/arm/xlnx_zcu102.cc" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/boards/arm/xlnx_zcu102.cc" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,16 @@ +#include +#include "common.h" +#include "arm.h" + +struct XlnxZCU102Board: ARMBoard { + void say_hello(); +}; + +void XlnxZCU102Board::say_hello() +{ + some_arm_thing(); + std::cout << ANSI_START << "I am the xlnx_zcu102 board" + << ANSI_END << std::endl; +} + +static XlnxZCU102Board xlnx_zcu102; diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/boards/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/boards/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/boards/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/boards/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,7 @@ +specific.add(when: 'TARGET_ARM', if_true: files('arm/arm.cc', 'arm/arm32.cc')) +specific.add(when: 'TARGET_AARCH64', if_true: files('arm/arm.cc', 'arm/aarch64.cc')) +specific.add(when: 'CONFIG_VIRT', if_true: files('arm/virt.cc')) +specific.add(when: 'CONFIG_XLNX_ZCU102', if_true: files('arm/xlnx_zcu102.cc')) +specific.add(when: 'CONFIG_VERSATILEPB', if_true: files('arm/versatilepb.cc')) + +specific.add(when: 'TARGET_X86', if_true: files('x86/pc.cc')) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/boards/x86/pc.cc" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/boards/x86/pc.cc" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/boards/x86/pc.cc" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/boards/x86/pc.cc" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,26 @@ +#include +#include "common.h" + +struct X86Board: Board { + const char *target(); + void say_hello(); +}; + +const char *X86Board::target() +{ + return THE_TARGET; +} + +void X86Board::say_hello() +{ + std::cout << ANSI_START << "I am a 1996 PC" + << ANSI_END << std::endl; +} + +void initialize_target() +{ + std::cout << ANSI_START << "ready, set, go" + << ANSI_END << std::endl; +} + +static X86Board pc; diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/common.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/common.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/common.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/common.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,41 @@ +#ifndef COMMON_H +#define COMMON_H 1 + +/* + * target-specific code will print in yellow, common code will print + * in grey. + */ +#ifdef THE_TARGET +#define ANSI_START "\x1b[33;1m" +#define ANSI_END "\x1b[0m" +#else +#define ANSI_START "" +#define ANSI_END "" +#endif + +void some_random_function(); +void initialize_target(); + +struct Board { + Board *next; + Board(); + virtual ~Board(); + virtual void say_hello() = 0; + virtual const char *target() = 0; +}; + +struct Device { + Device *next; + Device(); + virtual ~Device(); + virtual void say_hello() = 0; +}; + +struct Dependency { + Dependency *next; + Dependency(); + virtual ~Dependency(); + virtual void initialize() = 0; +}; + +#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/config/aarch64" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/config/aarch64" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/config/aarch64" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/config/aarch64" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +TARGET_AARCH64=y +CONFIG_VIRT=y +CONFIG_XLNX_ZCU102=y +CONFIG_VIRTIO=y +CONFIG_VIRTIO_MMIO=y diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/config/arm" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/config/arm" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/config/arm" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/config/arm" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +TARGET_ARM=y +CONFIG_VIRT=y +CONFIG_VERSATILEPB=y diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/config/x86" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/config/x86" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/config/x86" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/config/x86" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,4 @@ +TARGET_X86=y +CONFIG_PC=y +CONFIG_VIRTIO=y +CONFIG_VIRTIO_PCI=y diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/devices/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/devices/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/devices/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/devices/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +specific.add(when: 'CONFIG_VIRTIO', if_true: files('virtio.cc')) +common.add(when: 'CONFIG_VIRTIO_PCI', if_true: files('virtio-pci.cc')) +common.add(when: 'CONFIG_VIRTIO_MMIO', if_true: files('virtio-mmio.cc')) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/devices/virtio.cc" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/devices/virtio.cc" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/devices/virtio.cc" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/devices/virtio.cc" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,6 @@ +#include +#include "common.h" +#include "virtio.h" + +void VirtioDevice::some_virtio_thing() { +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/devices/virtio.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/devices/virtio.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/devices/virtio.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/devices/virtio.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,10 @@ +#ifndef VIRTIO_H +#define VIRTIO_H 1 + +#include "common.h" + +struct VirtioDevice: Device { + void some_virtio_thing(); +}; + +#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/devices/virtio-mmio.cc" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/devices/virtio-mmio.cc" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/devices/virtio-mmio.cc" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/devices/virtio-mmio.cc" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,16 @@ +#include +#include "common.h" +#include "virtio.h" + +struct VirtioMMIODevice: VirtioDevice { + void say_hello(); +}; + +void VirtioMMIODevice::say_hello() +{ + some_virtio_thing(); + std::cout << ANSI_START << "virtio-mmio is available" + << ANSI_END << std::endl; +} + +static VirtioMMIODevice virtio_mmio; diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/devices/virtio-pci.cc" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/devices/virtio-pci.cc" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/devices/virtio-pci.cc" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/devices/virtio-pci.cc" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,16 @@ +#include +#include "common.h" +#include "virtio.h" + +struct VirtioPCIDevice: VirtioDevice { + void say_hello(); +}; + +void VirtioPCIDevice::say_hello() +{ + some_virtio_thing(); + std::cout << ANSI_START << "virtio-pci is available" + << ANSI_END << std::endl; +} + +static VirtioPCIDevice virtio_pci; diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/main.cc" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/main.cc" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/main.cc" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/main.cc" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,32 @@ +#include +#include +#include "common.h" + +Board* boards; +Device* devices; +Dependency* deps; + +Board::Board() { this->next = boards; boards = this; } +Board::~Board() {} + +Device::Device() { this->next = devices; devices = this; } +Device::~Device() {} + +Dependency::Dependency() { this->next = deps; deps = this; } +Dependency::~Dependency() {} + +int main() +{ + some_random_function(); + for (auto d = deps; d; d = d->next) + d->initialize(); + + initialize_target(); + for (auto b = boards; b; b = b->next) { + std::cout << ANSI_START << b->target() << " - " << ANSI_END; + b->say_hello(); + } + + for (auto d = devices; d; d = d->next) + d->say_hello(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,52 @@ +# a sort-of realistic example that combines the sourceset and kconfig +# modules, inspired by QEMU's build system + +project('sourceset-example', 'cpp') + +cppid = meson.get_compiler('cpp').get_id() +if cppid == 'pgi' + error('MESON_SKIP_TEST: Even PGI 19.4 that claims C++17 full support, cannot handle auto x = y syntax used in this test.') +endif + +ss = import('sourceset') +kconfig = import('unstable-kconfig') + +zlib = declare_dependency(compile_args: '-DZLIB=1') +another = declare_dependency(compile_args: '-DANOTHER=1') +not_found = dependency('not-found', required: false) + +common = ss.source_set() +specific = ss.source_set() + +common.add(files('main.cc')) +common.add(when: [zlib, another], if_true: files('zlib.cc')) +common.add(when: not_found, + if_true: files('was-found.cc'), + if_false: files('not-found.cc')) + +subdir('boards') +subdir('devices') + +if meson.is_unity() + specific.add_all(common) + common = ss.source_set() +endif + +common_lib = static_library('common', common.all_sources(), + dependencies: common.all_dependencies()) + +targets = [ 'arm', 'aarch64', 'x86' ] +target_dirs = { 'arm' : 'arm', 'aarch64' : 'arm', 'x86': 'x86' } + +foreach x : targets + config = kconfig.load('config' / x) + target_specific = specific.apply(config, strict: false) + target_common = common.apply(config, strict: false) + target_deps = target_specific.dependencies() + target_common.dependencies() + executable(x, + objects: common_lib.extract_objects(target_common.sources()), + sources: target_specific.sources(), + dependencies: target_deps, + include_directories: 'boards' / target_dirs[x], + cpp_args: '-DTHE_TARGET="' + x + '"') +endforeach diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/not-found.cc" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/not-found.cc" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/not-found.cc" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/not-found.cc" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,8 @@ +#include +#include "common.h" + +void some_random_function() +{ + std::cout << ANSI_START << "everything's alright" + << ANSI_END << std::endl; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/was-found.cc" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/was-found.cc" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/was-found.cc" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/was-found.cc" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,7 @@ +#include + +void some_random_function() +{ + std::cout << ANSI_START << "huh?" + << ANSI_END << std::endl; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/zlib.cc" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/zlib.cc" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/222 source set realistic example/zlib.cc" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/222 source set realistic example/zlib.cc" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,15 @@ +#include +#include "common.h" + +struct ZLibDependency : Dependency { + void initialize(); +}; + +void ZLibDependency::initialize() { + if (ZLIB && ANOTHER) { + std::cout << ANSI_START << "hello from zlib" + << ANSI_END << std::endl; + } +} + +ZLibDependency zlib; diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/223 custom target input extracted objects/check_object.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/223 custom target input extracted objects/check_object.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/223 custom target input extracted objects/check_object.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/223 custom target input extracted objects/check_object.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 + +import sys, os + +if __name__ == '__main__': + if len(sys.argv) != 3: + print(sys.argv[0], 'object', 'output') + sys.exit(1) + elif os.path.exists(sys.argv[1]): + with open(sys.argv[2], 'wb') as out: + pass + else: + sys.exit(1) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/223 custom target input extracted objects/libdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/223 custom target input extracted objects/libdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/223 custom target input extracted objects/libdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/223 custom target input extracted objects/libdir/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +objlib = static_library('object', 'source.c', override_options : ['unity=off']) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/223 custom target input extracted objects/libdir/source.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/223 custom target input extracted objects/libdir/source.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/223 custom target input extracted objects/libdir/source.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/223 custom target input extracted objects/libdir/source.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,3 @@ +int func1_in_obj() { + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/223 custom target input extracted objects/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/223 custom target input extracted objects/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/223 custom target input extracted objects/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/223 custom target input extracted objects/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,13 @@ +project('custom target input extracted objects', 'c') + +checker = find_program('check_object.py') + +cc = meson.get_compiler('c').cmd_array().get(-1) + +subdir('libdir') + +custom_target('check', + input: objlib.extract_objects('source.c'), + output: 'objcheck', + command: [checker, '@INPUT@', '@OUTPUT@'], + build_by_default: true) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/224 test priorities/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/224 test priorities/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/224 test priorities/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/224 test priorities/meson.build" 2019-09-16 21:20:45.000000000 +0000 @@ -0,0 +1,22 @@ +project('test priorities', 'c') + +test_prog = find_program('testprog.py') + +test('priority 0', test_prog, + args : ['0'], +) + +test('priority neg 10', test_prog, + args : ['-10'], + priority : -10 +) + +test('priority 1000', test_prog, + args : ['1000'], + priority : 1000 +) + +test('priority 50', test_prog, + args : ['50'], + priority : 50 +) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/224 test priorities/testprog.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/224 test priorities/testprog.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/224 test priorities/testprog.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/224 test priorities/testprog.py" 2019-09-16 21:20:45.000000000 +0000 @@ -0,0 +1,5 @@ +#!/usr/bin/env python3 + +import sys + +print(sys.argv[1]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/225 include_dir dot/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/225 include_dir dot/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/225 include_dir dot/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/225 include_dir dot/meson.build" 2019-09-16 21:20:45.000000000 +0000 @@ -0,0 +1,8 @@ +project('Include Here', 'c') + +# The layout with the .h file in . and the .c files in src/ is critical to +# tickle the bug #5847 + +inc = include_directories('.') + +subdir('src') \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/225 include_dir dot/rone.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/225 include_dir dot/rone.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/225 include_dir dot/rone.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/225 include_dir dot/rone.h" 2019-09-16 21:20:45.000000000 +0000 @@ -0,0 +1 @@ +int rOne(void); \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/225 include_dir dot/src/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/225 include_dir dot/src/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/225 include_dir dot/src/main.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/225 include_dir dot/src/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +#include "rone.h" + +int main() { + return rOne(); +} \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/225 include_dir dot/src/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/225 include_dir dot/src/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/225 include_dir dot/src/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/225 include_dir dot/src/meson.build" 2019-09-16 21:20:45.000000000 +0000 @@ -0,0 +1,6 @@ +t = executable( + 'main', + ['main.c', 'rone.c'], + include_directories : inc, + implicit_include_directories : false, +) \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/225 include_dir dot/src/rone.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/225 include_dir dot/src/rone.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/225 include_dir dot/src/rone.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/225 include_dir dot/src/rone.c" 2019-09-16 21:20:45.000000000 +0000 @@ -0,0 +1,3 @@ +int rOne(void) { + return 1; +} \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/226 include_type dependency/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/226 include_type dependency/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/226 include_type dependency/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/226 include_type dependency/meson.build" 2019-10-06 17:01:35.000000000 +0000 @@ -0,0 +1,28 @@ +project( + 'dependency include_type', + ['c', 'cpp'], +) + +dep = dependency('zlib', method: 'pkg-config', required : false) +if not dep.found() + error('MESON_SKIP_TEST zlib was not found') +endif + +assert(dep.include_type() == 'preserve', 'include_type must default to "preserve"') + +dep_sys = dep.as_system() +assert(dep_sys.include_type() == 'system', 'as_system must return a system dep') + +dep2 = dependency('zlib', method: 'pkg-config', include_type : 'system') +assert(dep2.include_type() == 'system', 'include_type must be true when set') + +dep2_sys = dep2.as_system('non-system') +assert(dep2_sys.include_type() == 'non-system', 'as_system must set include_type correctly') + +sp = subproject('subDep') +sp_dep = sp.get_variable('subDep_dep') +assert(sp_dep.include_type() == 'preserve', 'default is preserve') + +sp_dep_sys = sp_dep.as_system('system') +assert(sp_dep_sys.include_type() == 'system', 'changing include_type works') +assert(sp_dep.include_type() == 'preserve', 'as_system must not mutate the original object') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/226 include_type dependency/subprojects/subDep/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/226 include_type dependency/subprojects/subDep/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/226 include_type dependency/subprojects/subDep/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/226 include_type dependency/subprojects/subDep/meson.build" 2019-10-06 17:01:35.000000000 +0000 @@ -0,0 +1,3 @@ +project('subDep', ['cpp']) + +subDep_dep = declare_dependency(compile_args : []) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/23 object extraction/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/23 object extraction/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/23 object extraction/meson.build" 2018-12-09 16:29:06.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/23 object extraction/meson.build" 2019-08-16 20:34:38.000000000 +0000 @@ -8,10 +8,13 @@ obj1 = lib1.extract_objects('src/lib.c') obj2 = lib2.extract_objects(['lib.c']) + obj3 = lib2.extract_objects(files('lib.c')) e1 = executable('main1', 'main.c', objects : obj1) e2 = executable('main2', 'main.c', objects : obj2) + e3 = executable('main3', 'main.c', objects : obj3) test('extraction test 1', e1) test('extraction test 2', e2) + test('extraction test 3', e3) endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/27 pipeline/depends/copyrunner.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/27 pipeline/depends/copyrunner.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/27 pipeline/depends/copyrunner.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/27 pipeline/depends/copyrunner.py" 2019-05-22 21:53:22.000000000 +0000 @@ -0,0 +1,7 @@ +#!/usr/bin/env python3 + +import sys, subprocess + +prog, infile, outfile = sys.argv[1:] + +subprocess.check_call([prog, infile, outfile]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/27 pipeline/depends/filecopier.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/27 pipeline/depends/filecopier.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/27 pipeline/depends/filecopier.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/27 pipeline/depends/filecopier.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,22 @@ +#include +#include + +#define BUFSIZE 1024 + +int main(int argc, char **argv) { + char buffer[BUFSIZE]; + size_t num_read; + size_t num_written; + FILE *fin = fopen(argv[1], "rb"); + FILE *fout; + assert(fin); + num_read = fread(buffer, 1, BUFSIZE, fin); + assert(num_read > 0); + fclose(fin); + fout = fopen(argv[2], "wb"); + assert(fout); + num_written = fwrite(buffer, 1, num_read, fout); + assert(num_written == num_read); + fclose(fout); + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/27 pipeline/depends/libsrc.c.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/27 pipeline/depends/libsrc.c.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/27 pipeline/depends/libsrc.c.in" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/27 pipeline/depends/libsrc.c.in" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,3 @@ +int func() { + return 42; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/27 pipeline/depends/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/27 pipeline/depends/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/27 pipeline/depends/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/27 pipeline/depends/meson.build" 2019-05-22 21:53:22.000000000 +0000 @@ -0,0 +1,11 @@ +runner = find_program('copyrunner.py') + +copier = executable('copier', 'filecopier.c', native: true) + +cg = generator(runner, + output: ['@BASENAME@.c'], + arguments: [copier.full_path(), '@INPUT@', '@OUTPUT@'], + depends: copier) + +test('generatordep', + executable('gd', 'prog.c', cg.process('libsrc.c.in'))) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/27 pipeline/depends/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/27 pipeline/depends/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/27 pipeline/depends/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/27 pipeline/depends/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +int func(); + +int main(int argc, char **argv) { + return func() != 42; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/27 pipeline/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/27 pipeline/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/27 pipeline/meson.build" 2018-12-09 16:29:09.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/27 pipeline/meson.build" 2019-08-16 20:34:44.000000000 +0000 @@ -15,3 +15,9 @@ e2 = executable('prog', 'prog.c', generated) test('pipelined', e2) + +# This is in a subdirectory to make sure +# we write proper subdir paths to output. +subdir('src') + +subdir('depends') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/27 pipeline/src/input_src.dat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/27 pipeline/src/input_src.dat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/27 pipeline/src/input_src.dat" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/27 pipeline/src/input_src.dat" 2019-05-22 21:53:22.000000000 +0000 @@ -0,0 +1 @@ +#include diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/27 pipeline/src/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/27 pipeline/src/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/27 pipeline/src/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/27 pipeline/src/meson.build" 2019-05-22 21:53:22.000000000 +0000 @@ -0,0 +1,12 @@ +e1 = executable('srcgen', 'srcgen.c', native : true) + +# Generate a header file that needs to be included. +gen = generator(e1, + output : '@BASENAME@.h', + arguments : ['@INPUT@', '@OUTPUT@']) + +generated = gen.process('input_src.dat') + +e2 = executable('prog', 'prog.c', generated) + +test('pipelined', e2) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/27 pipeline/src/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/27 pipeline/src/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/27 pipeline/src/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/27 pipeline/src/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,9 @@ +#include"input_src.h" + +int main(int argc, char **argv) { + void *foo = printf; + if(foo) { + return 0; + } + return 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/27 pipeline/src/srcgen.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/27 pipeline/src/srcgen.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/27 pipeline/src/srcgen.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/27 pipeline/src/srcgen.c" 2019-05-22 21:53:22.000000000 +0000 @@ -0,0 +1,40 @@ +#include +#include + +#define ARRSIZE 80 + +int main(int argc, char **argv) { + char arr[ARRSIZE]; + char *ifilename; + char *ofilename; + FILE *ifile; + FILE *ofile; + size_t bytes; + + if(argc != 3) { + fprintf(stderr, "%s \n", argv[0]); + return 1; + } + ifilename = argv[1]; + ofilename = argv[2]; + printf("%s\n", ifilename); + ifile = fopen(ifilename, "r"); + if(!ifile) { + fprintf(stderr, "Could not open source file %s.\n", ifilename); + return 1; + } + ofile = fopen(ofilename, "w"); + if(!ofile) { + fprintf(stderr, "Could not open target file %s\n", ofilename); + fclose(ifile); + return 1; + } + bytes = fread(arr, 1, ARRSIZE, ifile); + assert(bytes < 80); + assert(bytes > 0); + fwrite(arr, 1, bytes, ofile); + + fclose(ifile); + fclose(ofile); + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/28 find program/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/28 find program/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/28 find program/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/28 find program/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,29 @@ +project('find program', 'c') + +if build_machine.system() == 'windows' + # Things Windows does not provide: + # - an executable to copy files without prompting + # - working command line quoting + # - anything that you might actually need + # Because of these reasons we only check that + # the program can be found. + cp = find_program('xcopy') +else + cp = find_program('donotfindme', 'cp') + gen = generator(cp, \ + output : '@BASENAME@.c', \ + arguments : ['@INPUT@', '@OUTPUT@']) + + generated = gen.process('source.in') + e = executable('prog', generated) + test('external exe', e) +endif + +prog = find_program('print-version.py', version : '>=2.0', required : false) +assert(not prog.found(), 'Version should be too old') + +prog = find_program('print-version.py', version : '>=1.0') +assert(prog.found(), 'Program version should match') + +prog = find_program('print-version-with-prefix.py', version : '>=1.0') +assert(prog.found(), 'Program version should match') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/28 find program/print-version.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/28 find program/print-version.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/28 find program/print-version.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/28 find program/print-version.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,8 @@ +#!/usr/bin/env python3 + +import sys + +if len(sys.argv) != 2 or sys.argv[1] != '--version': + exit(1) + +print('1.0') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/28 find program/print-version-with-prefix.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/28 find program/print-version-with-prefix.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/28 find program/print-version-with-prefix.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/28 find program/print-version-with-prefix.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,8 @@ +#!/usr/bin/env python3 + +import sys + +if len(sys.argv) != 2 or sys.argv[1] != '--version': + exit(1) + +print('Version: 1.0') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/28 find program/source.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/28 find program/source.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/28 find program/source.in" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/28 find program/source.in" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,3 @@ +int main(int argc, char **argv) { + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/28 pipeline/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/28 pipeline/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/28 pipeline/meson.build" 2018-12-09 16:29:10.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/28 pipeline/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -project('pipeline test', 'c') - -# This is in a subdirectory to make sure -# we write proper subdir paths to output. -subdir('src') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/28 pipeline/src/input_src.dat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/28 pipeline/src/input_src.dat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/28 pipeline/src/input_src.dat" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/28 pipeline/src/input_src.dat" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#include diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/28 pipeline/src/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/28 pipeline/src/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/28 pipeline/src/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/28 pipeline/src/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -e1 = executable('srcgen', 'srcgen.c', native : true) - -# Generate a header file that needs to be included. -gen = generator(e1, - output : '@BASENAME@.h', - arguments : ['@INPUT@', '@OUTPUT@']) - -generated = gen.process('input_src.dat') - -e2 = executable('prog', 'prog.c', generated) - -test('pipelined', e2) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/28 pipeline/src/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/28 pipeline/src/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/28 pipeline/src/prog.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/28 pipeline/src/prog.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -#include"input_src.h" - -int main(int argc, char **argv) { - void *foo = printf; - if(foo) { - return 0; - } - return 1; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/28 pipeline/src/srcgen.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/28 pipeline/src/srcgen.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/28 pipeline/src/srcgen.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/28 pipeline/src/srcgen.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -#include -#include - -#define ARRSIZE 80 - -int main(int argc, char **argv) { - char arr[ARRSIZE]; - char *ifilename; - char *ofilename; - FILE *ifile; - FILE *ofile; - size_t bytes; - - if(argc != 3) { - fprintf(stderr, "%s \n", argv[0]); - return 1; - } - ifilename = argv[1]; - ofilename = argv[2]; - printf("%s\n", ifilename); - ifile = fopen(ifilename, "r"); - if(!ifile) { - fprintf(stderr, "Could not open source file %s.\n", ifilename); - return 1; - } - ofile = fopen(ofilename, "w"); - if(!ofile) { - fprintf(stderr, "Could not open target file %s\n", ofilename); - fclose(ifile); - return 1; - } - bytes = fread(arr, 1, ARRSIZE, ifile); - assert(bytes < 80); - assert(bytes > 0); - fwrite(arr, 1, bytes, ofile); - - fclose(ifile); - fclose(ofile); - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/29 find program/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/29 find program/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/29 find program/meson.build" 2018-12-09 16:29:11.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/29 find program/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -project('find program', 'c') - -if build_machine.system() == 'windows' - # Things Windows does not provide: - # - an executable to copy files without prompting - # - working command line quoting - # - anything that you might actually need - # Because of these reasons we only check that - # the program can be found. - cp = find_program('xcopy') -else - cp = find_program('donotfindme', 'cp') - gen = generator(cp, \ - output : '@BASENAME@.c', \ - arguments : ['@INPUT@', '@OUTPUT@']) - - generated = gen.process('source.in') - e = executable('prog', generated) - test('external exe', e) -endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/29 find program/source.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/29 find program/source.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/29 find program/source.in" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/29 find program/source.in" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -int main(int argc, char **argv) { - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/29 multiline string/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/29 multiline string/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/29 multiline string/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/29 multiline string/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,35 @@ +project('multiline string', 'c') + +x = '''hello again''' +y = '''hello +again''' + +if x == y + error('Things are wrong.') +endif + +multieol = ''' +''' +singleeol = '\n' + +if multieol != singleeol + error('Newline quoting is broken.') +endif + +# And one more for good measure. +quote1 = ''' ' '''.strip() +quote2 = '\'' + +if quote1 != quote2 + error('Single quote quoting is broken.') +endif + +cc = meson.get_compiler('c') +prog = ''' +int main(int argc, char **argv) { + int num = 1; + printf("%d\n", num); + return 0; +}''' + +assert(cc.compiles(prog), 'multline test compile failed') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/2 cpp/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/2 cpp/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/2 cpp/meson.build" 2018-12-09 16:28:45.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/2 cpp/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -1,9 +1,34 @@ project('c++ test', 'cpp') -if meson.get_compiler('cpp').get_id() == 'intel' +cpp = meson.get_compiler('cpp') +if cpp.get_id() == 'intel' # Error out if the -std=xxx option is incorrect add_project_arguments('-diag-error', '10159', language : 'cpp') +elif cpp.get_id() == 'intel-cl' + add_project_arguments('/Qdiag-error:10159', language : 'cpp') endif exe = executable('trivialprog', 'trivial.cc', extra_files : 'something.txt') test('runtest', exe) + +has_not_changed = false +if is_disabler(exe) + has_not_changed = true +else + has_not_changed = true +endif +assert(has_not_changed, 'Executable has changed.') + +assert(not is_disabler(exe), 'Executable is a disabler.') + +exe = executable('trivialprog', 'trivial.cc', extra_files : disabler()) + +assert(is_disabler(exe), 'Executable is not a disabler.') + +if exe.found() + exe_disabled = false +else + exe_disabled = true +endif + +assert(exe_disabled, 'Executable was not disabled.') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/30 multiline string/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/30 multiline string/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/30 multiline string/meson.build" 2018-12-09 16:29:12.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/30 multiline string/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -project('multiline string', 'c') - -x = '''hello again''' -y = '''hello -again''' - -if x == y - error('Things are wrong.') -endif - -multieol = ''' -''' -singleeol = '\n' - -if multieol != singleeol - error('Newline quoting is broken.') -endif - -# And one more for good measure. -quote1 = ''' ' '''.strip() -quote2 = '\'' - -if quote1 != quote2 - error('Single quote quoting is broken.') -endif - -cc = meson.get_compiler('c') -prog = ''' -int main(int argc, char **argv) { - int num = 1; - printf("%d\n", num); - return 0; -}''' - -assert(cc.compiles(prog), 'multline test compile failed') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/30 try compile/invalid.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/30 try compile/invalid.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/30 try compile/invalid.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/30 try compile/invalid.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,2 @@ +#include +void func() { printf("This won't work.\n"); } diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/30 try compile/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/30 try compile/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/30 try compile/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/30 try compile/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,27 @@ +project('try compile', 'c', 'cpp') + +code = '''#include +void func() { printf("Something.\n"); } +''' + +breakcode = '''#include +void func() { printf("This won't work.\n"); } +''' + +foreach compiler : [meson.get_compiler('c'), meson.get_compiler('cpp')] + if compiler.compiles(code, name : 'should succeed') == false + error('Compiler ' + compiler.get_id() + ' is fail.') + endif + + if compiler.compiles(files('valid.c'), name : 'should succeed') == false + error('Compiler ' + compiler.get_id() + ' is fail.') + endif + + if compiler.compiles(breakcode, name : 'should fail') + error('Compiler ' + compiler.get_id() + ' returned true on broken code.') + endif + + if compiler.compiles(files('invalid.c'), name : 'should fail') + error('Compiler ' + compiler.get_id() + ' returned true on broken code.') + endif +endforeach diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/30 try compile/valid.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/30 try compile/valid.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/30 try compile/valid.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/30 try compile/valid.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,2 @@ +#include +void func() { printf("Something.\n"); } diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/31 compiler id/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/31 compiler id/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/31 compiler id/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/31 compiler id/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,7 @@ +project('compiler id', 'c') + +comp = meson.get_compiler('c') +str = comp.get_id() + +message('Compiler name is:') +message(str) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/31 try compile/invalid.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/31 try compile/invalid.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/31 try compile/invalid.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/31 try compile/invalid.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include -void func() { printf("This won't work.\n"); } diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/31 try compile/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/31 try compile/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/31 try compile/meson.build" 2018-12-09 16:29:13.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/31 try compile/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -project('try compile', 'c', 'cpp') - -code = '''#include -void func() { printf("Something.\n"); } -''' - -breakcode = '''#include -void func() { printf("This won't work.\n"); } -''' - -foreach compiler : [meson.get_compiler('c'), meson.get_compiler('cpp')] - if compiler.compiles(code, name : 'should succeed') == false - error('Compiler ' + compiler.get_id() + ' is fail.') - endif - - if compiler.compiles(files('valid.c'), name : 'should succeed') == false - error('Compiler ' + compiler.get_id() + ' is fail.') - endif - - if compiler.compiles(breakcode, name : 'should fail') - error('Compiler ' + compiler.get_id() + ' returned true on broken code.') - endif - - if compiler.compiles(files('invalid.c'), name : 'should fail') - error('Compiler ' + compiler.get_id() + ' returned true on broken code.') - endif -endforeach diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/31 try compile/valid.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/31 try compile/valid.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/31 try compile/valid.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/31 try compile/valid.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#include -void func() { printf("Something.\n"); } diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/32 compiler id/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/32 compiler id/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/32 compiler id/meson.build" 2018-12-09 16:29:13.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/32 compiler id/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -project('compiler id', 'c') - -comp = meson.get_compiler('c') -str = comp.get_id() - -message('Compiler name is:') -message(str) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/32 sizeof/config.h.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/32 sizeof/config.h.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/32 sizeof/config.h.in" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/32 sizeof/config.h.in" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +#define INTSIZE @INTSIZE@ +#define WCHARSIZE @WCHARSIZE@ diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/32 sizeof/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/32 sizeof/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/32 sizeof/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/32 sizeof/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,33 @@ +project('sizeof', 'c', 'cpp') + +# Test with C +cc = meson.get_compiler('c') + +intsize = cc.sizeof('int') +wcharsize = cc.sizeof('wchar_t', prefix : '#include') + +cd = configuration_data() +cd.set('INTSIZE', intsize) +cd.set('WCHARSIZE', wcharsize) +cd.set('CONFIG', 'config.h') +configure_file(input : 'config.h.in', output : 'config.h', configuration : cd) +s = configure_file(input : 'prog.c.in', output : 'prog.c', configuration : cd) + +e = executable('prog', s) +test('sizeof test', e) + +# Test with C++ +cpp = meson.get_compiler('cpp') + +intsize = cpp.sizeof('int') +wcharsize = cpp.sizeof('wchar_t', prefix : '#include') + +cdpp = configuration_data() +cdpp.set('INTSIZE', intsize) +cdpp.set('WCHARSIZE', wcharsize) +cdpp.set('CONFIG', 'config.hpp') +configure_file(input : 'config.h.in', output : 'config.hpp', configuration : cdpp) +spp = configure_file(input : 'prog.c.in', output : 'prog.cc', configuration : cdpp) + +epp = executable('progpp', spp) +test('sizeof test c++', epp) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/32 sizeof/prog.c.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/32 sizeof/prog.c.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/32 sizeof/prog.c.in" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/32 sizeof/prog.c.in" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,15 @@ +#include "@CONFIG@" +#include +#include + +int main(int argc, char **argv) { + if(INTSIZE != sizeof(int)) { + fprintf(stderr, "Mismatch: detected int size %d, actual size %d.\n", INTSIZE, (int)sizeof(int)); + return 1; + } + if(WCHARSIZE != sizeof(wchar_t)) { + fprintf(stderr, "Mismatch: detected wchar size %d, actual size %d.\n", WCHARSIZE, (int)sizeof(wchar_t)); + return 1; + } + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/33 define10/config.h.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/33 define10/config.h.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/33 define10/config.h.in" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/33 define10/config.h.in" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +#mesondefine ONE +#mesondefine ZERO diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/33 define10/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/33 define10/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/33 define10/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/33 define10/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,12 @@ +project('set10test', 'c') + +conf = configuration_data() +conf.set10('ONE', true) +conf.set10('ZERO', false) + +configure_file(input : 'config.h.in', + output : 'config.h', + configuration : conf) + +exe = executable('prog', 'prog.c') +test('10test', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/33 define10/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/33 define10/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/33 define10/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/33 define10/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,13 @@ +#include +#include"config.h" + +int main(int argc, char **argv) { + if(ONE != 1) { + fprintf(stderr, "ONE is not 1.\n"); + return 1; + } + if(ZERO != 0) { + fprintf(stderr, "ZERO is not 0.\n"); + } + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/33 sizeof/config.h.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/33 sizeof/config.h.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/33 sizeof/config.h.in" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/33 sizeof/config.h.in" 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#define INTSIZE @INTSIZE@ -#define WCHARSIZE @WCHARSIZE@ diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/33 sizeof/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/33 sizeof/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/33 sizeof/meson.build" 2018-12-09 16:29:16.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/33 sizeof/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -project('sizeof', 'c', 'cpp') - -# Test with C -cc = meson.get_compiler('c') - -intsize = cc.sizeof('int') -wcharsize = cc.sizeof('wchar_t', prefix : '#include') - -cd = configuration_data() -cd.set('INTSIZE', intsize) -cd.set('WCHARSIZE', wcharsize) -cd.set('CONFIG', 'config.h') -configure_file(input : 'config.h.in', output : 'config.h', configuration : cd) -s = configure_file(input : 'prog.c.in', output : 'prog.c', configuration : cd) - -e = executable('prog', s) -test('sizeof test', e) - -# Test with C++ -cpp = meson.get_compiler('cpp') - -intsize = cpp.sizeof('int') -wcharsize = cpp.sizeof('wchar_t', prefix : '#include') - -cdpp = configuration_data() -cdpp.set('INTSIZE', intsize) -cdpp.set('WCHARSIZE', wcharsize) -cdpp.set('CONFIG', 'config.hpp') -configure_file(input : 'config.h.in', output : 'config.hpp', configuration : cdpp) -spp = configure_file(input : 'prog.c.in', output : 'prog.cc', configuration : cdpp) - -epp = executable('progpp', spp) -test('sizeof test c++', epp) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/33 sizeof/prog.c.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/33 sizeof/prog.c.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/33 sizeof/prog.c.in" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/33 sizeof/prog.c.in" 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -#include "@CONFIG@" -#include -#include - -int main(int argc, char **argv) { - if(INTSIZE != sizeof(int)) { - fprintf(stderr, "Mismatch: detected int size %d, actual size %d.\n", INTSIZE, (int)sizeof(int)); - return 1; - } - if(WCHARSIZE != sizeof(wchar_t)) { - fprintf(stderr, "Mismatch: detected wchar size %d, actual size %d.\n", WCHARSIZE, (int)sizeof(wchar_t)); - return 1; - } - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/34 define10/config.h.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/34 define10/config.h.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/34 define10/config.h.in" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/34 define10/config.h.in" 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#mesondefine ONE -#mesondefine ZERO diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/34 define10/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/34 define10/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/34 define10/meson.build" 2018-12-09 16:29:16.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/34 define10/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -project('set10test', 'c') - -conf = configuration_data() -conf.set10('ONE', true) -conf.set10('ZERO', false) - -configure_file(input : 'config.h.in', - output : 'config.h', - configuration : conf) - -exe = executable('prog', 'prog.c') -test('10test', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/34 define10/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/34 define10/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/34 define10/prog.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/34 define10/prog.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -#include -#include"config.h" - -int main(int argc, char **argv) { - if(ONE != 1) { - fprintf(stderr, "ONE is not 1.\n"); - return 1; - } - if(ZERO != 0) { - fprintf(stderr, "ZERO is not 0.\n"); - } - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/34 has header/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/34 has header/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/34 has header/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/34 has header/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,54 @@ +project('has header', 'c', 'cpp') + +host_system = host_machine.system() + +non_existant_header = 'ouagadougou.h' + +# Copy it into the builddir to ensure that it isn't found even if it's there +configure_file(input : non_existant_header, + output : non_existant_header, + configuration : configuration_data()) + +# Test that the fallback to __has_include also works on all compilers +if host_system != 'darwin' + fallbacks = ['', '\n#undef __has_include'] +else + # On Darwin's clang you can't redefine builtin macros so the above doesn't work + fallbacks = [''] +endif + +foreach fallback : fallbacks + foreach comp : [meson.get_compiler('c'), meson.get_compiler('cpp')] + assert(comp.has_header('stdio.h', prefix : fallback), 'Stdio missing.') + + # stdio.h doesn't actually need stdlib.h, but just test that setting the + # prefix does not result in an error. + assert(comp.has_header('stdio.h', prefix : '#include ' + fallback), + 'Stdio missing.') + + # XInput.h should not require type definitions from windows.h, but it does + # require macro definitions. Specifically, it requires an arch setting for + # VS2015 at least. + # We only do this check on MSVC because MinGW often defines its own wrappers + # that pre-include windows.h + if comp.get_id() == 'msvc' + assert(comp.has_header('XInput.h', prefix : '#include ' + fallback), + 'XInput.h should not be missing on Windows') + assert(comp.has_header('XInput.h', prefix : '#define _X86_' + fallback), + 'XInput.h should not need windows.h') + endif + + # Test that the following GCC bug doesn't happen: + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80005 + # https://github.com/mesonbuild/meson/issues/1458 + if host_system == 'linux' + assert(comp.has_header('linux/if.h', prefix : fallback), + 'Could not find ') + endif + + # This header exists in the source and the builddir, but we still must not + # find it since we are looking in the system directories. + assert(not comp.has_header(non_existant_header, prefix : fallback), + 'Found non-existant header.') + endforeach +endforeach diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/34 has header/ouagadougou.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/34 has header/ouagadougou.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/34 has header/ouagadougou.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/34 has header/ouagadougou.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +#define OMG_THIS_SHOULDNT_BE_FOUND diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/35 has header/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/35 has header/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/35 has header/meson.build" 2018-12-09 16:29:18.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/35 has header/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ -project('has header', 'c', 'cpp') - -host_system = host_machine.system() - -non_existant_header = 'ouagadougou.h' - -# Copy it into the builddir to ensure that it isn't found even if it's there -configure_file(input : non_existant_header, - output : non_existant_header, - configuration : configuration_data()) - -# Test that the fallback to __has_include also works on all compilers -if host_system != 'darwin' - fallbacks = ['', '\n#undef __has_include'] -else - # On Darwin's clang you can't redefine builtin macros so the above doesn't work - fallbacks = [''] -endif - -foreach fallback : fallbacks - foreach comp : [meson.get_compiler('c'), meson.get_compiler('cpp')] - assert(comp.has_header('stdio.h', prefix : fallback), 'Stdio missing.') - - # stdio.h doesn't actually need stdlib.h, but just test that setting the - # prefix does not result in an error. - assert(comp.has_header('stdio.h', prefix : '#include ' + fallback), - 'Stdio missing.') - - # XInput.h should not require type definitions from windows.h, but it does - # require macro definitions. Specifically, it requires an arch setting for - # VS2015 at least. - # We only do this check on MSVC because MinGW often defines its own wrappers - # that pre-include windows.h - if comp.get_id() == 'msvc' - assert(comp.has_header('XInput.h', prefix : '#include ' + fallback), - 'XInput.h should not be missing on Windows') - assert(comp.has_header('XInput.h', prefix : '#define _X86_' + fallback), - 'XInput.h should not need windows.h') - endif - - # Test that the following GCC bug doesn't happen: - # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80005 - # https://github.com/mesonbuild/meson/issues/1458 - if host_system == 'linux' - assert(comp.has_header('linux/if.h', prefix : fallback), - 'Could not find ') - endif - - # This header exists in the source and the builddir, but we still must not - # find it since we are looking in the system directories. - assert(not comp.has_header(non_existant_header, prefix : fallback), - 'Found non-existant header.') - endforeach -endforeach diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/35 has header/ouagadougou.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/35 has header/ouagadougou.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/35 has header/ouagadougou.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/35 has header/ouagadougou.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -#define OMG_THIS_SHOULDNT_BE_FOUND diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/35 run program/get-version.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/35 run program/get-version.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/35 run program/get-version.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/35 run program/get-version.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +#!/usr/bin/env python3 + +print('1.2') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/35 run program/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/35 run program/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/35 run program/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/35 run program/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,79 @@ +project('run command', version : run_command('get-version.py', check : true).stdout().strip()) + +if build_machine.system() == 'windows' + c = run_command('cmd', '/c', 'echo', 'hello') +else + c = run_command('echo', 'hello') +endif + +correct = 'hello' + +if c.returncode() != 0 + error('Executing echo failed.') +endif + +result = c.stdout().strip() + +if result != correct + error('Getting stdout failed.') +endif + +if c.stderr() != '' + error('Extra text in stderr.') +endif + +# Now the same with a script. + +if build_machine.system() == 'windows' + cs = run_command('scripts/hello.bat') +else + cs = run_command('scripts/hello.sh') +endif + +if cs.returncode() != 0 + error('Executing script failed.') +endif + +if cs.stdout().strip() != correct + error('Getting stdout failed (script).') +endif + +if cs.stderr() != '' + error('Extra text in stderr (script).') +endif + +# We should be able to have files() in argument +f = files('meson.build') + +if build_machine.system() == 'windows' + c = run_command('cmd', '/c', 'echo', f) +else + c = run_command('echo', f) +endif + +if c.returncode() != 0 + error('Using files() in argument failed.') +endif + +py3 = import('python3').find_python() + +ret = run_command(py3, '-c', 'print("some output")') +assert(ret.returncode() == 0, 'failed to run python3: ' + ret.stderr()) +assert(ret.stdout() == 'some output\n', 'failed to run python3') + +ret = run_command(py3, '-c', 'print("some output")', capture : false) +assert(ret.returncode() == 0, 'failed to run python3: ' + ret.stderr()) +assert(ret.stdout() == '', 'stdout is "@0@" instead of empty'.format(ret.stdout())) + +c_env = environment() +c_env.append('CUSTOM_ENV_VAR', 'FOOBAR') +ret = run_command(py3, '-c', 'import os; print(os.environ.get("CUSTOM_ENV_VAR"))', env : c_env) +assert(ret.returncode() == 0, 'failed to run python3: ' + ret.stderr()) +assert(ret.stdout() == 'FOOBAR\n', 'stdout is "@0@" instead of FOOBAR'.format(ret.stdout())) + +dd = find_program('dd', required : false) +if dd.found() + ret = run_command(dd, 'if=/dev/urandom', 'bs=10', 'count=1', capture: false) + assert(ret.returncode() == 0, 'failed to run dd: ' + ret.stderr()) + assert(ret.stdout() == '', 'stdout is "@0@" instead of empty'.format(ret.stdout())) +endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/35 run program/scripts/hello.bat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/35 run program/scripts/hello.bat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/35 run program/scripts/hello.bat" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/35 run program/scripts/hello.bat" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +@ECHO OFF +ECHO hello diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/35 run program/scripts/hello.sh" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/35 run program/scripts/hello.sh" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/35 run program/scripts/hello.sh" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/35 run program/scripts/hello.sh" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +#!/bin/sh + +echo hello diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/36 run program/get-version.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/36 run program/get-version.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/36 run program/get-version.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/36 run program/get-version.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -#!/usr/bin/env python3 - -print('1.2') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/36 run program/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/36 run program/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/36 run program/meson.build" 2018-12-09 16:29:17.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/36 run program/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,73 +0,0 @@ -project('run command', version : run_command('get-version.py', check : true).stdout().strip()) - -if build_machine.system() == 'windows' - c = run_command('cmd', '/c', 'echo', 'hello') -else - c = run_command('echo', 'hello') -endif - -correct = 'hello' - -if c.returncode() != 0 - error('Executing echo failed.') -endif - -result = c.stdout().strip() - -if result != correct - error('Getting stdout failed.') -endif - -if c.stderr() != '' - error('Extra text in stderr.') -endif - -# Now the same with a script. - -if build_machine.system() == 'windows' - cs = run_command('scripts/hello.bat') -else - cs = run_command('scripts/hello.sh') -endif - -if cs.returncode() != 0 - error('Executing script failed.') -endif - -if cs.stdout().strip() != correct - error('Getting stdout failed (script).') -endif - -if cs.stderr() != '' - error('Extra text in stderr (script).') -endif - -# We should be able to have files() in argument -f = files('meson.build') - -if build_machine.system() == 'windows' - c = run_command('cmd', '/c', 'echo', f) -else - c = run_command('echo', f) -endif - -if c.returncode() != 0 - error('Using files() in argument failed.') -endif - -py3 = import('python3').find_python() - -ret = run_command(py3, '-c', 'print("some output")') -assert(ret.returncode() == 0, 'failed to run python3: ' + ret.stderr()) -assert(ret.stdout() == 'some output\n', 'failed to run python3') - -ret = run_command(py3, '-c', 'print("some output")', capture : false) -assert(ret.returncode() == 0, 'failed to run python3: ' + ret.stderr()) -assert(ret.stdout() == '', 'stdout is "@0@" instead of empty'.format(ret.stdout())) - -dd = find_program('dd', required : false) -if dd.found() - ret = run_command(dd, 'if=/dev/urandom', 'bs=10', 'count=1', capture: false) - assert(ret.returncode() == 0, 'failed to run dd: ' + ret.stderr()) - assert(ret.stdout() == '', 'stdout is "@0@" instead of empty'.format(ret.stdout())) -endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/36 run program/scripts/hello.bat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/36 run program/scripts/hello.bat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/36 run program/scripts/hello.bat" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/36 run program/scripts/hello.bat" 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -@ECHO OFF -ECHO hello diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/36 run program/scripts/hello.sh" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/36 run program/scripts/hello.sh" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/36 run program/scripts/hello.sh" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/36 run program/scripts/hello.sh" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -#!/bin/sh - -echo hello diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/36 tryrun/error.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/36 tryrun/error.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/36 tryrun/error.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/36 tryrun/error.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,3 @@ +int main(int argc, char **argv) { + return 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/36 tryrun/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/36 tryrun/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/36 tryrun/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/36 tryrun/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,78 @@ +project('tryrun', 'c', 'cpp') + +# Complex to exercise all code paths. +if meson.is_cross_build() + if meson.has_exe_wrapper() + compilers = [meson.get_compiler('c', native : false), meson.get_compiler('cpp', native : false)] + else + compilers = [meson.get_compiler('c', native : true), meson.get_compiler('cpp', native : true)] + endif +else + compilers = [meson.get_compiler('c'), meson.get_compiler('cpp')] +endif + +ok_code = '''#include +int main(int argc, char **argv) { + printf("%s\n", "stdout"); + fprintf(stderr, "%s\n", "stderr"); + return 0; +} +''' + +error_code = '''int main(int argc, char **argv) { + return 1; +} +''' + +no_compile_code = '''int main(int argc, char **argv) { +''' + +INPUTS = [ + ['String', ok_code, error_code, no_compile_code], + ['File', files('ok.c'), files('error.c'), files('no_compile.c')], +] + +foreach cc : compilers + foreach input : INPUTS + type = input[0] + ok = cc.run(input[1], name : type + ' should succeed') + err = cc.run(input[2], name : type + ' should fail') + noc = cc.run(input[3], name : type + ' does not compile') + + if noc.compiled() + error(type + ' compilation fail test failed.') + else + message(type + ' fail detected properly.') + endif + + if ok.compiled() + message(type + ' compilation worked.') + else + error(type + ' compilation did not work.') + endif + + if ok.returncode() == 0 + message(type + ' return code ok.') + else + error(type + ' return code fail') + endif + + if err.returncode() == 1 + message(type + ' bad return code ok.') + else + error(type + ' bad return code fail.') + endif + + if ok.stdout().strip() == 'stdout' + message(type + ' stdout ok.') + else + message(type + ' bad stdout.') + endif + + if ok.stderr().strip() == 'stderr' + message(type + ' stderr ok.') + else + message(type + ' bad stderr.') + endif + endforeach +endforeach diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/36 tryrun/no_compile.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/36 tryrun/no_compile.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/36 tryrun/no_compile.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/36 tryrun/no_compile.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1 @@ +int main(int argc, char **argv) { diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/36 tryrun/ok.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/36 tryrun/ok.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/36 tryrun/ok.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/36 tryrun/ok.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,6 @@ +#include +int main(int argc, char **argv) { + printf("%s\n", "stdout"); + fprintf(stderr, "%s\n", "stderr"); + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/37 logic ops/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/37 logic ops/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/37 logic ops/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/37 logic ops/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,95 @@ +project('logicopts', 'c') + +t = true +f = false + +if (true) + message('Ok.') +else + error('Not ok.') +endif + +if (false) + error('Not ok.') +else + message('Ok.') +endif + +if (f) + error('Not ok.') +else + message('Ok.') +endif + +if (t) + message('Ok.') +else + error('Not ok.') +endif + +if true and t + message('Ok.') +else + error('Not ok.') +endif + +if t and false + error('Not ok.') +else + message('Ok.') +endif + +if f and t + error('Not ok.') +else + message('Ok.') +endif + +if f or false + error('Not ok.') +else + message('Ok.') +endif + +if true or f + message('Ok.') +else + error('Not ok.') +endif + +if t or true + message('Ok.') +else + error('Not ok.') +endif + +if not true + error('Negation failed.') +else + message('Ok.') +endif + +if not f + message('Ok.') +else + error('Negation failed.') +endif + + +if f or f or f or f or f or f or f or f or t + message('Ok.') +else + error('Chain of ors failed.') +endif + +if t and t and t and t and t and t and t and t and f + error('Chain of ands failed.') +else + message('Ok.') +endif + +if t and t or t + message('Ok.') +else + error('Combination of and-or failed.') +endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/37 tryrun/error.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/37 tryrun/error.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/37 tryrun/error.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/37 tryrun/error.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -int main(int argc, char **argv) { - return 1; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/37 tryrun/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/37 tryrun/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/37 tryrun/meson.build" 2018-12-09 16:29:22.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/37 tryrun/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,78 +0,0 @@ -project('tryrun', 'c', 'cpp') - -# Complex to exercise all code paths. -if meson.is_cross_build() - if meson.has_exe_wrapper() - compilers = [meson.get_compiler('c', native : false), meson.get_compiler('cpp', native : false)] - else - compilers = [meson.get_compiler('c', native : true), meson.get_compiler('cpp', native : true)] - endif -else - compilers = [meson.get_compiler('c'), meson.get_compiler('cpp')] -endif - -ok_code = '''#include -int main(int argc, char **argv) { - printf("%s\n", "stdout"); - fprintf(stderr, "%s\n", "stderr"); - return 0; -} -''' - -error_code = '''int main(int argc, char **argv) { - return 1; -} -''' - -no_compile_code = '''int main(int argc, char **argv) { -''' - -INPUTS = [ - ['String', ok_code, error_code, no_compile_code], - ['File', files('ok.c'), files('error.c'), files('no_compile.c')], -] - -foreach cc : compilers - foreach input : INPUTS - type = input[0] - ok = cc.run(input[1], name : type + ' should succeed') - err = cc.run(input[2], name : type + ' should fail') - noc = cc.run(input[3], name : type + ' does not compile') - - if noc.compiled() - error(type + ' compilation fail test failed.') - else - message(type + ' fail detected properly.') - endif - - if ok.compiled() - message(type + ' compilation worked.') - else - error(type + ' compilation did not work.') - endif - - if ok.returncode() == 0 - message(type + ' return code ok.') - else - error(type + ' return code fail') - endif - - if err.returncode() == 1 - message(type + ' bad return code ok.') - else - error(type + ' bad return code fail.') - endif - - if ok.stdout().strip() == 'stdout' - message(type + ' stdout ok.') - else - message(type + ' bad stdout.') - endif - - if ok.stderr().strip() == 'stderr' - message(type + ' stderr ok.') - else - message(type + ' bad stderr.') - endif - endforeach -endforeach diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/37 tryrun/no_compile.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/37 tryrun/no_compile.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/37 tryrun/no_compile.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/37 tryrun/no_compile.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -int main(int argc, char **argv) { diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/37 tryrun/ok.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/37 tryrun/ok.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/37 tryrun/ok.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/37 tryrun/ok.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#include -int main(int argc, char **argv) { - printf("%s\n", "stdout"); - fprintf(stderr, "%s\n", "stderr"); - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/38 logic ops/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/38 logic ops/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/38 logic ops/meson.build" 2018-12-09 16:29:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/38 logic ops/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,95 +0,0 @@ -project('logicopts', 'c') - -t = true -f = false - -if (true) - message('Ok.') -else - error('Not ok.') -endif - -if (false) - error('Not ok.') -else - message('Ok.') -endif - -if (f) - error('Not ok.') -else - message('Ok.') -endif - -if (t) - message('Ok.') -else - error('Not ok.') -endif - -if true and t - message('Ok.') -else - error('Not ok.') -endif - -if t and false - error('Not ok.') -else - message('Ok.') -endif - -if f and t - error('Not ok.') -else - message('Ok.') -endif - -if f or false - error('Not ok.') -else - message('Ok.') -endif - -if true or f - message('Ok.') -else - error('Not ok.') -endif - -if t or true - message('Ok.') -else - error('Not ok.') -endif - -if not true - error('Negation failed.') -else - message('Ok.') -endif - -if not f - message('Ok.') -else - error('Negation failed.') -endif - - -if f or f or f or f or f or f or f or f or t - message('Ok.') -else - error('Chain of ors failed.') -endif - -if t and t and t and t and t and t and t and t and f - error('Chain of ands failed.') -else - message('Ok.') -endif - -if t and t or t - message('Ok.') -else - error('Combination of and-or failed.') -endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/38 string operations/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/38 string operations/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/38 string operations/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/38 string operations/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,103 @@ +project('string formatting', 'c') + +templ = '@0@bar@1@' + +assert(templ.format('foo', 'baz') == 'foobarbaz', 'Basic string formatting is broken.') + +assert('@0@'.format(1) == '1', 'String number formatting is broken.') + +assert('@0@'.format(true) == 'true', 'String boolean formatting is broken.') + +templ2 = '@0@' +subs2 = '42' + +assert(templ2.format(subs2) == '42', 'String formatting with variables is broken.') + +assert('@@0@@ @@1@@'.format(1, 2) == '@1@ @2@', 'String format is recursive.') + +long = 'abcde' +prefix = 'abc' +suffix = 'cde' + +assert(long.startswith(prefix), 'Prefix.') + +assert(not long.startswith(suffix), 'Not prefix.') + +assert(long.endswith(suffix), 'Suffix.') + +assert(not long.endswith(prefix), 'Not suffix.') + +assert(long.contains(prefix), 'Does not contain prefix') + +assert(long.contains(suffix), 'Does not contain suffix') + +assert(long.contains('bcd'), 'Does not contain middle part') + +assert(not long.contains('dc'), 'Broken contains') + +assert(long.to_upper() == 'ABCDE', 'Broken to_upper') + +assert(long.to_upper().to_lower() == long, 'Broken to_lower') + +assert('struct stat.st_foo'.underscorify() == 'struct_stat_st_foo', 'Broken underscorify') + +assert('#include '.underscorify() == '_include__foo_bar_h_', 'Broken underscorify') + +# case should not change, space should be replaced, numbers are ok too +assert('Do SomeThing 09'.underscorify() == 'Do_SomeThing_09', 'Broken underscorify') + +assert('3'.to_int() == 3, 'String int conversion does not work.') + +assert(true.to_string() == 'true', 'bool string conversion failed') +assert(false.to_string() == 'false', 'bool string conversion failed') +assert(true.to_string('yes', 'no') == 'yes', 'bool string conversion with args failed') +assert(false.to_string('yes', 'no') == 'no', 'bool string conversion with args failed') +assert('@0@'.format(true) == 'true', 'bool string formatting failed') + +assert(' '.join(['a', 'b', 'c']) == 'a b c', 'join() array broken') +assert(''.join(['a', 'b', 'c']) == 'abc', 'empty join() broken') +assert(' '.join(['a']) == 'a', 'single join broken') + +version_number = '1.2.8' + +assert(version_number.version_compare('>=1.2.8'), 'Version_compare gt broken') +assert(not version_number.version_compare('>1.2.8'), 'Version_compare greater broken') +assert(not version_number.version_compare('<1.2.8'), 'Version_compare less broken') +assert(version_number.version_compare('<=1.2.8'), 'Version_compare le broken') +assert(version_number.version_compare('==1.2.8'), 'Version_compare eq broken') +assert(not version_number.version_compare('!=1.2.8'), 'Version_compare neq broken') + +assert(version_number.version_compare('<2.0'), 'Version_compare major less broken') +assert(version_number.version_compare('>0.9'), 'Version_compare major greater broken') + +assert(' spaces tabs '.strip() == 'spaces tabs', 'Spaces and tabs badly stripped') +assert(''' +multiline string '''.strip() == '''multiline string''', 'Newlines badly stripped') +assert('"1.1.20"'.strip('"') == '1.1.20', '" badly stripped') +assert('"1.1.20"'.strip('".') == '1.1.20', '". badly stripped') +assert('"1.1.20" '.strip('" ') == '1.1.20', '". badly stripped') + +bs_c = '''\c''' +bs_bs_c = '''\\c''' +nl = ''' +''' +bs_n = '''\n''' +bs_nl = '''\ +''' +bs_bs_n = '''\\n''' +bs_bs_nl = '''\\ +''' +bs_bs = '''\\''' +bs = '''\''' + +assert('\c' == bs_c, 'Single backslash broken') +assert('\\c' == bs_c, 'Double backslash broken') +assert('\\\c' == bs_bs_c, 'Three backslash broken') +assert('\\\\c' == bs_bs_c, 'Four backslash broken') +assert('\n' == nl, 'Newline escape broken') +assert('\\n' == bs_n, 'Double backslash broken before n') +assert('\\\n' == bs_nl, 'Three backslash broken before n') +assert('\\\\n' == bs_bs_n, 'Four backslash broken before n') +assert('\\\\\n' == bs_bs_nl, 'Five backslash broken before n') +assert('\\\\' == bs_bs, 'Double-backslash broken') +assert('\\' == bs, 'Backslash broken') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/39 has function/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/39 has function/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/39 has function/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/39 has function/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,91 @@ +project('has function', 'c', 'cpp') + +host_system = host_machine.system() + +# This is used in the `test_compiler_check_flags_order` unit test +unit_test_args = '-I/tmp' +defines_has_builtin = '''#ifndef __has_builtin +#error "no __has_builtin" +#endif +''' +compilers = [meson.get_compiler('c'), meson.get_compiler('cpp')] + +foreach cc : compilers + if not cc.has_function('printf', prefix : '#include', + args : unit_test_args) + error('"printf" function not found (should always exist).') + endif + + # Should also be able to detect it without specifying the header + # We check for a different function here to make sure the result is + # not taken from a cache (ie. the check above) + # On MSVC fprintf is defined as an inline function in the header, so it cannot + # be found without the include. + if not ['msvc', 'intel-cl'].contains(cc.get_id()) + assert(cc.has_function('fprintf', args : unit_test_args), + '"fprintf" function not found without include (on !msvc).') + else + assert(cc.has_function('fprintf', prefix : '#include ', + args : unit_test_args), + '"fprintf" function not found with include (on msvc).') + # Compiler intrinsics + assert(cc.has_function('strcmp'), + 'strcmp intrinsic should have been found on MSVC') + assert(cc.has_function('strcmp', prefix : '#include '), + 'strcmp intrinsic should have been found with #include on MSVC') + endif + + if cc.has_function('hfkerhisadf', prefix : '#include', + args : unit_test_args) + error('Found non-existent function "hfkerhisadf".') + endif + + if cc.has_function('hfkerhisadf', args : unit_test_args) + error('Found non-existent function "hfkerhisadf".') + endif + + # With glibc on Linux lchmod is a stub that will always return an error, + # we want to detect that and declare that the function is not available. + # We can't check for the C library used here of course, but if it's not + # implemented in glibc it's probably not implemented in any other 'slimmer' + # C library variants either, so the check should be safe either way hopefully. + if host_system == 'linux' or host_system == 'darwin' + assert (cc.has_function('poll', prefix : '#include ', + args : unit_test_args), + 'couldn\'t detect "poll" when defined by a header') + lchmod_prefix = '#include \n#include ' + if host_system == 'linux' + assert (not cc.has_function('lchmod', prefix : lchmod_prefix, + args : unit_test_args), + '"lchmod" check should have failed') + else + # macOS and *BSD have lchmod + assert (cc.has_function('lchmod', prefix : lchmod_prefix, + args : unit_test_args), + '"lchmod" check should have succeeded') + endif + # Check that built-ins are found properly both with and without headers + assert(cc.has_function('alloca', args : unit_test_args), + 'built-in alloca must be found on ' + host_system) + assert(cc.has_function('alloca', prefix : '#include ', + args : unit_test_args), + 'built-in alloca must be found with #include') + if not cc.compiles(defines_has_builtin, args : unit_test_args) + assert(not cc.has_function('alloca', + prefix : '#include \n#undef alloca', + args : unit_test_args), + 'built-in alloca must not be found with #include and #undef') + endif + endif + + # For some functions one needs to define _GNU_SOURCE before including the + # right headers to get them picked up. Make sure we can detect these functions + # as well without any prefix + if cc.has_header_symbol('sys/socket.h', 'recvmmsg', + prefix : '#define _GNU_SOURCE', + args : unit_test_args) + # We assume that if recvmmsg exists sendmmsg does too + assert (cc.has_function('sendmmsg', args : unit_test_args), + 'Failed to detect function "sendmmsg" (should always exist).') + endif +endforeach diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/39 string operations/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/39 string operations/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/39 string operations/meson.build" 2018-12-09 16:29:22.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/39 string operations/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,103 +0,0 @@ -project('string formatting', 'c') - -templ = '@0@bar@1@' - -assert(templ.format('foo', 'baz') == 'foobarbaz', 'Basic string formatting is broken.') - -assert('@0@'.format(1) == '1', 'String number formatting is broken.') - -assert('@0@'.format(true) == 'true', 'String boolean formatting is broken.') - -templ2 = '@0@' -subs2 = '42' - -assert(templ2.format(subs2) == '42', 'String formatting with variables is broken.') - -assert('@@0@@ @@1@@'.format(1, 2) == '@1@ @2@', 'String format is recursive.') - -long = 'abcde' -prefix = 'abc' -suffix = 'cde' - -assert(long.startswith(prefix), 'Prefix.') - -assert(not long.startswith(suffix), 'Not prefix.') - -assert(long.endswith(suffix), 'Suffix.') - -assert(not long.endswith(prefix), 'Not suffix.') - -assert(long.contains(prefix), 'Does not contain prefix') - -assert(long.contains(suffix), 'Does not contain suffix') - -assert(long.contains('bcd'), 'Does not contain middle part') - -assert(not long.contains('dc'), 'Broken contains') - -assert(long.to_upper() == 'ABCDE', 'Broken to_upper') - -assert(long.to_upper().to_lower() == long, 'Broken to_lower') - -assert('struct stat.st_foo'.underscorify() == 'struct_stat_st_foo', 'Broken underscorify') - -assert('#include '.underscorify() == '_include__foo_bar_h_', 'Broken underscorify') - -# case should not change, space should be replaced, numbers are ok too -assert('Do SomeThing 09'.underscorify() == 'Do_SomeThing_09', 'Broken underscorify') - -assert('3'.to_int() == 3, 'String int conversion does not work.') - -assert(true.to_string() == 'true', 'bool string conversion failed') -assert(false.to_string() == 'false', 'bool string conversion failed') -assert(true.to_string('yes', 'no') == 'yes', 'bool string conversion with args failed') -assert(false.to_string('yes', 'no') == 'no', 'bool string conversion with args failed') -assert('@0@'.format(true) == 'true', 'bool string formatting failed') - -assert(' '.join(['a', 'b', 'c']) == 'a b c', 'join() array broken') -assert(''.join(['a', 'b', 'c']) == 'abc', 'empty join() broken') -assert(' '.join(['a']) == 'a', 'single join broken') - -version_number = '1.2.8' - -assert(version_number.version_compare('>=1.2.8'), 'Version_compare gt broken') -assert(not version_number.version_compare('>1.2.8'), 'Version_compare greater broken') -assert(not version_number.version_compare('<1.2.8'), 'Version_compare less broken') -assert(version_number.version_compare('<=1.2.8'), 'Version_compare le broken') -assert(version_number.version_compare('==1.2.8'), 'Version_compare eq broken') -assert(not version_number.version_compare('!=1.2.8'), 'Version_compare neq broken') - -assert(version_number.version_compare('<2.0'), 'Version_compare major less broken') -assert(version_number.version_compare('>0.9'), 'Version_compare major greater broken') - -assert(' spaces tabs '.strip() == 'spaces tabs', 'Spaces and tabs badly stripped') -assert(''' -multiline string '''.strip() == '''multiline string''', 'Newlines badly stripped') -assert('"1.1.20"'.strip('"') == '1.1.20', '" badly stripped') -assert('"1.1.20"'.strip('".') == '1.1.20', '". badly stripped') -assert('"1.1.20" '.strip('" ') == '1.1.20', '". badly stripped') - -bs_c = '''\c''' -bs_bs_c = '''\\c''' -nl = ''' -''' -bs_n = '''\n''' -bs_nl = '''\ -''' -bs_bs_n = '''\\n''' -bs_bs_nl = '''\\ -''' -bs_bs = '''\\''' -bs = '''\''' - -assert('\c' == bs_c, 'Single backslash broken') -assert('\\c' == bs_c, 'Double backslash broken') -assert('\\\c' == bs_bs_c, 'Three backslash broken') -assert('\\\\c' == bs_bs_c, 'Four backslash broken') -assert('\n' == nl, 'Newline escape broken') -assert('\\n' == bs_n, 'Double backslash broken before n') -assert('\\\n' == bs_nl, 'Three backslash broken before n') -assert('\\\\n' == bs_bs_n, 'Four backslash broken before n') -assert('\\\\\n' == bs_bs_nl, 'Five backslash broken before n') -assert('\\\\' == bs_bs, 'Double-backslash broken') -assert('\\' == bs, 'Backslash broken') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/3 static/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/3 static/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/3 static/meson.build" 2018-12-09 16:28:45.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/3 static/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -2,3 +2,13 @@ lib = static_library('mylib', get_option('source'), link_args : '-THISMUSTNOBEUSED') # Static linker needs to ignore all link args. + +has_not_changed = false +if is_disabler(lib) + has_not_changed = true +else + has_not_changed = true +endif +assert(has_not_changed, 'Static library has changed.') + +assert(not is_disabler(lib), 'Static library is a disabler.') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/40 has function/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/40 has function/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/40 has function/meson.build" 2018-12-09 16:29:27.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/40 has function/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,91 +0,0 @@ -project('has function', 'c', 'cpp') - -host_system = host_machine.system() - -# This is used in the `test_compiler_check_flags_order` unit test -unit_test_args = '-I/tmp' -defines_has_builtin = '''#ifndef __has_builtin -#error "no __has_builtin" -#endif -''' -compilers = [meson.get_compiler('c'), meson.get_compiler('cpp')] - -foreach cc : compilers - if not cc.has_function('printf', prefix : '#include', - args : unit_test_args) - error('"printf" function not found (should always exist).') - endif - - # Should also be able to detect it without specifying the header - # We check for a different function here to make sure the result is - # not taken from a cache (ie. the check above) - # On MSVC fprintf is defined as an inline function in the header, so it cannot - # be found without the include. - if cc.get_id() != 'msvc' - assert(cc.has_function('fprintf', args : unit_test_args), - '"fprintf" function not found without include (on !msvc).') - else - assert(cc.has_function('fprintf', prefix : '#include ', - args : unit_test_args), - '"fprintf" function not found with include (on msvc).') - # Compiler intrinsics - assert(cc.has_function('strcmp'), - 'strcmp intrinsic should have been found on MSVC') - assert(cc.has_function('strcmp', prefix : '#include '), - 'strcmp intrinsic should have been found with #include on MSVC') - endif - - if cc.has_function('hfkerhisadf', prefix : '#include', - args : unit_test_args) - error('Found non-existent function "hfkerhisadf".') - endif - - if cc.has_function('hfkerhisadf', args : unit_test_args) - error('Found non-existent function "hfkerhisadf".') - endif - - # With glibc on Linux lchmod is a stub that will always return an error, - # we want to detect that and declare that the function is not available. - # We can't check for the C library used here of course, but if it's not - # implemented in glibc it's probably not implemented in any other 'slimmer' - # C library variants either, so the check should be safe either way hopefully. - if host_system == 'linux' or host_system == 'darwin' - assert (cc.has_function('poll', prefix : '#include ', - args : unit_test_args), - 'couldn\'t detect "poll" when defined by a header') - lchmod_prefix = '#include \n#include ' - if host_system == 'linux' - assert (not cc.has_function('lchmod', prefix : lchmod_prefix, - args : unit_test_args), - '"lchmod" check should have failed') - else - # macOS and *BSD have lchmod - assert (cc.has_function('lchmod', prefix : lchmod_prefix, - args : unit_test_args), - '"lchmod" check should have succeeded') - endif - # Check that built-ins are found properly both with and without headers - assert(cc.has_function('alloca', args : unit_test_args), - 'built-in alloca must be found on ' + host_system) - assert(cc.has_function('alloca', prefix : '#include ', - args : unit_test_args), - 'built-in alloca must be found with #include') - if not cc.compiles(defines_has_builtin, args : unit_test_args) - assert(not cc.has_function('alloca', - prefix : '#include \n#undef alloca', - args : unit_test_args), - 'built-in alloca must not be found with #include and #undef') - endif - endif - - # For some functions one needs to define _GNU_SOURCE before including the - # right headers to get them picked up. Make sure we can detect these functions - # as well without any prefix - if cc.has_header_symbol('sys/socket.h', 'recvmmsg', - prefix : '#define _GNU_SOURCE', - args : unit_test_args) - # We assume that if recvmmsg exists sendmmsg does too - assert (cc.has_function('sendmmsg', args : unit_test_args), - 'Failed to detect function "sendmmsg" (should always exist).') - endif -endforeach diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/40 has member/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/40 has member/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/40 has member/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/40 has member/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,21 @@ +project('has member', 'c', 'cpp') + +compilers = [meson.get_compiler('c'), meson.get_compiler('cpp')] + +foreach cc : compilers + if not cc.has_member('struct tm', 'tm_sec', prefix : '#include') + error('Did not detect member of "struct tm" that exists: "tm_sec"') + endif + + if cc.has_member('struct tm', 'tm_nonexistent', prefix : '#include') + error('Not existing member "tm_nonexistent" found.') + endif + + if not cc.has_members('struct tm', 'tm_sec', 'tm_min', prefix : '#include') + error('Did not detect members of "struct tm" that exist: "tm_sec" "tm_min"') + endif + + if cc.has_members('struct tm', 'tm_sec', 'tm_nonexistent2', prefix : '#include') + error('Not existing member "tm_nonexistent2" found.') + endif +endforeach diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/41 alignment/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/41 alignment/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/41 alignment/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/41 alignment/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,31 @@ +project('alignment', 'c', 'cpp') + +compilers = [meson.get_compiler('c'), meson.get_compiler('cpp')] + +foreach cc : compilers + # These tests should return the same value on all + # platforms. If (and when) they don't, fix 'em up. + if cc.alignment('char') != 1 + error('Alignment of char misdetected.') + endif + + ptr_size = cc.sizeof('void*') + dbl_alignment = cc.alignment('double') + + # These tests are not thorough. Doing this properly + # would take a lot of work because it is strongly + # platform and compiler dependent. So just check + # that they produce something fairly sane. + + if ptr_size == 8 or ptr_size == 4 + message('Size of ptr ok.') + else + error('Size of ptr misdetected.') + endif + + if dbl_alignment == 8 or dbl_alignment == 4 + message('Alignment of double ok.') + else + error('Alignment of double misdetected.') + endif +endforeach diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/41 has member/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/41 has member/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/41 has member/meson.build" 2018-12-09 16:29:25.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/41 has member/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -project('has member', 'c', 'cpp') - -compilers = [meson.get_compiler('c'), meson.get_compiler('cpp')] - -foreach cc : compilers - if not cc.has_member('struct tm', 'tm_sec', prefix : '#include') - error('Did not detect member of "struct tm" that exists: "tm_sec"') - endif - - if cc.has_member('struct tm', 'tm_nonexistent', prefix : '#include') - error('Not existing member "tm_nonexistent" found.') - endif - - if not cc.has_members('struct tm', 'tm_sec', 'tm_min', prefix : '#include') - error('Did not detect members of "struct tm" that exist: "tm_sec" "tm_min"') - endif - - if cc.has_members('struct tm', 'tm_sec', 'tm_nonexistent2', prefix : '#include') - error('Not existing member "tm_nonexistent2" found.') - endif -endforeach diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/42 alignment/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/42 alignment/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/42 alignment/meson.build" 2018-12-09 16:29:26.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/42 alignment/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -project('alignment', 'c', 'cpp') - -compilers = [meson.get_compiler('c'), meson.get_compiler('cpp')] - -foreach cc : compilers - # These tests should return the same value on all - # platforms. If (and when) they don't, fix 'em up. - if cc.alignment('char') != 1 - error('Alignment of char misdetected.') - endif - - ptr_size = cc.sizeof('void*') - dbl_alignment = cc.alignment('double') - - # These tests are not thorough. Doing this properly - # would take a lot of work because it is strongly - # platform and compiler dependent. So just check - # that they produce something fairly sane. - - if ptr_size == 8 or ptr_size == 4 - message('Size of ptr ok.') - else - error('Size of ptr misdetected.') - endif - - if dbl_alignment == 8 or dbl_alignment == 4 - message('Alignment of double ok.') - else - error('Alignment of double misdetected.') - endif -endforeach diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/42 library chain/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/42 library chain/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/42 library chain/installed_files.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/42 library chain/installed_files.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +usr/bin/prog?exe +?msvc:usr/bin/prog.pdb diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/42 library chain/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/42 library chain/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/42 library chain/main.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/42 library chain/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +int libfun(); + +int main() { + return libfun(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/42 library chain/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/42 library chain/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/42 library chain/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/42 library chain/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +project('libchain', 'c') + +subdir('subdir') +e = executable('prog', 'main.c', link_with : lib1, install : true) +test('tst', e) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/42 library chain/subdir/lib1.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/42 library chain/subdir/lib1.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/42 library chain/subdir/lib1.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/42 library chain/subdir/lib1.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,17 @@ +int lib2fun(); +int lib3fun(); + +#if defined _WIN32 || defined __CYGWIN__ + #define DLL_PUBLIC __declspec(dllexport) +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif + +int DLL_PUBLIC libfun() { + return lib2fun() + lib3fun(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/42 library chain/subdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/42 library chain/subdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/42 library chain/subdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/42 library chain/subdir/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,4 @@ +subdir('subdir2') +subdir('subdir3') + +lib1 = shared_library('lib1', 'lib1.c', install : false, link_with : [lib2, lib3]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/42 library chain/subdir/subdir2/lib2.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/42 library chain/subdir/subdir2/lib2.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/42 library chain/subdir/subdir2/lib2.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/42 library chain/subdir/subdir2/lib2.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,14 @@ +#if defined _WIN32 || defined __CYGWIN__ + #define DLL_PUBLIC __declspec(dllexport) +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif + +int DLL_PUBLIC lib2fun() { + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/42 library chain/subdir/subdir2/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/42 library chain/subdir/subdir2/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/42 library chain/subdir/subdir2/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/42 library chain/subdir/subdir2/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +lib2 = shared_library('lib2', 'lib2.c', install : false) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/42 library chain/subdir/subdir3/lib3.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/42 library chain/subdir/subdir3/lib3.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/42 library chain/subdir/subdir3/lib3.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/42 library chain/subdir/subdir3/lib3.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,14 @@ +#if defined _WIN32 || defined __CYGWIN__ + #define DLL_PUBLIC __declspec(dllexport) +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif + +int DLL_PUBLIC lib3fun() { + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/42 library chain/subdir/subdir3/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/42 library chain/subdir/subdir3/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/42 library chain/subdir/subdir3/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/42 library chain/subdir/subdir3/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +lib3 = shared_library('lib3', 'lib3.c', install : false) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/43 library chain/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/43 library chain/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/43 library chain/installed_files.txt" 2018-10-31 09:31:57.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/43 library chain/installed_files.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -usr/bin/prog?exe -?msvc:usr/bin/prog.pdb diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/43 library chain/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/43 library chain/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/43 library chain/main.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/43 library chain/main.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -int libfun(); - -int main() { - return libfun(); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/43 library chain/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/43 library chain/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/43 library chain/meson.build" 2018-12-09 16:29:28.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/43 library chain/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -project('libchain', 'c') - -subdir('subdir') -e = executable('prog', 'main.c', link_with : lib1, install : true) -test('tst', e) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/43 library chain/subdir/lib1.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/43 library chain/subdir/lib1.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/43 library chain/subdir/lib1.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/43 library chain/subdir/lib1.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -int lib2fun(); -int lib3fun(); - -#if defined _WIN32 || defined __CYGWIN__ - #define DLL_PUBLIC __declspec(dllexport) -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif - -int DLL_PUBLIC libfun() { - return lib2fun() + lib3fun(); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/43 library chain/subdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/43 library chain/subdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/43 library chain/subdir/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/43 library chain/subdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -subdir('subdir2') -subdir('subdir3') - -lib1 = shared_library('lib1', 'lib1.c', install : false, link_with : [lib2, lib3]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/43 library chain/subdir/subdir2/lib2.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/43 library chain/subdir/subdir2/lib2.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/43 library chain/subdir/subdir2/lib2.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/43 library chain/subdir/subdir2/lib2.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -#if defined _WIN32 || defined __CYGWIN__ - #define DLL_PUBLIC __declspec(dllexport) -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif - -int DLL_PUBLIC lib2fun() { - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/43 library chain/subdir/subdir2/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/43 library chain/subdir/subdir2/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/43 library chain/subdir/subdir2/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/43 library chain/subdir/subdir2/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -lib2 = shared_library('lib2', 'lib2.c', install : false) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/43 library chain/subdir/subdir3/lib3.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/43 library chain/subdir/subdir3/lib3.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/43 library chain/subdir/subdir3/lib3.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/43 library chain/subdir/subdir3/lib3.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -#if defined _WIN32 || defined __CYGWIN__ - #define DLL_PUBLIC __declspec(dllexport) -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif - -int DLL_PUBLIC lib3fun() { - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/43 library chain/subdir/subdir3/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/43 library chain/subdir/subdir3/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/43 library chain/subdir/subdir3/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/43 library chain/subdir/subdir3/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -lib3 = shared_library('lib3', 'lib3.c', install : false) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/43 options/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/43 options/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/43 options/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/43 options/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,33 @@ +project('options', 'c') + +if get_option('testoption') != 'optval' + error('Incorrect value to test option') +endif + +if get_option('other_one') != false + error('Incorrect value to boolean option.') +endif + +if get_option('combo_opt') != 'combo' + error('Incorrect value to combo option.') +endif + +if get_option('array_opt') != ['one', 'two'] + message(get_option('array_opt')) + error('Incorrect value for array option') +endif + +# If the default changes, update test cases/unit/13 reconfigure +if get_option('b_lto') != false + error('Incorrect value in base option.') +endif + +if get_option('includedir') != 'include' + error('Incorrect value in builtin option.') +endif + +if get_option('integer_opt') != 3 + error('Incorrect value in integer option.') +endif + +assert(get_option('wrap_mode') == 'default', 'Wrap mode option is broken.') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/43 options/meson_options.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/43 options/meson_options.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/43 options/meson_options.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/43 options/meson_options.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,6 @@ +option('testoption', type : 'string', value : 'optval', description : 'An option to do something') +option('other_one', type : 'boolean', value : false) +option('combo_opt', type : 'combo', choices : ['one', 'two', 'combo'], value : 'combo') +option('array_opt', type : 'array', choices : ['one', 'two', 'three'], value : ['one', 'two']) +option('free_array_opt', type : 'array') +option('integer_opt', type : 'integer', min : 0, max : 5, value : 3) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/44 options/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/44 options/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/44 options/meson.build" 2018-12-09 16:29:29.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/44 options/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -project('options', 'c') - -if get_option('testoption') != 'optval' - error('Incorrect value to test option') -endif - -if get_option('other_one') != false - error('Incorrect value to boolean option.') -endif - -if get_option('combo_opt') != 'combo' - error('Incorrect value to combo option.') -endif - -if get_option('array_opt') != ['one', 'two'] - message(get_option('array_opt')) - error('Incorrect value for array option') -endif - -# If the default changes, update test cases/unit/13 reconfigure -if get_option('b_lto') != false - error('Incorrect value in base option.') -endif - -if get_option('includedir') != 'include' - error('Incorrect value in builtin option.') -endif - -if get_option('integer_opt') != 3 - error('Incorrect value in integer option.') -endif - -assert(get_option('wrap_mode') == 'default', 'Wrap mode option is broken.') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/44 options/meson_options.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/44 options/meson_options.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/44 options/meson_options.txt" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/44 options/meson_options.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -option('testoption', type : 'string', value : 'optval', description : 'An option to do something') -option('other_one', type : 'boolean', value : false) -option('combo_opt', type : 'combo', choices : ['one', 'two', 'combo'], value : 'combo') -option('array_opt', type : 'array', choices : ['one', 'two', 'three'], value : ['one', 'two']) -option('free_array_opt', type : 'array') -option('integer_opt', type : 'integer', min : 0, max : 5, value : 3) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/44 test args/cmd_args.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/44 test args/cmd_args.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/44 test args/cmd_args.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/44 test args/cmd_args.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,18 @@ +#include +#include + +int main(int argc, char **argv) { + if(argc != 3) { + fprintf(stderr, "Incorrect number of arguments.\n"); + return 1; + } + if(strcmp(argv[1], "first") != 0) { + fprintf(stderr, "First argument is wrong.\n"); + return 1; + } + if(strcmp(argv[2], "second") != 0) { + fprintf(stderr, "Second argument is wrong.\n"); + return 1; + } + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/44 test args/copyfile.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/44 test args/copyfile.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/44 test args/copyfile.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/44 test args/copyfile.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,6 @@ +#!/usr/bin/env python3 + +import sys +import shutil + +shutil.copyfile(sys.argv[1], sys.argv[2]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/44 test args/env2vars.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/44 test args/env2vars.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/44 test args/env2vars.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/44 test args/env2vars.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,23 @@ +#include +#include +#include + +int main(int argc, char **argv) { + if(strcmp(getenv("first"), "something-else") != 0) { + fprintf(stderr, "First envvar is wrong. %s\n", getenv("first")); + return 1; + } + if(strcmp(getenv("second"), "val2") != 0) { + fprintf(stderr, "Second envvar is wrong.\n"); + return 1; + } + if(strcmp(getenv("third"), "val3:and_more") != 0) { + fprintf(stderr, "Third envvar is wrong.\n"); + return 1; + } + if(strstr(getenv("PATH"), "fakepath:") != NULL) { + fprintf(stderr, "Third envvar is wrong.\n"); + return 1; + } + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/44 test args/envvars.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/44 test args/envvars.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/44 test args/envvars.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/44 test args/envvars.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,23 @@ +#include +#include +#include + +int main(int argc, char **argv) { + if(strcmp(getenv("first"), "val1") != 0) { + fprintf(stderr, "First envvar is wrong. %s\n", getenv("first")); + return 1; + } + if(strcmp(getenv("second"), "val2") != 0) { + fprintf(stderr, "Second envvar is wrong.\n"); + return 1; + } + if(strcmp(getenv("third"), "val3:and_more") != 0) { + fprintf(stderr, "Third envvar is wrong.\n"); + return 1; + } + if(strstr(getenv("PATH"), "fakepath:") != NULL) { + fprintf(stderr, "Third envvar is wrong.\n"); + return 1; + } + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/44 test args/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/44 test args/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/44 test args/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/44 test args/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,35 @@ +project('test features', 'c') + +e1 = executable('cmd_args', 'cmd_args.c') +e2 = executable('envvars', 'envvars.c') +e3 = executable('env2vars', 'env2vars.c') + +env = environment() +env.set('first', 'val1') +env.set('second', 'val2') +env.set('third', 'val3', 'and_more', separator: ':') +env.append('PATH', 'fakepath', separator: ':') + +# Make sure environment objects are copied on assignment and we can +# change the copy without affecting the original environment object. +env2 = env +env2.set('first', 'something-else') + +test('command line arguments', e1, args : ['first', 'second']) +test('environment variables', e2, env : env) +test('environment variables 2', e3, env : env2) + +# https://github.com/mesonbuild/meson/issues/2211#issuecomment-327741571 +env_array = ['MESONTESTING=picklerror'] +testfile = files('testfile.txt') +testerpy = find_program('tester.py') +test('file arg', testerpy, args : testfile, env : env_array) + +copy = find_program('copyfile.py') +tester = executable('tester', 'tester.c') +testfilect = custom_target('testfile', + input : testfile, + output : 'outfile.txt', + build_by_default : true, + command : [copy, '@INPUT@', '@OUTPUT@']) +test('custom target arg', tester, args : testfilect, env : env_array) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/44 test args/tester.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/44 test args/tester.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/44 test args/tester.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/44 test args/tester.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,34 @@ +#include +#include +#include +#include + +#ifndef _MSC_VER +#include +#endif + +int main(int argc, char **argv) { + char data[10]; + int fd, size; + + if (argc != 2) { + fprintf(stderr, "Incorrect number of arguments, got %i\n", argc); + return 1; + } + fd = open(argv[1], O_RDONLY); + if (fd < 0) { + fprintf(stderr, "First argument is wrong.\n"); + return 1; + } + + size = read(fd, data, 8); + if (size < 0) { + fprintf(stderr, "Failed to read: %s\n", strerror(errno)); + return 1; + } + if (strncmp(data, "contents", 8) != 0) { + fprintf(stderr, "Contents don't match, got %s\n", data); + return 1; + } + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/44 test args/tester.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/44 test args/tester.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/44 test args/tester.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/44 test args/tester.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,7 @@ +#!/usr/bin/env python3 + +import sys + +with open(sys.argv[1]) as f: + if f.read() != 'contents\n': + sys.exit(1) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/44 test args/testfile.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/44 test args/testfile.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/44 test args/testfile.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/44 test args/testfile.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +contents diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/45 subproject/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/45 subproject/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/45 subproject/installed_files.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/45 subproject/installed_files.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +usr/bin/user?exe +?msvc:usr/bin/user.pdb +usr/share/sublib/sublib.depmf diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/45 subproject/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/45 subproject/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/45 subproject/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/45 subproject/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,28 @@ +project('subproj user', 'c', + version : '2.3.4', + license : 'mylicense') + +assert(meson.project_name() == 'subproj user', 'Incorrect project name') + +sub = subproject('sublib', version : '1.0.0') + +if meson.project_version() != '2.3.4' + error('Incorrect master project version string:' + meson.project_version()) +endif + +if meson.is_subproject() + error('Claimed to be a subproject even though we are the master project.') +endif + +inc = sub.get_variable('i') +lib = sub.get_variable('l') + +e = executable('user', 'user.c', include_directories : inc, link_with : lib, install : true) +test('subdirtest', e) + +meson.install_dependency_manifest('share/sublib/sublib.depmf') + +unknown_var = sub.get_variable('does-not-exist', []) +if unknown_var != [] + error ('unexpetced fallback value for subproject.get_variable()') +endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/45 subproject/subprojects/sublib/include/subdefs.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/45 subproject/subprojects/sublib/include/subdefs.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/45 subproject/subprojects/sublib/include/subdefs.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/45 subproject/subprojects/sublib/include/subdefs.h" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,21 @@ +#ifndef SUBDEFS_H_ +#define SUBDEFS_H_ + +#if defined _WIN32 || defined __CYGWIN__ +#if defined BUILDING_SUB + #define DLL_PUBLIC __declspec(dllexport) +#else + #define DLL_PUBLIC __declspec(dllimport) +#endif +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif + +int DLL_PUBLIC subfunc(); + +#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/45 subproject/subprojects/sublib/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/45 subproject/subprojects/sublib/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/45 subproject/subprojects/sublib/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/45 subproject/subprojects/sublib/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,19 @@ +project('subproject', 'c', + version : '1.0.0', + license : ['sublicense1', 'sublicense2']) + +if not meson.is_subproject() + error('Claimed to be master project even though we are a subproject.') +endif + +assert(meson.project_name() == 'subproject', 'Incorrect subproject name') + +if meson.project_version() != '1.0.0' + error('Incorrect version string in subproject.') +endif + +i = include_directories('include') +l = shared_library('sublib', 'sublib.c', include_directories : i, install : false, + c_args : '-DBUILDING_SUB=2') +t = executable('simpletest', 'simpletest.c', include_directories : i, link_with : l) +test('plain', t) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/45 subproject/subprojects/sublib/simpletest.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/45 subproject/subprojects/sublib/simpletest.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/45 subproject/subprojects/sublib/simpletest.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/45 subproject/subprojects/sublib/simpletest.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +#include + +int main(int argc, char **argv) { + return subfunc() == 42 ? 0 : 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/45 subproject/subprojects/sublib/sublib.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/45 subproject/subprojects/sublib/sublib.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/45 subproject/subprojects/sublib/sublib.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/45 subproject/subprojects/sublib/sublib.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +#include + +int DLL_PUBLIC subfunc() { + return 42; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/45 subproject/user.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/45 subproject/user.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/45 subproject/user.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/45 subproject/user.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,16 @@ +#include +#include + + +int main(int argc, char **argv) { + int res; + printf("Calling into sublib now.\n"); + res = subfunc(); + if(res == 42) { + printf("Everything is fine.\n"); + return 0; + } else { + printf("Something went wrong.\n"); + return 1; + } +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/45 test args/cmd_args.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/45 test args/cmd_args.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/45 test args/cmd_args.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/45 test args/cmd_args.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -#include -#include - -int main(int argc, char **argv) { - if(argc != 3) { - fprintf(stderr, "Incorrect number of arguments.\n"); - return 1; - } - if(strcmp(argv[1], "first") != 0) { - fprintf(stderr, "First argument is wrong.\n"); - return 1; - } - if(strcmp(argv[2], "second") != 0) { - fprintf(stderr, "Second argument is wrong.\n"); - return 1; - } - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/45 test args/copyfile.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/45 test args/copyfile.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/45 test args/copyfile.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/45 test args/copyfile.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#!/usr/bin/env python3 - -import sys -import shutil - -shutil.copyfile(sys.argv[1], sys.argv[2]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/45 test args/env2vars.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/45 test args/env2vars.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/45 test args/env2vars.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/45 test args/env2vars.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -#include -#include -#include - -int main(int argc, char **argv) { - if(strcmp(getenv("first"), "something-else") != 0) { - fprintf(stderr, "First envvar is wrong. %s\n", getenv("first")); - return 1; - } - if(strcmp(getenv("second"), "val2") != 0) { - fprintf(stderr, "Second envvar is wrong.\n"); - return 1; - } - if(strcmp(getenv("third"), "val3:and_more") != 0) { - fprintf(stderr, "Third envvar is wrong.\n"); - return 1; - } - if(strstr(getenv("PATH"), "fakepath:") != NULL) { - fprintf(stderr, "Third envvar is wrong.\n"); - return 1; - } - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/45 test args/envvars.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/45 test args/envvars.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/45 test args/envvars.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/45 test args/envvars.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -#include -#include -#include - -int main(int argc, char **argv) { - if(strcmp(getenv("first"), "val1") != 0) { - fprintf(stderr, "First envvar is wrong. %s\n", getenv("first")); - return 1; - } - if(strcmp(getenv("second"), "val2") != 0) { - fprintf(stderr, "Second envvar is wrong.\n"); - return 1; - } - if(strcmp(getenv("third"), "val3:and_more") != 0) { - fprintf(stderr, "Third envvar is wrong.\n"); - return 1; - } - if(strstr(getenv("PATH"), "fakepath:") != NULL) { - fprintf(stderr, "Third envvar is wrong.\n"); - return 1; - } - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/45 test args/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/45 test args/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/45 test args/meson.build" 2018-12-09 16:29:30.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/45 test args/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -project('test features', 'c') - -e1 = executable('cmd_args', 'cmd_args.c') -e2 = executable('envvars', 'envvars.c') -e3 = executable('env2vars', 'env2vars.c') - -env = environment() -env.set('first', 'val1') -env.set('second', 'val2') -env.set('third', 'val3', 'and_more', separator: ':') -env.append('PATH', 'fakepath', separator: ':') - -# Make sure environment objects are copied on assignment and we can -# change the copy without affecting the original environment object. -env2 = env -env2.set('first', 'something-else') - -test('command line arguments', e1, args : ['first', 'second']) -test('environment variables', e2, env : env) -test('environment variables 2', e3, env : env2) - -# https://github.com/mesonbuild/meson/issues/2211#issuecomment-327741571 -env_array = ['MESONTESTING=picklerror'] -testfile = files('testfile.txt') -testerpy = find_program('tester.py') -test('file arg', testerpy, args : testfile, env : env_array) - -copy = find_program('copyfile.py') -tester = executable('tester', 'tester.c') -testfilect = custom_target('testfile', - input : testfile, - output : 'outfile.txt', - build_by_default : true, - command : [copy, '@INPUT@', '@OUTPUT@']) -test('custom target arg', tester, args : testfilect, env : env_array) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/45 test args/tester.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/45 test args/tester.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/45 test args/tester.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/45 test args/tester.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -#include -#include -#include -#include - -#ifndef _MSC_VER -#include -#endif - -int main(int argc, char **argv) { - char data[10]; - int fd, size; - - if (argc != 2) { - fprintf(stderr, "Incorrect number of arguments, got %i\n", argc); - return 1; - } - fd = open(argv[1], O_RDONLY); - if (fd < 0) { - fprintf(stderr, "First argument is wrong.\n"); - return 1; - } - - size = read(fd, data, 8); - if (size < 0) { - fprintf(stderr, "Failed to read: %s\n", strerror(errno)); - return 1; - } - if (strncmp(data, "contents", 8) != 0) { - fprintf(stderr, "Contents don't match, got %s\n", data); - return 1; - } - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/45 test args/tester.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/45 test args/tester.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/45 test args/tester.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/45 test args/tester.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -#!/usr/bin/env python3 - -import sys - -with open(sys.argv[1]) as f: - if f.read() != 'contents\n': - sys.exit(1) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/45 test args/testfile.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/45 test args/testfile.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/45 test args/testfile.txt" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/45 test args/testfile.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -contents diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/46 subproject/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/46 subproject/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/46 subproject/installed_files.txt" 2018-10-31 09:31:57.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/46 subproject/installed_files.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -usr/bin/user?exe -?msvc:usr/bin/user.pdb -usr/share/sublib/sublib.depmf diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/46 subproject/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/46 subproject/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/46 subproject/meson.build" 2018-12-09 16:29:31.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/46 subproject/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -project('subproj user', 'c', - version : '2.3.4', - license : 'mylicense') - -assert(meson.project_name() == 'subproj user', 'Incorrect project name') - -sub = subproject('sublib', version : '1.0.0') - -if meson.project_version() != '2.3.4' - error('Incorrect master project version string:' + meson.project_version()) -endif - -if meson.is_subproject() - error('Claimed to be a subproject even though we are the master project.') -endif - -inc = sub.get_variable('i') -lib = sub.get_variable('l') - -e = executable('user', 'user.c', include_directories : inc, link_with : lib, install : true) -test('subdirtest', e) - -meson.install_dependency_manifest('share/sublib/sublib.depmf') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/46 subproject/subprojects/sublib/include/subdefs.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/46 subproject/subprojects/sublib/include/subdefs.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/46 subproject/subprojects/sublib/include/subdefs.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/46 subproject/subprojects/sublib/include/subdefs.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -#ifndef SUBDEFS_H_ -#define SUBDEFS_H_ - -#if defined _WIN32 || defined __CYGWIN__ -#if defined BUILDING_SUB - #define DLL_PUBLIC __declspec(dllexport) -#else - #define DLL_PUBLIC __declspec(dllimport) -#endif -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif - -int DLL_PUBLIC subfunc(); - -#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/46 subproject/subprojects/sublib/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/46 subproject/subprojects/sublib/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/46 subproject/subprojects/sublib/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/46 subproject/subprojects/sublib/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -project('subproject', 'c', - version : '1.0.0', - license : ['sublicense1', 'sublicense2']) - -if not meson.is_subproject() - error('Claimed to be master project even though we are a subproject.') -endif - -assert(meson.project_name() == 'subproject', 'Incorrect subproject name') - -if meson.project_version() != '1.0.0' - error('Incorrect version string in subproject.') -endif - -i = include_directories('include') -l = shared_library('sublib', 'sublib.c', include_directories : i, install : false, - c_args : '-DBUILDING_SUB=2') -t = executable('simpletest', 'simpletest.c', include_directories : i, link_with : l) -test('plain', t) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/46 subproject/subprojects/sublib/simpletest.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/46 subproject/subprojects/sublib/simpletest.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/46 subproject/subprojects/sublib/simpletest.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/46 subproject/subprojects/sublib/simpletest.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#include - -int main(int argc, char **argv) { - return subfunc() == 42 ? 0 : 1; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/46 subproject/subprojects/sublib/sublib.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/46 subproject/subprojects/sublib/sublib.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/46 subproject/subprojects/sublib/sublib.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/46 subproject/subprojects/sublib/sublib.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#include - -int DLL_PUBLIC subfunc() { - return 42; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/46 subproject/user.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/46 subproject/user.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/46 subproject/user.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/46 subproject/user.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -#include -#include - - -int main(int argc, char **argv) { - int res; - printf("Calling into sublib now.\n"); - res = subfunc(); - if(res == 42) { - printf("Everything is fine.\n"); - return 0; - } else { - printf("Something went wrong.\n"); - return 1; - } -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/46 subproject options/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/46 subproject options/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/46 subproject options/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/46 subproject options/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,7 @@ +project('suboptions', 'c') + +subproject('subproject') + +if not get_option('opt') + error('option unset when it should be set') +endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/46 subproject options/meson_options.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/46 subproject options/meson_options.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/46 subproject options/meson_options.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/46 subproject options/meson_options.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +option('opt', type : 'boolean', value : true, description : 'main project option') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/46 subproject options/subprojects/subproject/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/46 subproject options/subprojects/subproject/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/46 subproject options/subprojects/subproject/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/46 subproject options/subprojects/subproject/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +project('subproject', 'c') + +if get_option('opt') + error('option set when it should be unset.') +endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/46 subproject options/subprojects/subproject/meson_options.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/46 subproject options/subprojects/subproject/meson_options.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/46 subproject options/subprojects/subproject/meson_options.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/46 subproject options/subprojects/subproject/meson_options.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +option('opt', type : 'boolean', value : false, description : 'subproject option') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/47 pkgconfig-gen/dependencies/custom.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/47 pkgconfig-gen/dependencies/custom.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/47 pkgconfig-gen/dependencies/custom.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/47 pkgconfig-gen/dependencies/custom.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,3 @@ +int custom_function() { + return 42; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/47 pkgconfig-gen/dependencies/exposed.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/47 pkgconfig-gen/dependencies/exposed.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/47 pkgconfig-gen/dependencies/exposed.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/47 pkgconfig-gen/dependencies/exposed.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,3 @@ +int exposed_function() { + return 42; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/47 pkgconfig-gen/dependencies/internal.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/47 pkgconfig-gen/dependencies/internal.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/47 pkgconfig-gen/dependencies/internal.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/47 pkgconfig-gen/dependencies/internal.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,3 @@ +int internal_function() { + return 42; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/47 pkgconfig-gen/dependencies/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/47 pkgconfig-gen/dependencies/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/47 pkgconfig-gen/dependencies/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/47 pkgconfig-gen/dependencies/meson.build" 2019-09-28 23:52:33.000000000 +0000 @@ -0,0 +1,59 @@ +project('pkgconfig-gen-dependencies', 'c', version: '1.0') + +pkgg = import('pkgconfig') + +# libmain internally use libinternal and expose libexpose in its API +exposed_lib = shared_library('libexposed', 'exposed.c') +internal_lib = shared_library('libinternal', 'internal.c') +main_lib = both_libraries('libmain', link_with : [exposed_lib, internal_lib]) +custom_lib = shared_library('custom', 'custom.c') + +pkgg.generate(exposed_lib) + +# Declare a few different Dependency objects +pc_dep = dependency('libfoo', version : '>=1.0') +pc_dep_dup = dependency('libfoo', version : '>= 1.0') +notfound_dep = dependency('notfound', required : false) +threads_dep = dependency('threads') +custom_dep = declare_dependency(link_with : custom_lib, compile_args : ['-DCUSTOM']) +custom2_dep = declare_dependency(link_args : ['-lcustom2'], compile_args : ['-DCUSTOM2']) + +# Generate a PC file: +# - Having libmain in libraries should pull implicitly libexposed and libinternal in Libs.private +# - Having libexposed in libraries should remove it from Libs.private +# - We generated a pc file for libexposed so it should be in Requires instead of Libs +# - Having threads_dep in libraries should add '-pthread' in both Libs and Cflags +# - Having custom_dep in libraries and libraries_private should only add it in Libs +# - Having custom2_dep in libraries_private should not add its Cflags +# - Having pc_dep in libraries_private should add it in Requires.private +# - pc_dep_dup is the same library and same version, should be ignored +# - notfound_dep is not required so it shouldn't appear in the pc file. +pkgg.generate(libraries : [main_lib, exposed_lib, threads_dep, threads_dep, custom_dep, custom_dep, '-pthread'], + libraries_private : [custom_dep, custom2_dep, custom2_dep, pc_dep, pc_dep_dup, notfound_dep], + version : '1.0', + name : 'dependency-test', + filebase : 'dependency-test', + description : 'A dependency test.' +) + +pkgg.generate( + name : 'requires-test', + version : '1.0', + description : 'Dependency Requires field test.', + requires : [exposed_lib, pc_dep, 'libhello'], +) + +pkgg.generate( + name : 'requires-private-test', + version : '1.0', + description : 'Dependency Requires.private field test.', + requires_private : [exposed_lib, pc_dep, 'libhello', notfound_dep], +) + +# Verify that if we promote internal_lib as public dependency, it comes after +# the main library. +main_lib2 = both_libraries('libmain2', link_with : internal_lib) +pkgg.generate(main_lib2, + libraries : internal_lib, + filebase : 'pub-lib-order', +) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/47 pkgconfig-gen/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/47 pkgconfig-gen/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/47 pkgconfig-gen/installed_files.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/47 pkgconfig-gen/installed_files.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,4 @@ +usr/include/simple.h +usr/lib/pkgconfig/simple.pc +usr/lib/pkgconfig/libfoo.pc +usr/lib/pkgconfig/libhello.pc diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/47 pkgconfig-gen/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/47 pkgconfig-gen/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/47 pkgconfig-gen/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/47 pkgconfig-gen/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,54 @@ +project('pkgconfig-gen', 'c') + +# First check we have pkg-config >= 0.29 + +pkgconfig = find_program('pkg-config', required: false) +if not pkgconfig.found() + error('MESON_SKIP_TEST: pkg-config not found') +endif + +v = run_command(pkgconfig, '--version').stdout().strip() +if v.version_compare('<0.29') + error('MESON_SKIP_TEST: pkg-config version \'' + v + '\' too old') +endif + +pkgg = import('pkgconfig') + +lib = shared_library('simple', 'simple.c') +libver = '1.0' +h = install_headers('simple.h') + +pkgg.generate( + libraries : [lib, '-lz'], + subdirs : '.', + version : libver, + name : 'libsimple', + filebase : 'simple', + description : 'A simple demo library.', + requires : 'glib-2.0', # Not really, but only here to test that this works. + requires_private : ['gio-2.0', 'gobject-2.0'], + libraries_private : [lib, '-lz'], +) + +test('pkgconfig-validation', pkgconfig, + args: ['--validate', 'simple'], + env: [ 'PKG_CONFIG_PATH=' + meson.current_build_dir() + '/meson-private' ]) + +# Test that name_prefix='' and name='libfoo' results in '-lfoo' +lib2 = shared_library('libfoo', 'simple.c', + name_prefix : '', + version : libver) + +pkgg.generate( + libraries : lib2, + name : 'libfoo', + version : libver, + description : 'A foo library.', + variables : ['foo=bar', 'datadir=${prefix}/data'] +) + +pkgg.generate( + name : 'libhello', + description : 'A minimalistic pkgconfig file.', + version : libver, +) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/47 pkgconfig-gen/simple.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/47 pkgconfig-gen/simple.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/47 pkgconfig-gen/simple.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/47 pkgconfig-gen/simple.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +#include"simple.h" + +int simple_function() { + return 42; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/47 pkgconfig-gen/simple.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/47 pkgconfig-gen/simple.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/47 pkgconfig-gen/simple.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/47 pkgconfig-gen/simple.h" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,6 @@ +#ifndef SIMPLE_H_ +#define SIMPLE_H_ + +int simple_function(); + +#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/47 subproject options/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/47 subproject options/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/47 subproject options/meson.build" 2018-12-09 16:29:32.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/47 subproject options/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -project('suboptions', 'c') - -subproject('subproject') - -if not get_option('opt') - error('option unset when it should be set') -endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/47 subproject options/meson_options.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/47 subproject options/meson_options.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/47 subproject options/meson_options.txt" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/47 subproject options/meson_options.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -option('opt', type : 'boolean', value : true, description : 'main project option') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/47 subproject options/subprojects/subproject/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/47 subproject options/subprojects/subproject/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/47 subproject options/subprojects/subproject/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/47 subproject options/subprojects/subproject/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -project('subproject', 'c') - -if get_option('opt') - error('option set when it should be unset.') -endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/47 subproject options/subprojects/subproject/meson_options.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/47 subproject options/subprojects/subproject/meson_options.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/47 subproject options/subprojects/subproject/meson_options.txt" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/47 subproject options/subprojects/subproject/meson_options.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -option('opt', type : 'boolean', value : false, description : 'subproject option') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/48 custom install dirs/datafile.cat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/48 custom install dirs/datafile.cat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/48 custom install dirs/datafile.cat" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/48 custom install dirs/datafile.cat" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +Installed cat is installed. diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/48 custom install dirs/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/48 custom install dirs/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/48 custom install dirs/installed_files.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/48 custom install dirs/installed_files.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,12 @@ +usr/dib/dab/dub/prog?exe +?msvc:usr/dib/dab/dub/prog.pdb +usr/dib/dab/dub2/prog2?exe +?msvc:usr/dib/dab/dub2/prog2.pdb +usr/some/dir/sample.h +usr/some/dir2/sample.h +usr/woman/prog.1 +usr/woman2/prog.1 +usr/meow/datafile.cat +usr/meow2/datafile.cat +usr/woof/subdir/datafile.dog +usr/woof2/subdir/datafile.dog diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/48 custom install dirs/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/48 custom install dirs/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/48 custom install dirs/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/48 custom install dirs/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,11 @@ +project('custom install dirs', 'c') +executable('prog', 'prog.c', install : true, install_dir : 'dib/dab/dub') +executable('prog2', 'prog.c', install : true, install_dir : get_option('prefix') + '/dib/dab/dub2') +install_headers('sample.h', install_dir : 'some/dir') +install_headers('sample.h', install_dir : get_option('prefix') + '/some/dir2') +install_man('prog.1', install_dir : 'woman') +install_man('prog.1', install_dir : get_option('prefix') + '/woman2') +install_data('datafile.cat', install_dir : 'meow') +install_data('datafile.cat', install_dir : get_option('prefix') + '/meow2') +install_subdir('subdir', install_dir : 'woof') +install_subdir('subdir', install_dir : get_option('prefix') + '/woof2') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/48 custom install dirs/prog.1" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/48 custom install dirs/prog.1" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/48 custom install dirs/prog.1" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/48 custom install dirs/prog.1" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +Man up, you. diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/48 custom install dirs/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/48 custom install dirs/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/48 custom install dirs/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/48 custom install dirs/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,3 @@ +int main(int argc, char **arv) { + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/48 custom install dirs/sample.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/48 custom install dirs/sample.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/48 custom install dirs/sample.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/48 custom install dirs/sample.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,6 @@ +#ifndef SAMPLE_H +#define SAMPLE_H + +int wackiness(); + +#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/48 custom install dirs/subdir/datafile.dog" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/48 custom install dirs/subdir/datafile.dog" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/48 custom install dirs/subdir/datafile.dog" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/48 custom install dirs/subdir/datafile.dog" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +Installed dog is installed. diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/48 pkgconfig-gen/dependencies/custom.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/48 pkgconfig-gen/dependencies/custom.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/48 pkgconfig-gen/dependencies/custom.c" 2018-12-09 14:27:23.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/48 pkgconfig-gen/dependencies/custom.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -int custom_function() { - return 42; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/48 pkgconfig-gen/dependencies/exposed.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/48 pkgconfig-gen/dependencies/exposed.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/48 pkgconfig-gen/dependencies/exposed.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/48 pkgconfig-gen/dependencies/exposed.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -int exposed_function() { - return 42; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/48 pkgconfig-gen/dependencies/internal.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/48 pkgconfig-gen/dependencies/internal.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/48 pkgconfig-gen/dependencies/internal.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/48 pkgconfig-gen/dependencies/internal.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -int internal_function() { - return 42; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/48 pkgconfig-gen/dependencies/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/48 pkgconfig-gen/dependencies/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/48 pkgconfig-gen/dependencies/meson.build" 2018-12-09 14:27:23.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/48 pkgconfig-gen/dependencies/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ -project('pkgconfig-gen-dependencies', 'c', version: '1.0') - -pkgg = import('pkgconfig') - -# libmain internally use libinternal and expose libexpose in its API -exposed_lib = shared_library('libexposed', 'exposed.c') -internal_lib = shared_library('libinternal', 'internal.c') -main_lib = both_libraries('libmain', link_with : [exposed_lib, internal_lib]) -custom_lib = shared_library('custom', 'custom.c') - -pkgg.generate(exposed_lib) - -# Declare a few different Dependency objects -pc_dep = dependency('libfoo', version : '>=1.0') -pc_dep_dup = dependency('libfoo', version : '>= 1.0') -notfound_dep = dependency('notfound', required : false) -threads_dep = dependency('threads') -custom_dep = declare_dependency(link_with : custom_lib, compile_args : ['-DCUSTOM']) -custom2_dep = declare_dependency(link_args : ['-lcustom2'], compile_args : ['-DCUSTOM2']) - -# Generate a PC file: -# - Having libmain in libraries should pull implicitly libexposed and libinternal in Libs.private -# - Having libexposed in libraries should remove it from Libs.private -# - We generated a pc file for libexposed so it should be in Requires instead of Libs -# - Having threads_dep in libraries should add '-pthread' in both Libs and Cflags -# - Having custom_dep in libraries and libraries_private should only add it in Libs -# - Having custom2_dep in libraries_private should not add its Cflags -# - Having pc_dep in libraries_private should add it in Requires.private -# - pc_dep_dup is the same library and same version, should be ignored -# - notfound_dep is not required so it shouldn't appear in the pc file. -pkgg.generate(libraries : [main_lib, exposed_lib, threads_dep , custom_dep], - libraries_private : [custom_dep, custom2_dep, pc_dep, pc_dep_dup, notfound_dep], - version : '1.0', - name : 'dependency-test', - filebase : 'dependency-test', - description : 'A dependency test.' -) - -pkgg.generate( - name : 'requires-test', - version : '1.0', - description : 'Dependency Requires field test.', - requires : [exposed_lib, pc_dep, 'libhello'], -) - -pkgg.generate( - name : 'requires-private-test', - version : '1.0', - description : 'Dependency Requires.private field test.', - requires_private : [exposed_lib, pc_dep, 'libhello', notfound_dep], -) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/48 pkgconfig-gen/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/48 pkgconfig-gen/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/48 pkgconfig-gen/installed_files.txt" 2018-10-31 09:31:57.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/48 pkgconfig-gen/installed_files.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -usr/include/simple.h -usr/lib/pkgconfig/simple.pc -usr/lib/pkgconfig/libfoo.pc -usr/lib/pkgconfig/libhello.pc diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/48 pkgconfig-gen/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/48 pkgconfig-gen/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/48 pkgconfig-gen/meson.build" 2018-12-09 16:29:32.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/48 pkgconfig-gen/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ -project('pkgconfig-gen', 'c') - -# First check we have pkg-config >= 0.29 - -pkgconfig = find_program('pkg-config', required: false) -if not pkgconfig.found() - error('MESON_SKIP_TEST: pkg-config not found') -endif - -v = run_command(pkgconfig, '--version').stdout().strip() -if v.version_compare('<0.29') - error('MESON_SKIP_TEST: pkg-config version \'' + v + '\' too old') -endif - -pkgg = import('pkgconfig') - -lib = shared_library('simple', 'simple.c') -libver = '1.0' -h = install_headers('simple.h') - -pkgg.generate( - libraries : [lib, '-lz'], - subdirs : '.', - version : libver, - name : 'libsimple', - filebase : 'simple', - description : 'A simple demo library.', - requires : 'glib-2.0', # Not really, but only here to test that this works. - requires_private : ['gio-2.0', 'gobject-2.0'], - libraries_private : [lib, '-lz'], -) - -test('pkgconfig-validation', pkgconfig, - args: ['--validate', 'simple'], - env: [ 'PKG_CONFIG_PATH=' + meson.current_build_dir() + '/meson-private' ]) - -# Test that name_prefix='' and name='libfoo' results in '-lfoo' -lib2 = shared_library('libfoo', 'simple.c', - name_prefix : '', - version : libver) - -pkgg.generate( - libraries : lib2, - name : 'libfoo', - version : libver, - description : 'A foo library.', - variables : ['foo=bar', 'datadir=${prefix}/data'] -) - -pkgg.generate( - name : 'libhello', - description : 'A minimalistic pkgconfig file.', - version : libver, -) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/48 pkgconfig-gen/simple.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/48 pkgconfig-gen/simple.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/48 pkgconfig-gen/simple.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/48 pkgconfig-gen/simple.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#include"simple.h" - -int simple_function() { - return 42; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/48 pkgconfig-gen/simple.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/48 pkgconfig-gen/simple.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/48 pkgconfig-gen/simple.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/48 pkgconfig-gen/simple.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#ifndef SIMPLE_H_ -#define SIMPLE_H_ - -int simple_function(); - -#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/49 custom install dirs/datafile.cat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/49 custom install dirs/datafile.cat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/49 custom install dirs/datafile.cat" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/49 custom install dirs/datafile.cat" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Installed cat is installed. diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/49 custom install dirs/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/49 custom install dirs/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/49 custom install dirs/installed_files.txt" 2018-12-09 14:27:16.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/49 custom install dirs/installed_files.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -usr/dib/dab/dub/prog?exe -?msvc:usr/dib/dab/dub/prog.pdb -usr/dib/dab/dub2/prog2?exe -?msvc:usr/dib/dab/dub2/prog2.pdb -usr/some/dir/sample.h -usr/some/dir2/sample.h -usr/woman/prog.1 -usr/woman2/prog.1 -usr/meow/datafile.cat -usr/meow2/datafile.cat -usr/woof/subdir/datafile.dog -usr/woof2/subdir/datafile.dog diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/49 custom install dirs/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/49 custom install dirs/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/49 custom install dirs/meson.build" 2018-12-09 16:29:33.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/49 custom install dirs/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -project('custom install dirs', 'c') -executable('prog', 'prog.c', install : true, install_dir : 'dib/dab/dub') -executable('prog2', 'prog.c', install : true, install_dir : get_option('prefix') + '/dib/dab/dub2') -install_headers('sample.h', install_dir : 'some/dir') -install_headers('sample.h', install_dir : get_option('prefix') + '/some/dir2') -install_man('prog.1', install_dir : 'woman') -install_man('prog.1', install_dir : get_option('prefix') + '/woman2') -install_data('datafile.cat', install_dir : 'meow') -install_data('datafile.cat', install_dir : get_option('prefix') + '/meow2') -install_subdir('subdir', install_dir : 'woof') -install_subdir('subdir', install_dir : get_option('prefix') + '/woof2') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/49 custom install dirs/prog.1" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/49 custom install dirs/prog.1" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/49 custom install dirs/prog.1" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/49 custom install dirs/prog.1" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Man up, you. diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/49 custom install dirs/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/49 custom install dirs/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/49 custom install dirs/prog.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/49 custom install dirs/prog.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -int main(int argc, char **arv) { - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/49 custom install dirs/sample.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/49 custom install dirs/sample.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/49 custom install dirs/sample.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/49 custom install dirs/sample.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#ifndef SAMPLE_H -#define SAMPLE_H - -int wackiness(); - -#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/49 custom install dirs/subdir/datafile.dog" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/49 custom install dirs/subdir/datafile.dog" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/49 custom install dirs/subdir/datafile.dog" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/49 custom install dirs/subdir/datafile.dog" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Installed dog is installed. diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/49 subproject subproject/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/49 subproject subproject/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/49 subproject subproject/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/49 subproject subproject/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,11 @@ +project('sub sub', 'c') + +a = subproject('a') +lib = a.get_variable('l') + +dependency('not-found-dep', required : false, + version : '>=1', + fallback : ['c', 'notfound_dep']) + +exe = executable('prog', 'prog.c', link_with : lib) +test('basic', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/49 subproject subproject/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/49 subproject subproject/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/49 subproject subproject/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/49 subproject subproject/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +int func(); + +int main(int argc, char **argv) { + return func() == 42 ? 0 : 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/49 subproject subproject/subprojects/a/a.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/49 subproject subproject/subprojects/a/a.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/49 subproject subproject/subprojects/a/a.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/49 subproject subproject/subprojects/a/a.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,15 @@ +int func2(); + +#if defined _WIN32 || defined __CYGWIN__ + #define DLL_PUBLIC __declspec(dllexport) +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif + +int DLL_PUBLIC func() { return func2(); } + diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/49 subproject subproject/subprojects/a/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/49 subproject subproject/subprojects/a/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/49 subproject subproject/subprojects/a/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/49 subproject subproject/subprojects/a/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,4 @@ +project('a', 'c') + +b = subproject('b') +l = shared_library('a', 'a.c', link_with : b.get_variable('lb')) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/49 subproject subproject/subprojects/b/b.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/49 subproject subproject/subprojects/b/b.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/49 subproject subproject/subprojects/b/b.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/49 subproject subproject/subprojects/b/b.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,14 @@ +#if defined _WIN32 || defined __CYGWIN__ + #define DLL_PUBLIC __declspec(dllexport) +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif + +int DLL_PUBLIC func2() { + return 42; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/49 subproject subproject/subprojects/b/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/49 subproject subproject/subprojects/b/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/49 subproject subproject/subprojects/b/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/49 subproject subproject/subprojects/b/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +project('b', 'c') + +lb = shared_library('b', 'b.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/49 subproject subproject/subprojects/c/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/49 subproject subproject/subprojects/c/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/49 subproject subproject/subprojects/c/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/49 subproject subproject/subprojects/c/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +project('not-found-dep-subproj', 'c', version : '1.0') + +notfound_dep = dependency('', required : false) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/4 shared/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/4 shared/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/4 shared/meson.build" 2018-12-09 16:28:45.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/4 shared/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -1,2 +1,13 @@ project('shared library test', 'c') lib = shared_library('mylib', 'libfile.c') +build_target('mylib2', 'libfile.c', target_type: 'shared_library') + +has_not_changed = false +if is_disabler(lib) + has_not_changed = true +else + has_not_changed = true +endif +assert(has_not_changed, 'Shared library has changed.') + +assert(not is_disabler(lib), 'Shared library is a disabler.') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/50 same file name/d1/file.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/50 same file name/d1/file.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/50 same file name/d1/file.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/50 same file name/d1/file.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1 @@ +int func1() { return 42; } diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/50 same file name/d2/file.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/50 same file name/d2/file.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/50 same file name/d2/file.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/50 same file name/d2/file.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1 @@ +int func2() { return 42; } diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/50 same file name/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/50 same file name/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/50 same file name/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/50 same file name/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +project('samefile', 'c') + +test('basic', executable('prog', 'prog.c', 'd1/file.c', 'd2/file.c')) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/50 same file name/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/50 same file name/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/50 same file name/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/50 same file name/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,6 @@ +int func1(); +int func2(); + +int main(int argc, char **argv) { + return func1() - func2(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/50 subproject subproject/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/50 subproject subproject/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/50 subproject subproject/meson.build" 2018-12-09 16:29:35.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/50 subproject subproject/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -project('sub sub', 'c') - -a = subproject('a') -lib = a.get_variable('l') - -dependency('not-found-dep', required : false, - version : '>=1', - fallback : ['c', 'notfound_dep']) - -exe = executable('prog', 'prog.c', link_with : lib) -test('basic', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/50 subproject subproject/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/50 subproject subproject/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/50 subproject subproject/prog.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/50 subproject subproject/prog.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -int func(); - -int main(int argc, char **argv) { - return func() == 42 ? 0 : 1; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/50 subproject subproject/subprojects/a/a.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/50 subproject subproject/subprojects/a/a.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/50 subproject subproject/subprojects/a/a.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/50 subproject subproject/subprojects/a/a.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -int func2(); - -#if defined _WIN32 || defined __CYGWIN__ - #define DLL_PUBLIC __declspec(dllexport) -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif - -int DLL_PUBLIC func() { return func2(); } - diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/50 subproject subproject/subprojects/a/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/50 subproject subproject/subprojects/a/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/50 subproject subproject/subprojects/a/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/50 subproject subproject/subprojects/a/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -project('a', 'c') - -b = subproject('b') -l = shared_library('a', 'a.c', link_with : b.get_variable('lb')) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/50 subproject subproject/subprojects/b/b.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/50 subproject subproject/subprojects/b/b.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/50 subproject subproject/subprojects/b/b.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/50 subproject subproject/subprojects/b/b.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -#if defined _WIN32 || defined __CYGWIN__ - #define DLL_PUBLIC __declspec(dllexport) -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif - -int DLL_PUBLIC func2() { - return 42; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/50 subproject subproject/subprojects/b/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/50 subproject subproject/subprojects/b/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/50 subproject subproject/subprojects/b/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/50 subproject subproject/subprojects/b/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -project('b', 'c') - -lb = shared_library('b', 'b.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/50 subproject subproject/subprojects/c/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/50 subproject subproject/subprojects/c/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/50 subproject subproject/subprojects/c/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/50 subproject subproject/subprojects/c/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -project('not-found-dep-subproj', 'c', version : '1.0') - -notfound_dep = dependency('', required : false) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/51 file grabber/a.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/51 file grabber/a.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/51 file grabber/a.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/51 file grabber/a.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1 @@ +int funca() { return 0; } diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/51 file grabber/b.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/51 file grabber/b.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/51 file grabber/b.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/51 file grabber/b.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1 @@ +int funcb() { return 0; } diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/51 file grabber/c.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/51 file grabber/c.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/51 file grabber/c.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/51 file grabber/c.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1 @@ +int funcc() { return 0; } diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/51 file grabber/grabber2.bat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/51 file grabber/grabber2.bat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/51 file grabber/grabber2.bat" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/51 file grabber/grabber2.bat" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +@ECHO OFF +echo suba.c +echo subb.c +echo subc.c +echo subprog.c diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/51 file grabber/grabber.bat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/51 file grabber/grabber.bat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/51 file grabber/grabber.bat" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/51 file grabber/grabber.bat" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +@ECHO OFF +echo a.c +echo b.c +echo c.c +echo prog.c diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/51 file grabber/grabber.sh" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/51 file grabber/grabber.sh" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/51 file grabber/grabber.sh" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/51 file grabber/grabber.sh" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +#!/bin/sh + +for i in *.c; do + echo $i +done diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/51 file grabber/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/51 file grabber/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/51 file grabber/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/51 file grabber/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,35 @@ +project('grabber', 'c') + +# What this script does is NOT reliable. Simply adding a file in this directory +# will NOT make it automatically appear in the build. You have to manually +# re-invoke Meson (not just Ninja) for that to happen. The simplest way +# is to touch meson-private/coredata.dat. + +# This is not the recommended way to do things, but if the tradeoffs are +# acceptable to you, then we're certainly not going to stop you. Just don't +# file bugs when it fails. :) + +if build_machine.system() == 'windows' + c = run_command('grabber.bat') + grabber = find_program('grabber2.bat') +else + c = run_command('grabber.sh') + grabber = find_program('grabber.sh') +endif + + +# First test running command explicitly. +if c.returncode() != 0 + error('Executing script failed.') +endif + +newline = ''' +''' + +sources = c.stdout().strip().split(newline) + +e = executable('prog', sources) +test('grabtest', e) + +# Then test using program with find_program +subdir('subdir') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/51 file grabber/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/51 file grabber/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/51 file grabber/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/51 file grabber/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,7 @@ +int funca(); +int funcb(); +int funcc(); + +int main(int argc, char **argv) { + return funca() + funcb() + funcc(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/51 file grabber/subdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/51 file grabber/subdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/51 file grabber/subdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/51 file grabber/subdir/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +sc = run_command(grabber) +subsources = sc.stdout().strip().split(newline) + +se = executable('subprog', subsources) +test('subgrabtest', se) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/51 file grabber/subdir/suba.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/51 file grabber/subdir/suba.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/51 file grabber/subdir/suba.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/51 file grabber/subdir/suba.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1 @@ +int funca() { return 0; } diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/51 file grabber/subdir/subb.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/51 file grabber/subdir/subb.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/51 file grabber/subdir/subb.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/51 file grabber/subdir/subb.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1 @@ +int funcb() { return 0; } diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/51 file grabber/subdir/subc.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/51 file grabber/subdir/subc.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/51 file grabber/subdir/subc.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/51 file grabber/subdir/subc.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1 @@ +int funcc() { return 0; } diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/51 file grabber/subdir/subprog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/51 file grabber/subdir/subprog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/51 file grabber/subdir/subprog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/51 file grabber/subdir/subprog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,7 @@ +int funca(); +int funcb(); +int funcc(); + +int main(int argc, char **argv) { + return funca() + funcb() + funcc(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/51 same file name/d1/file.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/51 same file name/d1/file.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/51 same file name/d1/file.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/51 same file name/d1/file.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -int func1() { return 42; } diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/51 same file name/d2/file.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/51 same file name/d2/file.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/51 same file name/d2/file.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/51 same file name/d2/file.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -int func2() { return 42; } diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/51 same file name/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/51 same file name/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/51 same file name/meson.build" 2018-12-09 16:29:35.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/51 same file name/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -project('samefile', 'c') - -test('basic', executable('prog', 'prog.c', 'd1/file.c', 'd2/file.c')) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/51 same file name/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/51 same file name/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/51 same file name/prog.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/51 same file name/prog.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -int func1(); -int func2(); - -int main(int argc, char **argv) { - return func1() - func2(); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/52 custom target/data_source.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/52 custom target/data_source.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/52 custom target/data_source.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/52 custom target/data_source.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +This is a text only input file. diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/52 custom target/depfile/dep.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/52 custom target/depfile/dep.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/52 custom target/depfile/dep.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/52 custom target/depfile/dep.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,15 @@ +#!/usr/bin/env python + +import sys, os +from glob import glob + +_, srcdir, depfile, output = sys.argv + +depfiles = glob(os.path.join(srcdir, '*')) + +quoted_depfiles = [x.replace(' ', r'\ ') for x in depfiles] + +with open(output, 'w') as f: + f.write('I am the result of globbing.') +with open(depfile, 'w') as f: + f.write('%s: %s\n' % (output, ' '.join(quoted_depfiles))) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/52 custom target/depfile/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/52 custom target/depfile/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/52 custom target/depfile/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/52 custom target/depfile/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,7 @@ + + +mytarget = custom_target('depfile', + output : 'dep.dat', + depfile : 'dep.dat.d', + command : [find_program('dep.py'), meson.current_source_dir(), '@DEPFILE@', '@OUTPUT@'], +) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/52 custom target/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/52 custom target/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/52 custom target/installed_files.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/52 custom target/installed_files.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +usr/subdir/data.dat diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/52 custom target/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/52 custom target/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/52 custom target/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/52 custom target/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,66 @@ +project('custom target', 'c') + +python = find_program('python3', required : false) +if not python.found() + python = find_program('python') +endif + +# Note that this will not add a dependency to the compiler executable. +# Code will not be rebuilt if it changes. +comp = '@0@/@1@'.format(meson.current_source_dir(), 'my_compiler.py') +# Test that files() in command: works. The compiler just discards it. +useless = files('installed_files.txt') + +mytarget = custom_target('bindat', +output : 'data.dat', +input : 'data_source.txt', +command : [python, comp, '--input=@INPUT@', '--output=@OUTPUT@', useless], +install : true, +install_dir : 'subdir' +) + +has_not_changed = false +if is_disabler(mytarget) + has_not_changed = true +else + has_not_changed = true +endif +assert(has_not_changed, 'Custom target has changed.') + +assert(not is_disabler(mytarget), 'Custom target is a disabler.') + +mytarget_disabler = custom_target('bindat', +output : 'data.dat', +input : 'data_source.txt', +command : [disabler(), comp, '--input=@INPUT@', '--output=@OUTPUT@', useless], +install : true, +install_dir : 'subdir' +) + +if mytarget_disabler.found() + mytarget_disabled = false +else + mytarget_disabled = true +endif + +assert(mytarget_disabled, 'Disabled custom target should not be found.') + +mytarget_disabler = custom_target('bindat', +output : 'data.dat', +input : disabler(), +command : [python, comp, '--input=@INPUT@', '--output=@OUTPUT@', useless], +install : true, +install_dir : 'subdir' +) + +assert(is_disabler(mytarget_disabler), 'Disabled custom target is not a disabler.') + +if mytarget_disabler.found() + mytarget_disabled = false +else + mytarget_disabled = true +endif + +assert(mytarget_disabled, 'Disabled custom target should not be found.') + +subdir('depfile') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/52 custom target/my_compiler.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/52 custom target/my_compiler.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/52 custom target/my_compiler.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/52 custom target/my_compiler.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,21 @@ +#!/usr/bin/env python3 + +import os +import sys + +assert(os.path.exists(sys.argv[3])) + +args = sys.argv[:-1] + +if __name__ == '__main__': + if len(args) != 3 or not args[1].startswith('--input') or \ + not args[2].startswith('--output'): + print(args[0], '--input=input_file --output=output_file') + sys.exit(1) + with open(args[1].split('=')[1]) as f: + ifile = f.read() + if ifile != 'This is a text only input file.\n': + print('Malformed input') + sys.exit(1) + with open(args[2].split('=')[1], 'w') as ofile: + ofile.write('This is a binary output file.\n') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/52 file grabber/a.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/52 file grabber/a.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/52 file grabber/a.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/52 file grabber/a.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -int funca() { return 0; } diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/52 file grabber/b.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/52 file grabber/b.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/52 file grabber/b.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/52 file grabber/b.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -int funcb() { return 0; } diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/52 file grabber/c.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/52 file grabber/c.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/52 file grabber/c.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/52 file grabber/c.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -int funcc() { return 0; } diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/52 file grabber/grabber2.bat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/52 file grabber/grabber2.bat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/52 file grabber/grabber2.bat" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/52 file grabber/grabber2.bat" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -@ECHO OFF -echo suba.c -echo subb.c -echo subc.c -echo subprog.c diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/52 file grabber/grabber.bat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/52 file grabber/grabber.bat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/52 file grabber/grabber.bat" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/52 file grabber/grabber.bat" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -@ECHO OFF -echo a.c -echo b.c -echo c.c -echo prog.c diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/52 file grabber/grabber.sh" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/52 file grabber/grabber.sh" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/52 file grabber/grabber.sh" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/52 file grabber/grabber.sh" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#!/bin/sh - -for i in *.c; do - echo $i -done diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/52 file grabber/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/52 file grabber/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/52 file grabber/meson.build" 2018-12-09 16:29:35.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/52 file grabber/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -project('grabber', 'c') - -# What this script does is NOT reliable. Simply adding a file in this directory -# will NOT make it automatically appear in the build. You have to manually -# re-invoke Meson (not just Ninja) for that to happen. The simplest way -# is to touch meson-private/coredata.dat. - -# This is not the recommended way to do things, but if the tradeoffs are -# acceptable to you, then we're certainly not going to stop you. Just don't -# file bugs when it fails. :) - -if build_machine.system() == 'windows' - c = run_command('grabber.bat') - grabber = find_program('grabber2.bat') -else - c = run_command('grabber.sh') - grabber = find_program('grabber.sh') -endif - - -# First test running command explicitly. -if c.returncode() != 0 - error('Executing script failed.') -endif - -newline = ''' -''' - -sources = c.stdout().strip().split(newline) - -e = executable('prog', sources) -test('grabtest', e) - -# Then test using program with find_program -subdir('subdir') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/52 file grabber/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/52 file grabber/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/52 file grabber/prog.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/52 file grabber/prog.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -int funca(); -int funcb(); -int funcc(); - -int main(int argc, char **argv) { - return funca() + funcb() + funcc(); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/52 file grabber/subdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/52 file grabber/subdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/52 file grabber/subdir/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/52 file grabber/subdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -sc = run_command(grabber) -subsources = sc.stdout().strip().split(newline) - -se = executable('subprog', subsources) -test('subgrabtest', se) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/52 file grabber/subdir/suba.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/52 file grabber/subdir/suba.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/52 file grabber/subdir/suba.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/52 file grabber/subdir/suba.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -int funca() { return 0; } diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/52 file grabber/subdir/subb.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/52 file grabber/subdir/subb.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/52 file grabber/subdir/subb.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/52 file grabber/subdir/subb.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -int funcb() { return 0; } diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/52 file grabber/subdir/subc.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/52 file grabber/subdir/subc.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/52 file grabber/subdir/subc.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/52 file grabber/subdir/subc.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -int funcc() { return 0; } diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/52 file grabber/subdir/subprog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/52 file grabber/subdir/subprog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/52 file grabber/subdir/subprog.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/52 file grabber/subdir/subprog.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -int funca(); -int funcb(); -int funcc(); - -int main(int argc, char **argv) { - return funca() + funcb() + funcc(); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/53 custom target/data_source.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/53 custom target/data_source.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/53 custom target/data_source.txt" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/53 custom target/data_source.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -This is a text only input file. diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/53 custom target/depfile/dep.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/53 custom target/depfile/dep.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/53 custom target/depfile/dep.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/53 custom target/depfile/dep.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -#!/usr/bin/env python - -import sys, os -from glob import glob - -_, srcdir, depfile, output = sys.argv - -depfiles = glob(os.path.join(srcdir, '*')) - -quoted_depfiles = [x.replace(' ', '\ ') for x in depfiles] - -with open(output, 'w') as f: - f.write('I am the result of globbing.') -with open(depfile, 'w') as f: - f.write('%s: %s\n' % (output, ' '.join(quoted_depfiles))) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/53 custom target/depfile/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/53 custom target/depfile/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/53 custom target/depfile/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/53 custom target/depfile/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ - - -mytarget = custom_target('depfile', - output : 'dep.dat', - depfile : 'dep.dat.d', - command : [find_program('dep.py'), meson.current_source_dir(), '@DEPFILE@', '@OUTPUT@'], -) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/53 custom target/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/53 custom target/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/53 custom target/installed_files.txt" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/53 custom target/installed_files.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -usr/subdir/data.dat diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/53 custom target/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/53 custom target/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/53 custom target/meson.build" 2018-12-09 16:29:36.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/53 custom target/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ -project('custom target', 'c') - -python = find_program('python3', required : false) -if not python.found() - python = find_program('python') -endif - -# Note that this will not add a dependency to the compiler executable. -# Code will not be rebuilt if it changes. -comp = '@0@/@1@'.format(meson.current_source_dir(), 'my_compiler.py') -# Test that files() in command: works. The compiler just discards it. -useless = files('installed_files.txt') - -mytarget = custom_target('bindat', -output : 'data.dat', -input : 'data_source.txt', -command : [python, comp, '--input=@INPUT@', '--output=@OUTPUT@', useless], -install : true, -install_dir : 'subdir' -) - -subdir('depfile') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/53 custom target/my_compiler.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/53 custom target/my_compiler.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/53 custom target/my_compiler.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/53 custom target/my_compiler.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 - -import os -import sys - -assert(os.path.exists(sys.argv[3])) - -args = sys.argv[:-1] - -if __name__ == '__main__': - if len(args) != 3 or not args[1].startswith('--input') or \ - not args[2].startswith('--output'): - print(args[0], '--input=input_file --output=output_file') - sys.exit(1) - with open(args[1].split('=')[1]) as f: - ifile = f.read() - if ifile != 'This is a text only input file.\n': - print('Malformed input') - sys.exit(1) - with open(args[2].split('=')[1], 'w') as ofile: - ofile.write('This is a binary output file.\n') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/53 custom target chain/data_source.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/53 custom target chain/data_source.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/53 custom target chain/data_source.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/53 custom target chain/data_source.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +This is a text only input file. diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/53 custom target chain/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/53 custom target chain/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/53 custom target chain/installed_files.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/53 custom target chain/installed_files.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +usr/subdir/data2.dat +usr/subdir/data3.dat diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/53 custom target chain/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/53 custom target chain/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/53 custom target chain/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/53 custom target chain/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,34 @@ +project('custom target', 'c') + +python = find_program('python3', required : false) +if not python.found() + python = find_program('python') +endif + +# files() is the correct way to do this, but some people +# do this so test that it works. +comp = '@0@/@1@'.format(meson.current_source_dir(), 'my_compiler.py') +comp2 = '@0@/@1@'.format(meson.current_source_dir(), 'my_compiler2.py') +infile = files('data_source.txt')[0] + +mytarget = custom_target('bindat', + output : 'data.dat', + command : [python, comp, infile, '@OUTPUT@'], +) + +mytarget2 = custom_target('bindat2', + output : 'data2.dat', + command : [python, comp2, mytarget, '@OUTPUT@'], + install : true, + install_dir : 'subdir' +) + +mytarget3 = custom_target('bindat3', + output : 'data3.dat', + input : [mytarget], + command : [python, comp2, '@INPUT@', '@OUTPUT@'], + install : true, + install_dir : 'subdir' +) + +subdir('usetarget') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/53 custom target chain/my_compiler2.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/53 custom target chain/my_compiler2.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/53 custom target chain/my_compiler2.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/53 custom target chain/my_compiler2.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,15 @@ +#!/usr/bin/env python + +import sys + +if __name__ == '__main__': + if len(sys.argv) != 3: + print(sys.argv[0], 'input_file output_file') + sys.exit(1) + with open(sys.argv[1]) as f: + ifile = f.read() + if ifile != 'This is a binary output file.\n': + print('Malformed input') + sys.exit(1) + with open(sys.argv[2], 'w') as ofile: + ofile.write('This is a different binary output file.\n') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/53 custom target chain/my_compiler.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/53 custom target chain/my_compiler.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/53 custom target chain/my_compiler.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/53 custom target chain/my_compiler.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,15 @@ +#!/usr/bin/env python + +import sys + +if __name__ == '__main__': + if len(sys.argv) != 3: + print(sys.argv[0], 'input_file output_file') + sys.exit(1) + with open(sys.argv[1]) as f: + ifile = f.read() + if ifile != 'This is a text only input file.\n': + print('Malformed input') + sys.exit(1) + with open(sys.argv[2], 'w') as ofile: + ofile.write('This is a binary output file.\n') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/53 custom target chain/usetarget/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/53 custom target chain/usetarget/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/53 custom target chain/usetarget/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/53 custom target chain/usetarget/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,8 @@ +e = executable('myexe', 'myexe.c') +subexe = find_program('subcomp.py') + +custom_target('use_exe', + input : e, + output : 'subout.res', + command : [subexe, '@INPUT@', '@OUTPUT@'], +) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/53 custom target chain/usetarget/myexe.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/53 custom target chain/usetarget/myexe.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/53 custom target chain/usetarget/myexe.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/53 custom target chain/usetarget/myexe.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,6 @@ +#include + +int main(int argc, char **argv) { + printf("I am myexe.\n"); + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/53 custom target chain/usetarget/subcomp.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/53 custom target chain/usetarget/subcomp.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/53 custom target chain/usetarget/subcomp.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/53 custom target chain/usetarget/subcomp.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,7 @@ +#!/usr/bin/env python + +import sys + +with open(sys.argv[1], 'rb') as ifile: + with open(sys.argv[2], 'w') as ofile: + ofile.write('Everything ok.\n') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/54 custom target chain/data_source.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/54 custom target chain/data_source.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/54 custom target chain/data_source.txt" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/54 custom target chain/data_source.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -This is a text only input file. diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/54 custom target chain/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/54 custom target chain/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/54 custom target chain/installed_files.txt" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/54 custom target chain/installed_files.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -usr/subdir/data2.dat -usr/subdir/data3.dat diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/54 custom target chain/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/54 custom target chain/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/54 custom target chain/meson.build" 2018-12-09 16:29:38.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/54 custom target chain/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -project('custom target', 'c') - -python = find_program('python3', required : false) -if not python.found() - python = find_program('python') -endif - -# files() is the correct way to do this, but some people -# do this so test that it works. -comp = '@0@/@1@'.format(meson.current_source_dir(), 'my_compiler.py') -comp2 = '@0@/@1@'.format(meson.current_source_dir(), 'my_compiler2.py') -infile = files('data_source.txt')[0] - -mytarget = custom_target('bindat', - output : 'data.dat', - command : [python, comp, infile, '@OUTPUT@'], -) - -mytarget2 = custom_target('bindat2', - output : 'data2.dat', - command : [python, comp2, mytarget, '@OUTPUT@'], - install : true, - install_dir : 'subdir' -) - -mytarget3 = custom_target('bindat3', - output : 'data3.dat', - input : [mytarget], - command : [python, comp2, '@INPUT@', '@OUTPUT@'], - install : true, - install_dir : 'subdir' -) - -subdir('usetarget') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/54 custom target chain/my_compiler2.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/54 custom target chain/my_compiler2.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/54 custom target chain/my_compiler2.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/54 custom target chain/my_compiler2.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -#!/usr/bin/env python - -import sys - -if __name__ == '__main__': - if len(sys.argv) != 3: - print(sys.argv[0], 'input_file output_file') - sys.exit(1) - with open(sys.argv[1]) as f: - ifile = f.read() - if ifile != 'This is a binary output file.\n': - print('Malformed input') - sys.exit(1) - with open(sys.argv[2], 'w') as ofile: - ofile.write('This is a different binary output file.\n') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/54 custom target chain/my_compiler.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/54 custom target chain/my_compiler.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/54 custom target chain/my_compiler.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/54 custom target chain/my_compiler.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -#!/usr/bin/env python - -import sys - -if __name__ == '__main__': - if len(sys.argv) != 3: - print(sys.argv[0], 'input_file output_file') - sys.exit(1) - with open(sys.argv[1]) as f: - ifile = f.read() - if ifile != 'This is a text only input file.\n': - print('Malformed input') - sys.exit(1) - with open(sys.argv[2], 'w') as ofile: - ofile.write('This is a binary output file.\n') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/54 custom target chain/usetarget/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/54 custom target chain/usetarget/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/54 custom target chain/usetarget/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/54 custom target chain/usetarget/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -e = executable('myexe', 'myexe.c') -subexe = find_program('subcomp.py') - -custom_target('use_exe', - input : e, - output : 'subout.res', - command : [subexe, '@INPUT@', '@OUTPUT@'], -) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/54 custom target chain/usetarget/myexe.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/54 custom target chain/usetarget/myexe.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/54 custom target chain/usetarget/myexe.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/54 custom target chain/usetarget/myexe.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#include - -int main(int argc, char **argv) { - printf("I am myexe.\n"); - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/54 custom target chain/usetarget/subcomp.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/54 custom target chain/usetarget/subcomp.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/54 custom target chain/usetarget/subcomp.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/54 custom target chain/usetarget/subcomp.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -#!/usr/bin/env python - -import sys - -with open(sys.argv[1], 'rb') as ifile: - with open(sys.argv[2], 'w') as ofile: - ofile.write('Everything ok.\n') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/54 run target/check_exists.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/54 run target/check_exists.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/54 run target/check_exists.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/54 run target/check_exists.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,7 @@ +#!/usr/bin/env python3 + +import os +import sys + +if not os.path.isfile(sys.argv[1]): + raise Exception("Couldn't find {!r}".format(sys.argv[1])) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/54 run target/configure.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/54 run target/configure.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/54 run target/configure.in" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/54 run target/configure.in" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +#!/usr/bin/env python3 + +print('Success') \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/54 run target/converter.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/54 run target/converter.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/54 run target/converter.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/54 run target/converter.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,6 @@ +#!/usr/bin/env python3 + +import sys + +with open(sys.argv[1], 'rb') as ifile, open(sys.argv[2], 'wb') as ofile: + ofile.write(ifile.read()) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/54 run target/fakeburner.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/54 run target/fakeburner.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/54 run target/fakeburner.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/54 run target/fakeburner.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,16 @@ +#!/usr/bin/env python3 + +from __future__ import print_function + +import sys + +plain_arg = sys.argv[1] +_, filename, _ = plain_arg.split(':') +try: + with open(filename, 'rb') as f: + content = f.read() +except FileNotFoundError: + print('Could not open file. Missing dependency?') + sys.exit(1) +print('File opened, pretending to send it somewhere.') +print(len(content), 'bytes uploaded') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/54 run target/helloprinter.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/54 run target/helloprinter.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/54 run target/helloprinter.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/54 run target/helloprinter.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,11 @@ +#include + +int main(int argc, char **argv) { + if(argc != 2) { + printf("I can not haz argument.\n"); + return 1; + } else { + printf("I can haz argument: %s\n", argv[1]); + } + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/54 run target/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/54 run target/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/54 run target/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/54 run target/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,67 @@ +project('run target', 'c') + +# Make it possible to run built programs. +# In cross builds exe_wrapper should be added if it exists. + +exe = executable('helloprinter', 'helloprinter.c') +run_target('runhello', + command : [exe, 'argument']) + +converter = find_program('converter.py') + +hex = custom_target('exe.hex', + input : exe, + output : 'exe.hex', + command : [converter, '@INPUT@', '@OUTPUT@', + ], +) + +fakeburner = find_program('fakeburner.py') + +# These emulates the Arduino flasher application. It sandwiches the filename inside +# a packed argument. Thus we need to declare it manually. +run_target('upload', + command : [fakeburner, 'x:@0@:y'.format(exe.full_path())], + depends : exe, +) + +run_target('upload2', + command : [fakeburner, 'x:@0@:y'.format(hex.full_path())], + depends : hex, +) + +python3 = find_program('python3', required : false) +if not python3.found() + python3 = find_program('python') +endif + +run_target('py3hi', + command : [python3, '-c', 'print("I am Python3.")']) + +run_target('check_exists', + command : [find_program('check_exists.py'), files('helloprinter.c')]) + +run_target('check_exists', + command : [find_program('check_exists.py'), files('helloprinter.c')], + depends : disabler(), +) + +run_target('check_exists', + command : [disabler(), files('helloprinter.c')]) + +# What if the output of a custom_target is the command to +# execute. Obviously this will not work as hex is not an +# executable but test that the output is generated correctly. +run_target('donotrunme', + command : hex) + +# Ensure configure files can be passed +conf = configure_file( + input: 'configure.in', + output: 'configure', + configuration: configuration_data() +) + +run_target('configure_script', + command : conf +) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/55 object generator/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/55 object generator/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/55 object generator/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/55 object generator/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,34 @@ +project('object generator', 'c') + +python = find_program('python3', required : false) +if not python.found() + python = find_program('python') +endif + +# Note that this will not add a dependency to the compiler executable. +# Code will not be rebuilt if it changes. +comp = '@0@/@1@'.format(meson.current_source_dir(), 'obj_generator.py') + +if host_machine.system() == 'windows' + outputname = '@BASENAME@.obj' +else + outputname = '@BASENAME@.o' +endif + +cc = meson.get_compiler('c').cmd_array().get(-1) +# Generate an object file manually. +gen = generator(python, + output : outputname, + arguments : [comp, cc, '@INPUT@', '@OUTPUT@']) + +generated = gen.process(['source.c', 'source2.c']) + +# Generate an object file with indexed OUTPUT replacement. +gen2 = generator(python, + output : outputname, + arguments : [comp, cc, '@INPUT@', '@OUTPUT0@']) +generated2 = gen2.process(['source3.c']) + +e = executable('prog', 'prog.c', generated, generated2) + +test('objgen', e) \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/55 object generator/obj_generator.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/55 object generator/obj_generator.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/55 object generator/obj_generator.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/55 object generator/obj_generator.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 + +# Mimic a binary that generates an object file (e.g. windres). + +import sys, subprocess + +if __name__ == '__main__': + if len(sys.argv) != 4: + print(sys.argv[0], 'compiler input_file output_file') + sys.exit(1) + compiler = sys.argv[1] + ifile = sys.argv[2] + ofile = sys.argv[3] + if compiler.endswith('cl'): + cmd = [compiler, '/nologo', '/MDd', '/Fo' + ofile, '/c', ifile] + else: + cmd = [compiler, '-c', ifile, '-o', ofile] + sys.exit(subprocess.call(cmd)) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/55 object generator/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/55 object generator/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/55 object generator/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/55 object generator/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,7 @@ +int func1_in_obj(); +int func2_in_obj(); +int func3_in_obj(); + +int main(int argc, char **argv) { + return func1_in_obj() + func2_in_obj() + func3_in_obj(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/55 object generator/source2.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/55 object generator/source2.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/55 object generator/source2.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/55 object generator/source2.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,3 @@ +int func2_in_obj() { + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/55 object generator/source3.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/55 object generator/source3.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/55 object generator/source3.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/55 object generator/source3.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,3 @@ +int func3_in_obj() { + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/55 object generator/source.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/55 object generator/source.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/55 object generator/source.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/55 object generator/source.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,3 @@ +int func1_in_obj() { + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/55 run target/check_exists.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/55 run target/check_exists.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/55 run target/check_exists.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/55 run target/check_exists.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -#!/usr/bin/env python3 - -import os -import sys - -if not os.path.isfile(sys.argv[1]): - raise Exception("Couldn't find {!r}".format(sys.argv[1])) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/55 run target/configure.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/55 run target/configure.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/55 run target/configure.in" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/55 run target/configure.in" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -#!/usr/bin/env python3 - -print('Success') \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/55 run target/converter.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/55 run target/converter.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/55 run target/converter.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/55 run target/converter.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#!/usr/bin/env python3 - -import sys - -with open(sys.argv[1], 'rb') as ifile, open(sys.argv[2], 'wb') as ofile: - ofile.write(ifile.read()) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/55 run target/fakeburner.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/55 run target/fakeburner.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/55 run target/fakeburner.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/55 run target/fakeburner.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -#!/usr/bin/env python3 - -from __future__ import print_function - -import sys - -plain_arg = sys.argv[1] -_, filename, _ = plain_arg.split(':') -try: - with open(filename, 'rb') as f: - content = f.read() -except FileNotFoundError: - print('Could not open file. Missing dependency?') - sys.exit(1) -print('File opened, pretending to send it somewhere.') -print(len(content), 'bytes uploaded') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/55 run target/helloprinter.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/55 run target/helloprinter.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/55 run target/helloprinter.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/55 run target/helloprinter.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -#include - -int main(int argc, char **argv) { - if(argc != 2) { - printf("I can not haz argument.\n"); - return 1; - } else { - printf("I can haz argument: %s\n", argv[1]); - } - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/55 run target/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/55 run target/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/55 run target/meson.build" 2018-12-09 16:29:39.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/55 run target/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,59 +0,0 @@ -project('run target', 'c') - -# Make it possible to run built programs. -# In cross builds exe_wrapper should be added if it exists. - -exe = executable('helloprinter', 'helloprinter.c') -run_target('runhello', - command : [exe, 'argument']) - -converter = find_program('converter.py') - -hex = custom_target('exe.hex', - input : exe, - output : 'exe.hex', - command : [converter, '@INPUT@', '@OUTPUT@', - ], -) - -fakeburner = find_program('fakeburner.py') - -# These emulates the Arduino flasher application. It sandwiches the filename inside -# a packed argument. Thus we need to declare it manually. -run_target('upload', - command : [fakeburner, 'x:@0@:y'.format(exe.full_path())], - depends : exe, -) - -run_target('upload2', - command : [fakeburner, 'x:@0@:y'.format(hex.full_path())], - depends : hex, -) - -python3 = find_program('python3', required : false) -if not python3.found() - python3 = find_program('python') -endif - -run_target('py3hi', - command : [python3, '-c', 'print("I am Python3.")']) - -run_target('check_exists', - command : [find_program('check_exists.py'), files('helloprinter.c')]) - -# What if the output of a custom_target is the command to -# execute. Obviously this will not work as hex is not an -# executable but test that the output is generated correctly. -run_target('donotrunme', - command : hex) - -# Ensure configure files can be passed -conf = configure_file( - input: 'configure.in', - output: 'configure', - configuration: configuration_data() -) - -run_target('configure_script', - command : conf -) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/55 run target/scripts/script.sh" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/55 run target/scripts/script.sh" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/55 run target/scripts/script.sh" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/55 run target/scripts/script.sh" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#!/bin/sh - -cd "$MESON_SOURCE_ROOT" -echo My current directory is `pwd` -echo Build dir is at $MESON_BUILD_ROOT diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/56 install script/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/56 install script/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/56 install script/installed_files.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/56 install script/installed_files.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +usr/bin/prog?exe +?msvc:usr/bin/prog.pdb +usr/diiba/daaba/file.dat +usr/this/should/also-work.dat +usr/this/does/something-different.dat.in diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/56 install script/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/56 install script/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/56 install script/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/56 install script/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,7 @@ +project('custom install script', 'c') + +executable('prog', 'prog.c', install : true) +meson.add_install_script('myinstall.py', 'diiba/daaba', 'file.dat') +meson.add_install_script('myinstall.py', 'this/should', 'also-work.dat') + +subdir('src') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/56 install script/myinstall.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/56 install script/myinstall.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/56 install script/myinstall.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/56 install script/myinstall.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,12 @@ +#!/usr/bin/env python3 + +import os +import sys + +prefix = os.environ['MESON_INSTALL_DESTDIR_PREFIX'] + +dirname = os.path.join(prefix, sys.argv[1]) + +os.makedirs(dirname) +with open(os.path.join(dirname, sys.argv[2]), 'w') as f: + f.write('') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/56 install script/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/56 install script/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/56 install script/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/56 install script/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,6 @@ +#include + +int main(int argc, char **argv) { + printf("This is text.\n"); + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/56 install script/src/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/56 install script/src/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/56 install script/src/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/56 install script/src/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +meson.add_install_script('myinstall.py', 'this/does', 'something-different.dat') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/56 install script/src/myinstall.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/56 install script/src/myinstall.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/56 install script/src/myinstall.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/56 install script/src/myinstall.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,12 @@ +#!/usr/bin/env python3 + +import os +import sys + +prefix = os.environ['MESON_INSTALL_DESTDIR_PREFIX'] + +dirname = os.path.join(prefix, sys.argv[1]) + +os.makedirs(dirname) +with open(os.path.join(dirname, sys.argv[2] + '.in'), 'w') as f: + f.write('') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/56 object generator/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/56 object generator/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/56 object generator/meson.build" 2018-12-09 16:29:39.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/56 object generator/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -project('object generator', 'c') - -python = find_program('python3', required : false) -if not python.found() - python = find_program('python') -endif - -# Note that this will not add a dependency to the compiler executable. -# Code will not be rebuilt if it changes. -comp = '@0@/@1@'.format(meson.current_source_dir(), 'obj_generator.py') - -if host_machine.system() == 'windows' - outputname = '@BASENAME@.obj' -else - outputname = '@BASENAME@.o' -endif - -cc = meson.get_compiler('c').cmd_array().get(-1) -# Generate an object file manually. -gen = generator(python, - output : outputname, - arguments : [comp, cc, '@INPUT@', '@OUTPUT@']) - -generated = gen.process(['source.c', 'source2.c']) - -# Generate an object file with indexed OUTPUT replacement. -gen2 = generator(python, - output : outputname, - arguments : [comp, cc, '@INPUT@', '@OUTPUT0@']) -generated2 = gen2.process(['source3.c']) - -e = executable('prog', 'prog.c', generated, generated2) - -test('objgen', e) \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/56 object generator/obj_generator.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/56 object generator/obj_generator.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/56 object generator/obj_generator.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/56 object generator/obj_generator.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -#!/usr/bin/env python3 - -# Mimic a binary that generates an object file (e.g. windres). - -import sys, subprocess - -if __name__ == '__main__': - if len(sys.argv) != 4: - print(sys.argv[0], 'compiler input_file output_file') - sys.exit(1) - compiler = sys.argv[1] - ifile = sys.argv[2] - ofile = sys.argv[3] - if compiler.endswith('cl'): - cmd = [compiler, '/nologo', '/MDd', '/Fo' + ofile, '/c', ifile] - else: - cmd = [compiler, '-c', ifile, '-o', ofile] - sys.exit(subprocess.call(cmd)) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/56 object generator/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/56 object generator/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/56 object generator/prog.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/56 object generator/prog.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -int func1_in_obj(); -int func2_in_obj(); -int func3_in_obj(); - -int main(int argc, char **argv) { - return func1_in_obj() + func2_in_obj() + func3_in_obj(); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/56 object generator/source2.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/56 object generator/source2.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/56 object generator/source2.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/56 object generator/source2.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -int func2_in_obj() { - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/56 object generator/source3.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/56 object generator/source3.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/56 object generator/source3.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/56 object generator/source3.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -int func3_in_obj() { - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/56 object generator/source.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/56 object generator/source.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/56 object generator/source.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/56 object generator/source.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -int func1_in_obj() { - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/57 custom target source output/generator.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/57 custom target source output/generator.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/57 custom target source output/generator.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/57 custom target source output/generator.py" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,16 @@ +#!/usr/bin/env python3 + +import sys, os + +if len(sys.argv) != 2: + print(sys.argv[0], '') + +odir = sys.argv[1] + +with open(os.path.join(odir, 'mylib.h'), 'w') as f: + f.write('int func();\n') +with open(os.path.join(odir, 'mylib.c'), 'w') as f: + f.write('''int func() { + return 0; +} +''') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/57 custom target source output/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/57 custom target source output/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/57 custom target source output/main.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/57 custom target source output/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +#include"mylib.h" + +int main(int argc, char **argv) { + return func(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/57 custom target source output/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/57 custom target source output/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/57 custom target source output/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/57 custom target source output/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,9 @@ +project('source generation', 'c') + +ct = custom_target('gen', +output : ['mylib.h', 'mylib.c'], +command : [find_program('generator.py'), '@OUTDIR@'], +) + +e = executable('prog', 'main.c', ct) +test('gentest', e) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/57 install script/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/57 install script/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/57 install script/installed_files.txt" 2018-10-31 09:31:57.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/57 install script/installed_files.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -usr/bin/prog?exe -?msvc:usr/bin/prog.pdb -usr/diiba/daaba/file.dat -usr/this/should/also-work.dat -usr/this/does/something-different.dat.in diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/57 install script/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/57 install script/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/57 install script/meson.build" 2018-12-09 16:29:40.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/57 install script/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -project('custom install script', 'c') - -executable('prog', 'prog.c', install : true) -meson.add_install_script('myinstall.py', 'diiba/daaba', 'file.dat') -meson.add_install_script('myinstall.py', 'this/should', 'also-work.dat') - -subdir('src') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/57 install script/myinstall.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/57 install script/myinstall.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/57 install script/myinstall.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/57 install script/myinstall.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -#!/usr/bin/env python3 - -import os -import sys - -prefix = os.environ['MESON_INSTALL_DESTDIR_PREFIX'] - -dirname = os.path.join(prefix, sys.argv[1]) - -os.makedirs(dirname) -with open(os.path.join(dirname, sys.argv[2]), 'w') as f: - f.write('') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/57 install script/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/57 install script/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/57 install script/prog.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/57 install script/prog.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#include - -int main(int argc, char **argv) { - printf("This is text.\n"); - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/57 install script/src/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/57 install script/src/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/57 install script/src/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/57 install script/src/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -meson.add_install_script('myinstall.py', 'this/does', 'something-different.dat') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/57 install script/src/myinstall.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/57 install script/src/myinstall.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/57 install script/src/myinstall.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/57 install script/src/myinstall.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -#!/usr/bin/env python3 - -import os -import sys - -prefix = os.environ['MESON_INSTALL_DESTDIR_PREFIX'] - -dirname = os.path.join(prefix, sys.argv[1]) - -os.makedirs(dirname) -with open(os.path.join(dirname, sys.argv[2] + '.in'), 'w') as f: - f.write('') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/58 custom target source output/generator.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/58 custom target source output/generator.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/58 custom target source output/generator.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/58 custom target source output/generator.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -#!/usr/bin/env python3 - -import sys, os - -if len(sys.argv) != 2: - print(sys.argv[0], '') - -odir = sys.argv[1] - -with open(os.path.join(odir, 'mylib.h'), 'w') as f: - f.write('int func();\n') -with open(os.path.join(odir, 'mylib.c'), 'w') as f: - f.write('''int func() { - return 0; -} -''') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/58 custom target source output/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/58 custom target source output/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/58 custom target source output/main.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/58 custom target source output/main.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#include"mylib.h" - -int main(int argc, char **argv) { - return func(); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/58 custom target source output/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/58 custom target source output/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/58 custom target source output/meson.build" 2018-12-09 16:29:42.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/58 custom target source output/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -project('source generation', 'c') - -ct = custom_target('gen', -output : ['mylib.h', 'mylib.c'], -command : [find_program('generator.py'), '@OUTDIR@'], -) - -e = executable('prog', 'main.c', ct) -test('gentest', e) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/58 exe static shared/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/58 exe static shared/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/58 exe static shared/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/58 exe static shared/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,15 @@ +project('statchain', 'c') + +subdir('subdir') +# Test that -fPIC in c_args is also accepted (on platforms where it's permitted) +picflag = [] +if not ['darwin', 'windows'].contains(host_machine.system()) + picflag = ['-fPIC'] +endif +statlib2 = static_library('stat2', 'stat2.c', c_args : picflag, pic : false) +# Test that pic is needed for both direct and indirect static library +# dependencies of shared libraries (on Linux and BSD) +statlib = static_library('stat', 'stat.c', link_with : [shlib, statlib2], pic : true) +shlib2 = shared_library('shr2', 'shlib2.c', link_with : statlib) +exe = executable('prog', 'prog.c', link_with : shlib2) +test('runtest', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/58 exe static shared/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/58 exe static shared/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/58 exe static shared/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/58 exe static shared/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,10 @@ +int shlibfunc2(); +int statlibfunc(); + +int main(int argc, char **argv) { + if (statlibfunc() != 42) + return 1; + if (shlibfunc2() != 24) + return 1; + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/58 exe static shared/shlib2.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/58 exe static shared/shlib2.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/58 exe static shared/shlib2.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/58 exe static shared/shlib2.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,8 @@ +#include "subdir/exports.h" + +int statlibfunc(void); +int statlibfunc2(void); + +int DLL_PUBLIC shlibfunc2(void) { + return statlibfunc() - statlibfunc2(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/58 exe static shared/stat2.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/58 exe static shared/stat2.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/58 exe static shared/stat2.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/58 exe static shared/stat2.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,3 @@ +int statlibfunc2() { + return 18; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/58 exe static shared/stat.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/58 exe static shared/stat.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/58 exe static shared/stat.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/58 exe static shared/stat.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,7 @@ +#include "subdir/exports.h" + +int shlibfunc(); + +int DLL_PUBLIC statlibfunc() { + return shlibfunc(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/58 exe static shared/subdir/exports.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/58 exe static shared/subdir/exports.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/58 exe static shared/subdir/exports.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/58 exe static shared/subdir/exports.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,12 @@ +#pragma once + +#if defined _WIN32 || defined __CYGWIN__ + #define DLL_PUBLIC __declspec(dllexport) +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/58 exe static shared/subdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/58 exe static shared/subdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/58 exe static shared/subdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/58 exe static shared/subdir/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +shlib = shared_library('shar', 'shlib.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/58 exe static shared/subdir/shlib.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/58 exe static shared/subdir/shlib.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/58 exe static shared/subdir/shlib.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/58 exe static shared/subdir/shlib.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +#include "exports.h" + +int DLL_PUBLIC shlibfunc() { + return 42; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/59 array methods/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/59 array methods/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/59 array methods/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/59 array methods/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,46 @@ +project('array methods', 'c') + +empty = [] +one = ['abc'] +two = ['def', 'ghi'] +combined = [empty, one, two] + +if empty.contains('abc') + error('Empty is not empty.') +endif + +if one.contains('a') + error('One claims to contain a') +endif + +if not one.contains('abc') + error('One claims to not contain abc.') +endif + +if one.contains('abcd') + error('One claims to contain abcd.') +endif + +if two.contains('abc') + error('Two claims to contain abc.') +endif + +if not two.contains('def') + error('Two claims not to contain def.') +endif + +if not two.contains('ghi') + error('Two claims not to contain ghi.') +endif + +if two.contains('defg') + error('Two claims to contain defg.') +endif + +if not combined.contains('abc') + error('Combined claims not to contain abc.') +endif + +if not combined.contains('ghi') + error('Combined claims not to contain ghi.') +endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/59 exe static shared/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/59 exe static shared/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/59 exe static shared/meson.build" 2018-12-09 16:29:43.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/59 exe static shared/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -project('statchain', 'c') - -subdir('subdir') -# Test that -fPIC in c_args is also accepted -statlib2 = static_library('stat2', 'stat2.c', c_args : '-fPIC', pic : false) -# Test that pic is needed for both direct and indirect static library -# dependencies of shared libraries (on Linux and BSD) -statlib = static_library('stat', 'stat.c', link_with : [shlib, statlib2], pic : true) -shlib2 = shared_library('shr2', 'shlib2.c', link_with : statlib) -exe = executable('prog', 'prog.c', link_with : shlib2) -test('runtest', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/59 exe static shared/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/59 exe static shared/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/59 exe static shared/prog.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/59 exe static shared/prog.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -int shlibfunc2(); -int statlibfunc(); - -int main(int argc, char **argv) { - if (statlibfunc() != 42) - return 1; - if (shlibfunc2() != 24) - return 1; - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/59 exe static shared/shlib2.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/59 exe static shared/shlib2.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/59 exe static shared/shlib2.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/59 exe static shared/shlib2.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -#include "subdir/exports.h" - -int statlibfunc(void); -int statlibfunc2(void); - -int DLL_PUBLIC shlibfunc2(void) { - return statlibfunc() - statlibfunc2(); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/59 exe static shared/stat2.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/59 exe static shared/stat2.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/59 exe static shared/stat2.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/59 exe static shared/stat2.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -int statlibfunc2() { - return 18; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/59 exe static shared/stat.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/59 exe static shared/stat.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/59 exe static shared/stat.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/59 exe static shared/stat.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -#include "subdir/exports.h" - -int shlibfunc(); - -int DLL_PUBLIC statlibfunc() { - return shlibfunc(); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/59 exe static shared/subdir/exports.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/59 exe static shared/subdir/exports.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/59 exe static shared/subdir/exports.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/59 exe static shared/subdir/exports.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -#pragma once - -#if defined _WIN32 || defined __CYGWIN__ - #define DLL_PUBLIC __declspec(dllexport) -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/59 exe static shared/subdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/59 exe static shared/subdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/59 exe static shared/subdir/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/59 exe static shared/subdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -shlib = shared_library('shar', 'shlib.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/59 exe static shared/subdir/shlib.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/59 exe static shared/subdir/shlib.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/59 exe static shared/subdir/shlib.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/59 exe static shared/subdir/shlib.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#include "exports.h" - -int DLL_PUBLIC shlibfunc() { - return 42; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/60 array methods/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/60 array methods/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/60 array methods/meson.build" 2018-12-09 16:29:42.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/60 array methods/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -project('array methods', 'c') - -empty = [] -one = ['abc'] -two = ['def', 'ghi'] -combined = [empty, one, two] - -if empty.contains('abc') - error('Empty is not empty.') -endif - -if one.contains('a') - error('One claims to contain a') -endif - -if not one.contains('abc') - error('One claims to not contain abc.') -endif - -if one.contains('abcd') - error('One claims to contain abcd.') -endif - -if two.contains('abc') - error('Two claims to contain abc.') -endif - -if not two.contains('def') - error('Two claims not to contain def.') -endif - -if not two.contains('ghi') - error('Two claims not to contain ghi.') -endif - -if two.contains('defg') - error('Two claims to contain defg.') -endif - -if not combined.contains('abc') - error('Combined claims not to contain abc.') -endif - -if not combined.contains('ghi') - error('Combined claims not to contain ghi.') -endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/60 custom header generator/input.def" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/60 custom header generator/input.def" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/60 custom header generator/input.def" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/60 custom header generator/input.def" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +0 diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/60 custom header generator/makeheader.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/60 custom header generator/makeheader.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/60 custom header generator/makeheader.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/60 custom header generator/makeheader.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,12 @@ +#!/usr/bin/env python3 + +# NOTE: this file does not have the executable bit set. This tests that +# Meson can automatically parse shebang lines. + +import sys + +template = '#define RET_VAL %s\n' +with open(sys.argv[1]) as f: + output = template % (f.readline().strip(), ) +with open(sys.argv[2], 'w') as f: + f.write(output) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/60 custom header generator/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/60 custom header generator/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/60 custom header generator/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/60 custom header generator/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,21 @@ +project('custom header generator', 'c') + +cc_id = meson.get_compiler('c').get_id() +cc_ver = meson.get_compiler('c').version() + +if cc_id == 'intel' or (cc_id == 'lcc' and cc_ver.version_compare('<=1.23.08')) + # ICC and LCC <= 1.23.08 do not escape spaces in paths in the dependency file, so Ninja + # (correctly) thinks that the rule has multiple outputs and errors out: + # 'depfile has multiple output paths' + error('MESON_SKIP_TEST: Skipping test because your compiler is known to generate broken dependency files') +endif + +gen = find_program('makeheader.py') + +generated_h = custom_target('makeheader.py', + output : 'myheader.lh', # Suffix not .h to ensure this works with custom suffixes, too. + input : 'input.def', + command : [gen, '@INPUT0@', '@OUTPUT0@', files('somefile.txt')]) + +prog = executable('prog', 'prog.c', generated_h) +test('gentest', prog) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/60 custom header generator/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/60 custom header generator/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/60 custom header generator/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/60 custom header generator/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +#include"myheader.lh" + +int main(int argc, char **argv) { + return RET_VAL; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/61 custom header generator/input.def" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/61 custom header generator/input.def" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/61 custom header generator/input.def" 2018-12-09 16:26:10.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/61 custom header generator/input.def" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -0 diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/61 custom header generator/makeheader.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/61 custom header generator/makeheader.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/61 custom header generator/makeheader.py" 2018-12-09 16:26:11.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/61 custom header generator/makeheader.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -#!/usr/bin/env python3 - -# NOTE: this file does not have the executable bit set. This tests that -# Meson can automatically parse shebang lines. - -import sys - -template = '#define RET_VAL %s\n' -with open(sys.argv[1]) as f: - output = template % (f.readline().strip(), ) -with open(sys.argv[2], 'w') as f: - f.write(output) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/61 custom header generator/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/61 custom header generator/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/61 custom header generator/meson.build" 2018-12-09 16:29:44.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/61 custom header generator/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -project('custom header generator', 'c') - -cc_id = meson.get_compiler('c').get_id() -cc_ver = meson.get_compiler('c').version() - -if cc_id == 'intel' or (cc_id == 'lcc' and cc_ver.version_compare('<=1.23.08')) - # ICC and LCC <= 1.23.08 do not escape spaces in paths in the dependency file, so Ninja - # (correctly) thinks that the rule has multiple outputs and errors out: - # 'depfile has multiple output paths' - error('MESON_SKIP_TEST: Skipping test because your compiler is known to generate broken dependency files') -endif - -gen = find_program('makeheader.py') - -generated_h = custom_target('makeheader.py', - output : 'myheader.lh', # Suffix not .h to ensure this works with custom suffixes, too. - input : 'input.def', - command : [gen, '@INPUT0@', '@OUTPUT0@', files('somefile.txt')]) - -prog = executable('prog', 'prog.c', generated_h) -test('gentest', prog) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/61 custom header generator/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/61 custom header generator/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/61 custom header generator/prog.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/61 custom header generator/prog.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#include"myheader.lh" - -int main(int argc, char **argv) { - return RET_VAL; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/61 multiple generators/data2.dat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/61 multiple generators/data2.dat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/61 multiple generators/data2.dat" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/61 multiple generators/data2.dat" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +2 diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/61 multiple generators/main.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/61 multiple generators/main.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/61 multiple generators/main.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/61 multiple generators/main.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,6 @@ +#include"source1.h" +#include"source2.h" + +int main(int argc, char **argv) { + return func1() + func2(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/61 multiple generators/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/61 multiple generators/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/61 multiple generators/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/61 multiple generators/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,13 @@ +project('trickier generator', 'cpp') + +comp = find_program('mygen.py') +subdir('subdir') + +generated2 = custom_target('generated2', + output : ['source2.h', 'source2.cpp'], + input : 'data2.dat', + command : [comp, '@INPUT0@', '@OUTDIR@']) + +exe = executable('prog', 'main.cpp', generated, generated2, + include_directories : include_directories('subdir')) + test('generated test', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/61 multiple generators/mygen.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/61 multiple generators/mygen.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/61 multiple generators/mygen.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/61 multiple generators/mygen.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,22 @@ +#!/usr/bin/env python3 + +import sys, os + +if len(sys.argv) != 3: + print("You is fail.") + sys.exit(1) + +with open(sys.argv[1]) as f: + val = f.read().strip() +outdir = sys.argv[2] + +outhdr = os.path.join(outdir, 'source%s.h' % val) +outsrc = os.path.join(outdir, 'source%s.cpp' % val) + +with open(outhdr, 'w') as f: + f.write('int func%s();\n' % val) +with open(outsrc, 'w') as f: + f.write('''int func%s() { + return 0; +} +''' % val) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/61 multiple generators/subdir/data.dat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/61 multiple generators/subdir/data.dat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/61 multiple generators/subdir/data.dat" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/61 multiple generators/subdir/data.dat" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +1 diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/61 multiple generators/subdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/61 multiple generators/subdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/61 multiple generators/subdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/61 multiple generators/subdir/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,4 @@ +generated = custom_target('generated', +output : ['source1.h', 'source1.cpp'], +input : 'data.dat', +command : [comp, '@INPUT0@', '@OUTDIR@']) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/62 install subdir/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/62 install subdir/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/62 install subdir/installed_files.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/62 install subdir/installed_files.txt" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,12 @@ +usr/share/dircheck/fifth.dat +usr/share/dircheck/seventh.dat +usr/share/dircheck/nineth.dat +usr/share/eighth.dat +usr/share/fourth.dat +usr/share/sixth.dat +usr/share/sub1/data1.dat +usr/share/sub1/second.dat +usr/share/sub1/third.dat +usr/share/sub1/sub2/data2.dat +usr/share/sub2/one.dat +usr/share/sub2/dircheck/excluded-three.dat diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/62 install subdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/62 install subdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/62 install subdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/62 install subdir/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,18 @@ +project('install a whole subdir', 'c', + default_options : ['install_umask=preserve']) + +# A subdir with an exclusion: +install_subdir('sub2', + exclude_files : ['excluded-three.dat'], + exclude_directories : ['excluded'], + install_dir : 'share') + +subdir('subdir') +# A subdir with write perms only for the owner +# and read-list perms for owner and group +install_subdir('sub1', install_dir : 'share', install_mode : ['rwxr-x--t', 'root']) +install_subdir('sub/sub1', install_dir : 'share') + +# strip_directory +install_subdir('sub_elided', install_dir : 'share', strip_directory : true) +install_subdir('nested_elided/sub', install_dir : 'share', strip_directory : true) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/62 install subdir/nested_elided/sub/dircheck/nineth.dat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/62 install subdir/nested_elided/sub/dircheck/nineth.dat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/62 install subdir/nested_elided/sub/dircheck/nineth.dat" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/62 install subdir/nested_elided/sub/dircheck/nineth.dat" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1 @@ +Nested file under nested elided directory. diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/62 install subdir/nested_elided/sub/eighth.dat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/62 install subdir/nested_elided/sub/eighth.dat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/62 install subdir/nested_elided/sub/eighth.dat" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/62 install subdir/nested_elided/sub/eighth.dat" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +File in nested elided directory. diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/62 install subdir/sub/sub1/third.dat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/62 install subdir/sub/sub1/third.dat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/62 install subdir/sub/sub1/third.dat" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/62 install subdir/sub/sub1/third.dat" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +This is a third data file for sub1 dir. diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/62 install subdir/sub1/second.dat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/62 install subdir/sub1/second.dat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/62 install subdir/sub1/second.dat" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/62 install subdir/sub1/second.dat" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +Test that multiple install_subdirs meld their results. \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/62 install subdir/subdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/62 install subdir/subdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/62 install subdir/subdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/62 install subdir/subdir/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +install_subdir('sub1', install_dir : 'share', + # This mode will be overridden by the mode set in the outer install_subdir + install_mode : 'rwxr-x---') + +install_subdir('sub_elided', install_dir : 'share', strip_directory : true) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/62 install subdir/subdir/sub1/data1.dat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/62 install subdir/subdir/sub1/data1.dat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/62 install subdir/subdir/sub1/data1.dat" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/62 install subdir/subdir/sub1/data1.dat" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +This is a data file in a subdir. diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/62 install subdir/subdir/sub1/sub2/data2.dat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/62 install subdir/subdir/sub1/sub2/data2.dat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/62 install subdir/subdir/sub1/sub2/data2.dat" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/62 install subdir/subdir/sub1/sub2/data2.dat" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +This is a data file in a deeper subdir. diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/62 install subdir/subdir/sub_elided/dircheck/seventh.dat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/62 install subdir/subdir/sub_elided/dircheck/seventh.dat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/62 install subdir/subdir/sub_elided/dircheck/seventh.dat" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/62 install subdir/subdir/sub_elided/dircheck/seventh.dat" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +Nested file in a subdir. diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/62 install subdir/subdir/sub_elided/sixth.dat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/62 install subdir/subdir/sub_elided/sixth.dat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/62 install subdir/subdir/sub_elided/sixth.dat" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/62 install subdir/subdir/sub_elided/sixth.dat" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +Elide test file in a subdir. diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/62 install subdir/sub_elided/dircheck/fifth.dat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/62 install subdir/sub_elided/dircheck/fifth.dat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/62 install subdir/sub_elided/dircheck/fifth.dat" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/62 install subdir/sub_elided/dircheck/fifth.dat" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +Data file in a subdir of elided directory. diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/62 install subdir/sub_elided/fourth.dat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/62 install subdir/sub_elided/fourth.dat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/62 install subdir/sub_elided/fourth.dat" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/62 install subdir/sub_elided/fourth.dat" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +Test that this file is installed directly into install_dir. diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/62 multiple generators/data2.dat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/62 multiple generators/data2.dat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/62 multiple generators/data2.dat" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/62 multiple generators/data2.dat" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -2 diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/62 multiple generators/main.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/62 multiple generators/main.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/62 multiple generators/main.cpp" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/62 multiple generators/main.cpp" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#include"source1.h" -#include"source2.h" - -int main(int argc, char **argv) { - return func1() + func2(); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/62 multiple generators/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/62 multiple generators/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/62 multiple generators/meson.build" 2018-12-09 16:29:46.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/62 multiple generators/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -project('trickier generator', 'cpp') - -comp = find_program('mygen.py') -subdir('subdir') - -generated2 = custom_target('generated2', - output : ['source2.h', 'source2.cpp'], - input : 'data2.dat', - command : [comp, '@INPUT0@', '@OUTDIR@']) - -exe = executable('prog', 'main.cpp', generated, generated2, - include_directories : include_directories('subdir')) - test('generated test', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/62 multiple generators/mygen.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/62 multiple generators/mygen.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/62 multiple generators/mygen.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/62 multiple generators/mygen.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ -#!/usr/bin/env python3 - -import sys, os - -if len(sys.argv) != 3: - print("You is fail.") - sys.exit(1) - -with open(sys.argv[1]) as f: - val = f.read().strip() -outdir = sys.argv[2] - -outhdr = os.path.join(outdir, 'source%s.h' % val) -outsrc = os.path.join(outdir, 'source%s.cpp' % val) - -with open(outhdr, 'w') as f: - f.write('int func%s();\n' % val) -with open(outsrc, 'w') as f: - f.write('''int func%s() { - return 0; -} -''' % val) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/62 multiple generators/subdir/data.dat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/62 multiple generators/subdir/data.dat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/62 multiple generators/subdir/data.dat" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/62 multiple generators/subdir/data.dat" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -1 diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/62 multiple generators/subdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/62 multiple generators/subdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/62 multiple generators/subdir/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/62 multiple generators/subdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -generated = custom_target('generated', -output : ['source1.h', 'source1.cpp'], -input : 'data.dat', -command : [comp, '@INPUT0@', '@OUTDIR@']) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/63 foreach/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/63 foreach/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/63 foreach/installed_files.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/63 foreach/installed_files.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,6 @@ +usr/bin/prog1?exe +?msvc:usr/bin/prog1.pdb +usr/bin/prog2?exe +?msvc:usr/bin/prog2.pdb +usr/bin/prog3?exe +?msvc:usr/bin/prog3.pdb diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/63 foreach/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/63 foreach/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/63 foreach/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/63 foreach/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,33 @@ +project('foreach', 'c') + +tests = [['test1', 'prog1', 'prog1.c'], + ['test2', 'prog2', 'prog2.c', 'fallback'], + ['test3', 'prog3', 'prog3.c', 'urgh']] + +assert(tests[0].get(3, 'fallbck') == 'fallbck', 'array #1 fallback did not match') +assert(tests[1].get(3, 'failbk') == 'fallback', 'array #2 value did not match') +assert(tests[2].get(3, 'urgh') == 'urgh', 'array #3 value did not match') + +foreach i : tests + test(i.get(0), executable(i.get(1), i.get(2), install : true)) + + # Ensure that changing the tests variable does not + # affect ongoing iteration in the foreach loop. + # + # Being able to do that would make Meson Turing complete and + # we definitely don't want that. + tests = ['test4', 'prog4', 'prog4.c'] +endforeach + +items = ['a', 'continue', 'b', 'break', 'c'] +result = [] +foreach i : items + if i == 'continue' + continue + elif i == 'break' + break + endif + result += i +endforeach + +assert(result == ['a', 'b'], 'Continue or break in foreach failed') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/63 foreach/prog1.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/63 foreach/prog1.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/63 foreach/prog1.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/63 foreach/prog1.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,6 @@ +#include + +int main(int argc, char **argv) { + printf("This is test #1.\n"); + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/63 foreach/prog2.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/63 foreach/prog2.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/63 foreach/prog2.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/63 foreach/prog2.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,6 @@ +#include + +int main(int argc, char **argv) { + printf("This is test #2.\n"); + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/63 foreach/prog3.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/63 foreach/prog3.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/63 foreach/prog3.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/63 foreach/prog3.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,6 @@ +#include + +int main(int argc, char **argv) { + printf("This is test #3.\n"); + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/63 install subdir/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/63 install subdir/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/63 install subdir/installed_files.txt" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/63 install subdir/installed_files.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -usr/share/dircheck/fifth.dat -usr/share/dircheck/seventh.dat -usr/share/dircheck/nineth.dat -usr/share/eighth.dat -usr/share/fourth.dat -usr/share/sixth.dat -usr/share/sub1/data1.dat -usr/share/sub1/second.dat -usr/share/sub1/third.dat -usr/share/sub1/sub2/data2.dat -usr/share/sub2/one.dat -usr/share/sub2/dircheck/excluded-three.dat diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/63 install subdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/63 install subdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/63 install subdir/meson.build" 2018-12-09 16:29:46.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/63 install subdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -project('install a whole subdir', 'c', - default_options : ['install_umask=preserve']) - -# A subdir with an exclusion: -install_subdir('sub2', - exclude_files : ['excluded-three.dat'], - exclude_directories : ['excluded'], - install_dir : 'share') - -subdir('subdir') -# A subdir with write perms only for the owner -# and read-list perms for owner and group -install_subdir('sub1', install_dir : 'share', install_mode : ['rwxr-x--t', 'root']) -install_subdir('sub/sub1', install_dir : 'share') - -# strip_directory -install_subdir('sub_elided', install_dir : 'share', strip_directory : true) -install_subdir('nested_elided/sub', install_dir : 'share', strip_directory : true) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/63 install subdir/nested_elided/sub/dircheck/nineth.dat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/63 install subdir/nested_elided/sub/dircheck/nineth.dat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/63 install subdir/nested_elided/sub/dircheck/nineth.dat" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/63 install subdir/nested_elided/sub/dircheck/nineth.dat" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Nested file under nested elided directory. diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/63 install subdir/nested_elided/sub/eighth.dat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/63 install subdir/nested_elided/sub/eighth.dat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/63 install subdir/nested_elided/sub/eighth.dat" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/63 install subdir/nested_elided/sub/eighth.dat" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -File in nested elided directory. diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/63 install subdir/sub/sub1/third.dat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/63 install subdir/sub/sub1/third.dat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/63 install subdir/sub/sub1/third.dat" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/63 install subdir/sub/sub1/third.dat" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -This is a third data file for sub1 dir. diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/63 install subdir/sub1/second.dat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/63 install subdir/sub1/second.dat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/63 install subdir/sub1/second.dat" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/63 install subdir/sub1/second.dat" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Test that multiple install_subdirs meld their results. \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/63 install subdir/subdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/63 install subdir/subdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/63 install subdir/subdir/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/63 install subdir/subdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -install_subdir('sub1', install_dir : 'share', - # This mode will be overridden by the mode set in the outer install_subdir - install_mode : 'rwxr-x---') - -install_subdir('sub_elided', install_dir : 'share', strip_directory : true) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/63 install subdir/subdir/sub1/data1.dat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/63 install subdir/subdir/sub1/data1.dat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/63 install subdir/subdir/sub1/data1.dat" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/63 install subdir/subdir/sub1/data1.dat" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -This is a data file in a subdir. diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/63 install subdir/subdir/sub1/sub2/data2.dat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/63 install subdir/subdir/sub1/sub2/data2.dat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/63 install subdir/subdir/sub1/sub2/data2.dat" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/63 install subdir/subdir/sub1/sub2/data2.dat" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -This is a data file in a deeper subdir. diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/63 install subdir/subdir/sub_elided/dircheck/seventh.dat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/63 install subdir/subdir/sub_elided/dircheck/seventh.dat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/63 install subdir/subdir/sub_elided/dircheck/seventh.dat" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/63 install subdir/subdir/sub_elided/dircheck/seventh.dat" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Nested file in a subdir. diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/63 install subdir/subdir/sub_elided/sixth.dat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/63 install subdir/subdir/sub_elided/sixth.dat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/63 install subdir/subdir/sub_elided/sixth.dat" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/63 install subdir/subdir/sub_elided/sixth.dat" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Elide test file in a subdir. diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/63 install subdir/sub_elided/dircheck/fifth.dat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/63 install subdir/sub_elided/dircheck/fifth.dat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/63 install subdir/sub_elided/dircheck/fifth.dat" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/63 install subdir/sub_elided/dircheck/fifth.dat" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Data file in a subdir of elided directory. diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/63 install subdir/sub_elided/fourth.dat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/63 install subdir/sub_elided/fourth.dat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/63 install subdir/sub_elided/fourth.dat" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/63 install subdir/sub_elided/fourth.dat" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Test that this file is installed directly into install_dir. diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/64 foreach/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/64 foreach/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/64 foreach/installed_files.txt" 2018-10-31 09:31:57.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/64 foreach/installed_files.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -usr/bin/prog1?exe -?msvc:usr/bin/prog1.pdb -usr/bin/prog2?exe -?msvc:usr/bin/prog2.pdb -usr/bin/prog3?exe -?msvc:usr/bin/prog3.pdb diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/64 foreach/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/64 foreach/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/64 foreach/meson.build" 2018-12-09 16:29:46.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/64 foreach/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -project('foreach', 'c') - -tests = [['test1', 'prog1', 'prog1.c'], - ['test2', 'prog2', 'prog2.c', 'fallback'], - ['test3', 'prog3', 'prog3.c', 'urgh']] - -assert(tests[0].get(3, 'fallbck') == 'fallbck', 'array #1 fallback did not match') -assert(tests[1].get(3, 'failbk') == 'fallback', 'array #2 value did not match') -assert(tests[2].get(3, 'urgh') == 'urgh', 'array #3 value did not match') - -foreach i : tests - test(i.get(0), executable(i.get(1), i.get(2), install : true)) - - # Ensure that changing the tests variable does not - # affect ongoing iteration in the foreach loop. - # - # Being able to do that would make Meson Turing complete and - # we definitely don't want that. - tests = ['test4', 'prog4', 'prog4.c'] -endforeach - -items = ['a', 'continue', 'b', 'break', 'c'] -result = [] -foreach i : items - if i == 'continue' - continue - elif i == 'break' - break - endif - result += i -endforeach - -assert(result == ['a', 'b'], 'Continue or break in foreach failed') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/64 foreach/prog1.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/64 foreach/prog1.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/64 foreach/prog1.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/64 foreach/prog1.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#include - -int main(int argc, char **argv) { - printf("This is test #1.\n"); - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/64 foreach/prog2.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/64 foreach/prog2.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/64 foreach/prog2.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/64 foreach/prog2.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#include - -int main(int argc, char **argv) { - printf("This is test #2.\n"); - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/64 foreach/prog3.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/64 foreach/prog3.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/64 foreach/prog3.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/64 foreach/prog3.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#include - -int main(int argc, char **argv) { - printf("This is test #3.\n"); - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/64 number arithmetic/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/64 number arithmetic/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/64 number arithmetic/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/64 number arithmetic/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,76 @@ +project('number arithmetic', 'c') + +if 6 + 4 != 10 + error('Number addition is broken') +endif +if 6 - 4 != 2 + error('Number subtraction is broken') +endif + +if 6 * 4 != 24 + error('Number multiplication is broken') +endif +if 16 / 4 != 4 + error('Number division is broken') +endif + +#if (1 / 3) * 3 != 1 +# error('Float interconversion broken') +#endif +if (5 / 3) * 3 != 3 + error('Integer division is broken') +endif + +assert((5 % 2) == 1, 'Integer modulo (odd) is broken') +assert((4 % 2) == 0, 'Integer modulo (even) is broken') + +if 2 * 1 % 2 != 0 + error('Modulo precedence with multiplication is broken') +endif +if 2 + 1 % 2 != 3 + error('Modulo precedence with addition is broken') +endif +if 9 / 9 % 2 != 1 + error('Modulo precedence with division is broken') +endif +if 9 - 9 % 2 != 8 + error('Modulo precedence with subtraction is broken') +endif + +assert(2.is_even(), 'int is_even() broken for even value') +assert(not(2.is_odd()), 'int is_odd() broken for even value') +assert(not(3.is_even()), 'int is_even() broken for odd value') +assert(3.is_odd(), 'int is_odd() broken for odd value') + +assert(3 < 4, 'Lt broken') +assert(not(4 < 3), 'Lt broken') +assert(3 <= 4, 'Lte broken') +assert(not(4 <= 3), 'Lte broken') +assert(3 <= 3, 'Lte broken') + +assert(4 > 3, 'Gt broken') +assert(not(3 > 4), 'Gt broken') +assert(4 >= 3, 'Gte broken') +assert(not(3 >= 4), 'Gte broken') +assert(3 >= 3, 'Gte broken') + +assert(true.to_int() == 1,'bool to_int() broken') +assert(false.to_int() == 0,'bool to_int() broken') + +hex_255 = 0xff +hex2_255 = 0XFF + +assert(hex_255 == 255, 'Hex parsing is broken.') +assert(hex2_255 == 255, 'Uppercase hex parsing is broken.') + +bin_123 = 0b1111011 +bin2_123 = 0B1111011 + +assert(bin_123 == 123, 'Bin number parsing is broken.') +assert(bin2_123 == 123, 'Uppercase bin number parsing is broken.') + +oct_493 = 0o755 +oct2_493 = 0O755 + +assert(oct_493 == 493, 'Oct number parsing is broken.') +assert(oct2_493 == 493, 'Uppercase oct number parsing is broken.') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/65 number arithmetic/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/65 number arithmetic/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/65 number arithmetic/meson.build" 2018-12-09 16:29:47.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/65 number arithmetic/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,76 +0,0 @@ -project('number arithmetic', 'c') - -if 6 + 4 != 10 - error('Number addition is broken') -endif -if 6 - 4 != 2 - error('Number subtraction is broken') -endif - -if 6 * 4 != 24 - error('Number multiplication is broken') -endif -if 16 / 4 != 4 - error('Number division is broken') -endif - -#if (1 / 3) * 3 != 1 -# error('Float interconversion broken') -#endif -if (5 / 3) * 3 != 3 - error('Integer division is broken') -endif - -assert((5 % 2) == 1, 'Integer modulo (odd) is broken') -assert((4 % 2) == 0, 'Integer modulo (even) is broken') - -if 2 * 1 % 2 != 0 - error('Modulo precedence with multiplication is broken') -endif -if 2 + 1 % 2 != 3 - error('Modulo precedence with addition is broken') -endif -if 9 / 9 % 2 != 1 - error('Modulo precedence with division is broken') -endif -if 9 - 9 % 2 != 8 - error('Modulo precedence with subtraction is broken') -endif - -assert(2.is_even(), 'int is_even() broken for even value') -assert(not(2.is_odd()), 'int is_odd() broken for even value') -assert(not(3.is_even()), 'int is_even() broken for odd value') -assert(3.is_odd(), 'int is_odd() broken for odd value') - -assert(3 < 4, 'Lt broken') -assert(not(4 < 3), 'Lt broken') -assert(3 <= 4, 'Lte broken') -assert(not(4 <= 3), 'Lte broken') -assert(3 <= 3, 'Lte broken') - -assert(4 > 3, 'Gt broken') -assert(not(3 > 4), 'Gt broken') -assert(4 >= 3, 'Gte broken') -assert(not(3 >= 4), 'Gte broken') -assert(3 >= 3, 'Gte broken') - -assert(true.to_int() == 1,'bool to_int() broken') -assert(false.to_int() == 0,'bool to_int() broken') - -hex_255 = 0xff -hex2_255 = 0XFF - -assert(hex_255 == 255, 'Hex parsing is broken.') -assert(hex2_255 == 255, 'Uppercase hex parsing is broken.') - -bin_123 = 0b1111011 -bin2_123 = 0B1111011 - -assert(bin_123 == 123, 'Bin number parsing is broken.') -assert(bin2_123 == 123, 'Uppercase bin number parsing is broken.') - -oct_493 = 0o755 -oct2_493 = 0O755 - -assert(oct_493 == 493, 'Oct number parsing is broken.') -assert(oct2_493 == 493, 'Uppercase oct number parsing is broken.') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/65 string arithmetic/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/65 string arithmetic/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/65 string arithmetic/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/65 string arithmetic/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,16 @@ +project('string arithmetic', 'c') + +if 'foo' + 'bar' != 'foobar' + error('String concatenation is broken') +endif + +if 'foo' + 'bar' + 'baz' != 'foobarbaz' + error('Many-string concatenation is broken') +endif + +a = 'a' +b = 'b' + +if a + b + 'c' != 'abc' + error('String concat with variables is broken.') +endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/66 array arithmetic/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/66 array arithmetic/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/66 array arithmetic/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/66 array arithmetic/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,15 @@ +project('array arithmetic', 'c') + +array1 = ['foo', 'bar'] +array2 = ['qux', 'baz'] + +if array1 + array2 != ['foo', 'bar', 'qux', 'baz'] + error('Array concatenation is broken') +endif +if array2 + array1 != ['qux', 'baz', 'foo', 'bar'] + error('Array concatenation is broken') +endif + +if array1 + array1 + array1 != ['foo', 'bar', 'foo', 'bar', 'foo', 'bar'] + error('Many-array concatenation is broken') +endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/66 string arithmetic/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/66 string arithmetic/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/66 string arithmetic/meson.build" 2018-12-09 16:29:49.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/66 string arithmetic/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -project('string arithmetic', 'c') - -if 'foo' + 'bar' != 'foobar' - error('String concatenation is broken') -endif - -if 'foo' + 'bar' + 'baz' != 'foobarbaz' - error('Many-string concatenation is broken') -endif - -a = 'a' -b = 'b' - -if a + b + 'c' != 'abc' - error('String concat with variables is broken.') -endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/67 arithmetic bidmas/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/67 arithmetic bidmas/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/67 arithmetic bidmas/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/67 arithmetic bidmas/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,15 @@ +project('arithmetic bidmas', 'c') + +if 5 * 3 - 6 / 2 + 1 != 13 + error('Arithmetic bidmas broken') +endif +if 5 * (3 - 6 / 2) + 1 != 1 + error('Arithmetic bidmas with brackets broken') +endif + +if 5 * 12 / 2 * 3 != 90 + error('Sequential multiplication and division broken') +endif +if 5 * (12 / (2 * 3)) != 10 + error('Sequential multiplication and division with brackets broken') +endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/67 array arithmetic/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/67 array arithmetic/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/67 array arithmetic/meson.build" 2018-12-09 16:29:49.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/67 array arithmetic/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -project('array arithmetic', 'c') - -array1 = ['foo', 'bar'] -array2 = ['qux', 'baz'] - -if array1 + array2 != ['foo', 'bar', 'qux', 'baz'] - error('Array concatenation is broken') -endif -if array2 + array1 != ['qux', 'baz', 'foo', 'bar'] - error('Array concatenation is broken') -endif - -if array1 + array1 + array1 != ['foo', 'bar', 'foo', 'bar', 'foo', 'bar'] - error('Many-array concatenation is broken') -endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/68 arithmetic bidmas/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/68 arithmetic bidmas/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/68 arithmetic bidmas/meson.build" 2018-12-09 16:29:49.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/68 arithmetic bidmas/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -project('arithmetic bidmas', 'c') - -if 5 * 3 - 6 / 2 + 1 != 13 - error('Arithmetic bidmas broken') -endif -if 5 * (3 - 6 / 2) + 1 != 1 - error('Arithmetic bidmas with brackets broken') -endif - -if 5 * 12 / 2 * 3 != 90 - error('Sequential multiplication and division broken') -endif -if 5 * (12 / (2 * 3)) != 10 - error('Sequential multiplication and division with brackets broken') -endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/68 build always/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/68 build always/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/68 build always/main.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/68 build always/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,7 @@ +#include +#include"version.h" + +int main(int argc, char **argv) { + printf("Version is %s.\n", version_string); + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/68 build always/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/68 build always/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/68 build always/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/68 build always/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,14 @@ +project('run always', 'c') + +version = '1.0.0' + +vgen = find_program('version_gen.py') + +version_src = custom_target('Version string', +input : 'version.c.in', +output : 'version.c', +command : [vgen, '@INPUT@', '@OUTPUT@', version], +build_always : true, +) + +executable('versionprinter', 'main.c', version_src) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/68 build always/version.c.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/68 build always/version.c.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/68 build always/version.c.in" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/68 build always/version.c.in" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +#include"version.h" + +const char *version_string = "@VERSION@"; diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/68 build always/version_gen.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/68 build always/version_gen.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/68 build always/version_gen.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/68 build always/version_gen.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,29 @@ +#!/usr/bin/env python3 + +import sys, os, subprocess + +def generate(infile, outfile, fallback): + workdir = os.path.split(infile)[0] + if workdir == '': + workdir = '.' + try: + version = subprocess.check_output(['git', 'describe'], cwd=workdir).decode().strip() + except (subprocess.CalledProcessError, OSError, UnicodeDecodeError): + version = fallback + with open(infile) as f: + newdata = f.read().replace('@VERSION@', version) + try: + with open(outfile) as f: + olddata = f.read() + if olddata == newdata: + return + except OSError: + pass + with open(outfile, 'w') as f: + f.write(newdata) + +if __name__ == '__main__': + infile = sys.argv[1] + outfile = sys.argv[2] + fallback = sys.argv[3] + generate(infile, outfile, fallback) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/68 build always/version.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/68 build always/version.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/68 build always/version.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/68 build always/version.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +#pragma once + +const char *version_string; diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/69 build always/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/69 build always/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/69 build always/main.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/69 build always/main.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -#include -#include"version.h" - -int main(int argc, char **argv) { - printf("Version is %s.\n", version_string); - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/69 build always/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/69 build always/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/69 build always/meson.build" 2018-12-09 16:29:50.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/69 build always/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -project('run always', 'c') - -version = '1.0.0' - -vgen = find_program('version_gen.py') - -version_src = custom_target('Version string', -input : 'version.c.in', -output : 'version.c', -command : [vgen, '@INPUT@', '@OUTPUT@', version], -build_always : true, -) - -executable('versionprinter', 'main.c', version_src) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/69 build always/version.c.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/69 build always/version.c.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/69 build always/version.c.in" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/69 build always/version.c.in" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -#include"version.h" - -const char *version_string = "@VERSION@"; diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/69 build always/version_gen.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/69 build always/version_gen.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/69 build always/version_gen.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/69 build always/version_gen.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -#!/usr/bin/env python3 - -import sys, os, subprocess - -def generate(infile, outfile, fallback): - workdir = os.path.split(infile)[0] - if workdir == '': - workdir = '.' - try: - version = subprocess.check_output(['git', 'describe'], cwd=workdir).decode().strip() - except (subprocess.CalledProcessError, OSError, UnicodeDecodeError): - version = fallback - with open(infile) as f: - newdata = f.read().replace('@VERSION@', version) - try: - with open(outfile) as f: - olddata = f.read() - if olddata == newdata: - return - except OSError: - pass - with open(outfile, 'w') as f: - f.write(newdata) - -if __name__ == '__main__': - infile = sys.argv[1] - outfile = sys.argv[2] - fallback = sys.argv[3] - generate(infile, outfile, fallback) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/69 build always/version.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/69 build always/version.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/69 build always/version.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/69 build always/version.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -#pragma once - -const char *version_string; diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/69 vcstag/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/69 vcstag/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/69 vcstag/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/69 vcstag/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,18 @@ +project('vcstag', 'c') + +version_src = vcs_tag(input : 'vcstag.c.in', +output : 'vcstag.c', +fallback : '1.0.0') + +version_src_custom = vcs_tag(input : 'vcstag.c.in', +output : 'vcstag-custom.c', +command : ['git', 'show-ref', '-s', 'refs/heads/master'], +fallback : '1.0.0') + +version_src_fallback = vcs_tag(input : 'vcstag.c.in', +output : 'vcstag-fallback.c') + +executable('tagprog', 'tagprog.c', version_src) +executable('tagprog-custom', 'tagprog.c', version_src_custom) +executable('tagprog-fallback', 'tagprog.c', version_src_fallback) + diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/69 vcstag/tagprog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/69 vcstag/tagprog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/69 vcstag/tagprog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/69 vcstag/tagprog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,9 @@ +#include + +const char *vcstag; + +int main(int argc, char **argv) { + printf("Version is %s\n", vcstag); + return 0; +} + diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/69 vcstag/vcstag.c.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/69 vcstag/vcstag.c.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/69 vcstag/vcstag.c.in" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/69 vcstag/vcstag.c.in" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +const char *vcstag = "@VCS_TAG@"; + diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/70 modules/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/70 modules/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/70 modules/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/70 modules/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,4 @@ +project('module test', 'c') + +modtest = import('modtest') +modtest.print_hello() diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/70 vcstag/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/70 vcstag/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/70 vcstag/meson.build" 2018-12-09 16:29:53.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/70 vcstag/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -project('vcstag', 'c') - -version_src = vcs_tag(input : 'vcstag.c.in', -output : 'vcstag.c', -fallback : '1.0.0') - -version_src_custom = vcs_tag(input : 'vcstag.c.in', -output : 'vcstag-custom.c', -command : ['git', 'show-ref', '-s', 'refs/heads/master'], -fallback : '1.0.0') - -version_src_fallback = vcs_tag(input : 'vcstag.c.in', -output : 'vcstag-fallback.c') - -executable('tagprog', 'tagprog.c', version_src) -executable('tagprog-custom', 'tagprog.c', version_src_custom) -executable('tagprog-fallback', 'tagprog.c', version_src_fallback) - diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/70 vcstag/tagprog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/70 vcstag/tagprog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/70 vcstag/tagprog.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/70 vcstag/tagprog.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -#include - -const char *vcstag; - -int main(int argc, char **argv) { - printf("Version is %s\n", vcstag); - return 0; -} - diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/70 vcstag/vcstag.c.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/70 vcstag/vcstag.c.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/70 vcstag/vcstag.c.in" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/70 vcstag/vcstag.c.in" 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -const char *vcstag = "@VCS_TAG@"; - diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/71 modules/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/71 modules/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/71 modules/meson.build" 2018-12-09 16:29:53.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/71 modules/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -project('module test', 'c') - -modtest = import('modtest') -modtest.print_hello() diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/71 should fail/failing.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/71 should fail/failing.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/71 should fail/failing.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/71 should fail/failing.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,3 @@ +int main(int argc, char **argv) { + return 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/71 should fail/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/71 should fail/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/71 should fail/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/71 should fail/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,4 @@ +project('should fail', 'c') + +exe = executable('prog', 'failing.c') +test('failing', exe, should_fail : true) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/72 configure file in custom target/inc/confdata.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/72 configure file in custom target/inc/confdata.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/72 configure file in custom target/inc/confdata.in" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/72 configure file in custom target/inc/confdata.in" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +@VALUE@ diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/72 configure file in custom target/inc/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/72 configure file in custom target/inc/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/72 configure file in custom target/inc/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/72 configure file in custom target/inc/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,6 @@ +cdata = configuration_data() +cdata.set('VALUE', '42') + +cfile = configure_file(input : 'confdata.in', +output : 'confdata', +configuration : cdata) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/72 configure file in custom target/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/72 configure file in custom target/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/72 configure file in custom target/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/72 configure file in custom target/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,4 @@ +project('conf file in custom target', 'c') + +subdir('inc') +subdir('src') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/72 configure file in custom target/src/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/72 configure file in custom target/src/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/72 configure file in custom target/src/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/72 configure file in custom target/src/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,20 @@ +custom_target('thing', +output : 'final.dat', +input : cfile, +command : [find_program('mycompiler.py'), '@INPUT@', '@OUTPUT@']) + +# Test usage of a `configure_file` as part of the command list +py3 = find_program('python3', required : false) +if not py3.found() + # Maybe 'python' is Python 3 + py3 = find_program('python') +endif + +compiler = configure_file(input : 'mycompiler.py', + output : 'mycompiler2.py', + copy: true) + +custom_target('thing2', +output : 'final2.dat', +input : cfile, +command : [py3, compiler, '@INPUT@', '@OUTPUT@']) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/72 configure file in custom target/src/mycompiler.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/72 configure file in custom target/src/mycompiler.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/72 configure file in custom target/src/mycompiler.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/72 configure file in custom target/src/mycompiler.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,9 @@ +#!/usr/bin/env python3 + +import sys + +with open(sys.argv[1]) as ifile: + if ifile.readline().strip() != '42': + print('Incorrect input') +with open(sys.argv[2], 'w') as ofile: + ofile.write('Success\n') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/72 should fail/failing.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/72 should fail/failing.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/72 should fail/failing.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/72 should fail/failing.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -int main(int argc, char **argv) { - return 1; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/72 should fail/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/72 should fail/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/72 should fail/meson.build" 2018-12-09 16:29:53.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/72 should fail/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -project('should fail', 'c') - -exe = executable('prog', 'failing.c') -test('failing', exe, should_fail : true) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/73 configure file in custom target/inc/confdata.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/73 configure file in custom target/inc/confdata.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/73 configure file in custom target/inc/confdata.in" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/73 configure file in custom target/inc/confdata.in" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -@VALUE@ diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/73 configure file in custom target/inc/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/73 configure file in custom target/inc/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/73 configure file in custom target/inc/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/73 configure file in custom target/inc/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -cdata = configuration_data() -cdata.set('VALUE', '42') - -cfile = configure_file(input : 'confdata.in', -output : 'confdata', -configuration : cdata) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/73 configure file in custom target/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/73 configure file in custom target/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/73 configure file in custom target/meson.build" 2018-12-09 16:29:53.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/73 configure file in custom target/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -project('conf file in custom target', 'c') - -subdir('inc') -subdir('src') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/73 configure file in custom target/src/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/73 configure file in custom target/src/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/73 configure file in custom target/src/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/73 configure file in custom target/src/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -custom_target('thing', -output : 'final.dat', -input : cfile, -command : [find_program('mycompiler.py'), '@INPUT@', '@OUTPUT@']) - -# Test usage of a `configure_file` as part of the command list -py3 = find_program('python3', required : false) -if not py3.found() - # Maybe 'python' is Python 3 - py3 = find_program('python') -endif - -compiler = configure_file(input : 'mycompiler.py', - output : 'mycompiler2.py', - copy: true) - -custom_target('thing2', -output : 'final2.dat', -input : cfile, -command : [py3, compiler, '@INPUT@', '@OUTPUT@']) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/73 configure file in custom target/src/mycompiler.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/73 configure file in custom target/src/mycompiler.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/73 configure file in custom target/src/mycompiler.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/73 configure file in custom target/src/mycompiler.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -#!/usr/bin/env python3 - -import sys - -with open(sys.argv[1]) as ifile: - if ifile.readline().strip() != '42': - print('Incorrect input') -with open(sys.argv[2], 'w') as ofile: - ofile.write('Success\n') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/73 external test program/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/73 external test program/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/73 external test program/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/73 external test program/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +project('test is external', 'c') + +test('external', find_program('mytest.py'), args : ['correct']) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/73 external test program/mytest.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/73 external test program/mytest.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/73 external test program/mytest.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/73 external test program/mytest.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,11 @@ +#!/usr/bin/env python3 + +from __future__ import print_function + +import sys + +if sys.argv[1] == 'correct': + print('Argument is correct.') + sys.exit(0) +print('Argument is incorrect:', sys.argv[1]) +sys.exit(1) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/74 ctarget dependency/gen1.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/74 ctarget dependency/gen1.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/74 ctarget dependency/gen1.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/74 ctarget dependency/gen1.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,12 @@ +#!/usr/bin/env python3 + +import time, sys + +# Make sure other script runs first if dependency +# is missing. +time.sleep(0.5) + +with open(sys.argv[1], 'r') as f: + contents = f.read() +with open(sys.argv[2], 'w') as f: + f.write(contents) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/74 ctarget dependency/gen2.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/74 ctarget dependency/gen2.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/74 ctarget dependency/gen2.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/74 ctarget dependency/gen2.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,10 @@ +#!/usr/bin/env python3 + +import sys, os +from glob import glob + +files = glob(os.path.join(sys.argv[1], '*.tmp')) +assert(len(files) == 1) + +with open(files[0], 'r') as ifile, open(sys.argv[2], 'w') as ofile: + ofile.write(ifile.read()) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/74 ctarget dependency/input.dat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/74 ctarget dependency/input.dat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/74 ctarget dependency/input.dat" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/74 ctarget dependency/input.dat" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +This is a piece of text. diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/74 ctarget dependency/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/74 ctarget dependency/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/74 ctarget dependency/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/74 ctarget dependency/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,20 @@ +project('custom target dependency', 'c') + +# Sometimes custom targets do not take input files +# but instead do globbing or some similar wackiness. +# In this case we need to be able to specify a +# manual dependency between two custom targets, +# if one needs to be run before the other. + +g1 = find_program('gen1.py') +g2 = find_program('gen2.py') + +c1 = custom_target('medput', +input : 'input.dat', +output : 'medput.tmp', +command : [g1, '@INPUT@', '@OUTPUT@']) + +custom_target('output', +output : 'output.dat', +command : [g2, '@OUTDIR@', '@OUTPUT@'], +depends : c1) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/74 external test program/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/74 external test program/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/74 external test program/meson.build" 2018-12-09 16:29:56.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/74 external test program/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -project('test is external', 'c') - -test('external', find_program('mytest.py'), args : ['correct']) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/74 external test program/mytest.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/74 external test program/mytest.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/74 external test program/mytest.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/74 external test program/mytest.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -#!/usr/bin/env python3 - -from __future__ import print_function - -import sys - -if sys.argv[1] == 'correct': - print('Argument is correct.') - sys.exit(0) -print('Argument is incorrect:', sys.argv[1]) -sys.exit(1) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/75 ctarget dependency/gen1.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/75 ctarget dependency/gen1.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/75 ctarget dependency/gen1.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/75 ctarget dependency/gen1.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -#!/usr/bin/env python3 - -import time, sys - -# Make sure other script runs first if dependency -# is missing. -time.sleep(0.5) - -with open(sys.argv[1], 'r') as f: - contents = f.read() -with open(sys.argv[2], 'w') as f: - f.write(contents) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/75 ctarget dependency/gen2.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/75 ctarget dependency/gen2.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/75 ctarget dependency/gen2.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/75 ctarget dependency/gen2.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -#!/usr/bin/env python3 - -import sys, os -from glob import glob - -files = glob(os.path.join(sys.argv[1], '*.tmp')) -assert(len(files) == 1) - -with open(files[0], 'r') as ifile, open(sys.argv[2], 'w') as ofile: - ofile.write(ifile.read()) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/75 ctarget dependency/input.dat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/75 ctarget dependency/input.dat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/75 ctarget dependency/input.dat" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/75 ctarget dependency/input.dat" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -This is a piece of text. diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/75 ctarget dependency/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/75 ctarget dependency/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/75 ctarget dependency/meson.build" 2018-12-09 16:29:56.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/75 ctarget dependency/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -project('custom target dependency', 'c') - -# Sometimes custom targets do not take input files -# but instead do globbing or some similar wackiness. -# In this case we need to be able to specify a -# manual dependency between two custom targets, -# if one needs to be run before the other. - -g1 = find_program('gen1.py') -g2 = find_program('gen2.py') - -c1 = custom_target('medput', -input : 'input.dat', -output : 'medput.tmp', -command : [g1, '@INPUT@', '@OUTPUT@']) - -custom_target('output', -output : 'output.dat', -command : [g2, '@OUTDIR@', '@OUTPUT@'], -depends : c1) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/75 shared subproject/a.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/75 shared subproject/a.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/75 shared subproject/a.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/75 shared subproject/a.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,13 @@ +#include +char func_b(); +char func_c(); + +int main(int argc, char **argv) { + if(func_b() != 'b') { + return 1; + } + if(func_c() != 'c') { + return 2; + } + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/75 shared subproject/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/75 shared subproject/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/75 shared subproject/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/75 shared subproject/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,10 @@ +project('A', 'c') + +B = subproject('B') +b = B.get_variable('b') + +C = subproject('C') +c = C.get_variable('c') + +a = executable('a', 'a.c', link_with : [b, c]) +test('a test', a) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/75 shared subproject/subprojects/B/b.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/75 shared subproject/subprojects/B/b.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/75 shared subproject/subprojects/B/b.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/75 shared subproject/subprojects/B/b.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,21 @@ +#include +#if defined _WIN32 || defined __CYGWIN__ +#define DLL_PUBLIC __declspec(dllexport) +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif + + +char func_c(); + +char DLL_PUBLIC func_b() { + if(func_c() != 'c') { + exit(3); + } + return 'b'; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/75 shared subproject/subprojects/B/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/75 shared subproject/subprojects/B/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/75 shared subproject/subprojects/B/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/75 shared subproject/subprojects/B/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,4 @@ +project('B', 'c') +C = subproject('C') +c = C.get_variable('c') +b = shared_library('b', 'b.c', link_with : c) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/75 shared subproject/subprojects/C/c.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/75 shared subproject/subprojects/C/c.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/75 shared subproject/subprojects/C/c.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/75 shared subproject/subprojects/C/c.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,14 @@ +#if defined _WIN32 || defined __CYGWIN__ +#define DLL_PUBLIC __declspec(dllexport) +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif + +char DLL_PUBLIC func_c() { + return 'c'; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/75 shared subproject/subprojects/C/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/75 shared subproject/subprojects/C/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/75 shared subproject/subprojects/C/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/75 shared subproject/subprojects/C/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +project('C', 'c') +c = shared_library('c', 'c.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/76 shared subproject/a.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/76 shared subproject/a.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/76 shared subproject/a.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/76 shared subproject/a.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -#include -char func_b(); -char func_c(); - -int main(int argc, char **argv) { - if(func_b() != 'b') { - return 1; - } - if(func_c() != 'c') { - return 2; - } - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/76 shared subproject/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/76 shared subproject/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/76 shared subproject/meson.build" 2018-12-09 16:29:57.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/76 shared subproject/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -project('A', 'c') - -B = subproject('B') -b = B.get_variable('b') - -C = subproject('C') -c = C.get_variable('c') - -a = executable('a', 'a.c', link_with : [b, c]) -test('a test', a) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/76 shared subproject/subprojects/B/b.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/76 shared subproject/subprojects/B/b.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/76 shared subproject/subprojects/B/b.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/76 shared subproject/subprojects/B/b.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -#include -#if defined _WIN32 || defined __CYGWIN__ -#define DLL_PUBLIC __declspec(dllexport) -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif - - -char func_c(); - -char DLL_PUBLIC func_b() { - if(func_c() != 'c') { - exit(3); - } - return 'b'; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/76 shared subproject/subprojects/B/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/76 shared subproject/subprojects/B/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/76 shared subproject/subprojects/B/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/76 shared subproject/subprojects/B/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -project('B', 'c') -C = subproject('C') -c = C.get_variable('c') -b = shared_library('b', 'b.c', link_with : c) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/76 shared subproject/subprojects/C/c.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/76 shared subproject/subprojects/C/c.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/76 shared subproject/subprojects/C/c.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/76 shared subproject/subprojects/C/c.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -#if defined _WIN32 || defined __CYGWIN__ -#define DLL_PUBLIC __declspec(dllexport) -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif - -char DLL_PUBLIC func_c() { - return 'c'; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/76 shared subproject/subprojects/C/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/76 shared subproject/subprojects/C/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/76 shared subproject/subprojects/C/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/76 shared subproject/subprojects/C/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -project('C', 'c') -c = shared_library('c', 'c.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/76 shared subproject 2/a.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/76 shared subproject 2/a.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/76 shared subproject 2/a.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/76 shared subproject 2/a.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,13 @@ +#include +char func_b(); +char func_c(); + +int main(int argc, char **argv) { + if(func_b() != 'b') { + return 1; + } + if(func_c() != 'c') { + return 2; + } + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/76 shared subproject 2/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/76 shared subproject 2/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/76 shared subproject 2/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/76 shared subproject 2/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,13 @@ +project('A', 'c') + +# Same as the previous test but use C and B in +# the opposite order. + +C = subproject('C') +c = C.get_variable('c') + +B = subproject('B') +b = B.get_variable('b') + +a = executable('a', 'a.c', link_with : [b, c]) +test('a test', a) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/76 shared subproject 2/subprojects/B/b.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/76 shared subproject 2/subprojects/B/b.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/76 shared subproject 2/subprojects/B/b.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/76 shared subproject 2/subprojects/B/b.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,20 @@ +#include +char func_c(); + +#if defined _WIN32 || defined __CYGWIN__ +#define DLL_PUBLIC __declspec(dllexport) +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif + +char DLL_PUBLIC func_b() { + if(func_c() != 'c') { + exit(3); + } + return 'b'; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/76 shared subproject 2/subprojects/B/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/76 shared subproject 2/subprojects/B/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/76 shared subproject 2/subprojects/B/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/76 shared subproject 2/subprojects/B/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,4 @@ +project('B', 'c') +C = subproject('C') +c = C.get_variable('c') +b = shared_library('b', 'b.c', link_with : c) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/76 shared subproject 2/subprojects/C/c.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/76 shared subproject 2/subprojects/C/c.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/76 shared subproject 2/subprojects/C/c.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/76 shared subproject 2/subprojects/C/c.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,14 @@ +#if defined _WIN32 || defined __CYGWIN__ +#define DLL_PUBLIC __declspec(dllexport) +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif + +char DLL_PUBLIC func_c() { + return 'c'; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/76 shared subproject 2/subprojects/C/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/76 shared subproject 2/subprojects/C/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/76 shared subproject 2/subprojects/C/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/76 shared subproject 2/subprojects/C/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +project('C', 'c') +c = shared_library('c', 'c.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/77 file object/lib.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/77 file object/lib.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/77 file object/lib.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/77 file object/lib.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,3 @@ +int func() { + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/77 file object/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/77 file object/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/77 file object/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/77 file object/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,9 @@ +project('file object', 'c') + +prog0 = files('prog.c') +lib0 = files('lib.c') +test('fobj', executable('fobj', prog0, lib0)) + +subdir('subdir1') +subdir('subdir2') + diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/77 file object/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/77 file object/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/77 file object/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/77 file object/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,13 @@ +#include + +int func(); /* Files in different subdirs return different values. */ + +int main(int argc, char **argv) { + if(func() == 0) { + printf("Iz success.\n"); + } else { + printf("Iz fail.\n"); + return 1; + } + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/77 file object/subdir1/lib.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/77 file object/subdir1/lib.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/77 file object/subdir1/lib.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/77 file object/subdir1/lib.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,3 @@ +int func() { + return 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/77 file object/subdir1/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/77 file object/subdir1/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/77 file object/subdir1/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/77 file object/subdir1/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,7 @@ +prog1 = files('prog.c') +lib1 = files('lib.c') + +test('subdir0', executable('subdir0', prog0, lib1), should_fail : true) +test('subdir1', executable('subdir1', prog1, lib0), should_fail : true) + +test('subdir2', executable('subdir2', prog1, lib1)) \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/77 file object/subdir1/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/77 file object/subdir1/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/77 file object/subdir1/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/77 file object/subdir1/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,13 @@ +#include + +int func(); + +int main(int argc, char **argv) { + if(func() == 1) { + printf("Iz success.\n"); + } else { + printf("Iz fail.\n"); + return 1; + } + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/77 file object/subdir2/lib.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/77 file object/subdir2/lib.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/77 file object/subdir2/lib.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/77 file object/subdir2/lib.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,3 @@ +int func() { + return 2; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/77 file object/subdir2/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/77 file object/subdir2/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/77 file object/subdir2/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/77 file object/subdir2/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,7 @@ +prog2 = files('prog.c') +lib2 = files('lib.c') + +test('subdir3', executable('subdir3', prog1, lib2), should_fail : true) +test('subdir4', executable('subdir4', prog2, lib1), should_fail : true) + +test('subdir4', executable('subdir5', prog2, lib2)) \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/77 file object/subdir2/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/77 file object/subdir2/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/77 file object/subdir2/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/77 file object/subdir2/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,13 @@ +#include + +int func(); + +int main(int argc, char **argv) { + if(func() == 2) { + printf("Iz success.\n"); + } else { + printf("Iz fail.\n"); + return 1; + } + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/77 shared subproject 2/a.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/77 shared subproject 2/a.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/77 shared subproject 2/a.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/77 shared subproject 2/a.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -#include -char func_b(); -char func_c(); - -int main(int argc, char **argv) { - if(func_b() != 'b') { - return 1; - } - if(func_c() != 'c') { - return 2; - } - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/77 shared subproject 2/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/77 shared subproject 2/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/77 shared subproject 2/meson.build" 2018-12-09 16:29:57.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/77 shared subproject 2/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -project('A', 'c') - -# Same as the previous test but use C and B in -# the opposite order. - -C = subproject('C') -c = C.get_variable('c') - -B = subproject('B') -b = B.get_variable('b') - -a = executable('a', 'a.c', link_with : [b, c]) -test('a test', a) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/77 shared subproject 2/subprojects/B/b.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/77 shared subproject 2/subprojects/B/b.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/77 shared subproject 2/subprojects/B/b.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/77 shared subproject 2/subprojects/B/b.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -#include -char func_c(); - -#if defined _WIN32 || defined __CYGWIN__ -#define DLL_PUBLIC __declspec(dllexport) -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif - -char DLL_PUBLIC func_b() { - if(func_c() != 'c') { - exit(3); - } - return 'b'; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/77 shared subproject 2/subprojects/B/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/77 shared subproject 2/subprojects/B/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/77 shared subproject 2/subprojects/B/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/77 shared subproject 2/subprojects/B/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -project('B', 'c') -C = subproject('C') -c = C.get_variable('c') -b = shared_library('b', 'b.c', link_with : c) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/77 shared subproject 2/subprojects/C/c.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/77 shared subproject 2/subprojects/C/c.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/77 shared subproject 2/subprojects/C/c.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/77 shared subproject 2/subprojects/C/c.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -#if defined _WIN32 || defined __CYGWIN__ -#define DLL_PUBLIC __declspec(dllexport) -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif - -char DLL_PUBLIC func_c() { - return 'c'; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/77 shared subproject 2/subprojects/C/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/77 shared subproject 2/subprojects/C/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/77 shared subproject 2/subprojects/C/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/77 shared subproject 2/subprojects/C/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -project('C', 'c') -c = shared_library('c', 'c.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/78 custom subproject dir/a.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/78 custom subproject dir/a.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/78 custom subproject dir/a.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/78 custom subproject dir/a.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,13 @@ +#include +char func_b(); +char func_c(); + +int main(int argc, char **argv) { + if(func_b() != 'b') { + return 1; + } + if(func_c() != 'c') { + return 2; + } + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/78 custom subproject dir/custom_subproject_dir/B/b.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/78 custom subproject dir/custom_subproject_dir/B/b.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/78 custom subproject dir/custom_subproject_dir/B/b.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/78 custom subproject dir/custom_subproject_dir/B/b.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,20 @@ +#include +char func_c(); + +#if defined _WIN32 || defined __CYGWIN__ +#define DLL_PUBLIC __declspec(dllexport) +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif + +char DLL_PUBLIC func_b() { + if(func_c() != 'c') { + exit(3); + } + return 'b'; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/78 custom subproject dir/custom_subproject_dir/B/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/78 custom subproject dir/custom_subproject_dir/B/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/78 custom subproject dir/custom_subproject_dir/B/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/78 custom subproject dir/custom_subproject_dir/B/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,4 @@ +project('B', 'c') +C = subproject('C') +c = C.get_variable('c') +b = shared_library('b', 'b.c', link_with : c) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/78 custom subproject dir/custom_subproject_dir/C/c.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/78 custom subproject dir/custom_subproject_dir/C/c.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/78 custom subproject dir/custom_subproject_dir/C/c.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/78 custom subproject dir/custom_subproject_dir/C/c.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,14 @@ +#if defined _WIN32 || defined __CYGWIN__ +#define DLL_PUBLIC __declspec(dllexport) +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif + +char DLL_PUBLIC func_c() { + return 'c'; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/78 custom subproject dir/custom_subproject_dir/C/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/78 custom subproject dir/custom_subproject_dir/C/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/78 custom subproject dir/custom_subproject_dir/C/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/78 custom subproject dir/custom_subproject_dir/C/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +project('C', 'c') +c = shared_library('c', 'c.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/78 custom subproject dir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/78 custom subproject dir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/78 custom subproject dir/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/78 custom subproject dir/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,10 @@ +project('A', 'c', subproject_dir:'custom_subproject_dir') + +B = subproject('B') +b = B.get_variable('b') + +C = subproject('C') +c = C.get_variable('c') + +a = executable('a', 'a.c', link_with : [b, c]) +test('a test', a) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/78 file object/lib.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/78 file object/lib.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/78 file object/lib.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/78 file object/lib.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -int func() { - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/78 file object/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/78 file object/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/78 file object/meson.build" 2018-12-09 16:29:59.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/78 file object/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -project('file object', 'c') - -prog0 = files('prog.c') -lib0 = files('lib.c') -test('fobj', executable('fobj', prog0, lib0)) - -subdir('subdir1') -subdir('subdir2') - diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/78 file object/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/78 file object/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/78 file object/prog.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/78 file object/prog.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -#include - -int func(); /* Files in different subdirs return different values. */ - -int main(int argc, char **argv) { - if(func() == 0) { - printf("Iz success.\n"); - } else { - printf("Iz fail.\n"); - return 1; - } - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/78 file object/subdir1/lib.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/78 file object/subdir1/lib.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/78 file object/subdir1/lib.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/78 file object/subdir1/lib.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -int func() { - return 1; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/78 file object/subdir1/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/78 file object/subdir1/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/78 file object/subdir1/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/78 file object/subdir1/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -prog1 = files('prog.c') -lib1 = files('lib.c') - -test('subdir0', executable('subdir0', prog0, lib1), should_fail : true) -test('subdir1', executable('subdir1', prog1, lib0), should_fail : true) - -test('subdir2', executable('subdir2', prog1, lib1)) \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/78 file object/subdir1/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/78 file object/subdir1/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/78 file object/subdir1/prog.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/78 file object/subdir1/prog.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -#include - -int func(); - -int main(int argc, char **argv) { - if(func() == 1) { - printf("Iz success.\n"); - } else { - printf("Iz fail.\n"); - return 1; - } - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/78 file object/subdir2/lib.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/78 file object/subdir2/lib.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/78 file object/subdir2/lib.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/78 file object/subdir2/lib.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -int func() { - return 2; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/78 file object/subdir2/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/78 file object/subdir2/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/78 file object/subdir2/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/78 file object/subdir2/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -prog2 = files('prog.c') -lib2 = files('lib.c') - -test('subdir3', executable('subdir3', prog1, lib2), should_fail : true) -test('subdir4', executable('subdir4', prog2, lib1), should_fail : true) - -test('subdir4', executable('subdir5', prog2, lib2)) \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/78 file object/subdir2/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/78 file object/subdir2/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/78 file object/subdir2/prog.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/78 file object/subdir2/prog.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -#include - -int func(); - -int main(int argc, char **argv) { - if(func() == 2) { - printf("Iz success.\n"); - } else { - printf("Iz fail.\n"); - return 1; - } - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/79 custom subproject dir/a.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/79 custom subproject dir/a.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/79 custom subproject dir/a.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/79 custom subproject dir/a.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -#include -char func_b(); -char func_c(); - -int main(int argc, char **argv) { - if(func_b() != 'b') { - return 1; - } - if(func_c() != 'c') { - return 2; - } - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/79 custom subproject dir/custom_subproject_dir/B/b.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/79 custom subproject dir/custom_subproject_dir/B/b.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/79 custom subproject dir/custom_subproject_dir/B/b.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/79 custom subproject dir/custom_subproject_dir/B/b.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -#include -char func_c(); - -#if defined _WIN32 || defined __CYGWIN__ -#define DLL_PUBLIC __declspec(dllexport) -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif - -char DLL_PUBLIC func_b() { - if(func_c() != 'c') { - exit(3); - } - return 'b'; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/79 custom subproject dir/custom_subproject_dir/B/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/79 custom subproject dir/custom_subproject_dir/B/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/79 custom subproject dir/custom_subproject_dir/B/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/79 custom subproject dir/custom_subproject_dir/B/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -project('B', 'c') -C = subproject('C') -c = C.get_variable('c') -b = shared_library('b', 'b.c', link_with : c) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/79 custom subproject dir/custom_subproject_dir/C/c.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/79 custom subproject dir/custom_subproject_dir/C/c.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/79 custom subproject dir/custom_subproject_dir/C/c.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/79 custom subproject dir/custom_subproject_dir/C/c.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -#if defined _WIN32 || defined __CYGWIN__ -#define DLL_PUBLIC __declspec(dllexport) -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif - -char DLL_PUBLIC func_c() { - return 'c'; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/79 custom subproject dir/custom_subproject_dir/C/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/79 custom subproject dir/custom_subproject_dir/C/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/79 custom subproject dir/custom_subproject_dir/C/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/79 custom subproject dir/custom_subproject_dir/C/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -project('C', 'c') -c = shared_library('c', 'c.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/79 custom subproject dir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/79 custom subproject dir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/79 custom subproject dir/meson.build" 2018-12-09 16:30:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/79 custom subproject dir/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -project('A', 'c', subproject_dir:'custom_subproject_dir') - -B = subproject('B') -b = B.get_variable('b') - -C = subproject('C') -c = C.get_variable('c') - -a = executable('a', 'a.c', link_with : [b, c]) -test('a test', a) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/79 has type/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/79 has type/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/79 has type/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/79 has type/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,13 @@ +project('has type', 'c', 'cpp') + +compilers = [meson.get_compiler('c'), meson.get_compiler('cpp')] + +foreach cc : compilers + if not cc.has_type('time_t', prefix : '#include') + error('Did not detect type that exists.') + endif + + if cc.has_type('no_time_t', prefix : '#include') + error('Not existing type found.') + endif +endforeach diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/80 extract from nested subdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/80 extract from nested subdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/80 extract from nested subdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/80 extract from nested subdir/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,8 @@ +project('Extract objects from subdirs.', 'c') + +if meson.is_unity() + message('Unity build: skipping incompatible test') +else + subdir('src') + subdir('tst') +endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/80 extract from nested subdir/src/first/lib_first.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/80 extract from nested subdir/src/first/lib_first.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/80 extract from nested subdir/src/first/lib_first.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/80 extract from nested subdir/src/first/lib_first.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,3 @@ +int first() { + return 1001; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/80 extract from nested subdir/src/first/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/80 extract from nested subdir/src/first/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/80 extract from nested subdir/src/first/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/80 extract from nested subdir/src/first/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +first_lib = shared_library('first_lib', 'lib_first.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/80 extract from nested subdir/src/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/80 extract from nested subdir/src/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/80 extract from nested subdir/src/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/80 extract from nested subdir/src/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +subdir('first') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/80 extract from nested subdir/tst/first/exe_first.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/80 extract from nested subdir/tst/first/exe_first.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/80 extract from nested subdir/tst/first/exe_first.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/80 extract from nested subdir/tst/first/exe_first.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +int first(void); + +int main() { + return first() - 1001; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/80 extract from nested subdir/tst/first/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/80 extract from nested subdir/tst/first/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/80 extract from nested subdir/tst/first/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/80 extract from nested subdir/tst/first/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,4 @@ +first_exe = executable('first_exe', 'exe_first.c', + objects : first_lib.extract_objects('lib_first.c')) + +test('first_test', first_exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/80 extract from nested subdir/tst/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/80 extract from nested subdir/tst/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/80 extract from nested subdir/tst/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/80 extract from nested subdir/tst/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +subdir('first') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/80 has type/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/80 has type/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/80 has type/meson.build" 2018-12-09 16:30:01.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/80 has type/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -project('has type', 'c', 'cpp') - -compilers = [meson.get_compiler('c'), meson.get_compiler('cpp')] - -foreach cc : compilers - if not cc.has_type('time_t', prefix : '#include') - error('Did not detect type that exists.') - endif - - if cc.has_type('no_time_t', prefix : '#include') - error('Not existing type found.') - endif -endforeach diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/81 extract from nested subdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/81 extract from nested subdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/81 extract from nested subdir/meson.build" 2018-12-09 16:30:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/81 extract from nested subdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -project('Extract objects from subdirs.', 'c') - -if meson.is_unity() - message('Unity build: skipping incompatible test') -else - subdir('src') - subdir('tst') -endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/81 extract from nested subdir/src/first/lib_first.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/81 extract from nested subdir/src/first/lib_first.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/81 extract from nested subdir/src/first/lib_first.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/81 extract from nested subdir/src/first/lib_first.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -int first() { - return 1001; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/81 extract from nested subdir/src/first/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/81 extract from nested subdir/src/first/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/81 extract from nested subdir/src/first/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/81 extract from nested subdir/src/first/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -first_lib = shared_library('first_lib', 'lib_first.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/81 extract from nested subdir/src/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/81 extract from nested subdir/src/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/81 extract from nested subdir/src/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/81 extract from nested subdir/src/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -subdir('first') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/81 extract from nested subdir/tst/first/exe_first.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/81 extract from nested subdir/tst/first/exe_first.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/81 extract from nested subdir/tst/first/exe_first.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/81 extract from nested subdir/tst/first/exe_first.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -int first(void); - -int main() { - return first() - 1001; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/81 extract from nested subdir/tst/first/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/81 extract from nested subdir/tst/first/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/81 extract from nested subdir/tst/first/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/81 extract from nested subdir/tst/first/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -first_exe = executable('first_exe', 'exe_first.c', - objects : first_lib.extract_objects('lib_first.c')) - -test('first_test', first_exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/81 extract from nested subdir/tst/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/81 extract from nested subdir/tst/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/81 extract from nested subdir/tst/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/81 extract from nested subdir/tst/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -subdir('first') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/81 internal dependency/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/81 internal dependency/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/81 internal dependency/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/81 internal dependency/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,4 @@ +project('internal dependency', 'c') + +subdir('proj1') +subdir('src') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/81 internal dependency/proj1/include/proj1.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/81 internal dependency/proj1/include/proj1.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/81 internal dependency/proj1/include/proj1.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/81 internal dependency/proj1/include/proj1.h" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +#pragma once + +void proj1_func1(); +void proj1_func2(); +void proj1_func3(); diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/81 internal dependency/proj1/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/81 internal dependency/proj1/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/81 internal dependency/proj1/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/81 internal dependency/proj1/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,11 @@ +incdirs = include_directories('include') + +p1lib = static_library('proj1', 'proj1f1.c', + include_directories : incdirs +) + +indirect_source = files('proj1f2.c') + +proj1_dep = declare_dependency(include_directories : incdirs, + link_with : p1lib, + sources : ['proj1f3.c', indirect_source]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/81 internal dependency/proj1/proj1f1.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/81 internal dependency/proj1/proj1f1.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/81 internal dependency/proj1/proj1f1.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/81 internal dependency/proj1/proj1f1.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,6 @@ +#include +#include + +void proj1_func1() { + printf("In proj1_func1.\n"); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/81 internal dependency/proj1/proj1f2.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/81 internal dependency/proj1/proj1f2.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/81 internal dependency/proj1/proj1f2.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/81 internal dependency/proj1/proj1f2.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,6 @@ +#include +#include + +void proj1_func2() { + printf("In proj1_func2.\n"); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/81 internal dependency/proj1/proj1f3.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/81 internal dependency/proj1/proj1f3.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/81 internal dependency/proj1/proj1f3.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/81 internal dependency/proj1/proj1f3.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,6 @@ +#include +#include + +void proj1_func3() { + printf("In proj1_func3.\n"); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/81 internal dependency/src/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/81 internal dependency/src/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/81 internal dependency/src/main.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/81 internal dependency/src/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,10 @@ +#include +#include + +int main(int argc, char **argv) { + printf("Now calling into library.\n"); + proj1_func1(); + proj1_func2(); + proj1_func3(); + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/81 internal dependency/src/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/81 internal dependency/src/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/81 internal dependency/src/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/81 internal dependency/src/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +exe = executable('projtest', 'main.c', dependencies : proj1_dep) +test('projtest', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/82 internal dependency/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/82 internal dependency/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/82 internal dependency/meson.build" 2018-12-09 16:30:02.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/82 internal dependency/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -project('internal dependency', 'c') - -subdir('proj1') -subdir('src') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/82 internal dependency/proj1/include/proj1.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/82 internal dependency/proj1/include/proj1.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/82 internal dependency/proj1/include/proj1.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/82 internal dependency/proj1/include/proj1.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#pragma once - -void proj1_func1(); -void proj1_func2(); -void proj1_func3(); diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/82 internal dependency/proj1/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/82 internal dependency/proj1/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/82 internal dependency/proj1/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/82 internal dependency/proj1/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -incdirs = include_directories('include') - -p1lib = static_library('proj1', 'proj1f1.c', - include_directories : incdirs -) - -indirect_source = files('proj1f2.c') - -proj1_dep = declare_dependency(include_directories : incdirs, - link_with : p1lib, - sources : ['proj1f3.c', indirect_source]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/82 internal dependency/proj1/proj1f1.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/82 internal dependency/proj1/proj1f1.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/82 internal dependency/proj1/proj1f1.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/82 internal dependency/proj1/proj1f1.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#include -#include - -void proj1_func1() { - printf("In proj1_func1.\n"); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/82 internal dependency/proj1/proj1f2.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/82 internal dependency/proj1/proj1f2.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/82 internal dependency/proj1/proj1f2.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/82 internal dependency/proj1/proj1f2.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#include -#include - -void proj1_func2() { - printf("In proj1_func2.\n"); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/82 internal dependency/proj1/proj1f3.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/82 internal dependency/proj1/proj1f3.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/82 internal dependency/proj1/proj1f3.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/82 internal dependency/proj1/proj1f3.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#include -#include - -void proj1_func3() { - printf("In proj1_func3.\n"); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/82 internal dependency/src/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/82 internal dependency/src/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/82 internal dependency/src/main.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/82 internal dependency/src/main.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -#include -#include - -int main(int argc, char **argv) { - printf("Now calling into library.\n"); - proj1_func1(); - proj1_func2(); - proj1_func3(); - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/82 internal dependency/src/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/82 internal dependency/src/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/82 internal dependency/src/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/82 internal dependency/src/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -exe = executable('projtest', 'main.c', dependencies : proj1_dep) -test('projtest', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/82 same basename/exe1.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/82 same basename/exe1.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/82 same basename/exe1.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/82 same basename/exe1.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +int func(); + +int main(int argc, char **argv) { + return func(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/82 same basename/exe2.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/82 same basename/exe2.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/82 same basename/exe2.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/82 same basename/exe2.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +int func(); + +int main(int argc, char **argv) { + return func() == 1 ? 0 : 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/82 same basename/lib.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/82 same basename/lib.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/82 same basename/lib.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/82 same basename/lib.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,23 @@ +#if defined _WIN32 || defined __CYGWIN__ +#define DLL_PUBLIC __declspec(dllexport) +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif + +#if defined SHAR +int DLL_PUBLIC func() { + return 1; +} +#elif defined STAT +int func() { + return 0; +} +#else +#error "Missing type definition." +#endif + diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/82 same basename/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/82 same basename/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/82 same basename/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/82 same basename/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,14 @@ +project('same basename', 'c') + +subdir('sharedsub') +subdir('staticsub') + +# Use the same source file to check that each top level target +# has its own unique working directory. If they don't +# then the .o files will clobber each other. + +exe1 = executable('name', 'exe1.c', link_with : stlib) +exe2 = executable('name2', 'exe2.c', link_with : shlib) + +test('static', exe1) +test('shared', exe2) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/82 same basename/sharedsub/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/82 same basename/sharedsub/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/82 same basename/sharedsub/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/82 same basename/sharedsub/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +shlib = shared_library('name', '../lib.c', c_args : '-DSHAR') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/82 same basename/staticsub/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/82 same basename/staticsub/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/82 same basename/staticsub/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/82 same basename/staticsub/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +# On Windows a static lib is now libfoo.a, so it does not conflict with foo.lib +# from the shared library above +stlib = static_library('name', '../lib.c', c_args : '-DSTAT') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/83 declare dep/entity/entity1.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/83 declare dep/entity/entity1.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/83 declare dep/entity/entity1.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/83 declare dep/entity/entity1.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,9 @@ +#include"entity.h" + +#ifdef USING_ENT +#error "Entity use flag leaked into entity compilation." +#endif + +int entity_func1() { + return 5; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/83 declare dep/entity/entity2.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/83 declare dep/entity/entity2.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/83 declare dep/entity/entity2.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/83 declare dep/entity/entity2.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +#include + +int entity_func2() { + return 9; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/83 declare dep/entity/entity.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/83 declare dep/entity/entity.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/83 declare dep/entity/entity.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/83 declare dep/entity/entity.h" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,4 @@ +#pragma once + +int entity_func1(); +int entity_func2(); diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/83 declare dep/entity/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/83 declare dep/entity/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/83 declare dep/entity/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/83 declare dep/entity/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,10 @@ +entity_lib = static_library('entity', 'entity1.c') + +entity_dep = declare_dependency(link_with : [[entity_lib]], + include_directories : [['.']], + sources : 'entity2.c', + compile_args : ['-DUSING_ENT=1'], + version : '1.2.3', + link_args : []) # No simple way of testing linker flags :(. + +assert(entity_dep.version().version_compare('==1.2.3'), 'Declare_dep has incorrect version string.') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/83 declare dep/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/83 declare dep/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/83 declare dep/main.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/83 declare dep/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,18 @@ +#include +#include + +#ifndef USING_ENT +#error "Entity use flag not used for compilation." +#endif + +int main(int argc, char **argv) { + if(entity_func1() != 5) { + printf("Error in func1.\n"); + return 1; + } + if(entity_func2() != 9) { + printf("Error in func2.\n"); + return 2; + } + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/83 declare dep/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/83 declare dep/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/83 declare dep/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/83 declare dep/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,24 @@ +project('declare dependency', 'c') + +subdir('entity') + +exe = executable('dep_user', 'main.c', + dependencies : entity_dep) +test('dep', exe) + +# just to make sure [] works as a no-op dep here +executable('dummy', 'main.c', + dependencies : [entity_dep, []]) + +# simple case +declare_dependency(dependencies : entity_dep) + +# nested deps should be flattened +declare_dependency(dependencies : [entity_dep]) +declare_dependency(dependencies : [[entity_dep]]) + +# check that [] properly works as a no-op dep in declare_dependency() too +declare_dependency(dependencies : []) +declare_dependency(dependencies : [[]]) +declare_dependency(dependencies : [entity_dep, []]) +declare_dependency(dependencies : [[], entity_dep]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/83 same basename/exe1.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/83 same basename/exe1.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/83 same basename/exe1.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/83 same basename/exe1.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -int func(); - -int main(int argc, char **argv) { - return func(); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/83 same basename/exe2.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/83 same basename/exe2.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/83 same basename/exe2.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/83 same basename/exe2.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -int func(); - -int main(int argc, char **argv) { - return func() == 1 ? 0 : 1; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/83 same basename/lib.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/83 same basename/lib.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/83 same basename/lib.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/83 same basename/lib.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -#if defined _WIN32 || defined __CYGWIN__ -#define DLL_PUBLIC __declspec(dllexport) -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif - -#if defined SHAR -int DLL_PUBLIC func() { - return 1; -} -#elif defined STAT -int func() { - return 0; -} -#else -#error "Missing type definition." -#endif - diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/83 same basename/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/83 same basename/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/83 same basename/meson.build" 2018-12-09 16:30:03.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/83 same basename/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -project('same basename', 'c') - -subdir('sharedsub') -subdir('staticsub') - -# Use the same source file to check that each top level target -# has its own unique working directory. If they don't -# then the .o files will clobber each other. - -exe1 = executable('name', 'exe1.c', link_with : stlib) -exe2 = executable('name2', 'exe2.c', link_with : shlib) - -test('static', exe1) -test('shared', exe2) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/83 same basename/sharedsub/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/83 same basename/sharedsub/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/83 same basename/sharedsub/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/83 same basename/sharedsub/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -shlib = shared_library('name', '../lib.c', c_args : '-DSHAR') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/83 same basename/staticsub/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/83 same basename/staticsub/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/83 same basename/staticsub/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/83 same basename/staticsub/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -# On Windows a static lib is now libfoo.a, so it does not conflict with foo.lib -# from the shared library above -stlib = static_library('name', '../lib.c', c_args : '-DSTAT') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/84 declare dep/entity/entity1.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/84 declare dep/entity/entity1.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/84 declare dep/entity/entity1.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/84 declare dep/entity/entity1.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -#include"entity.h" - -#ifdef USING_ENT -#error "Entity use flag leaked into entity compilation." -#endif - -int entity_func1() { - return 5; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/84 declare dep/entity/entity2.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/84 declare dep/entity/entity2.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/84 declare dep/entity/entity2.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/84 declare dep/entity/entity2.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#include - -int entity_func2() { - return 9; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/84 declare dep/entity/entity.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/84 declare dep/entity/entity.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/84 declare dep/entity/entity.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/84 declare dep/entity/entity.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -#pragma once - -int entity_func1(); -int entity_func2(); diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/84 declare dep/entity/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/84 declare dep/entity/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/84 declare dep/entity/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/84 declare dep/entity/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -entity_lib = static_library('entity', 'entity1.c') - -entity_dep = declare_dependency(link_with : [[entity_lib]], - include_directories : include_directories('.'), - sources : 'entity2.c', - compile_args : ['-DUSING_ENT=1'], - version : '1.2.3', - link_args : []) # No simple way of testing linker flags :(. - -assert(entity_dep.version().version_compare('==1.2.3'), 'Declare_dep has incorrect version string.') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/84 declare dep/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/84 declare dep/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/84 declare dep/main.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/84 declare dep/main.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -#include -#include - -#ifndef USING_ENT -#error "Entity use flag not used for compilation." -#endif - -int main(int argc, char **argv) { - if(entity_func1() != 5) { - printf("Error in func1.\n"); - return 1; - } - if(entity_func2() != 9) { - printf("Error in func2.\n"); - return 2; - } - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/84 declare dep/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/84 declare dep/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/84 declare dep/meson.build" 2018-12-09 16:30:03.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/84 declare dep/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -project('declare dependency', 'c') - -subdir('entity') - -exe = executable('dep_user', 'main.c', - dependencies : entity_dep) -test('dep', exe) - -# just to make sure [] works as a no-op dep here -executable('dummy', 'main.c', - dependencies : [entity_dep, []]) - -# simple case -declare_dependency(dependencies : entity_dep) - -# nested deps should be flattened -declare_dependency(dependencies : [entity_dep]) -declare_dependency(dependencies : [[entity_dep]]) - -# check that [] properly works as a no-op dep in declare_dependency() too -declare_dependency(dependencies : []) -declare_dependency(dependencies : [[]]) -declare_dependency(dependencies : [entity_dep, []]) -declare_dependency(dependencies : [[], entity_dep]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/84 extract all/extractor.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/84 extract all/extractor.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/84 extract all/extractor.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/84 extract all/extractor.h" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,6 @@ +#pragma once + +int func1(); +int func2(); +int func3(); +int func4(); diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/84 extract all/four.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/84 extract all/four.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/84 extract all/four.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/84 extract all/four.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +#include"extractor.h" + +int func4() { + return 4; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/84 extract all/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/84 extract all/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/84 extract all/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/84 extract all/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,13 @@ +project('extract all', 'c') + +a = static_library('a', 'one.c', 'two.c') +b = static_library('b', 'three.c', 'four.c') +c = static_library('c', objects : [a.extract_all_objects(), b.extract_all_objects()]) +d = static_library('d', objects : [a.extract_all_objects(), b.extract_all_objects(), c.extract_all_objects()]) +d_recursive = static_library('d_recursive', objects : [c.extract_all_objects(recursive : true)]) + +e = executable('proggie', 'prog.c', link_with : d) +test('extall', e) + +e = executable('proggie_recursive', 'prog.c', link_with : d_recursive) +test('extall_recursive', e) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/84 extract all/one.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/84 extract all/one.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/84 extract all/one.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/84 extract all/one.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +#include"extractor.h" + +int func1() { + return 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/84 extract all/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/84 extract all/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/84 extract all/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/84 extract all/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,10 @@ +#include"extractor.h" +#include + +int main(int argc, char **argv) { + if((1+2+3+4) != (func1() + func2() + func3() + func4())) { + printf("Arithmetic is fail.\n"); + return 1; + } + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/84 extract all/three.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/84 extract all/three.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/84 extract all/three.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/84 extract all/three.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +#include"extractor.h" + +int func3() { + return 3; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/84 extract all/two.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/84 extract all/two.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/84 extract all/two.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/84 extract all/two.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +#include"extractor.h" + +int func2() { + return 2; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/85 add language/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/85 add language/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/85 add language/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/85 add language/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,8 @@ +project('add language', 'c') + +test('C', executable('cprog', 'prog.c')) + +assert(add_languages('cpp'), 'Add_languages returned false on success') +assert(not add_languages('klingon', required : false), 'Add_languages returned true on failure.') + +test('C++', executable('cppprog', 'prog.cc')) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/85 add language/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/85 add language/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/85 add language/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/85 add language/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,6 @@ +#include + +int main(int argc, char **argv) { + printf("I am plain C.\n"); + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/85 add language/prog.cc" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/85 add language/prog.cc" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/85 add language/prog.cc" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/85 add language/prog.cc" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,6 @@ +#include + +int main(int, char**) { + std::cout << "I am C++.\n"; + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/85 extract all/extractor.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/85 extract all/extractor.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/85 extract all/extractor.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/85 extract all/extractor.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#pragma once - -int func1(); -int func2(); -int func3(); -int func4(); diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/85 extract all/four.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/85 extract all/four.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/85 extract all/four.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/85 extract all/four.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#include"extractor.h" - -int func4() { - return 4; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/85 extract all/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/85 extract all/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/85 extract all/meson.build" 2018-12-09 16:30:04.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/85 extract all/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -project('extract all', 'c') - -a = static_library('a', 'one.c', 'two.c') -b = static_library('b', 'three.c', 'four.c') -c = static_library('c', objects : [a.extract_all_objects(), b.extract_all_objects()]) -d = static_library('d', objects : [a.extract_all_objects(), b.extract_all_objects(), c.extract_all_objects()]) -d_recursive = static_library('d_recursive', objects : [c.extract_all_objects(recursive : true)]) - -e = executable('proggie', 'prog.c', link_with : d) -test('extall', e) - -e = executable('proggie_recursive', 'prog.c', link_with : d_recursive) -test('extall_recursive', e) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/85 extract all/one.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/85 extract all/one.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/85 extract all/one.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/85 extract all/one.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#include"extractor.h" - -int func1() { - return 1; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/85 extract all/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/85 extract all/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/85 extract all/prog.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/85 extract all/prog.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -#include"extractor.h" -#include - -int main(int argc, char **argv) { - if((1+2+3+4) != (func1() + func2() + func3() + func4())) { - printf("Arithmetic is fail.\n"); - return 1; - } - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/85 extract all/three.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/85 extract all/three.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/85 extract all/three.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/85 extract all/three.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#include"extractor.h" - -int func3() { - return 3; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/85 extract all/two.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/85 extract all/two.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/85 extract all/two.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/85 extract all/two.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#include"extractor.h" - -int func2() { - return 2; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/86 add language/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/86 add language/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/86 add language/meson.build" 2018-12-09 16:30:06.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/86 add language/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -project('add language', 'c') - -test('C', executable('cprog', 'prog.c')) - -assert(add_languages('cpp'), 'Add_languages returned false on success') -assert(not add_languages('klingon', required : false), 'Add_languages returned true on failure.') - -test('C++', executable('cppprog', 'prog.cc')) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/86 add language/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/86 add language/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/86 add language/prog.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/86 add language/prog.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#include - -int main(int argc, char **argv) { - printf("I am plain C.\n"); - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/86 add language/prog.cc" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/86 add language/prog.cc" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/86 add language/prog.cc" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/86 add language/prog.cc" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#include - -int main(int, char**) { - std::cout << "I am C++.\n"; - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/86 identical target name in subproject/bar.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/86 identical target name in subproject/bar.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/86 identical target name in subproject/bar.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/86 identical target name in subproject/bar.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,6 @@ +#include + +int main(int argc, char **argv) { + printf("I'm a main project bar.\n"); + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/86 identical target name in subproject/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/86 identical target name in subproject/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/86 identical target name in subproject/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/86 identical target name in subproject/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,7 @@ +project('toplevel bar', 'c') + +subproject('foo') + +executable('bar', 'bar.c') +run_target('nop', command : ['true']) +custom_target('cus', output: ['cus.c'], command : ['true']) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/86 identical target name in subproject/subprojects/foo/bar.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/86 identical target name in subproject/subprojects/foo/bar.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/86 identical target name in subproject/subprojects/foo/bar.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/86 identical target name in subproject/subprojects/foo/bar.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,6 @@ +#include + +int main(int argc, char **argv) { + printf("I'm a subproject bar.\n"); + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/86 identical target name in subproject/subprojects/foo/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/86 identical target name in subproject/subprojects/foo/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/86 identical target name in subproject/subprojects/foo/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/86 identical target name in subproject/subprojects/foo/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +project('subfoo', 'c') + +executable('bar', 'bar.c') +run_target('nop', command : ['true']) +custom_target('cus', output: ['cus.c'], command : ['true']) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/87 identical target name in subproject/bar.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/87 identical target name in subproject/bar.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/87 identical target name in subproject/bar.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/87 identical target name in subproject/bar.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#include - -int main(int argc, char **argv) { - printf("I'm a main project bar.\n"); - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/87 identical target name in subproject/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/87 identical target name in subproject/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/87 identical target name in subproject/meson.build" 2018-12-09 16:30:06.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/87 identical target name in subproject/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -project('toplevel bar', 'c') - -subproject('foo') - -executable('bar', 'bar.c') -run_target('nop', command : ['true']) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/87 identical target name in subproject/subprojects/foo/bar.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/87 identical target name in subproject/subprojects/foo/bar.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/87 identical target name in subproject/subprojects/foo/bar.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/87 identical target name in subproject/subprojects/foo/bar.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#include - -int main(int argc, char **argv) { - printf("I'm a subproject bar.\n"); - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/87 identical target name in subproject/subprojects/foo/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/87 identical target name in subproject/subprojects/foo/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/87 identical target name in subproject/subprojects/foo/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/87 identical target name in subproject/subprojects/foo/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -project('subfoo', 'c') - -executable('bar', 'bar.c') -run_target('nop', command : ['true']) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/87 plusassign/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/87 plusassign/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/87 plusassign/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/87 plusassign/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,70 @@ +project('plusassign', 'c') + +x = [] + +x += 'a' + +if x.length() != 1 + error('Incorrect append') +endif + +if x[0] != 'a' + error('Incorrect append 2.') +endif + +y = x + +x += 'b' + +if y.length() != 1 + error('Immutability broken.') +endif + +if y[0] != 'a' + error('Immutability broken 2.') +endif + +if x.length() != 2 + error('Incorrect append 3') +endif + +if x[0] != 'a' + error('Incorrect append 4.') +endif + +if x[1] != 'b' + error('Incorrect append 5.') +endif + +# Now with evil added: append yourself. + +x += x + +if x.length() != 4 + error('Incorrect selfappend.') +endif + +# += on strings + +bra = 'bra' +foo = 'A' +foo += bra +foo += 'cada' +foo += bra +assert (foo == 'Abracadabra', 'string += failure [@0@]'.format(foo)) +assert (bra == 'bra', 'string += modified right argument!') +foo += ' ' + foo +assert (foo == 'Abracadabra Abracadabra', 'string += failure [@0@]'.format(foo)) + +# += on ints + +foo = 5 +foo += 6 +assert (foo == 11, 'int += failure [@0@]'.format(foo)) +bar = 99 +foo += bar +assert (foo == 110, 'int += failure [@0@]'.format(foo)) +assert (bar == 99, 'int += modified right argument"') +bar += foo + 1 +assert (bar == 210, 'int += failure [@0@]'.format(bar)) +assert (foo == 110, 'int += modified right argument"') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/88 plusassign/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/88 plusassign/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/88 plusassign/meson.build" 2018-12-09 16:30:06.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/88 plusassign/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ -project('plusassign', 'c') - -x = [] - -x += 'a' - -if x.length() != 1 - error('Incorrect append') -endif - -if x[0] != 'a' - error('Incorrect append 2.') -endif - -y = x - -x += 'b' - -if y.length() != 1 - error('Immutability broken.') -endif - -if y[0] != 'a' - error('Immutability broken 2.') -endif - -if x.length() != 2 - error('Incorrect append 3') -endif - -if x[0] != 'a' - error('Incorrect append 4.') -endif - -if x[1] != 'b' - error('Incorrect append 5.') -endif - -# Now with evil added: append yourself. - -x += x - -if x.length() != 4 - error('Incorrect selfappend.') -endif - -# += on strings - -bra = 'bra' -foo = 'A' -foo += bra -foo += 'cada' -foo += bra -assert (foo == 'Abracadabra', 'string += failure [@0@]'.format(foo)) -assert (bra == 'bra', 'string += modified right argument!') -foo += ' ' + foo -assert (foo == 'Abracadabra Abracadabra', 'string += failure [@0@]'.format(foo)) - -# += on ints - -foo = 5 -foo += 6 -assert (foo == 11, 'int += failure [@0@]'.format(foo)) -bar = 99 -foo += bar -assert (foo == 110, 'int += failure [@0@]'.format(foo)) -assert (bar == 99, 'int += modified right argument"') -bar += foo + 1 -assert (bar == 210, 'int += failure [@0@]'.format(bar)) -assert (foo == 110, 'int += modified right argument"') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/88 skip subdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/88 skip subdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/88 skip subdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/88 skip subdir/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +project('foo', 'c') + +subdir('subdir1/subdir2') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/88 skip subdir/subdir1/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/88 skip subdir/subdir1/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/88 skip subdir/subdir1/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/88 skip subdir/subdir1/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +error('This should not be called.') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/88 skip subdir/subdir1/subdir2/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/88 skip subdir/subdir1/subdir2/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/88 skip subdir/subdir1/subdir2/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/88 skip subdir/subdir1/subdir2/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +message('I\'m in subdir subdir.') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/89 private include/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/89 private include/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/89 private include/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/89 private include/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,4 @@ +project('access private', 'c') + +subdir('stlib') +subdir('user') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/89 private include/stlib/compiler.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/89 private include/stlib/compiler.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/89 private include/stlib/compiler.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/89 private include/stlib/compiler.py" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,32 @@ +#!/usr/bin/env python3 + +import sys, os + +assert(len(sys.argv) == 3) + +h_templ = '''#pragma once +unsigned int %s(); +''' + +c_templ = '''#include"%s.h" + +unsigned int %s() { + return 0; +} +''' + +ifile = sys.argv[1] +outdir = sys.argv[2] + +base = os.path.splitext(os.path.split(ifile)[-1])[0] + +cfile = os.path.join(outdir, base + '.c') +hfile = os.path.join(outdir, base + '.h') + +c_code = c_templ % (base, base) +h_code = h_templ % base + +with open(cfile, 'w') as f: + f.write(c_code) +with open(hfile, 'w') as f: + f.write(h_code) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/89 private include/stlib/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/89 private include/stlib/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/89 private include/stlib/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/89 private include/stlib/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,12 @@ +genbin = find_program('compiler.py') + +gen = generator(genbin, + output : ['@BASENAME@.h', '@BASENAME@.c'], + arguments : ['@INPUT@', '@BUILD_DIR@'] + ) + +defs = ['foo1.def', 'foo2.def'] +generated = gen.process(defs) + +stlib = static_library('st', generated) +st_priv_inc = stlib.private_dir_include() diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/89 private include/user/libuser.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/89 private include/user/libuser.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/89 private include/user/libuser.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/89 private include/user/libuser.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,6 @@ +#include"foo1.h" +#include"foo2.h" + +int main(int argc, char **argv) { + return foo1() + foo2(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/89 private include/user/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/89 private include/user/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/89 private include/user/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/89 private include/user/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +exe = executable('libuser', 'libuser.c', + link_with : stlib, + include_directories : st_priv_inc) + +test('libuser', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/89 skip subdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/89 skip subdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/89 skip subdir/meson.build" 2018-12-09 16:30:07.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/89 skip subdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -project('foo', 'c') - -subdir('subdir1/subdir2') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/89 skip subdir/subdir1/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/89 skip subdir/subdir1/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/89 skip subdir/subdir1/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/89 skip subdir/subdir1/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -error('This should not be called.') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/89 skip subdir/subdir1/subdir2/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/89 skip subdir/subdir1/subdir2/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/89 skip subdir/subdir1/subdir2/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/89 skip subdir/subdir1/subdir2/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -message('I\'m in subdir subdir.') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/90 default options/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/90 default options/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/90 default options/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/90 default options/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,30 @@ +project('default options', 'cpp', 'c', default_options : [ + 'prefix=/absoluteprefix', + 'buildtype=debugoptimized', + 'cpp_std=c++11', + 'cpp_eh=none', + 'warning_level=3', + ]) + +assert(get_option('buildtype') == 'debugoptimized', 'Build type default value wrong.') + +cpp_eh = get_option('cpp_eh') +assert(cpp_eh == 'none', 'EH value is "' + cpp_eh + '" instead of "none"') +cpp_std = get_option('cpp_std') +assert(cpp_std == 'c++11', 'C++ std value is "' + cpp_std + '" instead of c++11.') + +w_level = get_option('warning_level') +assert(w_level == '3', 'warning level "' + w_level + '" instead of "3"') + +# FIXME. Since we no longer accept invalid options to c_std etc, +# there is no simple way to test this. Gcc does not seem to expose +# the C std used in a preprocessor token so we can't check for it. +# Think of a way to fix this. +# +# # Verify that project args are not used when told not to. +# # MSVC plain C does not have a simple arg to test so skip it. +# if cpp.get_id() != 'msvc' +# cc = meson.get_compiler('c') +# assert(not cc.compiles('int foobar;'), 'Default arg not used in test.') +# assert(cc.compiles('int foobar;', no_builtin_args : true), 'No_builtin did not disable builtins.') +# endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/90 private include/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/90 private include/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/90 private include/meson.build" 2018-12-09 16:30:09.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/90 private include/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -project('access private', 'c') - -subdir('stlib') -subdir('user') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/90 private include/stlib/compiler.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/90 private include/stlib/compiler.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/90 private include/stlib/compiler.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/90 private include/stlib/compiler.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -#!/usr/bin/env python3 - -import sys, os - -assert(len(sys.argv) == 3) - -h_templ = '''#pragma once -unsigned int %s(); -''' - -c_templ = '''#include"%s.h" - -unsigned int %s() { - return 0; -} -''' - -ifile = sys.argv[1] -outdir = sys.argv[2] - -base = os.path.splitext(os.path.split(ifile)[-1])[0] - -cfile = os.path.join(outdir, base + '.c') -hfile = os.path.join(outdir, base + '.h') - -c_code = c_templ % (base, base) -h_code = h_templ % base - -with open(cfile, 'w') as f: - f.write(c_code) -with open(hfile, 'w') as f: - f.write(h_code) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/90 private include/stlib/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/90 private include/stlib/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/90 private include/stlib/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/90 private include/stlib/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -genbin = find_program('compiler.py') - -gen = generator(genbin, - output : ['@BASENAME@.h', '@BASENAME@.c'], - arguments : ['@INPUT@', '@BUILD_DIR@'] - ) - -defs = ['foo1.def', 'foo2.def'] -generated = gen.process(defs) - -stlib = static_library('st', generated) -st_priv_inc = stlib.private_dir_include() diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/90 private include/user/libuser.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/90 private include/user/libuser.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/90 private include/user/libuser.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/90 private include/user/libuser.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#include"foo1.h" -#include"foo2.h" - -int main(int argc, char **argv) { - return foo1() + foo2(); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/90 private include/user/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/90 private include/user/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/90 private include/user/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/90 private include/user/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -exe = executable('libuser', 'libuser.c', - link_with : stlib, - include_directories : st_priv_inc) - -test('libuser', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/91 default options/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/91 default options/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/91 default options/meson.build" 2018-12-09 16:30:09.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/91 default options/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -project('default options', 'cpp', 'c', default_options : [ - 'prefix=/absoluteprefix', - 'buildtype=debugoptimized', - 'cpp_std=c++11', - 'cpp_eh=none', - 'warning_level=3', - ]) - -assert(get_option('buildtype') == 'debugoptimized', 'Build type default value wrong.') - -if meson.get_compiler('cpp').get_argument_syntax() == 'msvc' - cpp_eh = get_option('cpp_eh') - assert(cpp_eh == 'none', 'MSVC eh value is "' + cpp_eh + '" instead of "none"') -else - cpp_std = get_option('cpp_std') - assert(cpp_std == 'c++11', 'C++ std value is "' + cpp_std + '" instead of c++11.') -endif - -w_level = get_option('warning_level') -assert(w_level == '3', 'warning level "' + w_level + '" instead of "3"') - -# FIXME. Since we no longer accept invalid options to c_std etc, -# there is no simple way to test this. Gcc does not seem to expose -# the C std used in a preprocessor token so we can't check for it. -# Think of a way to fix this. -# -# # Verify that project args are not used when told not to. -# # MSVC plain C does not have a simple arg to test so skip it. -# if cpp.get_id() != 'msvc' -# cc = meson.get_compiler('c') -# assert(not cc.compiles('int foobar;'), 'Default arg not used in test.') -# assert(cc.compiles('int foobar;', no_builtin_args : true), 'No_builtin did not disable builtins.') -# endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/91 dep fallback/gensrc.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/91 dep fallback/gensrc.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/91 dep fallback/gensrc.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/91 dep fallback/gensrc.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,6 @@ +#!/usr/bin/env python3 + +import sys +import shutil + +shutil.copyfile(sys.argv[1], sys.argv[2]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/91 dep fallback/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/91 dep fallback/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/91 dep fallback/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/91 dep fallback/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,25 @@ +project('dep fallback', 'c') + +bob = dependency('boblib', fallback : ['boblib', 'bob_dep'], required: false, + default_options : 'warning_level=1') +if not bob.found() + error('Bob is actually needed') +endif +# boblib subproject exists, but sita_dep doesn't exist +sita = dependency('sitalib', fallback : ['boblib', 'sita_dep'], required: false) +# jimmylib subproject doesn't exist +jimmy = dependency('jimmylib', fallback : ['jimmylib', 'jimmy_dep'], required: false) +# dummylib subproject fails to configure +dummy = dependency('dummylib', fallback : ['dummylib', 'dummy_dep'], required: false) + +gensrc_py = find_program('gensrc.py') +gensrc = custom_target('gensrc.c', + input : 'tester.c', + output : 'gensrc.c', + command : [gensrc_py, '@INPUT@', '@OUTPUT@']) + +exe = executable('bobtester', + [gensrc], + dependencies : bob) + +test('bobtester', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/91 dep fallback/subprojects/boblib/bob.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/91 dep fallback/subprojects/boblib/bob.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/91 dep fallback/subprojects/boblib/bob.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/91 dep fallback/subprojects/boblib/bob.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,8 @@ +#include"bob.h" + +#ifdef _MSC_VER +__declspec(dllexport) +#endif +const char* get_bob() { + return "bob"; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/91 dep fallback/subprojects/boblib/bob.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/91 dep fallback/subprojects/boblib/bob.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/91 dep fallback/subprojects/boblib/bob.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/91 dep fallback/subprojects/boblib/bob.h" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,6 @@ +#pragma once + +#ifdef _MSC_VER +__declspec(dllimport) +#endif +const char* get_bob(); diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/91 dep fallback/subprojects/boblib/genbob.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/91 dep fallback/subprojects/boblib/genbob.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/91 dep fallback/subprojects/boblib/genbob.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/91 dep fallback/subprojects/boblib/genbob.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,6 @@ +#!/usr/bin/env python3 + +import sys + +with open(sys.argv[1], 'w') as f: + f.write('') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/91 dep fallback/subprojects/boblib/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/91 dep fallback/subprojects/boblib/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/91 dep fallback/subprojects/boblib/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/91 dep fallback/subprojects/boblib/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,16 @@ +project('bob', 'c') + +gensrc_py = find_program('genbob.py') +genbob_h = custom_target('genbob.h', + output : 'genbob.h', + command : [gensrc_py, '@OUTPUT@']) +genbob_c = custom_target('genbob.c', + output : 'genbob.c', + command : [gensrc_py, '@OUTPUT@']) + +boblib = library('bob', ['bob.c', genbob_c]) +bobinc = include_directories('.') + +bob_dep = declare_dependency(link_with : boblib, + sources : [genbob_h], + include_directories : bobinc) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/91 dep fallback/subprojects/dummylib/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/91 dep fallback/subprojects/dummylib/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/91 dep fallback/subprojects/dummylib/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/91 dep fallback/subprojects/dummylib/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,4 @@ +project('dummylib', 'c') + +dummy_dep = declare_dependency() +error('this subproject fails to configure') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/91 dep fallback/tester.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/91 dep fallback/tester.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/91 dep fallback/tester.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/91 dep fallback/tester.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,14 @@ +#include"bob.h" +#include"genbob.h" +#include +#include + +int main(int argc, char **argv) { + if(strcmp("bob", get_bob()) == 0) { + printf("Bob is indeed bob.\n"); + } else { + printf("ERROR: bob is not bob.\n"); + return 1; + } + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/92 default library/ef.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/92 default library/ef.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/92 default library/ef.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/92 default library/ef.cpp" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,8 @@ +#include"ef.h" + +DLL_PUBLIC Ef::Ef() : x(99) { +} + +int DLL_PUBLIC Ef::get_x() const { + return x; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/92 default library/ef.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/92 default library/ef.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/92 default library/ef.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/92 default library/ef.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,22 @@ +#pragma once + +#if defined _WIN32 || defined __CYGWIN__ + #define DLL_PUBLIC __declspec(dllexport) +#else + #if defined __GNUC__ + #define DLL_PUBLIC __attribute__ ((visibility("default"))) + #else + #pragma message ("Compiler does not support symbol visibility.") + #define DLL_PUBLIC + #endif +#endif + +class Ef { +private: + int x; + +public: + + DLL_PUBLIC Ef(); + int DLL_PUBLIC get_x() const; +}; diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/92 default library/eftest.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/92 default library/eftest.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/92 default library/eftest.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/92 default library/eftest.cpp" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,14 @@ +#include"ef.h" + +#include + +int main(int, char **) { + Ef var; + if(var.get_x() == 99) { + std::cout << "All is fine.\n"; + return 0; + } else { + std::cout << "Something went wrong.\n"; + return 1; + } +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/92 default library/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/92 default library/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/92 default library/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/92 default library/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,10 @@ +project('default library', 'cpp') + +flib = library('ef', 'ef.cpp') +exe = executable('eftest', 'eftest.cpp', link_with : flib) +test('eftest', exe) + +# Same as above, but using build_target() +flib2 = build_target('ef2', 'ef.cpp', target_type: 'library') +exe2 = executable('eftest2', 'eftest.cpp', link_with : flib2) +test('eftest2', exe2) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/92 dep fallback/gensrc.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/92 dep fallback/gensrc.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/92 dep fallback/gensrc.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/92 dep fallback/gensrc.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#!/usr/bin/env python3 - -import sys -import shutil - -shutil.copyfile(sys.argv[1], sys.argv[2]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/92 dep fallback/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/92 dep fallback/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/92 dep fallback/meson.build" 2018-12-09 16:30:10.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/92 dep fallback/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -project('dep fallback', 'c') - -bob = dependency('boblib', fallback : ['boblib', 'bob_dep'], required: false, - default_options : 'warning_level=1') -if not bob.found() - error('Bob is actually needed') -endif -# boblib subproject exists, but sita_dep doesn't exist -sita = dependency('sitalib', fallback : ['boblib', 'sita_dep'], required: false) -# jimmylib subproject doesn't exist -jimmy = dependency('jimmylib', fallback : ['jimmylib', 'jimmy_dep'], required: false) -# dummylib subproject fails to configure -dummy = dependency('dummylib', fallback : ['dummylib', 'dummy_dep'], required: false) - -gensrc_py = find_program('gensrc.py') -gensrc = custom_target('gensrc.c', - input : 'tester.c', - output : 'gensrc.c', - command : [gensrc_py, '@INPUT@', '@OUTPUT@']) - -exe = executable('bobtester', - [gensrc], - dependencies : bob) - -test('bobtester', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/92 dep fallback/subprojects/boblib/bob.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/92 dep fallback/subprojects/boblib/bob.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/92 dep fallback/subprojects/boblib/bob.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/92 dep fallback/subprojects/boblib/bob.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -#include"bob.h" - -#ifdef _MSC_VER -__declspec(dllexport) -#endif -const char* get_bob() { - return "bob"; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/92 dep fallback/subprojects/boblib/bob.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/92 dep fallback/subprojects/boblib/bob.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/92 dep fallback/subprojects/boblib/bob.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/92 dep fallback/subprojects/boblib/bob.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#pragma once - -#ifdef _MSC_VER -__declspec(dllimport) -#endif -const char* get_bob(); diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/92 dep fallback/subprojects/boblib/genbob.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/92 dep fallback/subprojects/boblib/genbob.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/92 dep fallback/subprojects/boblib/genbob.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/92 dep fallback/subprojects/boblib/genbob.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#!/usr/bin/env python3 - -import sys - -with open(sys.argv[1], 'w') as f: - f.write('') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/92 dep fallback/subprojects/boblib/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/92 dep fallback/subprojects/boblib/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/92 dep fallback/subprojects/boblib/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/92 dep fallback/subprojects/boblib/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -project('bob', 'c') - -gensrc_py = find_program('genbob.py') -genbob_h = custom_target('genbob.h', - output : 'genbob.h', - command : [gensrc_py, '@OUTPUT@']) -genbob_c = custom_target('genbob.c', - output : 'genbob.c', - command : [gensrc_py, '@OUTPUT@']) - -boblib = library('bob', ['bob.c', genbob_c]) -bobinc = include_directories('.') - -bob_dep = declare_dependency(link_with : boblib, - sources : [genbob_h], - include_directories : bobinc) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/92 dep fallback/subprojects/dummylib/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/92 dep fallback/subprojects/dummylib/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/92 dep fallback/subprojects/dummylib/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/92 dep fallback/subprojects/dummylib/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -project('dummylib', 'c') - -dummy_dep = declare_dependency() -error('this subproject fails to configure') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/92 dep fallback/tester.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/92 dep fallback/tester.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/92 dep fallback/tester.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/92 dep fallback/tester.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -#include"bob.h" -#include"genbob.h" -#include -#include - -int main(int argc, char **argv) { - if(strcmp("bob", get_bob()) == 0) { - printf("Bob is indeed bob.\n"); - } else { - printf("ERROR: bob is not bob.\n"); - return 1; - } - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/93 default library/ef.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/93 default library/ef.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/93 default library/ef.cpp" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/93 default library/ef.cpp" 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -#include"ef.h" - -DLL_PUBLIC Ef::Ef() : x(99) { -} - -int DLL_PUBLIC Ef::get_x() const { - return x; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/93 default library/ef.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/93 default library/ef.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/93 default library/ef.h" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/93 default library/ef.h" 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ -#pragma once - -#if defined _WIN32 || defined __CYGWIN__ - #define DLL_PUBLIC __declspec(dllexport) -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif - -class Ef { -private: - int x; - -public: - - DLL_PUBLIC Ef(); - int DLL_PUBLIC get_x() const; -}; diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/93 default library/eftest.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/93 default library/eftest.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/93 default library/eftest.cpp" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/93 default library/eftest.cpp" 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -#include"ef.h" - -#include - -int main(int, char **) { - Ef var; - if(var.get_x() == 99) { - std::cout << "All is fine.\n"; - return 0; - } else { - std::cout << "Something went wrong.\n"; - return 1; - } -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/93 default library/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/93 default library/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/93 default library/meson.build" 2018-12-09 16:30:11.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/93 default library/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -project('default library', 'cpp') - -flib = library('ef', 'ef.cpp') -exe = executable('eftest', 'eftest.cpp', link_with : flib) -test('eftest', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/93 selfbuilt custom/data.dat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/93 selfbuilt custom/data.dat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/93 selfbuilt custom/data.dat" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/93 selfbuilt custom/data.dat" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +generated_function diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/93 selfbuilt custom/mainprog.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/93 selfbuilt custom/mainprog.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/93 selfbuilt custom/mainprog.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/93 selfbuilt custom/mainprog.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +#include"data.h" + +int main(int, char **) { + return generated_function() != 52; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/93 selfbuilt custom/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/93 selfbuilt custom/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/93 selfbuilt custom/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/93 selfbuilt custom/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,16 @@ +project('selfbuilt custom', 'cpp') + +# Build an exe and use it in a custom target +# whose output is used to build a different exe. + +tool = executable('tool', 'tool.cpp', native : true) + +hfile = custom_target('datah', + output : 'data.h', + input : 'data.dat', + command : [tool, '@INPUT@', '@OUTPUT@'], +) + +main = executable('mainprog', 'mainprog.cpp', hfile) + +test('maintest', main) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/93 selfbuilt custom/tool.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/93 selfbuilt custom/tool.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/93 selfbuilt custom/tool.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/93 selfbuilt custom/tool.cpp" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,34 @@ +#include +#include +#include + +using namespace std; + +const char prefix[] = "int "; +const char suffix[] = " () {\n return 52;}\n"; + +int main(int argc, char **argv) { + if(argc != 3) { + cout << "You is fail.\n"; + return 1; + } + ifstream is(argv[1], ifstream::binary); + if(!is) { + cout << "Opening input file failed.\n"; + return 1; + } + string funcname; + is >> funcname; + ofstream os(argv[2], ofstream::binary); + if(!os) { + cout << "Opening output file failed.\n"; + return 1; + } + os << prefix << funcname << suffix; + os.close(); + if(!os.good()) { + cout << "Writing data out failed.\n"; + return 1; + } + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/94 gen extra/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/94 gen extra/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/94 gen extra/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/94 gen extra/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,40 @@ +project('extra args in gen', 'c') + +prog = find_program('srcgen.py') + +gen = generator(prog, + output : '@BASENAME@.c', + arguments : ['--input=@INPUT@', '--output=@OUTPUT@', '@EXTRA_ARGS@']) + +g1 = gen.process('name.dat') +g2 = gen.process('name.dat', extra_args: '--upper') + +test('basic', executable('basic', 'plain.c', g1)) +test('upper', executable('upper', 'upper.c', g2)) + +prog2 = find_program('srcgen2.py') +basename_gen = generator(prog2, + output : ['@BASENAME@.tab.c', '@BASENAME@.tab.h'], + arguments : ['@BUILD_DIR@', '@BASENAME@', '@INPUT@']) + +basename_src = basename_gen.process('name.l') + +test('basename', executable('basename', basename_src)) + +plainname_gen = generator(prog2, + output : ['@PLAINNAME@.tab.c', '@PLAINNAME@.tab.h'], + arguments : ['@BUILD_DIR@', '@PLAINNAME@', '@INPUT@']) + +plainname_src = plainname_gen.process('name.l') + +test('plainname', executable('plainname', plainname_src)) + +prog3 = find_program('srcgen3.py') +capture_gen = generator(prog3, + output : ['@BASENAME@.yy.c'], + arguments : ['@INPUT@'], + capture : true) + +capture_src = capture_gen.process('name.l') + +test('capture', executable('capture', capture_src)) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/94 gen extra/name.dat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/94 gen extra/name.dat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/94 gen extra/name.dat" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/94 gen extra/name.dat" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +bob_mcbob diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/94 gen extra/name.l" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/94 gen extra/name.l" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/94 gen extra/name.l" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/94 gen extra/name.l" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,3 @@ +int main() { +return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/94 gen extra/plain.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/94 gen extra/plain.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/94 gen extra/plain.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/94 gen extra/plain.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +int bob_mcbob(); + +int main(int argc, char **argv) { + return bob_mcbob(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/94 gen extra/srcgen2.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/94 gen extra/srcgen2.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/94 gen extra/srcgen2.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/94 gen extra/srcgen2.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,32 @@ +#!/usr/bin/env python3 + +import os +import sys +import argparse + +parser = argparse.ArgumentParser() +parser.add_argument('target_dir', + help='the target dir') +parser.add_argument('stem', + help='the stem') +parser.add_argument('input', + help='the input file') + +options = parser.parse_args(sys.argv[1:]) + +with open(options.input) as f: + content = f.read() + + +output_c = os.path.join(options.target_dir, options.stem + ".tab.c") +with open(output_c, 'w') as f: + f.write(content) + + +output_h = os.path.join(options.target_dir, options.stem + ".tab.h") +h_content = '''#pragma once + +int myfun(void); +''' +with open(output_h, 'w') as f: + f.write(h_content) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/94 gen extra/srcgen3.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/94 gen extra/srcgen3.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/94 gen extra/srcgen3.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/94 gen extra/srcgen3.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,15 @@ +#!/usr/bin/env python3 + +import sys +import argparse + +parser = argparse.ArgumentParser() +parser.add_argument('input', + help='the input file') + +options = parser.parse_args(sys.argv[1:]) + +with open(options.input) as f: + content = f.read().strip() + +print(content) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/94 gen extra/srcgen.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/94 gen extra/srcgen.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/94 gen extra/srcgen.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/94 gen extra/srcgen.py" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,27 @@ +#!/usr/bin/env python3 + +import sys +import argparse + +parser = argparse.ArgumentParser() +parser.add_argument('--input', dest='input', + help='the input file') +parser.add_argument('--output', dest='output', + help='the output file') +parser.add_argument('--upper', dest='upper', action='store_true', default=False, + help='Convert to upper case.') + +c_templ = '''int %s() { + return 0; +} +''' + +options = parser.parse_args(sys.argv[1:]) + +with open(options.input) as f: + funcname = f.readline().strip() +if options.upper: + funcname = funcname.upper() + +with open(options.output, 'w') as f: + f.write(c_templ % funcname) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/94 gen extra/upper.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/94 gen extra/upper.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/94 gen extra/upper.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/94 gen extra/upper.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,5 @@ +int BOB_MCBOB(); + +int main(int argc, char **argv) { + return BOB_MCBOB(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/94 selfbuilt custom/data.dat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/94 selfbuilt custom/data.dat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/94 selfbuilt custom/data.dat" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/94 selfbuilt custom/data.dat" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -generated_function diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/94 selfbuilt custom/mainprog.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/94 selfbuilt custom/mainprog.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/94 selfbuilt custom/mainprog.cpp" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/94 selfbuilt custom/mainprog.cpp" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#include"data.h" - -int main(int, char **) { - return generated_function() != 52; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/94 selfbuilt custom/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/94 selfbuilt custom/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/94 selfbuilt custom/meson.build" 2018-12-09 16:30:13.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/94 selfbuilt custom/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -project('selfbuilt custom', 'cpp') - -# Build an exe and use it in a custom target -# whose output is used to build a different exe. - -tool = executable('tool', 'tool.cpp', native : true) - -hfile = custom_target('datah', - output : 'data.h', - input : 'data.dat', - command : [tool, '@INPUT@', '@OUTPUT@'], -) - -main = executable('mainprog', 'mainprog.cpp', hfile) - -test('maintest', main) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/94 selfbuilt custom/tool.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/94 selfbuilt custom/tool.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/94 selfbuilt custom/tool.cpp" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/94 selfbuilt custom/tool.cpp" 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -#include -#include -#include - -using namespace std; - -const char prefix[] = "int "; -const char suffix[] = " () {\n return 52;}\n"; - -int main(int argc, char **argv) { - if(argc != 3) { - cout << "You is fail.\n"; - return 1; - } - ifstream is(argv[1], ifstream::binary); - if(!is) { - cout << "Opening input file failed.\n"; - return 1; - } - string funcname; - is >> funcname; - ofstream os(argv[2], ofstream::binary); - if(!os) { - cout << "Opening output file failed.\n"; - return 1; - } - os << prefix << funcname << suffix; - os.close(); - if(!os.good()) { - cout << "Writing data out failed.\n"; - return 1; - } - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/95 benchmark/delayer.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/95 benchmark/delayer.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/95 benchmark/delayer.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/95 benchmark/delayer.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,20 @@ +/* Simple prog that sleeps for a random time. */ + +#include +#include +#if defined(_WIN32) +#include +#endif + +int main(int argc, char **argv) { + srand(time(NULL)); +#if !defined(_WIN32) + struct timespec t; + t.tv_sec = 0; + t.tv_nsec = 199999999.0*rand()/RAND_MAX; + nanosleep(&t, NULL); +#else + Sleep(50.0*rand()/RAND_MAX); +#endif + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/95 benchmark/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/95 benchmark/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/95 benchmark/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/95 benchmark/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,4 @@ +project('benchmark', 'c') + +delayer = executable('delayer', 'delayer.c', c_args : '-D_GNU_SOURCE') +benchmark('delayer', delayer) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/95 gen extra/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/95 gen extra/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/95 gen extra/meson.build" 2018-12-09 16:30:13.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/95 gen extra/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -project('extra args in gen', 'c') - -prog = find_program('srcgen.py') - -gen = generator(prog, - output : '@BASENAME@.c', - arguments : ['--input=@INPUT@', '--output=@OUTPUT@', '@EXTRA_ARGS@']) - -g1 = gen.process('name.dat') -g2 = gen.process('name.dat', extra_args: '--upper') - -test('basic', executable('basic', 'plain.c', g1)) -test('upper', executable('upper', 'upper.c', g2)) - -prog2 = find_program('srcgen2.py') -basename_gen = generator(prog2, - output : ['@BASENAME@.tab.c', '@BASENAME@.tab.h'], - arguments : ['@BUILD_DIR@', '@BASENAME@', '@INPUT@']) - -basename_src = basename_gen.process('name.l') - -test('basename', executable('basename', basename_src)) - -plainname_gen = generator(prog2, - output : ['@PLAINNAME@.tab.c', '@PLAINNAME@.tab.h'], - arguments : ['@BUILD_DIR@', '@PLAINNAME@', '@INPUT@']) - -plainname_src = plainname_gen.process('name.l') - -test('plainname', executable('plainname', plainname_src)) - -prog3 = find_program('srcgen3.py') -capture_gen = generator(prog3, - output : ['@BASENAME@.yy.c'], - arguments : ['@INPUT@'], - capture : true) - -capture_src = capture_gen.process('name.l') - -test('capture', executable('capture', capture_src)) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/95 gen extra/name.dat" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/95 gen extra/name.dat" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/95 gen extra/name.dat" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/95 gen extra/name.dat" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -bob_mcbob diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/95 gen extra/name.l" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/95 gen extra/name.l" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/95 gen extra/name.l" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/95 gen extra/name.l" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -int main() { -return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/95 gen extra/plain.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/95 gen extra/plain.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/95 gen extra/plain.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/95 gen extra/plain.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -int bob_mcbob(); - -int main(int argc, char **argv) { - return bob_mcbob(); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/95 gen extra/srcgen2.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/95 gen extra/srcgen2.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/95 gen extra/srcgen2.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/95 gen extra/srcgen2.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -#!/usr/bin/env python3 - -import os -import sys -import argparse - -parser = argparse.ArgumentParser() -parser.add_argument('target_dir', - help='the target dir') -parser.add_argument('stem', - help='the stem') -parser.add_argument('input', - help='the input file') - -options = parser.parse_args(sys.argv[1:]) - -with open(options.input) as f: - content = f.read() - - -output_c = os.path.join(options.target_dir, options.stem + ".tab.c") -with open(output_c, 'w') as f: - f.write(content) - - -output_h = os.path.join(options.target_dir, options.stem + ".tab.h") -h_content = '''#pragma once - -int myfun(void); -''' -with open(output_h, 'w') as f: - f.write(h_content) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/95 gen extra/srcgen3.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/95 gen extra/srcgen3.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/95 gen extra/srcgen3.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/95 gen extra/srcgen3.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -#!/usr/bin/env python3 - -import sys -import argparse - -parser = argparse.ArgumentParser() -parser.add_argument('input', - help='the input file') - -options = parser.parse_args(sys.argv[1:]) - -with open(options.input) as f: - content = f.read().strip() - -print(content) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/95 gen extra/srcgen.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/95 gen extra/srcgen.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/95 gen extra/srcgen.py" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/95 gen extra/srcgen.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -#!/usr/bin/env python3 - -import sys -import argparse - -parser = argparse.ArgumentParser() -parser.add_argument('--input', dest='input', - help='the input file') -parser.add_argument('--output', dest='output', - help='the output file') -parser.add_argument('--upper', dest='upper', action='store_true', default=False, - help='Convert to upper case.') - -c_templ = '''int %s() { - return 0; -} -''' - -options = parser.parse_args(sys.argv[1:]) - -with open(options.input) as f: - funcname = f.readline().strip() -if options.upper: - funcname = funcname.upper() - -with open(options.output, 'w') as f: - f.write(c_templ % funcname) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/95 gen extra/upper.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/95 gen extra/upper.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/95 gen extra/upper.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/95 gen extra/upper.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -int BOB_MCBOB(); - -int main(int argc, char **argv) { - return BOB_MCBOB(); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/96 benchmark/delayer.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/96 benchmark/delayer.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/96 benchmark/delayer.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/96 benchmark/delayer.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -/* Simple prog that sleeps for a random time. */ - -#include -#include -#if defined(_WIN32) -#include -#endif - -int main(int argc, char **argv) { - srand(time(NULL)); -#if !defined(_WIN32) - struct timespec t; - t.tv_sec = 0; - t.tv_nsec = 199999999.0*rand()/RAND_MAX; - nanosleep(&t, NULL); -#else - Sleep(50.0*rand()/RAND_MAX); -#endif - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/96 benchmark/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/96 benchmark/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/96 benchmark/meson.build" 2018-12-09 16:30:14.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/96 benchmark/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -project('benchmark', 'c') - -delayer = executable('delayer', 'delayer.c', c_args : '-D_GNU_SOURCE') -benchmark('delayer', delayer) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/96 test workdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/96 test workdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/96 test workdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/96 test workdir/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,8 @@ +project('test workdir', 'c') + +exe = executable('opener', 'opener.c') + +test('basic', exe, workdir : meson.source_root()) +test('shouldfail', exe, should_fail : true) + +subdir('subdir') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/96 test workdir/opener.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/96 test workdir/opener.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/96 test workdir/opener.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/96 test workdir/opener.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,12 @@ +// This test only succeeds if run in the source root dir. + +#include + +int main(int arg, char **argv) { + FILE *f = fopen("opener.c", "r"); + if(f) { + fclose(f); + return 0; + } + return 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/96 test workdir/subdir/checker.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/96 test workdir/subdir/checker.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/96 test workdir/subdir/checker.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/96 test workdir/subdir/checker.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +#!/usr/bin/env python3 + +import sys + +data = open(sys.argv[1], 'rb').read() diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/96 test workdir/subdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/96 test workdir/subdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/96 test workdir/subdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/96 test workdir/subdir/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,4 @@ +exe2 = executable('dummy', '../opener.c') +test('subdir', find_program('checker.py'), + workdir : meson.source_root(), + args: [exe2]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/97 suites/exe1.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/97 suites/exe1.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/97 suites/exe1.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/97 suites/exe1.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,6 @@ +#include + +int main(int argc, char **argv) { + printf("I am test exe1.\n"); + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/97 suites/exe2.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/97 suites/exe2.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/97 suites/exe2.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/97 suites/exe2.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,6 @@ +#include + +int main(int argc, char **argv) { + printf("I am test exe2.\n"); + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/97 suites/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/97 suites/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/97 suites/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/97 suites/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,9 @@ +project('multiple test suites', 'c') + +subproject('sub') + +exe1 = executable('exe1', 'exe1.c') +exe2 = executable('exe2', 'exe2.c') + +test('exe1', exe1) +test('exe2', exe2, suite : ['suite2', 'super-special']) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/97 suites/subprojects/sub/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/97 suites/subprojects/sub/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/97 suites/subprojects/sub/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/97 suites/subprojects/sub/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,7 @@ +project('subproject test suites', 'c') + +sub1 = executable('sub1', 'sub1.c') +sub2 = executable('sub2', 'sub2.c') + +test('sub1', sub1) +test('sub2', sub2, suite : 'suite2') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/97 suites/subprojects/sub/sub1.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/97 suites/subprojects/sub/sub1.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/97 suites/subprojects/sub/sub1.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/97 suites/subprojects/sub/sub1.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,6 @@ +#include + +int main(int argc, char **argv) { + printf("I am test sub1.\n"); + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/97 suites/subprojects/sub/sub2.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/97 suites/subprojects/sub/sub2.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/97 suites/subprojects/sub/sub2.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/97 suites/subprojects/sub/sub2.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,6 @@ +#include + +int main(int argc, char **argv) { + printf("I am test sub2.\n"); + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/97 test workdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/97 test workdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/97 test workdir/meson.build" 2018-12-09 16:30:15.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/97 test workdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -project('test workdir', 'c') - -exe = executable('opener', 'opener.c') - -test('basic', exe, workdir : meson.source_root()) -test('shouldfail', exe, should_fail : true) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/97 test workdir/opener.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/97 test workdir/opener.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/97 test workdir/opener.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/97 test workdir/opener.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -// This test only succeeds if run in the source root dir. - -#include - -int main(int arg, char **argv) { - FILE *f = fopen("opener.c", "r"); - if(f) { - fclose(f); - return 0; - } - return 1; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/98 suites/exe1.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/98 suites/exe1.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/98 suites/exe1.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/98 suites/exe1.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#include - -int main(int argc, char **argv) { - printf("I am test exe1.\n"); - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/98 suites/exe2.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/98 suites/exe2.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/98 suites/exe2.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/98 suites/exe2.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#include - -int main(int argc, char **argv) { - printf("I am test exe2.\n"); - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/98 suites/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/98 suites/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/98 suites/meson.build" 2018-12-09 16:30:16.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/98 suites/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -project('multiple test suites', 'c') - -subproject('sub') - -exe1 = executable('exe1', 'exe1.c') -exe2 = executable('exe2', 'exe2.c') - -test('exe1', exe1) -test('exe2', exe2, suite : ['suite2', 'super-special']) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/98 suites/subprojects/sub/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/98 suites/subprojects/sub/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/98 suites/subprojects/sub/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/98 suites/subprojects/sub/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -project('subproject test suites', 'c') - -sub1 = executable('sub1', 'sub1.c') -sub2 = executable('sub2', 'sub2.c') - -test('sub1', sub1) -test('sub2', sub2, suite : 'suite2') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/98 suites/subprojects/sub/sub1.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/98 suites/subprojects/sub/sub1.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/98 suites/subprojects/sub/sub1.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/98 suites/subprojects/sub/sub1.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#include - -int main(int argc, char **argv) { - printf("I am test sub1.\n"); - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/98 suites/subprojects/sub/sub2.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/98 suites/subprojects/sub/sub2.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/98 suites/subprojects/sub/sub2.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/98 suites/subprojects/sub/sub2.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#include - -int main(int argc, char **argv) { - printf("I am test sub2.\n"); - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/98 threads/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/98 threads/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/98 threads/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/98 threads/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,16 @@ +project('threads', 'cpp', 'c', + default_options : ['cpp_std=c++11']) + +threaddep = dependency('threads') + +test('cppthreadtest', + executable('cppthreadprog', 'threadprog.cpp', + dependencies : threaddep + ) +) + +test('cthreadtest', + executable('cthreadprog', 'threadprog.c', + dependencies : threaddep + ) +) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/98 threads/threadprog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/98 threads/threadprog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/98 threads/threadprog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/98 threads/threadprog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,40 @@ +#if defined _WIN32 + +#include +#include + +DWORD WINAPI thread_func(LPVOID ignored) { + printf("Printing from a thread.\n"); + return 0; +} + +int main(int argc, char **argv) { + DWORD id; + HANDLE th; + printf("Starting thread.\n"); + th = CreateThread(NULL, 0, thread_func, NULL, 0, &id); + WaitForSingleObject(th, INFINITE); + printf("Stopped thread.\n"); + return 0; +} +#else + +#include +#include + +void* main_func(void* ignored) { + printf("Printing from a thread.\n"); + return NULL; +} + +int main(int argc, char** argv) { + pthread_t thread; + int rc; + printf("Starting thread.\n"); + rc = pthread_create(&thread, NULL, main_func, NULL); + rc = pthread_join(thread, NULL); + printf("Stopped thread.\n"); + return rc; +} + +#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/98 threads/threadprog.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/98 threads/threadprog.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/98 threads/threadprog.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/98 threads/threadprog.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,43 @@ +/* On Windows not all versions of VS support C++11 and + * some (most?) versions of mingw don't support std::thread, + * even though they do support c++11. Since we only care about + * threads working, do the test with raw win threads. + */ + +#if defined _WIN32 + +#include +#include + +DWORD WINAPI thread_func(LPVOID) { + printf("Printing from a thread.\n"); + return 0; +} + +int main(int, char**) { + printf("Starting thread.\n"); + HANDLE th; + DWORD id; + th = CreateThread(NULL, 0, thread_func, NULL, 0, &id); + WaitForSingleObject(th, INFINITE); + printf("Stopped thread.\n"); + return 0; +} +#else + +#include +#include + +void main_func() { + printf("Printing from a thread.\n"); +} + +int main(int, char**) { + printf("Starting thread.\n"); + std::thread th(main_func); + th.join(); + printf("Stopped thread.\n"); + return 0; +} + +#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/99 manygen/depuser.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/99 manygen/depuser.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/99 manygen/depuser.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/99 manygen/depuser.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,8 @@ +#include"gen_func.h" + +int main(int argc, char **argv) { + unsigned int i = (unsigned int) gen_func_in_lib(); + unsigned int j = (unsigned int) gen_func_in_obj(); + unsigned int k = (unsigned int) gen_func_in_src(); + return (int)(i + j + k); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/99 manygen/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/99 manygen/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/99 manygen/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/99 manygen/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,14 @@ +project('manygen', 'c') + +if meson.is_cross_build() + # FIXME error out with skip message once cross test runner + # recognizes it. + message('Not running this test during cross build.') +else + subdir('subdir') + + exe = executable('depuser', 'depuser.c', + generated) + + test('depuser test', exe) +endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/99 manygen/subdir/funcinfo.def" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/99 manygen/subdir/funcinfo.def" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/99 manygen/subdir/funcinfo.def" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/99 manygen/subdir/funcinfo.def" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +gen_func diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/99 manygen/subdir/manygen.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/99 manygen/subdir/manygen.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/99 manygen/subdir/manygen.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/99 manygen/subdir/manygen.py" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,83 @@ +#!/usr/bin/env python + +from __future__ import print_function + +# Generates a static library, object file, source +# file and a header file. + +import sys, os +import subprocess + +with open(sys.argv[1]) as f: + funcname = f.readline().strip() +outdir = sys.argv[2] +buildtype_args = sys.argv[3] +compiler_type = sys.argv[4] +compiler = sys.argv[5:] + +if not os.path.isdir(outdir): + print('Outdir does not exist.') + sys.exit(1) + +if compiler_type == 'msvc': + libsuffix = '.lib' + is_vs = True + if any(['clang-cl' in c for c in compiler]): + linker = 'llvm-lib' + else: + linker = 'lib' +else: + libsuffix = '.a' + is_vs = False + linker = 'ar' + +objsuffix = '.o' + +outo = os.path.join(outdir, funcname + objsuffix) +outa = os.path.join(outdir, funcname + libsuffix) +outh = os.path.join(outdir, funcname + '.h') +outc = os.path.join(outdir, funcname + '.c') + +tmpc = 'diibadaaba.c' +tmpo = 'diibadaaba' + objsuffix + +with open(outc, 'w') as f: + f.write('''#include"%s.h" +int %s_in_src() { + return 0; +} +''' % (funcname, funcname)) + +with open(outh, 'w') as f: + f.write('''#pragma once +int %s_in_lib(); +int %s_in_obj(); +int %s_in_src(); +''' % (funcname, funcname, funcname)) + +with open(tmpc, 'w') as f: + f.write('''int %s_in_obj() { + return 0; +} +''' % funcname) + +if is_vs: + subprocess.check_call(compiler + ['/nologo', '/c', buildtype_args, '/Fo' + outo, tmpc]) +else: + subprocess.check_call(compiler + ['-c', '-o', outo, tmpc]) + +with open(tmpc, 'w') as f: + f.write('''int %s_in_lib() { + return 0; +} +''' % funcname) + +if is_vs: + subprocess.check_call(compiler + ['/nologo', '/c', '/Fo' + tmpo, tmpc]) + subprocess.check_call([linker, '/NOLOGO', '/OUT:' + outa, tmpo]) +else: + subprocess.check_call(compiler + ['-c', '-o', tmpo, tmpc]) + subprocess.check_call([linker, 'csr', outa, tmpo]) + +os.unlink(tmpo) +os.unlink(tmpc) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/99 manygen/subdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/99 manygen/subdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/99 manygen/subdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/99 manygen/subdir/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,26 @@ +gen = files('manygen.py') +py3_bin = import('python3').find_python() + +buildtype = get_option('buildtype') +buildtype_args = '-Dfooxxx' # a useless compiler argument +cc = meson.get_compiler('c') +if cc.get_argument_syntax() == 'msvc' + # We need our manually generated code to use the same CRT as the executable. + # Taken from compilers.py since build files do not have access to this. + if buildtype == 'debug' + buildtype_args = '/MDd' + elif buildtype == 'debugoptimized' + buildtype_args = '/MDd' + elif buildtype == 'release' + buildtype_args = '/MD' + endif + outfiles = ['gen_func.lib', 'gen_func.c', 'gen_func.h', 'gen_func.o'] +else + outfiles = ['gen_func.a', 'gen_func.c', 'gen_func.h', 'gen_func.o'] +endif + +generated = custom_target('manygen', + output : outfiles, + input : ['funcinfo.def'], + command : [py3_bin, gen[0], '@INPUT@', '@OUTDIR@', buildtype_args, cc.get_argument_syntax(), cc.cmd_array()], +) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/99 threads/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/99 threads/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/99 threads/meson.build" 2018-12-09 16:30:17.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/99 threads/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -project('threads', 'cpp', 'c', - default_options : ['cpp_std=c++11']) - -threaddep = dependency('threads') - -test('cppthreadtest', - executable('cppthreadprog', 'threadprog.cpp', - dependencies : threaddep - ) -) - -test('cthreadtest', - executable('cthreadprog', 'threadprog.c', - dependencies : threaddep - ) -) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/99 threads/threadprog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/99 threads/threadprog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/99 threads/threadprog.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/99 threads/threadprog.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -#if defined _WIN32 - -#include -#include - -DWORD WINAPI thread_func(LPVOID ignored) { - printf("Printing from a thread.\n"); - return 0; -} - -int main(int argc, char **argv) { - DWORD id; - HANDLE th; - printf("Starting thread.\n"); - th = CreateThread(NULL, 0, thread_func, NULL, 0, &id); - WaitForSingleObject(th, INFINITE); - printf("Stopped thread.\n"); - return 0; -} -#else - -#include -#include - -void* main_func(void* ignored) { - printf("Printing from a thread.\n"); - return NULL; -} - -int main(int argc, char** argv) { - pthread_t thread; - int rc; - printf("Starting thread.\n"); - rc = pthread_create(&thread, NULL, main_func, NULL); - rc = pthread_join(thread, NULL); - printf("Stopped thread.\n"); - return rc; -} - -#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/99 threads/threadprog.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/99 threads/threadprog.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/99 threads/threadprog.cpp" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/99 threads/threadprog.cpp" 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -/* On Windows not all versions of VS support C++11 and - * some (most?) versions of mingw don't support std::thread, - * even though they do support c++11. Since we only care about - * threads working, do the test with raw win threads. - */ - -#if defined _WIN32 - -#include -#include - -DWORD WINAPI thread_func(LPVOID) { - printf("Printing from a thread.\n"); - return 0; -} - -int main(int, char**) { - printf("Starting thread.\n"); - HANDLE th; - DWORD id; - th = CreateThread(NULL, 0, thread_func, NULL, 0, &id); - WaitForSingleObject(th, INFINITE); - printf("Stopped thread.\n"); - return 0; -} -#else - -#include -#include - -void main_func() { - printf("Printing from a thread.\n"); -} - -int main(int, char**) { - printf("Starting thread.\n"); - std::thread th(main_func); - th.join(); - printf("Stopped thread.\n"); - return 0; -} - -#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/9 header install/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/9 header install/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/common/9 header install/meson.build" 2018-12-09 16:28:52.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/common/9 header install/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -8,4 +8,5 @@ h1 = install_headers('rootdir.h') h2 = install_headers(as_array, subdir : 'subdir') h3 = install_headers(subheader) +h4 = install_headers(disabler()) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/1 simple/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/1 simple/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/1 simple/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/1 simple/meson.build" 2019-02-07 09:08:55.000000000 +0000 @@ -0,0 +1,5 @@ +project('simple', 'cuda', version : '1.0.0') + +exe = executable('prog', 'prog.cu') +test('cudatest', exe) + diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/1 simple/prog.cu" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/1 simple/prog.cu" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/1 simple/prog.cu" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/1 simple/prog.cu" 2019-02-07 09:08:55.000000000 +0000 @@ -0,0 +1,30 @@ +#include + +int main(int argc, char **argv) { + int cuda_devices = 0; + std::cout << "CUDA version: " << CUDART_VERSION << "\n"; + cudaGetDeviceCount(&cuda_devices); + if(cuda_devices == 0) { + std::cout << "No Cuda hardware found. Exiting.\n"; + return 0; + } + std::cout << "This computer has " << cuda_devices << " Cuda device(s).\n"; + cudaDeviceProp props; + cudaGetDeviceProperties(&props, 0); + std::cout << "Properties of device 0.\n\n"; + + std::cout << " Name: " << props.name << "\n"; + std::cout << " Global memory: " << props.totalGlobalMem << "\n"; + std::cout << " Shared memory: " << props.sharedMemPerBlock << "\n"; + std::cout << " Constant memory: " << props.totalConstMem << "\n"; + std::cout << " Block registers: " << props.regsPerBlock << "\n"; + + std::cout << " Warp size: " << props.warpSize << "\n"; + std::cout << " Threads per block: " << props.maxThreadsPerBlock << "\n"; + std::cout << " Max block dimensions: [ " << props.maxThreadsDim[0] << ", " << props.maxThreadsDim[1] << ", " << props.maxThreadsDim[2] << " ]" << "\n"; + std::cout << " Max grid dimensions: [ " << props.maxGridSize[0] << ", " << props.maxGridSize[1] << ", " << props.maxGridSize[2] << " ]" << "\n"; + std::cout << "\n"; + + return 0; +} + diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/2 split/lib.cu" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/2 split/lib.cu" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/2 split/lib.cu" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/2 split/lib.cu" 2019-02-07 09:08:55.000000000 +0000 @@ -0,0 +1,13 @@ +#include +#include + +__global__ void kernel (void){ +} + +int do_cuda_stuff() { + kernel<<<1,1>>>(); + + printf("Hello, World!\n"); + return 0; +} + diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/2 split/main.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/2 split/main.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/2 split/main.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/2 split/main.cpp" 2019-02-07 09:08:55.000000000 +0000 @@ -0,0 +1,7 @@ +#include + +int do_cuda_stuff(); + +int main(int argc, char **argv) { + return do_cuda_stuff(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/2 split/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/2 split/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/2 split/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/2 split/meson.build" 2019-02-07 09:08:55.000000000 +0000 @@ -0,0 +1,7 @@ +project('simple', 'cuda', 'cpp') + +exe = executable('prog', 'main.cpp', 'lib.cu') +test('cudatest', exe) + +subdir('static') + diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/2 split/static/lib.cu" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/2 split/static/lib.cu" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/2 split/static/lib.cu" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/2 split/static/lib.cu" 2019-02-07 09:08:55.000000000 +0000 @@ -0,0 +1,13 @@ +#include +#include + +__global__ void kernel (void){ +} + +int do_cuda_stuff() { + kernel<<<1,1>>>(); + + printf("Hello, World!\n"); + return 0; +} + diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/2 split/static/libsta.cu" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/2 split/static/libsta.cu" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/2 split/static/libsta.cu" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/2 split/static/libsta.cu" 2019-02-07 09:08:55.000000000 +0000 @@ -0,0 +1,13 @@ +#include +#include + +__global__ void kernel (void){ +} + +int do_cuda_stuff() { + kernel<<<1,1>>>(); + + printf("Hello, World!\n"); + return 0; +} + diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/2 split/static/main_static.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/2 split/static/main_static.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/2 split/static/main_static.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/2 split/static/main_static.cpp" 2019-02-07 09:08:55.000000000 +0000 @@ -0,0 +1,7 @@ +#include + +int do_cuda_stuff(); + +int main(int argc, char **argv) { + return do_cuda_stuff(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/2 split/static/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/2 split/static/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/2 split/static/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/2 split/static/meson.build" 2019-02-07 09:08:55.000000000 +0000 @@ -0,0 +1,4 @@ +l = static_library('clib', 'lib.cu') +exe = executable('staexe', 'main_static.cpp', + link_with : l) +test('static Cuda test', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/3 cudamodule/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/3 cudamodule/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/3 cudamodule/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/3 cudamodule/meson.build" 2019-02-07 09:08:59.000000000 +0000 @@ -0,0 +1,16 @@ +project('cudamodule', 'cuda', version : '1.0.0') + +nvcc = meson.get_compiler('cuda') +cuda = import('unstable-cuda') + +arch_flags = cuda.nvcc_arch_flags(nvcc, 'Auto', detected: ['3.0']) +arch_readable = cuda.nvcc_arch_readable(nvcc, 'Auto', detected: ['3.0']) +driver_version = cuda.min_driver_version(nvcc) + +message('NVCC version: ' + nvcc.version()) +message('NVCC flags: ' + ' '.join(arch_flags)) +message('NVCC readable: ' + ' '.join(arch_readable)) +message('Driver version: >=' + driver_version) + +exe = executable('prog', 'prog.cu', cuda_args: arch_flags) +test('cudatest', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/3 cudamodule/prog.cu" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/3 cudamodule/prog.cu" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/3 cudamodule/prog.cu" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/3 cudamodule/prog.cu" 2019-02-07 09:08:59.000000000 +0000 @@ -0,0 +1,30 @@ +#include + +int main(int argc, char **argv) { + int cuda_devices = 0; + std::cout << "CUDA version: " << CUDART_VERSION << "\n"; + cudaGetDeviceCount(&cuda_devices); + if(cuda_devices == 0) { + std::cout << "No Cuda hardware found. Exiting.\n"; + return 0; + } + std::cout << "This computer has " << cuda_devices << " Cuda device(s).\n"; + cudaDeviceProp props; + cudaGetDeviceProperties(&props, 0); + std::cout << "Properties of device 0.\n\n"; + + std::cout << " Name: " << props.name << "\n"; + std::cout << " Global memory: " << props.totalGlobalMem << "\n"; + std::cout << " Shared memory: " << props.sharedMemPerBlock << "\n"; + std::cout << " Constant memory: " << props.totalConstMem << "\n"; + std::cout << " Block registers: " << props.regsPerBlock << "\n"; + + std::cout << " Warp size: " << props.warpSize << "\n"; + std::cout << " Threads per block: " << props.maxThreadsPerBlock << "\n"; + std::cout << " Max block dimensions: [ " << props.maxThreadsDim[0] << ", " << props.maxThreadsDim[1] << ", " << props.maxThreadsDim[2] << " ]" << "\n"; + std::cout << " Max grid dimensions: [ " << props.maxGridSize[0] << ", " << props.maxGridSize[1] << ", " << props.maxGridSize[2] << " ]" << "\n"; + std::cout << "\n"; + + return 0; +} + diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/4 shared/main.cu" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/4 shared/main.cu" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/4 shared/main.cu" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/4 shared/main.cu" 2019-02-28 20:43:18.000000000 +0000 @@ -0,0 +1,20 @@ +#include +#include +#include "shared/kernels.h" + + +int main(int argc, char **argv) { + int cuda_devices = 0; + cudaGetDeviceCount(&cuda_devices); + if(cuda_devices == 0) { + printf("No Cuda hardware found. Exiting.\n"); + return 0; + } + + if(run_tests() != 0){ + printf("CUDA tests failed! Exiting.\n"); + return 0; + } + + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/4 shared/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/4 shared/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/4 shared/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/4 shared/meson.build" 2019-02-28 20:43:18.000000000 +0000 @@ -0,0 +1,6 @@ +project('simple', 'cuda', version : '1.0.0') + +subdir('shared') + +exe = executable('prog', 'main.cu', dependencies: libkernels) +test('cudatest', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/4 shared/shared/kernels.cu" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/4 shared/shared/kernels.cu" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/4 shared/shared/kernels.cu" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/4 shared/shared/kernels.cu" 2019-02-28 20:43:18.000000000 +0000 @@ -0,0 +1,14 @@ +#include +#include +#include "kernels.h" + + +TAG_HIDDEN __global__ void kernel (void){ +} + +TAG_PUBLIC int run_tests(void) { + kernel<<<1,1>>>(); + + return (int)cudaDeviceSynchronize(); +} + diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/4 shared/shared/kernels.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/4 shared/shared/kernels.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/4 shared/shared/kernels.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/4 shared/shared/kernels.h" 2019-02-28 20:43:18.000000000 +0000 @@ -0,0 +1,86 @@ +/* Include Guard */ +#ifndef SHARED_KERNELS_H +#define SHARED_KERNELS_H + +/** + * Includes + */ + +#include + + +/** + * Defines + */ + +/** + * When building a library, it is a good idea to expose as few as possible + * internal symbols (functions, objects, data structures). Not only does it + * prevent users from relying on private portions of the library that are + * subject to change without any notice, but it can have performance + * advantages: + * + * - It can make shared libraries link faster at dynamic-load time. + * - It can make internal function calls faster by bypassing the PLT. + * + * Thus, the compilation should by default hide all symbols, while the API + * headers will explicitly mark public the few symbols the users are permitted + * to use with a PUBLIC tag. We also define a HIDDEN tag, since it may be + * required to explicitly tag certain C++ types as visible in order for + * exceptions to function correctly. + * + * Additional complexity comes from non-POSIX-compliant systems, which + * artificially impose a requirement on knowing whether we are building or + * using a DLL. + * + * The above commentary and below code is inspired from + * 'https://gcc.gnu.org/wiki/Visibility' + */ + +#if defined(_WIN32) || defined(__CYGWIN__) +# define TAG_ATTRIBUTE_EXPORT __declspec(dllexport) +# define TAG_ATTRIBUTE_IMPORT __declspec(dllimport) +# define TAG_ATTRIBUTE_HIDDEN +#elif __GNUC__ >= 4 +# define TAG_ATTRIBUTE_EXPORT __attribute__((visibility("default"))) +# define TAG_ATTRIBUTE_IMPORT __attribute__((visibility("default"))) +# define TAG_ATTRIBUTE_HIDDEN __attribute__((visibility("hidden"))) +#else +# define TAG_ATTRIBUTE_EXPORT +# define TAG_ATTRIBUTE_IMPORT +# define TAG_ATTRIBUTE_HIDDEN +#endif + +#if TAG_IS_SHARED +# if TAG_IS_BUILDING +# define TAG_PUBLIC TAG_ATTRIBUTE_EXPORT +# else +# define TAG_PUBLIC TAG_ATTRIBUTE_IMPORT +# endif +# define TAG_HIDDEN TAG_ATTRIBUTE_HIDDEN +#else +# define TAG_PUBLIC +# define TAG_HIDDEN +#endif +#define TAG_STATIC static + + + + +/* Extern "C" Guard */ +#ifdef __cplusplus +extern "C" { +#endif + + + +/* Function Prototypes */ +TAG_PUBLIC int run_tests(void); + + + +/* End Extern "C" and Include Guard */ +#ifdef __cplusplus +} +#endif +#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/4 shared/shared/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/4 shared/shared/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/4 shared/shared/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/4 shared/shared/meson.build" 2019-02-28 20:43:18.000000000 +0000 @@ -0,0 +1,5 @@ +libkernels = shared_library('kernels', 'kernels.cu', + cuda_args: ['-DTAG_IS_SHARED=1', '-DTAG_IS_BUILDING=1'], + gnu_symbol_visibility: 'hidden') +libkernels = declare_dependency(compile_args: ['-DTAG_IS_SHARED=1'], + link_with: libkernels) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/5 threads/main.cu" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/5 threads/main.cu" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/5 threads/main.cu" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/5 threads/main.cu" 2019-02-28 20:43:18.000000000 +0000 @@ -0,0 +1,20 @@ +#include +#include +#include "shared/kernels.h" + + +int main(int argc, char **argv) { + int cuda_devices = 0; + cudaGetDeviceCount(&cuda_devices); + if(cuda_devices == 0) { + printf("No Cuda hardware found. Exiting.\n"); + return 0; + } + + if(run_tests() != 0){ + printf("CUDA tests failed! Exiting.\n"); + return 0; + } + + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/5 threads/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/5 threads/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/5 threads/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/5 threads/meson.build" 2019-02-28 20:43:18.000000000 +0000 @@ -0,0 +1,7 @@ +project('simple', 'cuda', version : '1.0.0') + +subdir('shared') + +thread_dep = dependency('threads') +exe = executable('prog', 'main.cu', dependencies: [libkernels, thread_dep]) +test('cudatest', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/5 threads/shared/kernels.cu" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/5 threads/shared/kernels.cu" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/5 threads/shared/kernels.cu" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/5 threads/shared/kernels.cu" 2019-02-28 20:43:18.000000000 +0000 @@ -0,0 +1,14 @@ +#include +#include +#include "kernels.h" + + +TAG_HIDDEN __global__ void kernel (void){ +} + +TAG_PUBLIC int run_tests(void) { + kernel<<<1,1>>>(); + + return (int)cudaDeviceSynchronize(); +} + diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/5 threads/shared/kernels.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/5 threads/shared/kernels.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/5 threads/shared/kernels.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/5 threads/shared/kernels.h" 2019-02-28 20:43:18.000000000 +0000 @@ -0,0 +1,86 @@ +/* Include Guard */ +#ifndef SHARED_KERNELS_H +#define SHARED_KERNELS_H + +/** + * Includes + */ + +#include + + +/** + * Defines + */ + +/** + * When building a library, it is a good idea to expose as few as possible + * internal symbols (functions, objects, data structures). Not only does it + * prevent users from relying on private portions of the library that are + * subject to change without any notice, but it can have performance + * advantages: + * + * - It can make shared libraries link faster at dynamic-load time. + * - It can make internal function calls faster by bypassing the PLT. + * + * Thus, the compilation should by default hide all symbols, while the API + * headers will explicitly mark public the few symbols the users are permitted + * to use with a PUBLIC tag. We also define a HIDDEN tag, since it may be + * required to explicitly tag certain C++ types as visible in order for + * exceptions to function correctly. + * + * Additional complexity comes from non-POSIX-compliant systems, which + * artificially impose a requirement on knowing whether we are building or + * using a DLL. + * + * The above commentary and below code is inspired from + * 'https://gcc.gnu.org/wiki/Visibility' + */ + +#if defined(_WIN32) || defined(__CYGWIN__) +# define TAG_ATTRIBUTE_EXPORT __declspec(dllexport) +# define TAG_ATTRIBUTE_IMPORT __declspec(dllimport) +# define TAG_ATTRIBUTE_HIDDEN +#elif __GNUC__ >= 4 +# define TAG_ATTRIBUTE_EXPORT __attribute__((visibility("default"))) +# define TAG_ATTRIBUTE_IMPORT __attribute__((visibility("default"))) +# define TAG_ATTRIBUTE_HIDDEN __attribute__((visibility("hidden"))) +#else +# define TAG_ATTRIBUTE_EXPORT +# define TAG_ATTRIBUTE_IMPORT +# define TAG_ATTRIBUTE_HIDDEN +#endif + +#if TAG_IS_SHARED +# if TAG_IS_BUILDING +# define TAG_PUBLIC TAG_ATTRIBUTE_EXPORT +# else +# define TAG_PUBLIC TAG_ATTRIBUTE_IMPORT +# endif +# define TAG_HIDDEN TAG_ATTRIBUTE_HIDDEN +#else +# define TAG_PUBLIC +# define TAG_HIDDEN +#endif +#define TAG_STATIC static + + + + +/* Extern "C" Guard */ +#ifdef __cplusplus +extern "C" { +#endif + + + +/* Function Prototypes */ +TAG_PUBLIC int run_tests(void); + + + +/* End Extern "C" and Include Guard */ +#ifdef __cplusplus +} +#endif +#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/5 threads/shared/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/5 threads/shared/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/5 threads/shared/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/5 threads/shared/meson.build" 2019-02-28 20:43:18.000000000 +0000 @@ -0,0 +1,5 @@ +libkernels = shared_library('kernels', 'kernels.cu', + cuda_args: ['-DTAG_IS_SHARED=1', '-DTAG_IS_BUILDING=1'], + gnu_symbol_visibility: 'hidden') +libkernels = declare_dependency(compile_args: ['-DTAG_IS_SHARED=1'], + link_with: libkernels) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/6 std/main.cu" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/6 std/main.cu" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/6 std/main.cu" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/6 std/main.cu" 2019-09-28 23:52:33.000000000 +0000 @@ -0,0 +1,20 @@ +#include +#include + +auto cuda_devices() { + int result = 0; + cudaGetDeviceCount(&result); + return result; +} + + +int main() { + int n = cuda_devices(); + if (n == 0) { + std::cout << "No Cuda hardware found. Exiting.\n"; + return 0; + } + + std::cout << "Found " << n << "Cuda devices.\n"; + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/6 std/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/6 std/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/6 std/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/6 std/meson.build" 2019-09-28 23:52:33.000000000 +0000 @@ -0,0 +1,4 @@ +project('C++ std', 'cuda', version : '1.0.0', default_options : ['cuda_std=c++14']) + +exe = executable('prog', 'main.cu') +test('cudatest', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/7 static vs runtime/main.cu" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/7 static vs runtime/main.cu" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/7 static vs runtime/main.cu" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/7 static vs runtime/main.cu" 2019-09-28 23:52:33.000000000 +0000 @@ -0,0 +1,20 @@ +#include +#include + +int cuda_devices() { + int result = 0; + cudaGetDeviceCount(&result); + return result; +} + + +int main() { + int n = cuda_devices(); + if (n == 0) { + std::cout << "No Cuda hardware found. Exiting.\n"; + return 0; + } + + std::cout << "Found " << n << "Cuda devices.\n"; + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/7 static vs runtime/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/7 static vs runtime/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/7 static vs runtime/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/7 static vs runtime/meson.build" 2019-09-28 23:52:33.000000000 +0000 @@ -0,0 +1,4 @@ +project('static msvc runtime', 'cuda', version : '1.0.0', default_options : ['b_vscrt=mtd']) + +exe = executable('prog', 'main.cu') +test('cudatest', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/8 release/main.cu" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/8 release/main.cu" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/8 release/main.cu" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/8 release/main.cu" 2019-09-28 23:52:33.000000000 +0000 @@ -0,0 +1,20 @@ +#include +#include + +int cuda_devices() { + int result = 0; + cudaGetDeviceCount(&result); + return result; +} + + +int main() { + int n = cuda_devices(); + if (n == 0) { + std::cout << "No Cuda hardware found. Exiting.\n"; + return 0; + } + + std::cout << "Found " << n << "Cuda devices.\n"; + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/8 release/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/8 release/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/8 release/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/8 release/meson.build" 2019-09-28 23:52:33.000000000 +0000 @@ -0,0 +1,4 @@ +project('release', 'cuda', version : '1.0.0', default_options : ['buildtype=release']) + +exe = executable('prog', 'main.cu') +test('cudatest', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/9 optimize for space/main.cu" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/9 optimize for space/main.cu" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/9 optimize for space/main.cu" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/9 optimize for space/main.cu" 2019-09-28 23:52:33.000000000 +0000 @@ -0,0 +1,20 @@ +#include +#include + +int cuda_devices() { + int result = 0; + cudaGetDeviceCount(&result); + return result; +} + + +int main() { + int n = cuda_devices(); + if (n == 0) { + std::cout << "No Cuda hardware found. Exiting.\n"; + return 0; + } + + std::cout << "Found " << n << "Cuda devices.\n"; + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/9 optimize for space/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/9 optimize for space/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/cuda/9 optimize for space/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/cuda/9 optimize for space/meson.build" 2019-09-28 23:52:33.000000000 +0000 @@ -0,0 +1,4 @@ +project('optimize for space', 'cuda', version : '1.0.0', default_options : ['optimization=s']) + +exe = executable('prog', 'main.cu') +test('cudatest', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing/85 gtest dependency with version/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing/85 gtest dependency with version/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing/85 gtest dependency with version/meson.build" 2018-10-31 09:31:57.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing/85 gtest dependency with version/meson.build" 2019-04-17 08:08:43.000000000 +0000 @@ -1,3 +1,3 @@ project('gtest dependency with version', ['c', 'cpp']) # discovering gtest version is not yet implemented -dep = dependency('gtest', version: '>0') +dep = dependency('gtest', method: 'system', version: '>0') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing/89 link_with custom target/demo.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing/89 link_with custom target/demo.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing/89 link_with custom target/demo.c" 2018-10-31 09:31:57.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing/89 link_with custom target/demo.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -int func_in_foo(); - -int main(int argc, char **argv) { - return func_in_foo(); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing/89 link_with custom target/foo.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing/89 link_with custom target/foo.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing/89 link_with custom target/foo.c" 2018-10-31 09:31:57.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing/89 link_with custom target/foo.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -int func_in_foo() { - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing/89 link_with custom target/lib_generator.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing/89 link_with custom target/lib_generator.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing/89 link_with custom target/lib_generator.py" 2018-10-31 09:31:57.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing/89 link_with custom target/lib_generator.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -#!/usr/bin/env python3 - -# Mimic a binary that generates a static library - -import os -import subprocess -import sys - -if __name__ == '__main__': - if len(sys.argv) != 4: - print(sys.argv[0], 'compiler input_file output_file') - sys.exit(1) - compiler = sys.argv[1] - ifile = sys.argv[2] - ofile = sys.argv[3] - tmp = ifile + '.o' - if compiler.endswith('cl'): - subprocess.check_call([compiler, '/nologo', '/MDd', '/Fo' + tmp, '/c', ifile]) - subprocess.check_call(['lib', '/nologo', '/OUT:' + ofile, tmp]) - else: - subprocess.check_call([compiler, '-c', ifile, '-o', tmp]) - subprocess.check_call(['ar', 'csr', ofile, tmp]) - -os.unlink(tmp) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing/89 link_with custom target/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing/89 link_with custom target/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing/89 link_with custom target/meson.build" 2018-10-31 09:31:57.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing/89 link_with custom target/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -project('link_with custom target', ['c']) - -# -# libraries created by a custom_target currently can be used in sources: (see -# common/100 manygen/ for an example of that), but not in link_with: -# - -lib_generator = find_program('lib_generator.py') - -cc = meson.get_compiler('c').cmd_array().get(-1) - -libfoo_target = custom_target( - 'libfoo', - input: ['foo.c'], - output: ['libfoo.a'], - command: [lib_generator, cc, '@INPUT@', '@OUTPUT@'] -) - -libfoo = declare_dependency( - link_with: libfoo_target, -) - -executable('demo', ['demo.c'], dependencies: [libfoo]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing/89 subproj not-found dep/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing/89 subproj not-found dep/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing/89 subproj not-found dep/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing/89 subproj not-found dep/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +project('dep-test') +missing = dependency('', fallback: ['somesubproj', 'notfound_dep'], required: true) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing/89 subproj not-found dep/subprojects/somesubproj/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing/89 subproj not-found dep/subprojects/somesubproj/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing/89 subproj not-found dep/subprojects/somesubproj/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing/89 subproj not-found dep/subprojects/somesubproj/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +project('dep', 'c') + +notfound_dep = dependency('', required : false) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing/90 invalid configure file/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing/90 invalid configure file/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing/90 invalid configure file/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing/90 invalid configure file/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,9 @@ +project('invalid configura file') + +configure_file( + configuration : configuration_data(), + input : 'input', + output : 'output', + install_dir : '', + install : true, +) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing/90 subproj not-found dep/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing/90 subproj not-found dep/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing/90 subproj not-found dep/meson.build" 2018-12-09 14:27:16.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing/90 subproj not-found dep/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -project('dep-test') -missing = dependency('', fallback: ['somesubproj', 'notfound_dep'], required: true) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing/90 subproj not-found dep/subprojects/somesubproj/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing/90 subproj not-found dep/subprojects/somesubproj/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing/90 subproj not-found dep/subprojects/somesubproj/meson.build" 2018-12-09 14:27:16.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing/90 subproj not-found dep/subprojects/somesubproj/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -project('dep', 'c') - -notfound_dep = dependency('', required : false) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing/92 missing pch file/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing/92 missing pch file/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing/92 missing pch file/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing/92 missing pch file/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +project('pch test', 'c') +exe = executable('prog', 'prog.c', +c_pch : ['pch/prog_pch.c', 'pch/prog.h']) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing/92 missing pch file/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing/92 missing pch file/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing/92 missing pch file/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing/92 missing pch file/prog.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +int main(int argc, char **argv) { + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing/93 pch source different folder/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing/93 pch source different folder/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing/93 pch source different folder/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing/93 pch source different folder/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +project('pch', 'c') +# It is not allowed to have the PCH implementation in a different +# folder than the header. +exe = executable('prog', 'prog.c', + c_pch : ['include/pch.h', 'src/pch.c']) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing/93 pch source different folder/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing/93 pch source different folder/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing/93 pch source different folder/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing/93 pch source different folder/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1 @@ +int main() {} \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing/94 vala without c/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing/94 vala without c/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing/94 vala without c/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing/94 vala without c/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +project('vala without c') +add_languages('vala') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing/95 unknown config tool/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing/95 unknown config tool/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing/95 unknown config tool/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing/95 unknown config tool/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +project('no-such-config-tool') +dependency('no-such-config-tool', method:'config-tool') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing/96 custom target install data/Info.plist.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing/96 custom target install data/Info.plist.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing/96 custom target install data/Info.plist.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing/96 custom target install data/Info.plist.cpp" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +Some data which gets processed before installation diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing/96 custom target install data/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing/96 custom target install data/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing/96 custom target install data/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing/96 custom target install data/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,11 @@ +project('custom target install data') + +preproc = find_program('preproc.py') + +t = custom_target('Info.plist', + command: [preproc, '@INPUT@', '@OUTPUT@'], + input: 'Info.plist.cpp', + output: 'Info.plist', +) + +install_data(t) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing/96 custom target install data/preproc.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing/96 custom target install data/preproc.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing/96 custom target install data/preproc.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing/96 custom target install data/preproc.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 + +import sys + +if len(sys.argv) != 3: + print(sys.argv[0], '', '') + +inf = sys.argv[1] +outf = sys.argv[2] + +with open(outf, 'wb') as o: + with open(inf, 'rb') as i: + o.write(i.read()) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing build/2 hidden symbol/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing build/2 hidden symbol/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing build/2 hidden symbol/meson.build" 2018-12-09 16:32:33.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing build/2 hidden symbol/meson.build" 2019-08-16 20:38:56.000000000 +0000 @@ -1,10 +1,7 @@ project('hidden symbol', 'c') if host_machine.system() == 'windows' or host_machine.system() == 'cygwin' - cc = meson.get_compiler('c') - if cc.get_id() == 'gcc' - error('MESON_SKIP_TEST -fvisibility=hidden does not work on MinGW or Cygwin.') - endif + error('MESON_SKIP_TEST -fvisibility=hidden does not work for PE files.') endif l = shared_library('bob', 'bob.c', diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing build/3 pch disabled/c/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing build/3 pch disabled/c/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing build/3 pch disabled/c/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing build/3 pch disabled/c/meson.build" 2019-02-07 09:08:55.000000000 +0000 @@ -0,0 +1,2 @@ +exe = executable('prog', 'prog.c', +c_pch : ['pch/prog_pch.c', 'pch/prog.h']) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing build/3 pch disabled/c/pch/prog.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing build/3 pch disabled/c/pch/prog.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing build/3 pch disabled/c/pch/prog.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing build/3 pch disabled/c/pch/prog.h" 2019-02-07 09:08:55.000000000 +0000 @@ -0,0 +1 @@ +#include diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing build/3 pch disabled/c/pch/prog_pch.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing build/3 pch disabled/c/pch/prog_pch.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing build/3 pch disabled/c/pch/prog_pch.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing build/3 pch disabled/c/pch/prog_pch.c" 2019-02-07 09:08:55.000000000 +0000 @@ -0,0 +1,5 @@ +#if !defined(_MSC_VER) +#error "This file is only for use with MSVC." +#endif + +#include "prog.h" diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing build/3 pch disabled/c/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing build/3 pch disabled/c/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing build/3 pch disabled/c/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing build/3 pch disabled/c/prog.c" 2019-02-07 09:08:55.000000000 +0000 @@ -0,0 +1,10 @@ +// No includes here, they need to come from the PCH + +void func() { + fprintf(stdout, "This is a function that fails if stdio is not #included.\n"); +} + +int main(int argc, char **argv) { + return 0; +} + diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing build/3 pch disabled/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing build/3 pch disabled/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing build/3 pch disabled/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing build/3 pch disabled/meson.build" 2019-08-16 20:38:56.000000000 +0000 @@ -0,0 +1,5 @@ +# Disable PCH usage to make sure backends respect this setting. +# Since the .c file requires PCH usage (it does not include necessary +# headers itself), the build should fail. +project('pch test', 'c', default_options: ['b_pch=false']) +subdir('c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing test/4 hard error/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing test/4 hard error/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing test/4 hard error/main.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing test/4 hard error/main.c" 2019-03-06 20:48:10.000000000 +0000 @@ -0,0 +1,3 @@ +int main(void) { + return 99; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing test/4 hard error/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing test/4 hard error/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing test/4 hard error/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing test/4 hard error/meson.build" 2019-08-16 20:39:00.000000000 +0000 @@ -0,0 +1,4 @@ +project('trivial', 'c') + +# Exit code 99 even overrides should_fail +test('My Test', executable('main', 'main.c'), should_fail: true) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing test/5 tap tests/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing test/5 tap tests/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing test/5 tap tests/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing test/5 tap tests/meson.build" 2019-08-16 20:39:03.000000000 +0000 @@ -0,0 +1,6 @@ +project('test features', 'c') + +tester = executable('tester', 'tester.c') +test('nonzero return code', tester, args : [], protocol: 'tap') +test('missing test', tester, args : ['1..1'], protocol: 'tap') +test('incorrect skip', tester, args : ['1..1 # skip\nok 1'], protocol: 'tap') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing test/5 tap tests/tester.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing test/5 tap tests/tester.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing test/5 tap tests/tester.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing test/5 tap tests/tester.c" 2019-03-06 20:48:10.000000000 +0000 @@ -0,0 +1,10 @@ +#include + +int main(int argc, char **argv) { + if (argc != 2) { + fprintf(stderr, "Incorrect number of arguments, got %i\n", argc); + return 1; + } + puts(argv[1]); + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing test/6 xpass/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing test/6 xpass/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing test/6 xpass/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing test/6 xpass/meson.build" 2019-08-16 20:39:03.000000000 +0000 @@ -0,0 +1,4 @@ +project('unexpected pass', 'c') + +test('should_fail_but_does_not', executable('xpass', 'xpass.c'), + should_fail: true) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing test/6 xpass/xpass.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing test/6 xpass/xpass.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/failing test/6 xpass/xpass.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/failing test/6 xpass/xpass.c" 2019-04-21 19:25:09.000000000 +0000 @@ -0,0 +1 @@ +int main(int argc, char **argv) { return 0; } diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/10 find library/gzip.f90" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/10 find library/gzip.f90" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/10 find library/gzip.f90" 2018-08-25 08:05:43.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/10 find library/gzip.f90" 2019-02-07 09:08:59.000000000 +0000 @@ -1,32 +1,32 @@ module gzip - interface - function gzopen(path, mode) bind(C) - use iso_c_binding, only: c_char, c_ptr - implicit none - character(c_char), intent(in) :: path(*), mode(*) - type(c_ptr) :: gzopen - end function gzopen - end interface - - interface - function gzwrite(file, buf, len) bind(C) - use iso_c_binding, only: c_int, c_ptr - implicit none - type(c_ptr), value, intent(in) :: file - type(*), intent(in) :: buf - integer(c_int), value, intent(in) :: len - integer(c_int) :: gzwrite - end function gzwrite - end interface - - interface - function gzclose(file) bind(C) - use iso_c_binding, only: c_int, c_ptr - implicit none - type(c_ptr), value, intent(in) :: file - integer(c_int) :: gzclose - end function gzclose - end interface +use iso_c_binding, only: c_char, c_ptr, c_int +implicit none + +interface +type(c_ptr) function gzopen(path, mode) bind(C) +import c_char, c_ptr + +character(kind=c_char), intent(in) :: path(*), mode(*) +end function gzopen +end interface + +interface +integer(c_int) function gzwrite(file, buf, len) bind(C) +import c_int, c_ptr, c_char + +type(c_ptr), value, intent(in) :: file +character(kind=c_char), intent(in) :: buf +integer(c_int), value, intent(in) :: len +end function gzwrite +end interface + +interface +integer(c_int) function gzclose(file) bind(C) +import c_int, c_ptr + +type(c_ptr), value, intent(in) :: file +end function gzclose +end interface end module gzip diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/10 find library/main.f90" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/10 find library/main.f90" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/10 find library/main.f90" 2018-08-25 08:05:43.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/10 find library/main.f90" 2019-02-07 09:08:59.000000000 +0000 @@ -1,40 +1,38 @@ -program main - use iso_c_binding, only: c_int, c_char, c_null_char, c_ptr - use gzip, only: gzopen, gzwrite, gzclose +use iso_fortran_env, only: stderr=>error_unit +use iso_c_binding, only: c_int, c_char, c_null_char, c_ptr +use gzip, only: gzopen, gzwrite, gzclose + +implicit none + +character(kind=c_char,len=*), parameter :: path = c_char_"test.gz"//c_null_char +character(kind=c_char,len=*), parameter :: mode = c_char_"wb9"//c_null_char +integer(c_int), parameter :: buffer_size = 512 + +type(c_ptr) :: file +character(kind=c_char, len=buffer_size) :: buffer +integer(c_int) :: ret +integer :: i + +! open file +file = gzopen(path, mode) + +! fill buffer with data +do i=1,buffer_size/4 + write(buffer(4*(i-1)+1:4*i), '(i3.3, a)') i, new_line('') +end do +ret = gzwrite(file, buffer, buffer_size) +if (ret /= buffer_size) then + write(stderr,'(a, i3, a, i3, a)') 'Error: ', ret, ' / ', buffer_size, & + ' bytes written.' + stop 1 +end if + +! close file +ret = gzclose(file) +if (ret /= 0) then + write(stderr,*) 'Error: failure to close file with error code ', ret + stop 1 +end if - implicit none - - character(kind=c_char,len=*), parameter :: path = & - c_char_"test.gz"//c_null_char - character(kind=c_char,len=*), parameter :: mode = & - c_char_"wb9"//c_null_char - integer(c_int), parameter :: buffer_size = 512 - - type(c_ptr) :: file - character(len=buffer_size) :: buffer - integer(c_int) :: ret - integer :: i - - ! open file - file = gzopen(path, mode) - - ! fill buffer with data - do i=1,buffer_size/4 - write(buffer(4*(i-1)+1:4*i), '(i3.3, a)') i, new_line('') - end do - ret = gzwrite(file, buffer, buffer_size) - if (ret.ne.buffer_size) then - write(*,'(a, i3, a, i3, a)') 'Error: ', ret, ' / ', buffer_size, & - ' bytes written.' - stop 1 - end if - - ! close file - ret = gzclose(file) - if (ret.ne.0) then - print *, 'Error: failure to close file with error code ', ret - stop 1 - end if - -end program main +end program diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/10 find library/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/10 find library/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/10 find library/meson.build" 2018-12-09 16:35:15.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/10 find library/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -1,9 +1,13 @@ project('find fortran library', 'fortran') -fortranc = meson.get_compiler('fortran') +fc = meson.get_compiler('fortran') sources = ['main.f90', 'gzip.f90'] -zlib = fortranc.find_library('z') +zlib = fc.find_library('z', required: false) + +if not zlib.found() + error('MESON_SKIP_TEST: Z library not available.') +endif exe = executable('zlibtest', sources, dependencies : zlib) test('testzlib', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/11 compiles links runs/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/11 compiles links runs/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/11 compiles links runs/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/11 compiles links runs/meson.build" 2019-08-16 20:42:27.000000000 +0000 @@ -0,0 +1,20 @@ +project('compiles_links_runs', 'fortran') + +fc = meson.get_compiler('fortran') + +code = '''error stop 123; end''' + +if not fc.compiles(code) + error('Fortran 2008 code failed to compile') +endif + +if not fc.links(code) + error('Fortran 2008 code failed to link') +endif + +if fc.run(code).returncode() != 123 + error('Fortran 2008 code failed to run') +endif + + + diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/12 submodule/a1.f90" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/12 submodule/a1.f90" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/12 submodule/a1.f90" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/12 submodule/a1.f90" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,25 @@ +module a1 +implicit none + +interface +module elemental real function pi2tau(pi) + real, intent(in) :: pi +end function pi2tau + +module real function get_pi() +end function get_pi +end interface + +end module a1 + +program hierN + +use a1 + +pi = get_pi() + +tau = pi2tau(pi) + +print *,'pi=',pi,'tau=',tau + +end program diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/12 submodule/a2.f90" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/12 submodule/a2.f90" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/12 submodule/a2.f90" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/12 submodule/a2.f90" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,10 @@ +! testing no space between submodule() +submodule(a1) a2 + +contains + +module procedure pi2tau + pi2tau = 2*pi +end procedure pi2tau + +end submodule a2 diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/12 submodule/a3.f90" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/12 submodule/a3.f90" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/12 submodule/a3.f90" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/12 submodule/a3.f90" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,13 @@ +! submodule (bogus) foo +! testing don't detect commented submodule + +submodule (a1:a2) a3 ! testing inline comment + +contains + +module procedure get_pi + get_pi = 4.*atan(1.) +end procedure get_pi + + +end submodule a3 diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/12 submodule/child.f90" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/12 submodule/child.f90" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/12 submodule/child.f90" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/12 submodule/child.f90" 2019-08-25 19:17:02.000000000 +0000 @@ -0,0 +1,14 @@ +submodule (parent) parent + +contains + +module procedure pi2tau + pi2tau = 2*pi +end procedure pi2tau + +module procedure good +print *, 'Good!' +end procedure good + +end submodule parent + diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/12 submodule/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/12 submodule/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/12 submodule/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/12 submodule/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,8 @@ +project('submodule single level', 'fortran', + meson_version: '>= 0.50.0') + +hier2 = executable('single', 'parent.f90', 'child.f90') +test('single-level hierarchy', hier2) + +hierN = executable('multi', 'a1.f90', 'a2.f90', 'a3.f90') +test('multi-level hierarchy', hierN) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/12 submodule/parent.f90" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/12 submodule/parent.f90" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/12 submodule/parent.f90" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/12 submodule/parent.f90" 2019-08-25 19:17:02.000000000 +0000 @@ -0,0 +1,25 @@ +module parent +real, parameter :: pi = 4.*atan(1.) +real :: tau + +interface +module elemental real function pi2tau(pi) + real, intent(in) :: pi +end function pi2tau + +module subroutine good() +end subroutine good +end interface + +end module parent + + +use parent + +tau = pi2tau(pi) + +print *,'pi=',pi, 'tau=', tau + +call good() + +end program diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/13 coarray/main.f90" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/13 coarray/main.f90" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/13 coarray/main.f90" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/13 coarray/main.f90" 2019-02-28 20:43:18.000000000 +0000 @@ -0,0 +1,9 @@ +implicit none + +if (this_image() == 1) print *, 'number of Fortran coarray images:', num_images() + +sync all ! semaphore, ensures message above is printed at top. + +print *, 'Process ', this_image() + +end program diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/13 coarray/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/13 coarray/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/13 coarray/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/13 coarray/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,26 @@ +project('Fortran coarray', 'fortran', + meson_version: '>=0.50') + +fc = meson.get_compiler('fortran') +fcid = fc.get_id() + +if ['pgi', 'flang'].contains(fcid) + error('MESON_SKIP_TEST: At least through PGI 19.4 and Flang 7.1 do not support Fortran Coarrays.') +endif + +# coarray is required because single-image fallback is an intrinsic feature +coarray = dependency('coarray') + +# check coarray, because user might not have all the library stack installed correctly +# for example, conflicting library/compiler versions on PATH +# this has to invoke a run of "sync all" to verify the MPI stack is functioning, +# particularly for dynamic linking +coarray_ok = fc.run('sync all; end', dependencies: coarray, name: 'Coarray link & run').returncode() == 0 +if not coarray_ok + error('MESON_SKIP_TEST: The coarray stack (including MPI) did not link correctly so that a simple test could run.') +endif + +exe = executable('hello', 'main.f90', + dependencies : coarray) + +test('Coarray hello world', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/14 fortran links c/clib.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/14 fortran links c/clib.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/14 fortran links c/clib.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/14 fortran links c/clib.c" 2019-05-05 19:11:16.000000000 +0000 @@ -0,0 +1,7 @@ +#include + +void hello(void){ + + printf("hello from C\n"); + +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/14 fortran links c/clib.def" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/14 fortran links c/clib.def" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/14 fortran links c/clib.def" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/14 fortran links c/clib.def" 2019-05-22 21:53:22.000000000 +0000 @@ -0,0 +1,2 @@ +EXPORTS + hello diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/14 fortran links c/f_call_c.f90" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/14 fortran links c/f_call_c.f90" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/14 fortran links c/f_call_c.f90" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/14 fortran links c/f_call_c.f90" 2019-05-05 19:11:16.000000000 +0000 @@ -0,0 +1,10 @@ +implicit none + +interface +subroutine hello() bind (c) +end subroutine hello +end interface + +call hello() + +end program diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/14 fortran links c/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/14 fortran links c/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/14 fortran links c/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/14 fortran links c/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,15 @@ +project('Fortran calling C', 'fortran', 'c', + meson_version: '>= 0.51.0', + default_options : ['default_library=static']) + +ccid = meson.get_compiler('c').get_id() +if ccid == 'msvc' or ccid == 'clang-cl' + error('MESON_SKIP_TEST: MSVC and GCC do not interoperate like this.') +endif + +c_lib = library('clib', 'clib.c', vs_module_defs : 'clib.def') + +f_call_c = executable('f_call_c', 'f_call_c.f90', + link_with: c_lib, + link_language: 'fortran') +test('Fortran calling C', f_call_c) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/15 include/inc1.f90" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/15 include/inc1.f90" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/15 include/inc1.f90" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/15 include/inc1.f90" 2019-06-27 16:43:00.000000000 +0000 @@ -0,0 +1,5 @@ + +real :: pi = 4.*atan(1.) +real :: tau + +include "inc2.f90" ! testing inline comment diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/15 include/inc2.f90" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/15 include/inc2.f90" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/15 include/inc2.f90" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/15 include/inc2.f90" 2019-04-17 08:08:43.000000000 +0000 @@ -0,0 +1,2 @@ + +tau = 2*pi diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/15 include/include_hierarchy.f90" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/15 include/include_hierarchy.f90" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/15 include/include_hierarchy.f90" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/15 include/include_hierarchy.f90" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,8 @@ + +implicit none + +include "inc1.f90" + +print *, '2*pi:', tau + +end program diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/15 include/include_syntax.f90" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/15 include/include_syntax.f90" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/15 include/include_syntax.f90" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/15 include/include_syntax.f90" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,23 @@ +implicit none + +integer :: x, y + +x = 1 +y = 0 + +! include "timestwo.f90" + +include "timestwo.f90" ! inline comment check +if (x/=2) error stop 'failed on first include' + +! leading space check + include 'timestwo.f90' +if (x/=4) error stop 'failed on second include' + +! Most Fortran compilers can't handle the non-standard #include, +! including (ha!) Flang, Gfortran, Ifort and PGI. +! #include "timestwo.f90" + +print *, 'OK: Fortran include tests: x=',x + +end program \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/15 include/include_tests.f90" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/15 include/include_tests.f90" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/15 include/include_tests.f90" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/15 include/include_tests.f90" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,24 @@ +implicit none + +integer :: x, y + +x = 1 +y = 0 + +! include "timestwo.f90" + +! double quote and inline comment check +include "timestwo.f90" ! inline comment check +if (x/=2) error stop 'failed on first include' + +! leading space and single quote check + include 'timestwo.f90' +if (x/=4) error stop 'failed on second include' + +! Most Fortran compilers can't handle the non-standard #include, +! including (ha!) Flang, Gfortran, Ifort and PGI. +! #include "timestwo.f90" + +print *, 'OK: Fortran include tests: x=',x + +end program \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/15 include/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/15 include/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/15 include/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/15 include/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,8 @@ +project('Inclusive', 'fortran', + meson_version: '>= 0.51.1') + +hier_exe = executable('include_hierarchy', 'include_hierarchy.f90') +test('Fortran include file hierarchy', hier_exe) + +syntax_exe = executable('include_syntax', 'include_syntax.f90') +test('Fortran include file syntax', syntax_exe) \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/15 include/timestwo.f90" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/15 include/timestwo.f90" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/15 include/timestwo.f90" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/15 include/timestwo.f90" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +x = 2*x +y = y+1 \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/16 openmp/main.f90" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/16 openmp/main.f90" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/16 openmp/main.f90" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/16 openmp/main.f90" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,17 @@ +use, intrinsic :: iso_fortran_env, only: stderr=>error_unit +use omp_lib, only: omp_get_max_threads +implicit none + +integer :: N, ierr +character(80) :: buf ! can't be allocatable in this use case. Just set arbitrarily large. + +call get_environment_variable('OMP_NUM_THREADS', buf, status=ierr) +if (ierr/=0) error stop 'environment variable OMP_NUM_THREADS could not be read' +read(buf,*) N + +if (omp_get_max_threads() /= N) then + write(stderr, *) 'Max Fortran threads: ', omp_get_max_threads(), '!=', N + error stop +endif + +end program diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/16 openmp/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/16 openmp/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/16 openmp/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/16 openmp/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,34 @@ +# This test is complementary to and extends "common/190 openmp" so that +# we can examine more compilers and options than would be warranted in +# the common test where C/C++ must also be handled. +project('openmp', 'fortran', + meson_version: '>= 0.46') + + +fc = meson.get_compiler('fortran') +if fc.get_id() == 'gcc' and fc.version().version_compare('<4.2.0') + error('MESON_SKIP_TEST gcc is too old to support OpenMP.') +endif +if host_machine.system() == 'darwin' + error('MESON_SKIP_TEST macOS does not support OpenMP.') +endif + +openmp = dependency('openmp') + +env = environment() +env.set('OMP_NUM_THREADS', '2') + +exef = executable('exef', + 'main.f90', + dependencies : [openmp]) +test('OpenMP Fortran', exef, env : env) + +openmp_f = dependency('openmp', language : 'fortran') +exe_f = executable('exe_f', + 'main.f90', + dependencies : [openmp_f]) +test('OpenMP Fortran-specific', exe_f, env : env) + + +# Check we can apply a version constraint +dependency('openmp', version: '>=@0@'.format(openmp.version())) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/1 basic/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/1 basic/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/1 basic/meson.build" 2018-12-09 16:35:05.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/1 basic/meson.build" 2019-08-16 20:42:16.000000000 +0000 @@ -1,7 +1,13 @@ project('simple fortran', 'fortran') -add_global_arguments('-fbounds-check', language : 'fortran') +fc = meson.get_compiler('fortran') +if fc.get_id() == 'gcc' + add_global_arguments('-fbounds-check', language : 'fortran') +endif + +args = fc.first_supported_argument(['-ffree-form', '-free', '/free']) +assert(args != [], 'No arguments found?') e = executable('simple', 'simple.f90', - fortran_args : '-ffree-form') + fortran_args : args) test('Simple Fortran', e) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/2 modules/comment_mod.f90" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/2 modules/comment_mod.f90" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/2 modules/comment_mod.f90" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/2 modules/comment_mod.f90" 2019-06-27 16:43:00.000000000 +0000 @@ -0,0 +1,6 @@ +module line ! inline comment +implicit none + +real :: length + +end module line diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/2 modules/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/2 modules/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/2 modules/meson.build" 2018-12-09 16:35:05.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/2 modules/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -1,4 +1,8 @@ -project('modules', 'fortran') +project('modules', 'fortran', + default_options : ['default_library=static']) -e = executable('modprog', 'stuff.f90', 'prog.f90') +commented = library('commented', 'comment_mod.f90') + +e = executable('modprog', 'mymod.f90', 'prog.f90', + link_with: commented) test('moduletest', e) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/2 modules/mymod.f90" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/2 modules/mymod.f90" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/2 modules/mymod.f90" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/2 modules/mymod.f90" 2019-08-25 19:17:02.000000000 +0000 @@ -0,0 +1,8 @@ +! module circle to be sure module regex doesn't allow commented modules + +module circle +implicit none + +real, parameter :: pi = 4.*atan(1.) +real :: radius +end module circle diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/2 modules/prog.f90" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/2 modules/prog.f90" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/2 modules/prog.f90" 2017-01-04 21:36:19.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/2 modules/prog.f90" 2019-06-27 16:43:00.000000000 +0000 @@ -1,7 +1,11 @@ -PROGRAM prog +use circle, only: pi +use line, only: length +implicit none -use Circle -IMPLICIT NONE +print *,'pi=',pi -END PROGRAM prog +length = pi +print *, length + +end program diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/2 modules/stuff.f90" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/2 modules/stuff.f90" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/2 modules/stuff.f90" 2017-01-04 21:36:19.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/2 modules/stuff.f90" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -MODULE Circle - REAL, PARAMETER :: Pi = 3.1415927 - REAL :: radius -END MODULE Circle - diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/3 module procedure/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/3 module procedure/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/3 module procedure/meson.build" 2018-12-09 16:35:05.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/3 module procedure/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -1,4 +1,5 @@ -project('use in same file', 'fortran') +project('Fortran 2003 use statement, in same file', 'fortran', + meson_version: '>= 0.50.0') -e = executable('prog', 'prog.f90') -test('simple', e) +e = executable('use_syntax', 'use_syntax.f90') +test('Fortran 2003 use syntax', e) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/3 module procedure/prog.f90" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/3 module procedure/prog.f90" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/3 module procedure/prog.f90" 2016-01-23 18:52:39.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/3 module procedure/prog.f90" 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -MODULE Circle - REAL, PARAMETER :: Pi = 3.1415927 - REAL :: radius - INTERFACE DEFAULT - MODULE PROCEDURE func - END INTERFACE - CONTAINS - FUNCTION func() - func = 0 - END FUNCTION -END MODULE Circle - -PROGRAM PROG - print *, "Module procedure is working." -END PROGRAM PROG diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/3 module procedure/use_syntax.f90" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/3 module procedure/use_syntax.f90" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/3 module procedure/use_syntax.f90" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/3 module procedure/use_syntax.f90" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,31 @@ +module circle +implicit none + +integer :: x +real :: radius + +interface default + module procedure timestwo +end interface + +contains + +elemental integer function timestwo(x) result(y) + integer, intent(in) :: x + y = 2*x +end function +end module circle + +program prog + +use, non_intrinsic :: circle, only: timestwo, x + +implicit none + +x = 3 + +if (timestwo(x) /= 6) error stop 'fortran module procedure problem' + +print *,'OK: Fortran module procedure' + +end program prog diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/4 self dependency/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/4 self dependency/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/4 self dependency/meson.build" 2018-12-09 16:35:05.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/4 self dependency/meson.build" 2019-08-16 20:42:16.000000000 +0000 @@ -2,3 +2,7 @@ e = executable('selfdep', 'selfdep.f90') test('selfdep', e) + +library('selfmod', 'src/selfdep_mod.f90') + +subproject('sub1') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/4 self dependency/selfdep.f90" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/4 self dependency/selfdep.f90" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/4 self dependency/selfdep.f90" 2016-01-23 18:52:39.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/4 self dependency/selfdep.f90" 2019-02-07 09:08:59.000000000 +0000 @@ -1,11 +1,18 @@ -MODULE Circle - REAL, PARAMETER :: Pi = 3.1415927 +MODULE geom + +type :: circle + REAL :: Pi = 4.*atan(1.) REAL :: radius -END MODULE Circle +end type circle +END MODULE geom PROGRAM prog -use Circle +use geom, only : circle IMPLICIT NONE +type(circle) :: ell + +ell%radius = 3. + END PROGRAM prog diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/4 self dependency/src/selfdep_mod.f90" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/4 self dependency/src/selfdep_mod.f90" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/4 self dependency/src/selfdep_mod.f90" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/4 self dependency/src/selfdep_mod.f90" 2019-02-28 20:43:18.000000000 +0000 @@ -0,0 +1,6 @@ +module a +end module a + +module b +use a +end module b diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/4 self dependency/subprojects/sub1/main.f90" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/4 self dependency/subprojects/sub1/main.f90" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/4 self dependency/subprojects/sub1/main.f90" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/4 self dependency/subprojects/sub1/main.f90" 2019-02-28 20:43:18.000000000 +0000 @@ -0,0 +1,6 @@ +module a +end + +program b + use a +end diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/4 self dependency/subprojects/sub1/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/4 self dependency/subprojects/sub1/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/4 self dependency/subprojects/sub1/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/4 self dependency/subprojects/sub1/meson.build" 2019-02-28 20:43:18.000000000 +0000 @@ -0,0 +1,3 @@ +project('subproject self-def', 'fortran') + +library('subself', 'main.f90') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/5 static/main.f90" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/5 static/main.f90" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/5 static/main.f90" 2017-01-04 21:36:19.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/5 static/main.f90" 2019-02-07 09:08:59.000000000 +0000 @@ -1,6 +1,6 @@ -program hello - use static_hello - implicit none - call static_say_hello() -end program hello +use static_hello +implicit none + +call static_say_hello() +end program diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/5 static/static_hello.f90" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/5 static/static_hello.f90" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/5 static/static_hello.f90" 2017-01-04 21:36:19.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/5 static/static_hello.f90" 2019-02-07 09:08:59.000000000 +0000 @@ -1,17 +1,17 @@ module static_hello - implicit none +implicit none - private - public :: static_say_hello +private +public :: static_say_hello - interface static_say_hello - module procedure say_hello - end interface static_say_hello +interface static_say_hello + module procedure say_hello +end interface static_say_hello contains - subroutine say_hello - print *, "Static library called." - end subroutine say_hello +subroutine say_hello + print *, "Static library called." +end subroutine say_hello end module static_hello diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/6 dynamic/dynamic.f90" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/6 dynamic/dynamic.f90" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/6 dynamic/dynamic.f90" 2017-01-04 21:36:19.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/6 dynamic/dynamic.f90" 2019-02-07 09:08:59.000000000 +0000 @@ -1,17 +1,17 @@ module dynamic - implicit none +implicit none - private - public :: hello +private +public :: hello - interface hello - module procedure say - end interface hello +interface hello + module procedure say +end interface hello contains - subroutine say - print *, "Hello, hello..." - end subroutine say +subroutine say + print *, "Hello from shared library." +end subroutine say end module dynamic diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/6 dynamic/main.f90" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/6 dynamic/main.f90" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/6 dynamic/main.f90" 2017-01-04 21:36:19.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/6 dynamic/main.f90" 2019-02-07 09:08:59.000000000 +0000 @@ -1,6 +1,5 @@ -program main - use dynamic - implicit none +use dynamic, only: hello +implicit none - call hello() -end program main +call hello() +end program diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/6 dynamic/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/6 dynamic/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/6 dynamic/meson.build" 2018-12-09 16:35:11.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/6 dynamic/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -1,5 +1,13 @@ project('dynamic_fortran', 'fortran') +fcid = meson.get_compiler('fortran').get_id() +if fcid == 'intel-cl' or (host_machine.system() == 'windows' and fcid == 'pgi') + error('MESON_SKIP_TEST: non-Gfortran Windows Fortran compilers do not do shared libraries in a Fortran standard way') + # !DEC$ ATTRIBUTES DLLEXPORT must be used! + # https://software.intel.com/en-us/node/535306 + # https://www.pgroup.com/resources/docs/19.4/x86/pgi-user-guide/index.htm#lib-dynlnk-bld-dll-fort +endif + dynamic = shared_library('dynamic', 'dynamic.f90') exe = executable('test_exe', 'main.f90', link_with : dynamic) test('dynamic-fortran', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/7 generated/prog.f90" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/7 generated/prog.f90" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/7 generated/prog.f90" 2017-05-17 21:09:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/7 generated/prog.f90" 2019-02-28 20:43:18.000000000 +0000 @@ -1,9 +1,7 @@ program prog - use mod2 - implicit none +use mod2 +implicit none - if (modval1 + modval2 /= 3) then - stop 1 - end if +if (modval1 + modval2 /= 3) stop 1 end program prog diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/8 module names/mod1.f90" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/8 module names/mod1.f90" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/8 module names/mod1.f90" 2017-05-26 22:31:04.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/8 module names/mod1.f90" 2019-02-07 09:08:59.000000000 +0000 @@ -1,6 +1,6 @@ module MyMod1 - implicit none +implicit none - integer, parameter :: myModVal1 = 1 +integer, parameter :: myModVal1 = 1 end module MyMod1 diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/8 module names/mod2.f90" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/8 module names/mod2.f90" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/8 module names/mod2.f90" 2017-05-26 22:31:04.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/8 module names/mod2.f90" 2019-02-07 09:08:59.000000000 +0000 @@ -1,6 +1,6 @@ module mymod2 - implicit none +implicit none - integer, parameter :: myModVal2 = 2 +integer, parameter :: myModVal2 = 2 end module mymod2 diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/8 module names/test.f90" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/8 module names/test.f90" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/8 module names/test.f90" 2017-05-26 22:31:04.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/8 module names/test.f90" 2019-06-27 16:43:00.000000000 +0000 @@ -1,7 +1,8 @@ -program test - use mymod1 - use MyMod2 +use mymod1 +use MyMod2 ! test inline comment - integer, parameter :: testVar = myModVal1 + myModVal2 +implicit none -end program test +integer, parameter :: testVar = myModVal1 + myModVal2 + +end program diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/9 cpp/fortran.f" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/9 cpp/fortran.f" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/9 cpp/fortran.f" 2018-08-25 08:05:43.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/9 cpp/fortran.f" 2019-02-07 09:08:59.000000000 +0000 @@ -1,5 +1,11 @@ function fortran() bind(C) - use, intrinsic :: iso_c_binding - real(kind=c_double) :: fortran - fortran = 2.0**rand(1) + use, intrinsic :: iso_c_binding, only: dp=>c_double + implicit none + + real(dp) :: r, fortran + + call random_number(r) + + fortran = 2._dp**r + end function fortran diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/9 cpp/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/9 cpp/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/fortran/9 cpp/meson.build" 2018-12-09 16:35:15.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/fortran/9 cpp/meson.build" 2019-08-16 20:42:25.000000000 +0000 @@ -1,12 +1,16 @@ project('C++ and FORTRAN', 'cpp', 'fortran') cpp = meson.get_compiler('cpp') +fc = meson.get_compiler('fortran') if cpp.get_id() == 'clang' error('MESON_SKIP_TEST Clang C++ does not find -lgfortran for some reason.') endif -fc = meson.get_compiler('fortran') +if build_machine.system() == 'windows' and cpp.get_id() != fc.get_id() + error('MESON_SKIP_TEST mixing gfortran with non-GNU C++ does not work.') +endif + link_with = [] if fc.get_id() == 'intel' link_with += fc.find_library('ifport') @@ -15,7 +19,7 @@ e = executable( 'cppfort', ['main.cpp', 'fortran.f'], - dependencies : [link_with], + dependencies : link_with, ) test('C++ FORTRAN', e) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/10 gtk-doc/doc/foobar1/foobar-docs.sgml" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/10 gtk-doc/doc/foobar1/foobar-docs.sgml" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/10 gtk-doc/doc/foobar1/foobar-docs.sgml" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/10 gtk-doc/doc/foobar1/foobar-docs.sgml" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,41 @@ + + +]> + + + Foolib Reference Manual + + for Foobar &version; + + + + Jonny + Example + +
+ unknown@example.com +
+
+
+
+ + 2015 + Foobar corporation holdings ltd + +
+ + + Foobar library + + + This part documents Foobar libs. + + + + + + + +
diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/10 gtk-doc/doc/foobar1/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/10 gtk-doc/doc/foobar1/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/10 gtk-doc/doc/foobar1/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/10 gtk-doc/doc/foobar1/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +gnome.gtkdoc('foobar', + src_dir : inc, + main_sgml : 'foobar-docs.sgml', + content_files : [docbook, version_xml], + install : true) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/10 gtk-doc/doc/foobar2/foobar-docs.sgml" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/10 gtk-doc/doc/foobar2/foobar-docs.sgml" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/10 gtk-doc/doc/foobar2/foobar-docs.sgml" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/10 gtk-doc/doc/foobar2/foobar-docs.sgml" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,41 @@ + + +]> + + + Foolib Reference Manual + + for Foobar &version; + + + + Jonny + Example + +
+ unknown@example.com +
+
+
+
+ + 2015 + Foobar corporation holdings ltd + +
+ + + Foobar library + + + This part documents Foobar libs. + + + + + + + +
diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/10 gtk-doc/doc/foobar2/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/10 gtk-doc/doc/foobar2/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/10 gtk-doc/doc/foobar2/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/10 gtk-doc/doc/foobar2/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,6 @@ +gnome.gtkdoc('foobar2', + src_dir : inc, + main_sgml : 'foobar-docs.sgml', + content_files : [docbook, version_xml], + install : true, + install_dir : 'foobar2') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/10 gtk-doc/doc/foobar3/foobar-docs.sgml" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/10 gtk-doc/doc/foobar3/foobar-docs.sgml" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/10 gtk-doc/doc/foobar3/foobar-docs.sgml" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/10 gtk-doc/doc/foobar3/foobar-docs.sgml" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,41 @@ + + +]> + + + Foolib Reference Manual + + for Foobar &version; + + + + Jonny + Example + +
+ unknown@example.com +
+
+
+
+ + 2015 + Foobar corporation holdings ltd + +
+ + + Foobar library + + + This part documents Foobar libs. + + + + + + + +
diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/10 gtk-doc/doc/foobar3/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/10 gtk-doc/doc/foobar3/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/10 gtk-doc/doc/foobar3/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/10 gtk-doc/doc/foobar3/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,6 @@ +gnome.gtkdoc('foobar', + module_version : '3.0', + src_dir : inc, + main_sgml : 'foobar-docs.sgml', + content_files : [docbook, version_xml], + install : true) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/10 gtk-doc/doc/foobar4/foobar-docs.sgml" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/10 gtk-doc/doc/foobar4/foobar-docs.sgml" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/10 gtk-doc/doc/foobar4/foobar-docs.sgml" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/10 gtk-doc/doc/foobar4/foobar-docs.sgml" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,41 @@ + + +]> + + + Foolib Reference Manual + + for Foobar &version; + + + + Jonny + Example + +
+ unknown@example.com +
+
+
+
+ + 2015 + Foobar corporation holdings ltd + +
+ + + Foobar library + + + This part documents Foobar libs. + + + + + + + +
diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/10 gtk-doc/doc/foobar4/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/10 gtk-doc/doc/foobar4/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/10 gtk-doc/doc/foobar4/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/10 gtk-doc/doc/foobar4/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,7 @@ +gnome.gtkdoc('foobar2', + module_version : '3.0', + src_dir : inc, + main_sgml : 'foobar-docs.sgml', + content_files : [docbook, version_xml], + install : true, + install_dir : 'foobar3') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/10 gtk-doc/doc/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/10 gtk-doc/doc/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/10 gtk-doc/doc/meson.build" 2018-12-09 14:27:16.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/10 gtk-doc/doc/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -4,30 +4,7 @@ output : 'version.xml', configuration : cdata) -gnome.gtkdoc('foobar', - src_dir : inc, - main_sgml : 'foobar-docs.sgml', - content_files : [docbook, version_xml], - install : true) - -gnome.gtkdoc('foobar2', - src_dir : inc, - main_sgml : 'foobar-docs.sgml', - content_files : [docbook, version_xml], - install : true, - install_dir : 'foobar2') - -gnome.gtkdoc('foobar', - module_version : '3.0', - src_dir : inc, - main_sgml : 'foobar-docs.sgml', - content_files : [docbook, version_xml], - install : true) - -gnome.gtkdoc('foobar2', - module_version : '3.0', - src_dir : inc, - main_sgml : 'foobar-docs.sgml', - content_files : [docbook, version_xml], - install : true, - install_dir : 'foobar3') +subdir('foobar1') +subdir('foobar2') +subdir('foobar3') +subdir('foobar4') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/15 llvm/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/15 llvm/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/15 llvm/meson.build" 2018-12-09 16:36:14.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/15 llvm/meson.build" 2019-08-16 20:44:09.000000000 +0000 @@ -1,6 +1,6 @@ project('llvmtest', ['c', 'cpp'], default_options : ['c_std=c99']) -d = dependency('llvm', required : false) +d = dependency('llvm', required : false, method : 'config-tool') if not d.found() d = dependency('llvm', required : false, static : true) if not d.found() @@ -31,25 +31,29 @@ dep_tinfo = cpp.find_library('tinfo', required: false) endif -foreach static : [true, false] - llvm_dep = dependency( - 'llvm', - modules : ['bitwriter', 'asmprinter', 'executionengine', 'target', - 'mcjit', 'nativecodegen'], - required : false, - static : static, - ) - if llvm_dep.found() - name = static ? 'static' : 'dynamic' - executable( - 'sum-@0@'.format(name), - 'sum.c', - dependencies : [ - llvm_dep, dep_tinfo, - # zlib will be statically linked on windows - dependency('zlib', required : host_machine.system() != 'windows'), - meson.get_compiler('c').find_library('dl', required : false), - ] +foreach method : ['config-tool', 'cmake'] + foreach static : [true, false] + message('Trying method @0@ for @1@ link'.format(method, static ? 'static' : 'dynamic')) + llvm_dep = dependency( + 'llvm', + modules : ['bitwriter', 'asmprinter', 'executionengine', 'target', + 'mcjit', 'nativecodegen', 'amdgpu'], + required : false, + static : static, + method : method, ) - endif + if llvm_dep.found() + name = static ? 'static' : 'dynamic' + executable( + 'sum-@0@-@1@'.format(name, method), + 'sum.c', + dependencies : [ + llvm_dep, dep_tinfo, + # zlib will be statically linked on windows + dependency('zlib', required : host_machine.system() != 'windows'), + meson.get_compiler('c').find_library('dl', required : false), + ] + ) + endif + endforeach endforeach diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/17 mpi/is_broken_ubuntu.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/17 mpi/is_broken_ubuntu.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/17 mpi/is_broken_ubuntu.py" 2018-12-09 14:27:23.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/17 mpi/is_broken_ubuntu.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -#!/usr/bin/env python3 - -# Any exception causes return value to be not zero, which is sufficient. - -import sys - -fc = open('/etc/apt/sources.list').read() -if 'artful' not in fc and 'bionic' not in fc and 'cosmic' not in fc: - sys.exit(1) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/17 mpi/main.f90" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/17 mpi/main.f90" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/17 mpi/main.f90" 2017-08-13 18:43:17.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/17 mpi/main.f90" 2019-04-17 08:08:43.000000000 +0000 @@ -1,21 +1,30 @@ -program mpitest - implicit none - include 'mpif.h' - logical :: flag - integer :: ier - call MPI_Init(ier) - if (ier /= 0) then - print *, 'Unable to initialize MPI: ', ier - stop 1 - endif - call MPI_Initialized(flag, ier) - if (ier /= 0) then - print *, 'Unable to check MPI initialization state: ', ier - stop 1 - endif - call MPI_Finalize(ier) - if (ier /= 0) then - print *, 'Unable to finalize MPI: ', ier - stop 1 - endif -end program mpitest +use, intrinsic :: iso_fortran_env, only: stderr=>error_unit +use mpi + +implicit none + +logical :: flag +integer :: ier + +call MPI_Init(ier) + +if (ier /= 0) then + write(stderr,*) 'Unable to initialize MPI', ier + stop 1 +endif + +call MPI_Initialized(flag, ier) +if (ier /= 0) then + write(stderr,*) 'Unable to check MPI initialization state: ', ier + stop 1 +endif + +call MPI_Finalize(ier) +if (ier /= 0) then + write(stderr,*) 'Unable to finalize MPI: ', ier + stop 1 +endif + +print *, "OK: Fortran MPI" + +end program diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/17 mpi/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/17 mpi/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/17 mpi/meson.build" 2018-12-09 16:36:11.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/17 mpi/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -26,21 +26,17 @@ test('MPI C++', execpp) endif -# OpenMPI is broken with Fortran on Ubuntu Artful. -# Remove this once the following bug has been fixed: -# -# https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/1727474 +# One of few feasible ways to use MPI for Fortran on Windows is via Intel compilers. +if build_machine.system() != 'windows' or cc.get_id() == 'intel' + if add_languages('fortran', required : false) + mpifort = dependency('mpi', language : 'fortran') -ubudetector = find_program('is_broken_ubuntu.py') -uburesult = run_command(ubudetector) - -if uburesult.returncode() != 0 and add_languages('fortran', required : false) - mpifort = dependency('mpi', language : 'fortran') - exef = executable('exef', + exef = executable('exef', 'main.f90', dependencies : [mpifort]) - test('MPI Fortran', exef) + test('MPI Fortran', exef) + endif endif # Check we can apply a version constraint diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/17 mpi/meson.build.orig" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/17 mpi/meson.build.orig" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/17 mpi/meson.build.orig" 2018-12-09 14:27:23.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/17 mpi/meson.build.orig" 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ -project('mpi', 'c', 'cpp', default_options: ['b_asneeded=false']) - -cc = meson.get_compiler('c') - -if build_machine.system() == 'windows' and cc.get_id() != 'msvc' - error('MESON_SKIP_TEST: MPI not available on Windows without MSVC.') -endif - -mpic = dependency('mpi', language : 'c', required : false) -if not mpic.found() - error('MESON_SKIP_TEST: MPI not found, skipping.') -endif -exec = executable('exec', - 'main.c', - dependencies : [mpic]) - -test('MPI C', exec) - -if build_machine.system() != 'windows' - # C++ MPI not supported by MS-MPI - mpicpp = dependency('mpi', language : 'cpp') - execpp = executable('execpp', - 'main.cpp', - dependencies : [mpicpp]) - - test('MPI C++', execpp) -endif - -# OpenMPI is broken with Fortran on Ubuntu Artful. -# Remove this once the following bug has been fixed: -# -# https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/1727474 - -ubudetector = find_program('is_broken_ubuntu.py') -uburesult = run_command(ubudetector) - -if uburesult.returncode() != 0 and add_languages('fortran', required : false) - mpifort = dependency('mpi', language : 'fortran') - exef = executable('exef', - 'main.f90', - dependencies : [mpifort]) - - test('MPI Fortran', exef) -endif - -# Check we can apply a version constraint -if mpic.version() != 'unknown' - dependency('mpi', version: '>=@0@'.format(mpic.version())) -endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/18 vulkan/vulkanprog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/18 vulkan/vulkanprog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/18 vulkan/vulkanprog.c" 2017-08-13 18:43:17.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/18 vulkan/vulkanprog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -4,14 +4,14 @@ int main() { VkInstanceCreateInfo instance_create_info = { - VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO, - NULL, - 0, - NULL, - 0, - NULL, - 0, - NULL, + VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO, + NULL, + 0, + NULL, + 0, + NULL, + 0, + NULL, }; // we don't actually require instance creation to succeed since @@ -23,4 +23,4 @@ vkDestroyInstance(instance, NULL); return 0; -} \ No newline at end of file +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/1 boost/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/1 boost/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/1 boost/meson.build" 2018-12-09 16:35:34.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/1 boost/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -26,18 +26,71 @@ nomoddep = dependency('boost') extralibdep = dependency('boost', modules : ['thread', 'system', 'log_setup', 'log']) +pymod = import('python') +python2 = pymod.find_installation('python2', required: host_machine.system() == 'linux', disabler: true) +python3 = pymod.find_installation('python3', required: host_machine.system() == 'linux', disabler: true) +python2dep = python2.dependency(required: host_machine.system() == 'linux', disabler: true) +python3dep = python3.dependency(required: host_machine.system() == 'linux', disabler: true) + +# compile python 2/3 modules only if we found a corresponding python version +if(python2dep.found() and host_machine.system() == 'linux') + if(dep.version().version_compare('>=1.67')) + # if we have a new version of boost, we need to construct the module name based + # on the installed version of python (and hope that they match the version boost + # was compiled against) + py2version_string = ''.join(python2dep.version().split('.')) + bpython2dep = dependency('boost', modules : ['python' + py2version_string]) + else + # if we have an older version of boost, we need to use the old module names + bpython2dep = dependency('boost', modules : ['python']) + endif + + if not (bpython2dep.found()) + bpython2dep = disabler() + endif +else + python2dep = disabler() + bpython2dep = disabler() +endif + +if(python3dep.found() and host_machine.system() == 'linux') + if(dep.version().version_compare('>=1.67')) + py3version_string = ''.join(python3dep.version().split('.')) + bpython3dep = dependency('boost', modules : ['python' + py3version_string]) + else + bpython3dep = dependency('boost', modules : ['python3']) + endif + + if not (bpython3dep.found()) + bpython3dep = disabler() + endif +else + python3dep = disabler() + bpython3dep = disabler() +endif + linkexe = executable('linkedexe', 'linkexe.cc', dependencies : linkdep) staticexe = executable('staticlinkedexe', 'linkexe.cc', dependencies : staticdep) unitexe = executable('utf', 'unit_test.cpp', dependencies: testdep) nomodexe = executable('nomod', 'nomod.cpp', dependencies : nomoddep) extralibexe = executable('extralibexe', 'extralib.cpp', dependencies : extralibdep) +# python modules are shared libraries +python2module = shared_library('python2_module', ['python_module.cpp'], dependencies: [python2dep, bpython2dep], name_prefix: '', cpp_args: ['-DMOD_NAME=python2_module']) +python3module = shared_library('python3_module', ['python_module.cpp'], dependencies: [python3dep, bpython3dep], name_prefix: '', cpp_args: ['-DMOD_NAME=python3_module']) + test('Boost linktest', linkexe) test('Boost statictest', staticexe) test('Boost UTF test', unitexe) test('Boost nomod', nomodexe) test('Boost extralib test', extralibexe) +# explicitly use the correct python interpreter so that we don't have to provide two different python scripts that have different shebang lines +python2interpreter = find_program(python2.path(), required: false, disabler: true) +test('Boost Python2', python2interpreter, args: ['./test_python_module.py', meson.current_build_dir()], workdir: meson.current_source_dir(), depends: python2module) +python3interpreter = find_program(python3.path(), required: false, disabler: true) +test('Boost Python3', python3interpreter, args: ['./test_python_module.py', meson.current_build_dir()], workdir: meson.current_source_dir(), depends: python2module) + subdir('partial_dep') # check we can apply a version constraint diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/1 boost/python_module.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/1 boost/python_module.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/1 boost/python_module.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/1 boost/python_module.cpp" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,22 @@ +#define PY_SSIZE_T_CLEAN +#include +#include + +struct World +{ + void set(std::string msg) { this->msg = msg; } + std::string greet() { return msg; } + std::string version() { return std::to_string(PY_MAJOR_VERSION) + "." + std::to_string(PY_MINOR_VERSION); } + std::string msg; +}; + + +BOOST_PYTHON_MODULE(MOD_NAME) +{ + using namespace boost::python; + class_("World") + .def("greet", &World::greet) + .def("set", &World::set) + .def("version", &World::version) + ; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/1 boost/test_python_module.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/1 boost/test_python_module.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/1 boost/test_python_module.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/1 boost/test_python_module.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,27 @@ +import sys +sys.path.append(sys.argv[1]) + +# import compiled python module depending on version of python we are running with +if sys.version_info[0] == 2: + import python2_module + +if sys.version_info[0] == 3: + import python3_module + + +def run(): + msg = 'howdy' + if sys.version_info[0] == 2: + w = python2_module.World() + + if sys.version_info[0] == 3: + w = python3_module.World() + + w.set(msg) + + assert(msg == w.greet()) + version_string = str(sys.version_info[0]) + "." + str(sys.version_info[1]) + assert(version_string == w.version()) + +if __name__ == '__main__': + run() diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/23 hotdoc/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/23 hotdoc/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/23 hotdoc/installed_files.txt" 2018-12-09 14:27:23.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/23 hotdoc/installed_files.txt" 2019-07-09 16:34:14.000000000 +0000 @@ -66,6 +66,15 @@ usr/share/doc/foobar/html/assets/js/search/hotdoc_fragments/index.html-hello-world.fragment usr/share/doc/foobar/html/assets/js/search/hotdoc_fragments/dumped.trie usr/share/doc/foobar/html/assets/js/search/hotdoc_fragments/foo.html-FooIndecision.fragment +usr/share/doc/foobar/html/assets/js/search/Subpages +usr/share/doc/foobar/html/assets/js/search/foo +usr/share/doc/foobar/html/assets/js/search/API +usr/share/doc/foobar/html/assets/js/search/Reference +usr/share/doc/foobar/html/assets/js/search/api +usr/share/doc/foobar/html/assets/js/search/reference +usr/share/doc/foobar/html/assets/js/search/subpages +usr/share/doc/foobar/html/assets/js/search/hotdoc_fragments/index.html-subpages.fragment +usr/share/doc/foobar/html/assets/js/search/hotdoc_fragments/c-index.html-subpages.fragment usr/share/doc/foobar/html/assets/prism_components/prism-inform7.min.js usr/share/doc/foobar/html/assets/prism_components/prism-pascal.min.js usr/share/doc/foobar/html/assets/prism_components/prism-bro.js diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/25 hdf5/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/25 hdf5/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/25 hdf5/main.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/25 hdf5/main.c" 2019-02-07 09:08:59.000000000 +0000 @@ -0,0 +1,30 @@ +#include +#include + +#include "hdf5.h" + +int main(void) +{ +herr_t ier; +unsigned maj, min, rel; + +ier = H5open(); +if (ier) { + fprintf(stderr,"Unable to initialize HDF5: %d\n", ier); + return EXIT_FAILURE; +} + +ier = H5get_libversion(&maj, &min, &rel); +if (ier) { + fprintf(stderr,"HDF5 did not initialize!\n"); + return EXIT_FAILURE; +} +printf("C HDF5 version %d.%d.%d\n", maj, min, rel); + +ier = H5close(); +if (ier) { + fprintf(stderr,"Unable to close HDF5: %d\n", ier); + return EXIT_FAILURE; +} +return EXIT_SUCCESS; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/25 hdf5/main.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/25 hdf5/main.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/25 hdf5/main.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/25 hdf5/main.cpp" 2019-02-07 09:08:59.000000000 +0000 @@ -0,0 +1,29 @@ +#include +#include "hdf5.h" + + +int main(void) +{ +herr_t ier; +unsigned maj, min, rel; + +ier = H5open(); +if (ier) { + std::cerr << "Unable to initialize HDF5: " << ier << std::endl; + return EXIT_FAILURE; +} + +ier = H5get_libversion(&maj, &min, &rel); +if (ier) { + std::cerr << "HDF5 did not initialize!" << std::endl; + return EXIT_FAILURE; +} +std::cout << "C++ HDF5 version " << maj << "." << min << "." << rel << std::endl; + +ier = H5close(); +if (ier) { + std::cerr << "Unable to close HDF5: " << ier << std::endl; + return EXIT_FAILURE; +} +return EXIT_SUCCESS; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/25 hdf5/main.f90" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/25 hdf5/main.f90" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/25 hdf5/main.f90" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/25 hdf5/main.f90" 2019-02-07 09:08:59.000000000 +0000 @@ -0,0 +1,17 @@ +use hdf5 + +implicit none + +integer :: ier, major, minor, rel + +call h5open_f(ier) +if (ier /= 0) error stop 'Unable to initialize HDF5' + +call h5get_libversion_f(major, minor, rel, ier) +if (ier /= 0) error stop 'Unable to check HDF5 version' +print '(A,I1,A1,I0.2,A1,I1)','Fortran HDF5 version ',major,'.',minor,'.',rel + +call h5close_f(ier) +if (ier /= 0) error stop 'Unable to close HDF5 library' + +end program diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/25 hdf5/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/25 hdf5/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/25 hdf5/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/25 hdf5/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,43 @@ +project('hdf5_test', 'c', 'cpp') + +if build_machine.system() == 'darwin' + error('MESON_SKIP_TEST: HDF5 CI image not setup for OSX.') +endif + +if build_machine.system() == 'cygwin' + error('MESON_SKIP_TEST: HDF5 CI image not setup for Cygwin.') +endif + + +# --- C tests +h5c = dependency('hdf5', language : 'c', required : false) +if not h5c.found() + error('MESON_SKIP_TEST: HDF5 C library not found, skipping HDF5 framework tests.') +endif +exec = executable('exec', 'main.c', dependencies : h5c) + +test('HDF5 C', exec) + +# --- C++ tests +h5cpp = dependency('hdf5', language : 'cpp', required : false) +if h5cpp.found() + execpp = executable('execpp', 'main.cpp', dependencies : h5cpp) + test('HDF5 C++', execpp) +endif + +# --- Fortran tests +if build_machine.system() != 'windows' + add_languages('fortran') + + h5f = dependency('hdf5', language : 'fortran', required : false) + if h5f.found() + exef = executable('exef', 'main.f90', dependencies : h5f) + + test('HDF5 Fortran', exef) + endif +endif + +# Check we can apply a version constraint +if h5c.version() != 'unknown' + dependency('hdf5', version: '>=@0@'.format(h5c.version())) +endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/26 netcdf/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/26 netcdf/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/26 netcdf/main.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/26 netcdf/main.c" 2019-02-28 20:43:18.000000000 +0000 @@ -0,0 +1,14 @@ +#include "netcdf.h" + +int main(void) +{ +int ret, ncid; + +if ((ret = nc_create("foo.nc", NC_CLOBBER, &ncid))) + return ret; + +if ((ret = nc_close(ncid))) + return ret; + +return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/26 netcdf/main.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/26 netcdf/main.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/26 netcdf/main.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/26 netcdf/main.cpp" 2019-02-28 20:43:18.000000000 +0000 @@ -0,0 +1,15 @@ +#include +#include "netcdf.h" + +int main(void) +{ +int ret, ncid; + +if ((ret = nc_create("foo.nc", NC_CLOBBER, &ncid))) + return ret; + +if ((ret = nc_close(ncid))) + return ret; + +return EXIT_SUCCESS; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/26 netcdf/main.f90" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/26 netcdf/main.f90" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/26 netcdf/main.f90" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/26 netcdf/main.f90" 2019-02-28 20:43:18.000000000 +0000 @@ -0,0 +1,19 @@ +use netcdf + +implicit none + +integer :: ncid + +call check( nf90_create("foo.nc", NF90_CLOBBER, ncid) ) + +call check( nf90_close(ncid) ) + +contains + + subroutine check(status) + integer, intent (in) :: status + + if(status /= nf90_noerr) error stop trim(nf90_strerror(status)) +end subroutine check + +end program diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/26 netcdf/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/26 netcdf/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/26 netcdf/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/26 netcdf/meson.build" 2019-02-28 20:43:18.000000000 +0000 @@ -0,0 +1,35 @@ +project('netcdf_test', 'c', 'cpp') + + +# --- C tests +nc_c = dependency('netcdf', language : 'c', required : false) +if not nc_c.found() + error('MESON_SKIP_TEST: NetCDF C library not found, skipping NetCDF framework tests.') +endif +exec = executable('exec', 'main.c', dependencies : nc_c) + +test('NetCDF C', exec) + +# --- C++ tests +nc_cpp = dependency('netcdf', language : 'cpp', required : false) +if nc_cpp.found() + execpp = executable('execpp', 'main.cpp', dependencies : nc_cpp) + test('NetCDF C++', execpp) +endif + +# --- Fortran tests +if build_machine.system() != 'windows' + add_languages('fortran') + + nc_f = dependency('netcdf', language : 'fortran', required : false) + if nc_f.found() + exef = executable('exef', 'main.f90', dependencies : nc_f) + + test('NetCDF Fortran', exef) + endif +endif + +# Check we can apply a version constraint +if nc_c.version() != 'unknown' + dependency('netcdf', version: '>=@0@'.format(nc_c.version())) +endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/27 gpgme/gpgme_prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/27 gpgme/gpgme_prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/27 gpgme/gpgme_prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/27 gpgme/gpgme_prog.c" 2019-04-17 08:08:43.000000000 +0000 @@ -0,0 +1,8 @@ +#include + +int +main() +{ + printf("gpgme-v%s", gpgme_check_version(NULL)); + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/27 gpgme/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/27 gpgme/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/27 gpgme/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/27 gpgme/meson.build" 2019-04-17 08:08:43.000000000 +0000 @@ -0,0 +1,27 @@ +project('gpgme test', 'c') + +wm = find_program('gpgme-config', required: false) +if not wm.found() + error('MESON_SKIP_TEST: gpgme-config not installed') +endif + +gpgme_dep = dependency('gpgme', version: '>= 1.0') +gpgme_ver = gpgme_dep.version() +assert(gpgme_ver.split('.').length() > 1, 'gpgme version is "@0@"'.format(gpgme_ver)) +message('gpgme version is "@0@"'.format(gpgme_ver)) +e = executable('gpgme_prog', 'gpgme_prog.c', dependencies: gpgme_dep) + +test('gpgmetest', e) + +# Test using the method keyword: + +dependency('gpgme', method: 'config-tool') + +# Check we can apply a version constraint +dependency('gpgme', version: '>=@0@'.format(gpgme_dep.version()), method: 'config-tool') + +# If gpgme is new enough, make sure it picks up pkg-config by default: + +if gpgme_ver.version_compare('>=1.13.0') + assert(gpgme_dep.type_name() == 'pkgconfig', 'dependency found via pkg-config') +endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/28 gir link order 2/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/28 gir link order 2/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/28 gir link order 2/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/28 gir link order 2/meson.build" 2019-08-16 20:44:19.000000000 +0000 @@ -0,0 +1,35 @@ +project('gir link order 2', 'c') + +if not dependency('gobject-2.0', required : false).found() + error('MESON_SKIP_TEST gobject not found.') +endif + +gnome = import('gnome') +gobject = dependency('gobject-2.0') + +# This builds a dummy libsample under samelibname that's not really used +subdir('samelibname') + +# This builds the real libsample +meson_sample_sources = ['meson-sample.c', 'meson-sample.h'] +meson_sample_lib = shared_library( + 'sample', + sources : meson_sample_sources, + dependencies : [gobject], + link_with: [samelibname], + install : false, +) + +# g-ir-scanner should get the linker paths in the right order so it links first +# against the target libsample and not the dummy one that's just a dependency +# https://github.com/mesonbuild/meson/pull/5423 +gnome.generate_gir( + meson_sample_lib, + sources : meson_sample_sources, + nsversion : '1.0', + namespace : 'Meson', + symbol_prefix : 'meson', + identifier_prefix : 'Meson', + install : false, + build_by_default: true, +) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/28 gir link order 2/meson-sample.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/28 gir link order 2/meson-sample.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/28 gir link order 2/meson-sample.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/28 gir link order 2/meson-sample.c" 2019-06-16 18:54:18.000000000 +0000 @@ -0,0 +1,42 @@ +#include "meson-sample.h" + +struct _MesonSample { + GObject parent_instance; +}; + +G_DEFINE_TYPE (MesonSample, meson_sample, G_TYPE_OBJECT) + +/** + * meson_sample_new: + * + * Allocates a new #MesonSample. + * + * Returns: (transfer full): a #MesonSample. + */ +MesonSample * +meson_sample_new (void) +{ + return g_object_new (MESON_TYPE_SAMPLE, NULL); +} + +static void +meson_sample_class_init (MesonSampleClass *klass) +{ +} + +static void +meson_sample_init (MesonSample *self) +{ +} + +/** + * meson_sample_print_message: + * @self: a #MesonSample. + * + * Prints a message. + */ +void +meson_sample_print_message (MesonSample *self) +{ + g_return_if_fail (MESON_IS_SAMPLE (self)); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/28 gir link order 2/meson-sample.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/28 gir link order 2/meson-sample.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/28 gir link order 2/meson-sample.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/28 gir link order 2/meson-sample.h" 2019-06-16 18:54:18.000000000 +0000 @@ -0,0 +1,17 @@ +#ifndef MESON_SAMPLE_H +#define MESON_SAMPLE_H + +#include + +G_BEGIN_DECLS + +#define MESON_TYPE_SAMPLE (meson_sample_get_type()) + +G_DECLARE_FINAL_TYPE (MesonSample, meson_sample, MESON, SAMPLE, GObject) + +MesonSample *meson_sample_new (void); +void meson_sample_print_message (MesonSample *self); + +G_END_DECLS + +#endif /* MESON_SAMPLE_H */ diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/28 gir link order 2/samelibname/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/28 gir link order 2/samelibname/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/28 gir link order 2/samelibname/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/28 gir link order 2/samelibname/meson.build" 2019-06-16 18:54:18.000000000 +0000 @@ -0,0 +1,5 @@ +samelibname = shared_library( + 'sample', + sources : [], + install : false, +) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/29 blocks/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/29 blocks/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/29 blocks/main.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/29 blocks/main.c" 2019-09-28 23:52:33.000000000 +0000 @@ -0,0 +1,6 @@ +int main(int argc, char **argv) +{ + int (^callback)(void) = ^ int (void) { return 0; }; + + return callback(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/29 blocks/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/29 blocks/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/29 blocks/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/29 blocks/meson.build" 2019-09-28 23:52:33.000000000 +0000 @@ -0,0 +1,12 @@ +project('blocks-dependency', 'c') + +id = meson.get_compiler('c').get_id() +if id != 'clang' or build_machine.system() == 'windows' + error('MESON_SKIP_TEST: Only clang on unix-like systems supports the blocks extension.') +endif + +exe = executable('main', 'main.c', + dependencies: dependency('blocks') +) + +test('test-blocks', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/2 gtest/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/2 gtest/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/2 gtest/meson.build" 2018-12-09 16:35:31.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/2 gtest/meson.build" 2019-08-16 20:42:58.000000000 +0000 @@ -4,7 +4,7 @@ if not gtest.found() error('MESON_SKIP_TEST: gtest not installed.') endif -gtest_nomain = dependency('gtest', main : false) +gtest_nomain = dependency('gtest', main : false, method : 'system') e = executable('testprog', 'test.cc', dependencies : gtest) test('gtest test', e) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/3 gmock/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/3 gmock/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/3 gmock/meson.build" 2018-12-09 16:35:31.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/3 gmock/meson.build" 2019-08-16 20:43:12.000000000 +0000 @@ -3,7 +3,7 @@ # Using gmock without gtest is a pain so just # don't support that then. -gtest = dependency('gtest', main : true, required : false) +gtest = dependency('gtest', main : true, required : false, method : 'system') if not gtest.found() error('MESON_SKIP_TEST: gtest not installed.') endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/6 gettext/data2/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/6 gettext/data2/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/6 gettext/data2/meson.build" 2018-10-31 09:31:57.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/6 gettext/data2/meson.build" 2019-05-02 18:59:50.000000000 +0000 @@ -1,8 +1,9 @@ i18n.merge_file( input: 'test.desktop.in', - output: 'test.desktop', + output: 'test.plugin', type: 'desktop', po_dir: '../po', + args: ['--keyword=Description'], install: true, install_dir: join_paths(get_option('datadir'), 'applications') ) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/6 gettext/data2/test.desktop.in" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/6 gettext/data2/test.desktop.in" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/6 gettext/data2/test.desktop.in" 2018-10-31 09:31:57.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/6 gettext/data2/test.desktop.in" 2019-05-02 18:59:50.000000000 +0000 @@ -1,6 +1,6 @@ [Desktop Entry] Name=Test GenericName=Application -Comment=Test Application +Description=Test Application Type=Application diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/6 gettext/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/6 gettext/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/6 gettext/installed_files.txt" 2018-12-09 14:27:16.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/6 gettext/installed_files.txt" 2019-05-02 18:59:50.000000000 +0000 @@ -1,8 +1,10 @@ usr/bin/intlprog?exe usr/share/locale/de/LC_MESSAGES/intltest.mo usr/share/locale/fi/LC_MESSAGES/intltest.mo +usr/share/locale/ru/LC_MESSAGES/intltest.mo usr/share/applications/something.desktop usr/share/applications/test.desktop +usr/share/applications/test.plugin usr/share/applications/test2.desktop usr/share/applications/test3.desktop usr/share/applications/test4.desktop diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/6 gettext/po/LINGUAS" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/6 gettext/po/LINGUAS" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/6 gettext/po/LINGUAS" 2016-12-13 21:40:39.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/6 gettext/po/LINGUAS" 2019-05-02 18:59:50.000000000 +0000 @@ -1,2 +1,4 @@ de fi +ru + diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/6 gettext/po/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/6 gettext/po/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/6 gettext/po/meson.build" 2016-05-28 14:39:38.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/6 gettext/po/meson.build" 2019-05-02 18:59:50.000000000 +0000 @@ -1,3 +1,3 @@ -langs = ['fi', 'de'] +langs = ['fi', 'de', 'ru'] i18n.gettext('intltest', languages : langs) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/6 gettext/po/ru.po" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/6 gettext/po/ru.po" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/frameworks/6 gettext/po/ru.po" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/frameworks/6 gettext/po/ru.po" 2019-05-02 18:59:50.000000000 +0000 @@ -0,0 +1,34 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the intltest package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: intltest\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-05-31 05:16-0500\n" +"PO-Revision-Date: 2019-04-22 02:38+0300\n" +"Language: ru\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Last-Translator: \n" +"Language-Team: \n" +"X-Generator: Poedit 2.2.1\n" + +#: src/intlmain.c:15 +msgid "International greeting." +msgstr "Межнациональное приветствие." + +#: data/test.desktop.in:3 +msgid "Test" +msgstr "Тест" + +#: data/test.desktop.in:4 +msgid "Application" +msgstr "Приложение" + +#: data/test.desktop.in:5 +msgid "Test Application" +msgstr "Тестовое приложение" diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/kconfig/1 basic/.config" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/kconfig/1 basic/.config" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/kconfig/1 basic/.config" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/kconfig/1 basic/.config" 2019-04-17 08:08:43.000000000 +0000 @@ -0,0 +1,3 @@ +CONFIG_VAL1=y +# CONFIG_VAL2 is not set +CONFIG_VAL_VAL=4 diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/kconfig/1 basic/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/kconfig/1 basic/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/kconfig/1 basic/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/kconfig/1 basic/meson.build" 2019-08-16 20:39:06.000000000 +0000 @@ -0,0 +1,16 @@ +project('kconfig basic test') + +k = import('unstable-kconfig') +conf = k.load('.config') + +if not conf.has_key('CONFIG_VAL1') + error('Expected CONFIG_VAL1 to be set, but it wasn\'t') +endif + +if conf.has_key('CONFIG_VAL2') + error('Expected CONFIG_VAL2 not be set, but it was') +endif + +if conf.get('CONFIG_VAL_VAL').to_int() != 4 + error('Expected CONFIG_VAL_VAL to be 4') +endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/kconfig/2 subdir/.config" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/kconfig/2 subdir/.config" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/kconfig/2 subdir/.config" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/kconfig/2 subdir/.config" 2019-04-17 08:08:43.000000000 +0000 @@ -0,0 +1,2 @@ +CONFIG_IS_SET=y +# CONFIG_NOT_IS_SET is not set diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/kconfig/2 subdir/dir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/kconfig/2 subdir/dir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/kconfig/2 subdir/dir/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/kconfig/2 subdir/dir/meson.build" 2019-04-17 08:08:43.000000000 +0000 @@ -0,0 +1,13 @@ + +k = import('unstable-kconfig') + +conf = k.load(meson.source_root() / '.config') + +if not conf.has_key('CONFIG_IS_SET') + error('Expected CONFIG_IS_SET to be set, but it wasn\'t') +endif + +if conf.has_key('CONFIG_NOT_IS_SET') + error('Expected CONFIG_NOT_IS_SET not be set, but it was') +endif + diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/kconfig/2 subdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/kconfig/2 subdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/kconfig/2 subdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/kconfig/2 subdir/meson.build" 2019-08-16 20:39:06.000000000 +0000 @@ -0,0 +1,4 @@ +project('kconfig subdir test') + +# Test into sub directory +subdir('dir') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/kconfig/3 load_config files/dir/config" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/kconfig/3 load_config files/dir/config" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/kconfig/3 load_config files/dir/config" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/kconfig/3 load_config files/dir/config" 2019-04-17 08:08:43.000000000 +0000 @@ -0,0 +1,2 @@ +CONFIG_IS_SET=y +# CONFIG_NOT_IS_SET is not set diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/kconfig/3 load_config files/dir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/kconfig/3 load_config files/dir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/kconfig/3 load_config files/dir/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/kconfig/3 load_config files/dir/meson.build" 2019-04-17 08:08:43.000000000 +0000 @@ -0,0 +1,13 @@ + +k = import('unstable-kconfig') + +conf = k.load(files('config')) + +if not conf.has_key('CONFIG_IS_SET') + error('Expected CONFIG_IS_SET to be set, but it wasn\'t') +endif + +if conf.has_key('CONFIG_NOT_IS_SET') + error('Expected CONFIG_NOT_IS_SET not be set, but it was') +endif + diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/kconfig/3 load_config files/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/kconfig/3 load_config files/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/kconfig/3 load_config files/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/kconfig/3 load_config files/meson.build" 2019-08-16 20:39:06.000000000 +0000 @@ -0,0 +1,4 @@ +project('kconfig subdir test') + +# Test into sub directory +subdir('dir') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/kconfig/4 load_config builddir/config" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/kconfig/4 load_config builddir/config" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/kconfig/4 load_config builddir/config" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/kconfig/4 load_config builddir/config" 2019-04-17 08:08:43.000000000 +0000 @@ -0,0 +1,2 @@ +CONFIG_IS_SET=y +# CONFIG_NOT_IS_SET is not set diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/kconfig/4 load_config builddir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/kconfig/4 load_config builddir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/kconfig/4 load_config builddir/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/kconfig/4 load_config builddir/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,14 @@ +project('kconfig builddir test') + +k = import('unstable-kconfig') + +out_conf = configure_file(input: 'config', output: 'out-config', copy: true) +conf = k.load(out_conf) + +if not conf.has_key('CONFIG_IS_SET') + error('Expected CONFIG_IS_SET to be set, but it wasn\'t') +endif + +if conf.has_key('CONFIG_NOT_IS_SET') + error('Expected CONFIG_NOT_IS_SET not be set, but it was') +endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/linuxlike/13 cmake dependency/cmake/FindImportedTarget.cmake" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/linuxlike/13 cmake dependency/cmake/FindImportedTarget.cmake" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/linuxlike/13 cmake dependency/cmake/FindImportedTarget.cmake" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/linuxlike/13 cmake dependency/cmake/FindImportedTarget.cmake" 2019-09-28 23:52:33.000000000 +0000 @@ -0,0 +1,15 @@ +find_package(ZLIB) + +if(ZLIB_FOUND OR ZLIB_Found) + set(ImportedTarget_FOUND ON) + add_library(mesonTestLibDefs SHARED IMPORTED) + set_property(TARGET mesonTestLibDefs PROPERTY IMPORTED_LOCATION ${ZLIB_LIBRARY}) + set_property(TARGET mesonTestLibDefs PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${ZLIB_INCLUDE_DIR}) + set_property(TARGET mesonTestLibDefs APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS REQUIRED_MESON_FLAG1) + set_property(TARGET mesonTestLibDefs APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS $<$>:QT_NO_DEBUG>) # Error empty string + set_property(TARGET mesonTestLibDefs APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS REQUIRED_MESON_FLAG2) + set_target_properties(mesonTestLibDefs PROPERTIES IMPORTED_GLOBAL TRUE) + add_library(MesonTest::TestLibDefs ALIAS mesonTestLibDefs) +else() + set(ImportedTarget_FOUND OFF) +endif() diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/linuxlike/13 cmake dependency/cmake/FindSomethingLikeZLIB.cmake" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/linuxlike/13 cmake dependency/cmake/FindSomethingLikeZLIB.cmake" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/linuxlike/13 cmake dependency/cmake/FindSomethingLikeZLIB.cmake" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/linuxlike/13 cmake dependency/cmake/FindSomethingLikeZLIB.cmake" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,12 @@ +find_package(ZLIB) + +include(CMakeFindDependencyMacro) +find_dependency(Threads) + +if(ZLIB_FOUND OR ZLIB_Found) + set(SomethingLikeZLIB_FOUND ON) + set(SomethingLikeZLIB_LIBRARIES ${ZLIB_LIBRARY}) + set(SomethingLikeZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR}) +else() + set(SomethingLikeZLIB_FOUND OFF) +endif() diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/linuxlike/13 cmake dependency/cmake_pref_env/lib/cmake/cmMesonTestDep/cmMesonTestDepConfig.cmake" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/linuxlike/13 cmake dependency/cmake_pref_env/lib/cmake/cmMesonTestDep/cmMesonTestDepConfig.cmake" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/linuxlike/13 cmake dependency/cmake_pref_env/lib/cmake/cmMesonTestDep/cmMesonTestDepConfig.cmake" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/linuxlike/13 cmake dependency/cmake_pref_env/lib/cmake/cmMesonTestDep/cmMesonTestDepConfig.cmake" 2019-08-25 19:17:02.000000000 +0000 @@ -0,0 +1,9 @@ +find_package(ZLIB) + +if(ZLIB_FOUND OR ZLIB_Found) + set(cmMesonTestDep_FOUND ON) + set(cmMesonTestDep_LIBRARIES ${ZLIB_LIBRARY}) + set(cmMesonTestDep_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR}) +else() + set(cmMesonTestDep_FOUND OFF) +endif() diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/linuxlike/13 cmake dependency/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/linuxlike/13 cmake dependency/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/linuxlike/13 cmake dependency/meson.build" 2018-12-09 16:32:52.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/linuxlike/13 cmake dependency/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -36,6 +36,25 @@ assert(depf2.found() == false, 'Invalid CMake targets should fail') +# Try to find cmMesonTestDep in a custom prefix + +depPrefEnv = dependency('cmMesonTestDep', required : true, method : 'cmake') + +# Try to find a dependency with a custom CMake module + +depm1 = dependency('SomethingLikeZLIB', required : true, method : 'cmake', cmake_module_path : 'cmake') +depm2 = dependency('SomethingLikeZLIB', required : true, method : 'cmake', cmake_module_path : ['cmake']) +depm3 = dependency('SomethingLikeZLIB', required : true, cmake_module_path : 'cmake') + +# Test some edge cases with spaces, etc. + +testDep1 = dependency('ImportedTarget', required : true, method : 'cmake', cmake_module_path : 'cmake', modules: 'mesonTestLibDefs') +testDep2 = dependency('ImportedTarget', required : true, method : 'cmake', cmake_module_path : 'cmake', modules : ['MesonTest::TestLibDefs']) +testFlagSet1 = executable('testFlagSet1', ['testFlagSet.c'], dependencies: [testDep1]) +testFlagSet2 = executable('testFlagSet2', ['testFlagSet.c'], dependencies: [testDep2]) +test('testFlagSetTest1', testFlagSet1) +test('testFlagSetTest2', testFlagSet2) + # Try to compile a test that takes a dep and an include_directories cc = meson.get_compiler('c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/linuxlike/13 cmake dependency/setup_env.json" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/linuxlike/13 cmake dependency/setup_env.json" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/linuxlike/13 cmake dependency/setup_env.json" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/linuxlike/13 cmake dependency/setup_env.json" 2019-08-25 19:17:02.000000000 +0000 @@ -0,0 +1,3 @@ +{ + "CMAKE_PREFIX_PATH": "@ROOT@/cmake_pref_env" +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/linuxlike/13 cmake dependency/testFlagSet.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/linuxlike/13 cmake dependency/testFlagSet.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/linuxlike/13 cmake dependency/testFlagSet.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/linuxlike/13 cmake dependency/testFlagSet.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,18 @@ +#include +#include + +#ifndef REQUIRED_MESON_FLAG1 +#error "REQUIRED_MESON_FLAG1 not set" +#endif + +#ifndef REQUIRED_MESON_FLAG2 +#error "REQUIRED_MESON_FLAG2 not set" +#endif + +int main(int argc, char *argv[]) { + printf("Hello World\n"); + void * something = deflate; + if(something != 0) + return 0; + return 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/linuxlike/14 static dynamic linkage/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/linuxlike/14 static dynamic linkage/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/linuxlike/14 static dynamic linkage/main.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/linuxlike/14 static dynamic linkage/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,7 @@ +#include "stdio.h" +#include "zlib.h" + +int main() { + printf("%s\n", zlibVersion()); + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/linuxlike/14 static dynamic linkage/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/linuxlike/14 static dynamic linkage/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/linuxlike/14 static dynamic linkage/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/linuxlike/14 static dynamic linkage/meson.build" 2019-09-16 21:20:45.000000000 +0000 @@ -0,0 +1,36 @@ +project('static dynamic', 'c') + +# Solaris does not ship static libraries +if host_machine.system() == 'sunos' + has_static = false +else + has_static = true +endif + +cc = meson.get_compiler('c') + +z_default = cc.find_library('z') +if has_static + z_static = cc.find_library('z', static: true) +endif +z_dynamic = cc.find_library('z', static: false) + +exe_default = executable('main_default', 'main.c', dependencies: [z_default]) +if has_static + exe_static = executable('main_static', 'main.c', dependencies: [z_static]) +endif +exe_dynamic = executable('main_dynamic', 'main.c', dependencies: [z_dynamic]) + +test('test default', exe_default) +if has_static + test('test static', exe_static) +endif +test('test dynamic', exe_dynamic) + +if has_static + test('verify static linking', find_program('verify_static.py'), + args: ['--platform=' + host_machine.system(), exe_static.full_path()]) +endif +test('verify dynamic linking', find_program('verify_static.py'), + args: ['--platform=' + host_machine.system(), exe_dynamic.full_path()], + should_fail: true) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/linuxlike/14 static dynamic linkage/verify_static.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/linuxlike/14 static dynamic linkage/verify_static.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/linuxlike/14 static dynamic linkage/verify_static.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/linuxlike/14 static dynamic linkage/verify_static.py" 2019-04-21 19:25:09.000000000 +0000 @@ -0,0 +1,29 @@ +#!/usr/bin/env python +"""Test script that checks if zlib was statically linked to executable""" +import subprocess +import sys + +def handle_common(path): + """Handle the common case.""" + output = subprocess.check_output(['nm', path]).decode('utf-8') + if 'T zlibVersion' in output: + return 0 + return 1 + +def handle_cygwin(path): + """Handle the Cygwin case.""" + output = subprocess.check_output(['nm', path]).decode('utf-8') + if 'I __imp_zlibVersion' in output: + return 1 + return 0 + +def main(): + """Main function""" + if len(sys.argv) > 2 and sys.argv[1] == '--platform=cygwin': + return handle_cygwin(sys.argv[2]) + else: + return handle_common(sys.argv[2]) + + +if __name__ == '__main__': + sys.exit(main()) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/linuxlike/1 pkg-config/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/linuxlike/1 pkg-config/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/linuxlike/1 pkg-config/meson.build" 2018-12-09 16:32:40.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/linuxlike/1 pkg-config/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -2,7 +2,8 @@ # Zlib is probably on all dev machines. -dep = dependency('zlib', version : '>=1.2') +dep = dependency('zlib', version : '>=1.2', + not_found_message: 'DANGER! DANGER! THIS MUST NEVER BE SEEN!') exe = executable('zlibprog', 'prog-checkver.c', dependencies : dep, c_args : '-DFOUND_ZLIB="' + dep.version() + '"') @@ -29,7 +30,8 @@ # Try to find a nonexistent library to ensure requires:false works. -dep = dependency('nvakuhrabnsdfasdf', required : false) +dep = dependency('nvakuhrabnsdfasdf', required : false, + not_found_message : 'This dependency was not found as was expected.') # Try to compile a test that takes a dep and an include_directories diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/objc/2 nsstring/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/objc/2 nsstring/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/objc/2 nsstring/meson.build" 2018-12-09 16:34:57.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/objc/2 nsstring/meson.build" 2019-08-16 20:42:08.000000000 +0000 @@ -15,3 +15,6 @@ endif exe = executable('stringprog', 'stringprog.m', dependencies : dep) test('stringtest', exe) + +# Ensure that a non-required dep that is not found does not cause an error +dependency('appleframeworks', modules: 'nonexisting', required: false) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/osx/2 library versions/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/osx/2 library versions/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/osx/2 library versions/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/osx/2 library versions/meson.build" 2019-02-07 09:08:59.000000000 +0000 @@ -1,15 +1,27 @@ project('library versions', 'c') -zlib_dep = dependency('zlib') +if run_command(find_program('require_pkgconfig.py'), check: true).stdout().strip() == 'yes' + required = true +else + required = false +endif -some = shared_library('some', 'lib.c', - # duplicate the rpath again, in order - # to test Meson's RPATH deduplication - build_rpath : zlib_dep.get_pkgconfig_variable('libdir'), - dependencies : zlib_dep, - version : '1.2.3', - soversion : '7', - install : true) +zlib_dep = dependency('zlib', required: required) +if zlib_dep.found() + some = shared_library('some', 'lib.c', + # duplicate the rpath again, in order + # to test Meson's RPATH deduplication + build_rpath : zlib_dep.get_pkgconfig_variable('libdir'), + dependencies : zlib_dep, + version : '1.2.3', + soversion : '7', + install : true) +else + some = shared_library('some', 'lib.c', + version : '1.2.3', + soversion : '7', + install : true) +endif noversion = shared_library('noversion', 'lib.c', install : true) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/osx/2 library versions/require_pkgconfig.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/osx/2 library versions/require_pkgconfig.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/osx/2 library versions/require_pkgconfig.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/osx/2 library versions/require_pkgconfig.py" 2019-02-07 09:08:59.000000000 +0000 @@ -0,0 +1,9 @@ +#!/usr/bin/env python3 + +import os +import shutil + +if 'CI' in os.environ or shutil.which('pkg-config'): + print('yes') +else: + print('no') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/osx/5 extra frameworks/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/osx/5 extra frameworks/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/osx/5 extra frameworks/installed_files.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/osx/5 extra frameworks/installed_files.txt" 2019-02-07 09:08:59.000000000 +0000 @@ -0,0 +1,2 @@ +usr/bin/prog +usr/lib/libstat.a diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/osx/5 extra frameworks/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/osx/5 extra frameworks/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/osx/5 extra frameworks/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/osx/5 extra frameworks/meson.build" 2019-02-07 09:08:59.000000000 +0000 @@ -0,0 +1,13 @@ +project('xcode extra framework test', 'c') + +dep_libs = dependency('OpenGL', method : 'extraframework') +assert(dep_libs.type_name() == 'extraframeworks', 'type_name is ' + dep_libs.type_name()) + +dep_main = dependency('Foundation') +assert(dep_main.type_name() == 'extraframeworks', 'type_name is ' + dep_main.type_name()) + +dep_py = dependency('python', method : 'extraframework') +assert(dep_main.type_name() == 'extraframeworks', 'type_name is ' + dep_main.type_name()) + +stlib = static_library('stat', 'stat.c', install : true, dependencies: dep_libs) +exe = executable('prog', 'prog.c', install : true, dependencies: dep_main) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/osx/5 extra frameworks/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/osx/5 extra frameworks/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/osx/5 extra frameworks/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/osx/5 extra frameworks/prog.c" 2019-02-07 09:08:59.000000000 +0000 @@ -0,0 +1,3 @@ +int main(int argc, char **argv) { + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/osx/5 extra frameworks/stat.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/osx/5 extra frameworks/stat.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/osx/5 extra frameworks/stat.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/osx/5 extra frameworks/stat.c" 2019-02-07 09:08:59.000000000 +0000 @@ -0,0 +1 @@ +int func() { return 933; } diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/osx/6 multiframework/main.m" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/osx/6 multiframework/main.m" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/osx/6 multiframework/main.m" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/osx/6 multiframework/main.m" 2019-03-10 17:10:57.000000000 +0000 @@ -0,0 +1,5 @@ +#import + +int main(int argc, const char * argv[]) { + return NSApplicationMain(argc, argv); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/osx/6 multiframework/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/osx/6 multiframework/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/osx/6 multiframework/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/osx/6 multiframework/meson.build" 2019-03-10 17:10:57.000000000 +0000 @@ -0,0 +1,13 @@ +project('multiframework', 'objc') + +# In theory only 'AppKit' would be enough but there was a bug +# that causes a build failure when defining two modules. The +# arguments for the latter module overwrote the arguments for +# the first one rather than adding to them. +cocoa_dep = dependency('appleframeworks', modules : ['AppKit', 'foundation']) + +executable('deptester', + 'main.m', + objc_args : ['-fobjc-arc'], + dependencies : [cocoa_dep], +) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/osx/7 bitcode/libbar.mm" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/osx/7 bitcode/libbar.mm" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/osx/7 bitcode/libbar.mm" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/osx/7 bitcode/libbar.mm" 2019-06-27 16:43:00.000000000 +0000 @@ -0,0 +1,7 @@ +#import +#import "vis.h" + +int EXPORT_PUBLIC libbar(int arg) { + return 0; +} + diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/osx/7 bitcode/libfile.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/osx/7 bitcode/libfile.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/osx/7 bitcode/libfile.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/osx/7 bitcode/libfile.c" 2019-06-27 16:43:00.000000000 +0000 @@ -0,0 +1,5 @@ +#include "vis.h" + +int EXPORT_PUBLIC libfunc() { + return 3; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/osx/7 bitcode/libfoo.m" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/osx/7 bitcode/libfoo.m" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/osx/7 bitcode/libfoo.m" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/osx/7 bitcode/libfoo.m" 2019-06-27 16:43:00.000000000 +0000 @@ -0,0 +1,7 @@ +#import +#import "vis.h" + +int EXPORT_PUBLIC libfoo(int arg) { + return 0; +} + diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/osx/7 bitcode/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/osx/7 bitcode/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/osx/7 bitcode/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/osx/7 bitcode/meson.build" 2019-06-27 16:43:00.000000000 +0000 @@ -0,0 +1,10 @@ +project('bitcode test', 'c', 'objc', 'objcpp') + +both_libraries('alib', 'libfoo.m') +shared_module('amodule', 'libfoo.m') + +both_libraries('blib', 'libbar.mm') +shared_module('bmodule', 'libbar.mm') + +both_libraries('clib', 'libfile.c') +shared_module('cmodule', 'libfile.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/osx/7 bitcode/vis.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/osx/7 bitcode/vis.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/osx/7 bitcode/vis.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/osx/7 bitcode/vis.h" 2019-06-27 16:43:00.000000000 +0000 @@ -0,0 +1,6 @@ +#if defined __GNUC__ + #define EXPORT_PUBLIC __attribute__ ((visibility("default"))) +#else + #pragma message ("Compiler does not support symbol visibility.") + #define EXPORT_PUBLIC +#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/1 basic/gluon/gluonator.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/1 basic/gluon/gluonator.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/1 basic/gluon/gluonator.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/1 basic/gluon/gluonator.py" 2019-02-07 09:08:55.000000000 +0000 @@ -0,0 +1,2 @@ +def gluoninate(): + return 42 diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/1 basic/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/1 basic/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/1 basic/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/1 basic/meson.build" 2019-08-16 20:42:42.000000000 +0000 @@ -0,0 +1,26 @@ +project('python sample', 'c') + +py_mod = import('python') +py = py_mod.find_installation('python3') + +py_version = py.language_version() +if py_version.version_compare('< 3.2') + error('MESON_SKIP_TEST python 3 required for tests') +endif + +py_purelib = py.get_path('purelib') +if not py_purelib.endswith('site-packages') + error('Python3 purelib path seems invalid? ' + py_purelib) +endif + +# could be 'lib64' or 'Lib' on some systems +py_platlib = py.get_path('platlib') +if not py_platlib.endswith('site-packages') + error('Python3 platlib path seems invalid? ' + py_platlib) +endif + +main = files('prog.py') + +test('toplevel', py, args : main) + +subdir('subdir') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/1 basic/prog.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/1 basic/prog.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/1 basic/prog.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/1 basic/prog.py" 2019-02-07 09:08:55.000000000 +0000 @@ -0,0 +1,9 @@ +#!/usr/bin/env python3 + +from gluon import gluonator +import sys + +print('Running mainprog from root dir.') + +if gluonator.gluoninate() != 42: + sys.exit(1) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/1 basic/subdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/1 basic/subdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/1 basic/subdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/1 basic/subdir/meson.build" 2019-02-07 09:08:55.000000000 +0000 @@ -0,0 +1,4 @@ +test('subdir', + py, + args : files('subprog.py'), + env : 'PYTHONPATH=' + meson.source_root()) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/1 basic/subdir/subprog.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/1 basic/subdir/subprog.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/1 basic/subdir/subprog.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/1 basic/subdir/subprog.py" 2019-02-07 09:08:55.000000000 +0000 @@ -0,0 +1,12 @@ +#!/usr/bin/env python3 + +# In order to run this program, PYTHONPATH must be set to +# point to source root. + +from gluon import gluonator +import sys + +print('Running mainprog from subdir.') + +if gluonator.gluoninate() != 42: + sys.exit(1) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/2 extmodule/blaster.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/2 extmodule/blaster.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/2 extmodule/blaster.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/2 extmodule/blaster.py" 2019-02-07 09:08:55.000000000 +0000 @@ -0,0 +1,14 @@ +#!/usr/bin/env python3 + +import tachyon +import sys + +result = tachyon.phaserize('shoot') + +if not isinstance(result, int): + print('Returned result not an integer.') + sys.exit(1) + +if result != 1: + print('Returned result {} is not 1.'.format(result)) + sys.exit(1) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/2 extmodule/ext/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/2 extmodule/ext/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/2 extmodule/ext/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/2 extmodule/ext/meson.build" 2019-02-07 09:08:55.000000000 +0000 @@ -0,0 +1,6 @@ +pylib = py.extension_module('tachyon', + 'tachyon_module.c', + dependencies : py_dep, +) + +pypathdir = meson.current_build_dir() diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/2 extmodule/ext/tachyon_module.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/2 extmodule/ext/tachyon_module.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/2 extmodule/ext/tachyon_module.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/2 extmodule/ext/tachyon_module.c" 2019-02-07 09:08:55.000000000 +0000 @@ -0,0 +1,49 @@ +/* + Copyright 2016 The Meson development team + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* A very simple Python extension module. */ + +#include +#include + +static PyObject* phaserize(PyObject *self, PyObject *args) { + const char *message; + int result; + + if(!PyArg_ParseTuple(args, "s", &message)) + return NULL; + + result = strcmp(message, "shoot") ? 0 : 1; + return PyLong_FromLong(result); +} + +static PyMethodDef TachyonMethods[] = { + {"phaserize", phaserize, METH_VARARGS, + "Shoot tachyon cannons."}, + {NULL, NULL, 0, NULL} +}; + +static struct PyModuleDef tachyonmodule = { + PyModuleDef_HEAD_INIT, + "tachyon", + NULL, + -1, + TachyonMethods +}; + +PyMODINIT_FUNC PyInit_tachyon(void) { + return PyModule_Create(&tachyonmodule); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/2 extmodule/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/2 extmodule/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/2 extmodule/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/2 extmodule/meson.build" 2019-08-16 20:42:43.000000000 +0000 @@ -0,0 +1,28 @@ +project('Python extension module', 'c', + default_options : ['buildtype=release']) +# Because Windows Python ships only with optimized libs, +# we must build this project the same way. + +py_mod = import('python') +py = py_mod.find_installation() +py_dep = py.dependency() + +if py_dep.found() + subdir('ext') + + test('extmod', + py, + args : files('blaster.py'), + env : ['PYTHONPATH=' + pypathdir]) + + # Check we can apply a version constraint + dependency('python3', version: '>=@0@'.format(py_dep.version())) + +else + error('MESON_SKIP_TEST: Python3 libraries not found, skipping test.') +endif + +py3_pkg_dep = dependency('python3', method: 'pkg-config', required : false) +if py3_pkg_dep.found() + python_lib_dir = py3_pkg_dep.get_pkgconfig_variable('libdir') +endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/3 cython/cytest.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/3 cython/cytest.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/3 cython/cytest.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/3 cython/cytest.py" 2019-02-07 09:08:55.000000000 +0000 @@ -0,0 +1,23 @@ +#!/usr/bin/env python3 + +from storer import Storer +import sys + +s = Storer() + +if s.get_value() != 0: + print('Initial value incorrect.') + sys.exit(1) + +s.set_value(42) + +if s.get_value() != 42: + print('Setting value failed.') + sys.exit(1) + +try: + s.set_value('not a number') + print('Using wrong argument type did not fail.') + sys.exit(1) +except TypeError: + pass diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/3 cython/libdir/cstorer.pxd" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/3 cython/libdir/cstorer.pxd" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/3 cython/libdir/cstorer.pxd" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/3 cython/libdir/cstorer.pxd" 2019-02-07 09:08:55.000000000 +0000 @@ -0,0 +1,9 @@ + +cdef extern from "storer.h": + ctypedef struct Storer: + pass + + Storer* storer_new(); + void storer_destroy(Storer *s); + int storer_get_value(Storer *s); + void storer_set_value(Storer *s, int v); diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/3 cython/libdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/3 cython/libdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/3 cython/libdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/3 cython/libdir/meson.build" 2019-02-07 09:08:55.000000000 +0000 @@ -0,0 +1,11 @@ +pyx_c = custom_target('storer_pyx', + output : 'storer_pyx.c', + input : 'storer.pyx', + command : [cython, '@INPUT@', '-o', '@OUTPUT@'], +) + +slib = py3.extension_module('storer', + 'storer.c', pyx_c, + dependencies : py3_dep) + +pydir = meson.current_build_dir() diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/3 cython/libdir/storer.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/3 cython/libdir/storer.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/3 cython/libdir/storer.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/3 cython/libdir/storer.c" 2019-02-07 09:08:55.000000000 +0000 @@ -0,0 +1,24 @@ +#include"storer.h" +#include + +struct _Storer { + int value; +}; + +Storer* storer_new() { + Storer *s = malloc(sizeof(struct _Storer)); + s->value = 0; + return s; +} + +void storer_destroy(Storer *s) { + free(s); +} + +int storer_get_value(Storer *s) { + return s->value; +} + +void storer_set_value(Storer *s, int v) { + s->value = v; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/3 cython/libdir/storer.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/3 cython/libdir/storer.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/3 cython/libdir/storer.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/3 cython/libdir/storer.h" 2019-02-07 09:08:55.000000000 +0000 @@ -0,0 +1,8 @@ +#pragma once + +typedef struct _Storer Storer; + +Storer* storer_new(); +void storer_destroy(Storer *s); +int storer_get_value(Storer *s); +void storer_set_value(Storer *s, int v); diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/3 cython/libdir/storer.pyx" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/3 cython/libdir/storer.pyx" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/3 cython/libdir/storer.pyx" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/3 cython/libdir/storer.pyx" 2019-02-07 09:08:55.000000000 +0000 @@ -0,0 +1,16 @@ +cimport cstorer + +cdef class Storer: + cdef cstorer.Storer* _c_storer + + def __cinit__(self): + self._c_storer = cstorer.storer_new() + + def __dealloc__(self): + cstorer.storer_destroy(self._c_storer) + + cpdef int get_value(self): + return cstorer.storer_get_value(self._c_storer) + + cpdef set_value(self, int value): + cstorer.storer_set_value(self._c_storer, value) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/3 cython/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/3 cython/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/3 cython/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/3 cython/meson.build" 2019-08-16 20:42:43.000000000 +0000 @@ -0,0 +1,20 @@ +project('cython', 'c', + default_options : ['warning_level=3']) + +cython = find_program('cython3', required : false) +py3_dep = dependency('python3', required : false) + +if cython.found() and py3_dep.found() + py_mod = import('python') + py3 = py_mod.find_installation() + py3_dep = py3.dependency() + subdir('libdir') + + test('cython tester', + py3, + args : files('cytest.py'), + env : ['PYTHONPATH=' + pydir] + ) +else + error('MESON_SKIP_TEST: Cython3 or Python3 libraries not found, skipping test.') +endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/4 custom target depends extmodule/blaster.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/4 custom target depends extmodule/blaster.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/4 custom target depends extmodule/blaster.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/4 custom target depends extmodule/blaster.py" 2019-02-07 09:08:55.000000000 +0000 @@ -0,0 +1,32 @@ +#!/usr/bin/env python3 + +import os +import sys +import argparse + +from pathlib import Path + +filedir = Path(os.path.dirname(__file__)).resolve() +if list(filedir.glob('ext/*tachyon*')): + sys.path.insert(0, (filedir / 'ext').as_posix()) + +import tachyon + +parser = argparse.ArgumentParser() +parser.add_argument('-o', dest='output', default=None) + +options = parser.parse_args(sys.argv[1:]) + +result = tachyon.phaserize('shoot') + +if options.output: + with open(options.output, 'w') as f: + f.write('success') + +if not isinstance(result, int): + print('Returned result not an integer.') + sys.exit(1) + +if result != 1: + print('Returned result {} is not 1.'.format(result)) + sys.exit(1) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/4 custom target depends extmodule/ext/lib/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/4 custom target depends extmodule/ext/lib/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/4 custom target depends extmodule/ext/lib/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/4 custom target depends extmodule/ext/lib/meson.build" 2019-02-07 09:08:55.000000000 +0000 @@ -0,0 +1,4 @@ +libtachyon = shared_library('tachyonlib', 'meson-tachyonlib.c') + +libtachyon_dep = declare_dependency(link_with : libtachyon, + include_directories : include_directories('.')) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/4 custom target depends extmodule/ext/lib/meson-tachyonlib.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/4 custom target depends extmodule/ext/lib/meson-tachyonlib.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/4 custom target depends extmodule/ext/lib/meson-tachyonlib.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/4 custom target depends extmodule/ext/lib/meson-tachyonlib.c" 2019-02-07 09:08:55.000000000 +0000 @@ -0,0 +1,8 @@ +#ifdef _MSC_VER +__declspec(dllexport) +#endif +const char* +tachyon_phaser_command (void) +{ + return "shoot"; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/4 custom target depends extmodule/ext/lib/meson-tachyonlib.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/4 custom target depends extmodule/ext/lib/meson-tachyonlib.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/4 custom target depends extmodule/ext/lib/meson-tachyonlib.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/4 custom target depends extmodule/ext/lib/meson-tachyonlib.h" 2019-02-07 09:08:55.000000000 +0000 @@ -0,0 +1,6 @@ +#pragma once + +#ifdef _MSC_VER +__declspec(dllimport) +#endif +const char* tachyon_phaser_command (void); diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/4 custom target depends extmodule/ext/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/4 custom target depends extmodule/ext/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/4 custom target depends extmodule/ext/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/4 custom target depends extmodule/ext/meson.build" 2019-02-07 09:08:55.000000000 +0000 @@ -0,0 +1,6 @@ +subdir('lib') + +pylib = py3.extension_module('tachyon', + 'tachyon_module.c', + dependencies : [libtachyon_dep, py3_dep], +) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/4 custom target depends extmodule/ext/tachyon_module.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/4 custom target depends extmodule/ext/tachyon_module.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/4 custom target depends extmodule/ext/tachyon_module.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/4 custom target depends extmodule/ext/tachyon_module.c" 2019-02-07 09:08:55.000000000 +0000 @@ -0,0 +1,51 @@ +/* + Copyright 2016 The Meson development team + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* A very simple Python extension module. */ + +#include +#include + +#include "meson-tachyonlib.h" + +static PyObject* phaserize(PyObject *self, PyObject *args) { + const char *message; + int result; + + if(!PyArg_ParseTuple(args, "s", &message)) + return NULL; + + result = strcmp(message, tachyon_phaser_command()) ? 0 : 1; + return PyLong_FromLong(result); +} + +static PyMethodDef TachyonMethods[] = { + {"phaserize", phaserize, METH_VARARGS, + "Shoot tachyon cannons."}, + {NULL, NULL, 0, NULL} +}; + +static struct PyModuleDef tachyonmodule = { + PyModuleDef_HEAD_INIT, + "tachyon", + NULL, + -1, + TachyonMethods +}; + +PyMODINIT_FUNC PyInit_tachyon(void) { + return PyModule_Create(&tachyonmodule); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/4 custom target depends extmodule/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/4 custom target depends extmodule/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/4 custom target depends extmodule/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/4 custom target depends extmodule/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,35 @@ +project('Python extension module', 'c', + default_options : ['buildtype=release']) +# Because Windows Python ships only with optimized libs, +# we must build this project the same way. + +py_mod = import('python') +py3 = py_mod.find_installation() +py3_dep = py3.dependency(required : false) + +# Copy to the builddir so that blaster.py can find the built tachyon module +# FIXME: We should automatically detect this case and append the correct paths +# to PYTHONLIBDIR +blaster_py = configure_file(input : 'blaster.py', + output : 'blaster.py', + copy : true) + +check_exists = ''' +import os, sys +with open(sys.argv[1], 'rb') as f: + assert(f.read() == b'success') +''' +if py3_dep.found() + subdir('ext') + + out_txt = custom_target('tachyon flux', + input : blaster_py, + output : 'out.txt', + command : [py3, '@INPUT@', '-o', '@OUTPUT@'], + depends : pylib, + build_by_default: true) + + test('flux', py3, args : ['-c', check_exists, out_txt]) +else + error('MESON_SKIP_TEST: Python3 libraries not found, skipping test.') +endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/5 modules kwarg/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/5 modules kwarg/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/python/5 modules kwarg/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/python/5 modules kwarg/meson.build" 2019-08-16 20:42:46.000000000 +0000 @@ -0,0 +1,7 @@ +project('python kwarg') + +py = import('python') +prog_python = py.find_installation('python3', modules : ['setuptools']) +assert(prog_python.found() == true, 'python not found when should be') +prog_python = py.find_installation('python3', modules : ['thisbetternotexistmod'], required : false) +assert(prog_python.found() == false, 'python not found but reported as found') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/1 basic/added.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/1 basic/added.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/1 basic/added.txt" 2016-12-13 21:40:39.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/1 basic/added.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -project('rewritetest', 'c') - -sources = ['trivial.c'] - -exe = executable('trivialprog', 'notthere.c', sources) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/1 basic/addSrc.json" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/1 basic/addSrc.json" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/1 basic/addSrc.json" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/1 basic/addSrc.json" 2019-03-06 20:48:10.000000000 +0000 @@ -0,0 +1,94 @@ +[ + { + "type": "target", + "target": "trivialprog1", + "operation": "src_add", + "sources": ["a2.cpp", "a1.cpp", "a2.cpp"] + }, + { + "type": "target", + "target": "trivialprog2", + "operation": "src_add", + "sources": ["a7.cpp"] + }, + { + "type": "target", + "target": "trivialprog3", + "operation": "src_add", + "sources": ["a5.cpp"] + }, + { + "type": "target", + "target": "trivialprog4", + "operation": "src_add", + "sources": ["a5.cpp"] + }, + { + "type": "target", + "target": "trivialprog5", + "operation": "src_add", + "sources": ["a3.cpp"] + }, + { + "type": "target", + "target": "trivialprog6", + "operation": "src_add", + "sources": ["a4.cpp"] + }, + { + "type": "target", + "target": "trivialprog9", + "operation": "src_add", + "sources": ["a6.cpp", "a1.cpp"] + }, + { + "type": "target", + "target": "trivialprog0", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog1", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog2", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog3", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog4", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog5", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog6", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog7", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog8", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog9", + "operation": "info" + } +] diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/1 basic/addTgt.json" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/1 basic/addTgt.json" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/1 basic/addTgt.json" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/1 basic/addTgt.json" 2019-03-06 20:48:10.000000000 +0000 @@ -0,0 +1,9 @@ +[ + { + "type": "target", + "target": "trivialprog10", + "operation": "target_add", + "sources": ["new1.cpp", "new2.cpp"], + "target_type": "shared_library" + } +] diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/1 basic/info.json" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/1 basic/info.json" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/1 basic/info.json" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/1 basic/info.json" 2019-03-06 20:48:10.000000000 +0000 @@ -0,0 +1,57 @@ +[ + { + "type": "target", + "target": "trivialprog0", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog1", + "operation": "info" + }, + { + "type": "target", + "target": "exe2", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog3", + "operation": "info" + }, + { + "type": "target", + "target": "exe4", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog5", + "operation": "info" + }, + { + "type": "target", + "target": "exe6", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog7", + "operation": "info" + }, + { + "type": "target", + "target": "exe8", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog9", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog10", + "operation": "info" + } +] diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/1 basic/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/1 basic/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/1 basic/meson.build" 2016-12-13 21:40:39.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/1 basic/meson.build" 2019-03-06 20:48:10.000000000 +0000 @@ -1,5 +1,19 @@ -project('rewritetest', 'c') +project('rewritetest', 'cpp') -sources = ['trivial.c', 'notthere.c'] +src1 = ['main.cpp', 'fileA.cpp'] +src2 = files(['fileB.cpp', 'fileC.cpp']) +src3 = src1 +src4 = [src3] -exe = executable('trivialprog', sources) +# Magic comment + +exe0 = executable('trivialprog0', src1 + src2) +exe1 = executable('trivialprog1', src1) +exe2 = executable('trivialprog2', [src2]) +exe3 = executable('trivialprog3', ['main.cpp', 'fileA.cpp']) +exe4 = executable('trivialprog4', ['main.cpp', ['fileA.cpp']]) +exe5 = executable('trivialprog5', [src2, 'main.cpp']) +exe6 = executable('trivialprog6', 'main.cpp', 'fileA.cpp') +exe7 = executable('trivialprog7', 'fileB.cpp', src1, 'fileC.cpp') +exe8 = executable('trivialprog8', src3) +executable('trivialprog9', src4) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/1 basic/removed.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/1 basic/removed.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/1 basic/removed.txt" 2016-12-13 21:40:39.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/1 basic/removed.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -project('rewritetest', 'c') - -sources = ['trivial.c'] - -exe = executable('trivialprog', sources) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/1 basic/rmSrc.json" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/1 basic/rmSrc.json" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/1 basic/rmSrc.json" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/1 basic/rmSrc.json" 2019-03-06 20:48:10.000000000 +0000 @@ -0,0 +1,88 @@ +[ + { + "type": "target", + "target": "trivialprog1", + "operation": "src_rm", + "sources": ["fileA.cpp"] + }, + { + "type": "target", + "target": "trivialprog3", + "operation": "src_rm", + "sources": ["fileA.cpp"] + }, + { + "type": "target", + "target": "trivialprog4", + "operation": "src_rm", + "sources": ["fileA.cpp"] + }, + { + "type": "target", + "target": "trivialprog5", + "operation": "src_rm", + "sources": ["fileB.cpp"] + }, + { + "type": "target", + "target": "trivialprog6", + "operation": "src_rm", + "sources": ["fileA.cpp"] + }, + { + "type": "target", + "target": "trivialprog7", + "operation": "src_rm", + "sources": ["fileB.cpp"] + }, + { + "type": "target", + "target": "trivialprog0", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog1", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog2", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog3", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog4", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog5", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog6", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog7", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog8", + "operation": "info" + }, + { + "type": "target", + "target": "trivialprog9", + "operation": "info" + } +] diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/1 basic/rmTgt.json" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/1 basic/rmTgt.json" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/1 basic/rmTgt.json" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/1 basic/rmTgt.json" 2019-03-06 20:48:10.000000000 +0000 @@ -0,0 +1,17 @@ +[ + { + "type": "target", + "target": "exe0", + "operation": "target_rm" + }, + { + "type": "target", + "target": "trivialprog1", + "operation": "target_rm" + }, + { + "type": "target", + "target": "trivialprog9", + "operation": "target_rm" + } +] diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/2 subdirs/addSrc.json" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/2 subdirs/addSrc.json" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/2 subdirs/addSrc.json" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/2 subdirs/addSrc.json" 2019-02-28 20:43:18.000000000 +0000 @@ -0,0 +1,13 @@ +[ + { + "type": "target", + "target": "something", + "operation": "src_add", + "sources": ["third.c"] + }, + { + "type": "target", + "target": "something", + "operation": "info" + } +] diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/2 subdirs/addTgt.json" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/2 subdirs/addTgt.json" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/2 subdirs/addTgt.json" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/2 subdirs/addTgt.json" 2019-03-06 20:48:10.000000000 +0000 @@ -0,0 +1,10 @@ +[ + { + "type": "target", + "target": "newLib", + "operation": "target_add", + "sources": ["new1.cpp", "new2.cpp"], + "target_type": "shared_library", + "subdir": "sub2" + } +] diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/2 subdirs/info.json" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/2 subdirs/info.json" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/2 subdirs/info.json" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/2 subdirs/info.json" 2019-02-28 20:43:18.000000000 +0000 @@ -0,0 +1,12 @@ +[ + { + "type": "target", + "target": "something", + "operation": "info" + }, + { + "type": "target", + "target": "newLib", + "operation": "info" + } +] diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/2 subdirs/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/2 subdirs/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/2 subdirs/meson.build" 2016-12-13 21:40:39.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/2 subdirs/meson.build" 2019-02-07 09:08:59.000000000 +0000 @@ -2,4 +2,3 @@ subdir('sub1') subdir('sub2') - diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/2 subdirs/rmTgt.json" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/2 subdirs/rmTgt.json" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/2 subdirs/rmTgt.json" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/2 subdirs/rmTgt.json" 2019-03-06 20:48:10.000000000 +0000 @@ -0,0 +1,7 @@ +[ + { + "type": "target", + "target": "something", + "operation": "target_rm" + } +] diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/2 subdirs/sub1/after.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/2 subdirs/sub1/after.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/2 subdirs/sub1/after.txt" 2016-12-13 21:40:39.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/2 subdirs/sub1/after.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -srcs = ['first.c'] diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/2 subdirs/sub2/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/2 subdirs/sub2/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/2 subdirs/sub2/meson.build" 2016-12-13 21:40:39.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/2 subdirs/sub2/meson.build" 2019-02-07 09:08:59.000000000 +0000 @@ -1,2 +1 @@ executable('something', srcs) - diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/3 kwargs/add.json" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/3 kwargs/add.json" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/3 kwargs/add.json" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/3 kwargs/add.json" 2019-03-06 20:48:10.000000000 +0000 @@ -0,0 +1,29 @@ +[ + { + "type": "kwargs", + "function": "project", + "id": "/", + "operation": "set", + "kwargs": { + "license": "GPL" + } + }, + { + "type": "kwargs", + "function": "project", + "id": "/", + "operation": "add", + "kwargs": { + "license": ["MIT"] + } + }, + { + "type": "kwargs", + "function": "project", + "id": "/", + "operation": "add", + "kwargs": { + "license": "BSD" + } + } +] diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/3 kwargs/defopts_delete.json" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/3 kwargs/defopts_delete.json" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/3 kwargs/defopts_delete.json" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/3 kwargs/defopts_delete.json" 2019-03-06 20:48:10.000000000 +0000 @@ -0,0 +1,18 @@ +[ + { + "type": "kwargs", + "function": "project", + "id": "/", + "operation": "set", + "kwargs": { + "default_options": ["cpp_std=c++14", "buildtype=release", "debug=true"] + } + }, + { + "type": "default_options", + "operation": "delete", + "options": { + "buildtype": null + } + } +] diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/3 kwargs/defopts_set.json" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/3 kwargs/defopts_set.json" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/3 kwargs/defopts_set.json" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/3 kwargs/defopts_set.json" 2019-02-28 20:43:18.000000000 +0000 @@ -0,0 +1,24 @@ +[ + { + "type": "default_options", + "operation": "set", + "options": { + "cpp_std": "c++14" + } + }, + { + "type": "default_options", + "operation": "set", + "options": { + "buildtype": "release", + "debug": true + } + }, + { + "type": "default_options", + "operation": "set", + "options": { + "cpp_std": "c++11" + } + } +] diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/3 kwargs/delete.json" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/3 kwargs/delete.json" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/3 kwargs/delete.json" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/3 kwargs/delete.json" 2019-06-16 18:54:18.000000000 +0000 @@ -0,0 +1,20 @@ +[ + { + "type": "kwargs", + "function": "project", + "id": "/", + "operation": "delete", + "kwargs": { + "version": null + } + }, + { + "type": "kwargs", + "function": "target", + "id": "helloWorld", + "operation": "delete", + "kwargs": { + "build_by_default": false + } + } +] diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/3 kwargs/info.json" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/3 kwargs/info.json" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/3 kwargs/info.json" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/3 kwargs/info.json" 2019-03-06 20:48:10.000000000 +0000 @@ -0,0 +1,20 @@ +[ + { + "type": "kwargs", + "function": "project", + "id": "/", + "operation": "info" + }, + { + "type": "kwargs", + "function": "target", + "id": "tgt1", + "operation": "info" + }, + { + "type": "kwargs", + "function": "dependency", + "id": "dep1", + "operation": "info" + } +] diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/3 kwargs/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/3 kwargs/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/3 kwargs/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/3 kwargs/meson.build" 2019-02-28 20:43:18.000000000 +0000 @@ -0,0 +1,7 @@ +project('rewritetest', 'cpp', version: '0.0.1') + +# Find ZLIB +dep1 = dependency('zlib', required: false) + +# Make a test exe +tgt1 = executable('helloWorld', 'main.cpp', build_by_default: true) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/3 kwargs/remove.json" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/3 kwargs/remove.json" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/3 kwargs/remove.json" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/3 kwargs/remove.json" 2019-03-06 20:48:10.000000000 +0000 @@ -0,0 +1,29 @@ +[ + { + "type": "kwargs", + "function": "project", + "id": "/", + "operation": "set", + "kwargs": { + "license": ["GPL", "MIT", "BSD"] + } + }, + { + "type": "kwargs", + "function": "project", + "id": "/", + "operation": "remove", + "kwargs": { + "license": ["MIT"] + } + }, + { + "type": "kwargs", + "function": "project", + "id": "/", + "operation": "remove", + "kwargs": { + "license": "BSD" + } + } +] diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/3 kwargs/remove_regex.json" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/3 kwargs/remove_regex.json" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/3 kwargs/remove_regex.json" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/3 kwargs/remove_regex.json" 2019-03-06 20:48:10.000000000 +0000 @@ -0,0 +1,20 @@ +[ + { + "type": "kwargs", + "function": "project", + "id": "/", + "operation": "set", + "kwargs": { + "default_options": ["cpp_std=c++14", "buildtype=release", "debug=true"] + } + }, + { + "type": "kwargs", + "function": "project", + "id": "/", + "operation": "remove_regex", + "kwargs": { + "default_options": ["cpp_std=.*"] + } + } +] diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/3 kwargs/set.json" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/3 kwargs/set.json" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/3 kwargs/set.json" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/3 kwargs/set.json" 2019-03-06 20:48:10.000000000 +0000 @@ -0,0 +1,34 @@ +[ + { + "type": "kwargs", + "function": "project", + "id": "/", + "operation": "set", + "kwargs": { + "version": "0.0.2", + "meson_version": "0.50.0", + "license": ["GPL", "MIT"] + } + }, + { + "type": "kwargs", + "function": "target", + "id": "helloWorld", + "operation": "set", + "kwargs": { + "build_by_default": false, + "build_rpath": "/usr/local", + "dependencies": "dep1" + } + }, + { + "type": "kwargs", + "function": "dependency", + "id": "zlib", + "operation": "set", + "kwargs": { + "required": true, + "method": "cmake" + } + } +] diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/4 same name targets/addSrc.json" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/4 same name targets/addSrc.json" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/4 same name targets/addSrc.json" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/4 same name targets/addSrc.json" 2019-03-06 20:48:10.000000000 +0000 @@ -0,0 +1,8 @@ +[ + { + "type": "target", + "target": "myExe", + "operation": "src_add", + "sources": ["a1.cpp", "a2.cpp"] + } +] diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/4 same name targets/info.json" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/4 same name targets/info.json" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/4 same name targets/info.json" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/4 same name targets/info.json" 2019-03-06 20:48:10.000000000 +0000 @@ -0,0 +1,12 @@ +[ + { + "type": "target", + "target": "exe1", + "operation": "info" + }, + { + "type": "target", + "target": "exe2", + "operation": "info" + } +] diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/4 same name targets/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/4 same name targets/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/4 same name targets/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/4 same name targets/meson.build" 2019-03-06 20:48:10.000000000 +0000 @@ -0,0 +1,6 @@ +project('rewrite same name targets', 'cpp') + +src1 = ['main.cpp'] + +exe1 = executable('myExe', src1) +subdir('sub1') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/4 same name targets/sub1/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/4 same name targets/sub1/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/4 same name targets/sub1/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/4 same name targets/sub1/meson.build" 2019-03-06 20:48:10.000000000 +0000 @@ -0,0 +1,3 @@ +src2 = ['main.cpp'] + +exe2 = executable('myExe', src2) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/5 sorting/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/5 sorting/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rewrite/5 sorting/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rewrite/5 sorting/meson.build" 2019-03-06 20:48:10.000000000 +0000 @@ -0,0 +1,33 @@ +project('rewriter source sorting', ['c', 'cpp']) + +src1 = files([ + 'a1.c', + 'a10.c', + 'a2.c', + 'a3.c', + 'bbb/a/b1.c', + 'bbb/a4.c', + 'bbb/b3.c', + 'bbb/b4.c', + 'bbb/b/b2.c', + 'bbb/c1/b5.c', + 'bbb/c10/b6.c', + 'bbb/c2/b7.c', + 'bbb/b5.c', + 'a110.c', + 'aaa/f1.c', + 'aaa/f2.c', + 'aaa/f3.c', + 'a20.c', + 'b1.c', + 'aaa/b/b1.c', + 'aaa/b/b2.c', + 'a30.c', + 'a100.c', + 'aaa/a/a1.c', + 'a101.c', + 'a210.c', + 'c2.c' +]) + +exe1 = executable('exe1', src1) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rust/1 basic/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rust/1 basic/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rust/1 basic/installed_files.txt" 2017-04-04 16:41:09.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rust/1 basic/installed_files.txt" 2019-06-27 16:43:00.000000000 +0000 @@ -1,2 +1,4 @@ usr/bin/program?exe +?msvc:usr/bin/program.pdb usr/bin/program2?exe +?msvc:usr/bin/program2.pdb diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rust/2 sharedlib/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rust/2 sharedlib/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rust/2 sharedlib/installed_files.txt" 2017-07-21 20:07:34.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rust/2 sharedlib/installed_files.txt" 2019-06-27 16:43:00.000000000 +0000 @@ -1,2 +1,6 @@ usr/bin/prog?exe -usr/lib/libstuff.so +?msvc:usr/bin/prog.pdb +?gcc:usr/lib/libstuff.so +?msvc:usr/bin/stuff.dll +?msvc:usr/bin/stuff.pdb +?msvc:usr/lib/stuff.dll.lib diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rust/2 sharedlib/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rust/2 sharedlib/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rust/2 sharedlib/meson.build" 2018-12-09 16:34:01.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rust/2 sharedlib/meson.build" 2019-08-16 20:41:20.000000000 +0000 @@ -2,4 +2,11 @@ l = shared_library('stuff', 'stuff.rs', install : true) e = executable('prog', 'prog.rs', link_with : l, install : true) -test('linktest', e) + +if build_machine.system() == 'windows' + rustup = find_program('rustup') + test('linktest', rustup, + args: ['run', 'stable', e]) +else + test('linktest', e) +endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rust/3 staticlib/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rust/3 staticlib/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rust/3 staticlib/installed_files.txt" 2016-07-15 10:52:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rust/3 staticlib/installed_files.txt" 2019-06-27 16:43:00.000000000 +0000 @@ -1,2 +1,3 @@ usr/bin/prog?exe +?msvc:usr/bin/prog.pdb usr/lib/libstuff.rlib diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rust/4 polyglot/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rust/4 polyglot/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rust/4 polyglot/installed_files.txt" 2017-07-21 20:07:34.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rust/4 polyglot/installed_files.txt" 2019-06-27 16:43:00.000000000 +0000 @@ -1,2 +1,7 @@ usr/bin/prog?exe -usr/lib/libstuff.so +?msvc:usr/bin/prog.pdb +?gcc:usr/lib/libstuff.so +?msvc:usr/bin/stuff.dll +?msvc:usr/lib/stuff.dll.lib +?msvc:usr/bin/stuff.pdb + diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rust/5 polyglot static/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rust/5 polyglot static/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rust/5 polyglot static/installed_files.txt" 2017-07-21 20:07:34.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rust/5 polyglot static/installed_files.txt" 2019-06-27 16:43:00.000000000 +0000 @@ -1,2 +1,3 @@ usr/bin/prog?exe +?msvc:usr/bin/prog.pdb usr/lib/libstuff.a diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rust/5 polyglot static/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rust/5 polyglot static/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rust/5 polyglot static/meson.build" 2018-12-09 16:34:05.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rust/5 polyglot static/meson.build" 2019-08-16 20:41:27.000000000 +0000 @@ -1,10 +1,16 @@ project('static rust and c polyglot executable', 'c', 'rust') deps = [ - meson.get_compiler('c').find_library('dl'), + meson.get_compiler('c').find_library('dl', required: false), dependency('threads'), ] +extra_winlibs = meson.get_compiler('c').get_id() == 'msvc' ? ['userenv.lib', 'ws2_32.lib'] : [] + l = static_library('stuff', 'stuff.rs', rust_crate_type : 'staticlib', install : true) -e = executable('prog', 'prog.c', dependencies: deps, link_with : l, install : true) +e = executable('prog', 'prog.c', + dependencies: deps, + link_with : l, + link_args: extra_winlibs, + install : true) test('polyglottest', e) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rust/6 named staticlib/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rust/6 named staticlib/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rust/6 named staticlib/installed_files.txt" 2017-07-22 16:05:44.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rust/6 named staticlib/installed_files.txt" 2019-06-27 16:43:00.000000000 +0000 @@ -1,2 +1,3 @@ usr/bin/prog?exe +?msvc:usr/bin/prog.pdb usr/lib/libnamed_stuff.rlib diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rust/7 private crate collision/installed_files.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rust/7 private crate collision/installed_files.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/rust/7 private crate collision/installed_files.txt" 2018-08-25 08:05:43.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/rust/7 private crate collision/installed_files.txt" 2019-06-27 16:43:00.000000000 +0000 @@ -1,2 +1,3 @@ usr/bin/prog?exe +?msvc:usr/bin/prog.pdb usr/lib/librand.rlib diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/17 prebuilt shared/patron.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/17 prebuilt shared/patron.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/17 prebuilt shared/patron.c" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/17 prebuilt shared/patron.c" 2019-02-07 09:08:55.000000000 +0000 @@ -5,4 +5,5 @@ printf("You are standing outside the Great Library of Alexandria.\n"); printf("You decide to go inside.\n\n"); alexandria_visit(); + return 0; } diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/20 subproj dep variables/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/20 subproj dep variables/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/20 subproj dep variables/meson.build" 2018-08-25 08:05:43.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/20 subproj dep variables/meson.build" 2019-02-07 09:08:55.000000000 +0000 @@ -11,3 +11,6 @@ dependency('zlibproxy', required : true, fallback : ['somesubproj', 'zlibproxy_dep']) + +dependency('somedep', required : false, + fallback : ['nestedsubproj', 'nestedsubproj_dep']) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/20 subproj dep variables/subprojects/nestedsubproj/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/20 subproj dep variables/subprojects/nestedsubproj/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/20 subproj dep variables/subprojects/nestedsubproj/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/20 subproj dep variables/subprojects/nestedsubproj/meson.build" 2019-02-07 09:08:55.000000000 +0000 @@ -0,0 +1,3 @@ +project('dep', 'c') + +subproject('subsubproject') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/20 subproj dep variables/subprojects/nestedsubproj/subprojects/subsubproject.wrap" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/20 subproj dep variables/subprojects/nestedsubproj/subprojects/subsubproject.wrap" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/20 subproj dep variables/subprojects/nestedsubproj/subprojects/subsubproject.wrap" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/20 subproj dep variables/subprojects/nestedsubproj/subprojects/subsubproject.wrap" 2019-02-07 09:08:55.000000000 +0000 @@ -0,0 +1 @@ +[wrap-file] diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/46 native file binary/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/46 native file binary/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/46 native file binary/meson.build" 2018-12-09 14:27:23.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/46 native file binary/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -project('test project') - -case = get_option('case') - -if case == 'find_program' - prog = find_program('bash') - result = run_command(prog, ['--version']) - assert(result.stdout().strip().endswith('12345'), 'Didn\'t load bash from config file') -elif case == 'config_dep' - add_languages('cpp') - dep = dependency('llvm') - assert(dep.get_configtool_variable('version').endswith('12345'), 'Didn\'t load llvm from config file') -elif case == 'python3' - prog = import('python3').find_python() - result = run_command(prog, ['--version']) - assert(result.stdout().strip().endswith('12345'), 'Didn\'t load python3 from config file') -elif case == 'python' - prog = import('python').find_installation() - result = run_command(prog, ['--version']) - assert(result.stdout().strip().endswith('12345'), 'Didn\'t load python from config file') -endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/46 native file binary/meson_options.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/46 native file binary/meson_options.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/46 native file binary/meson_options.txt" 2018-12-09 14:27:23.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/46 native file binary/meson_options.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -option( - 'case', - type : 'combo', - choices : ['find_program', 'config_dep', 'python3', 'python'] -) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/46 reconfigure/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/46 reconfigure/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/46 reconfigure/main.c" 2018-12-09 14:27:16.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/46 reconfigure/main.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -int main(int argc, char *argv[]) -{ - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/46 reconfigure/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/46 reconfigure/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/46 reconfigure/meson.build" 2018-12-09 14:27:16.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/46 reconfigure/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -project('test-reconfigure', 'c') - -message('opt1 ' + get_option('opt1')) -message('opt2 ' + get_option('opt2')) -message('opt3 ' + get_option('opt3')) -message('opt4 ' + get_option('opt4')) - -exe = executable('test1', 'main.c') -test('test1', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/46 reconfigure/meson_options.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/46 reconfigure/meson_options.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/46 reconfigure/meson_options.txt" 2018-12-09 14:27:16.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/46 reconfigure/meson_options.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -option('opt1', type : 'string', value : 'default1') -option('opt2', type : 'string', value : 'default2') -option('opt3', type : 'string', value : 'default3') -option('opt4', type : 'string', value : 'default4') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/47 native file binary/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/47 native file binary/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/47 native file binary/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/47 native file binary/meson.build" 2019-05-05 19:11:16.000000000 +0000 @@ -0,0 +1,21 @@ +project('test project') + +case = get_option('case') + +if case == 'find_program' + prog = find_program('bash') + result = run_command(prog, ['--version']) + assert(result.stdout().strip().endswith('12345'), 'Didn\'t load bash from config file') +elif case == 'config_dep' + add_languages('cpp') + dep = dependency('llvm', method : 'config-tool') + assert(dep.get_configtool_variable('version').endswith('12345'), 'Didn\'t load llvm from config file') +elif case == 'python3' + prog = import('python3').find_python() + result = run_command(prog, ['--version']) + assert(result.stdout().strip().endswith('12345'), 'Didn\'t load python3 from config file') +elif case == 'python' + prog = import('python').find_installation() + result = run_command(prog, ['--version']) + assert(result.stdout().strip().endswith('12345'), 'Didn\'t load python from config file') +endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/47 native file binary/meson_options.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/47 native file binary/meson_options.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/47 native file binary/meson_options.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/47 native file binary/meson_options.txt" 2019-03-10 17:10:57.000000000 +0000 @@ -0,0 +1,5 @@ +option( + 'case', + type : 'combo', + choices : ['find_program', 'config_dep', 'python3', 'python'] +) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/47 testsetup default/envcheck.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/47 testsetup default/envcheck.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/47 testsetup default/envcheck.py" 2018-12-09 14:27:16.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/47 testsetup default/envcheck.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -#!/usr/bin/env python3 - -import os - -assert('ENV_A' in os.environ) -assert('ENV_B' in os.environ) -assert('ENV_C' in os.environ) - -print('ENV_A is', os.environ['ENV_A']) -print('ENV_B is', os.environ['ENV_B']) -print('ENV_C is', os.environ['ENV_C']) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/47 testsetup default/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/47 testsetup default/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/47 testsetup default/meson.build" 2018-12-09 14:27:16.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/47 testsetup default/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -project('testsetup default', 'c') - -envcheck = find_program('envcheck.py') - -# Defining ENV_A in test-env should overwrite ENV_A from test setup -env_1 = environment() -env_1.set('ENV_A', '1') -test('test-env', envcheck, env: env_1) - -# Defining default env which is used unless --setup is given or the -# env variable is defined in the test. -env_2 = environment() -env_2.set('ENV_A', '2') -env_2.set('ENV_B', '2') -env_2.set('ENV_C', '2') -add_test_setup('mydefault', env: env_2, is_default: true) - -# Defining a test setup that will update some of the env variables -# from the default test setup. -env_3 = env_2 -env_3.set('ENV_A', '3') -env_3.set('ENV_B', '3') -add_test_setup('other', env: env_3) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/48 pkgconfig csharp library/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/48 pkgconfig csharp library/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/48 pkgconfig csharp library/meson.build" 2018-12-09 14:27:23.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/48 pkgconfig csharp library/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -project('pkgformat', 'cs', - version : '1.0') - -pkgg = import('pkgconfig') - -l = library('libsomething', 'somelib.cs') - -pkgg.generate(l, - version: '1.0', - description: 'A library that does something') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/48 pkgconfig csharp library/somelib.cs" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/48 pkgconfig csharp library/somelib.cs" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/48 pkgconfig csharp library/somelib.cs" 2018-12-09 14:27:23.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/48 pkgconfig csharp library/somelib.cs" 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -using System; - -namespace Abc -{ - public static class Something - { - public static bool Api1(this String str) - { - return str == "foo"; - } - } -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/48 reconfigure/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/48 reconfigure/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/48 reconfigure/main.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/48 reconfigure/main.c" 2019-03-10 17:10:57.000000000 +0000 @@ -0,0 +1,4 @@ +int main(int argc, char *argv[]) +{ + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/48 reconfigure/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/48 reconfigure/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/48 reconfigure/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/48 reconfigure/meson.build" 2019-03-10 17:10:57.000000000 +0000 @@ -0,0 +1,9 @@ +project('test-reconfigure', 'c') + +message('opt1 ' + get_option('opt1')) +message('opt2 ' + get_option('opt2')) +message('opt3 ' + get_option('opt3')) +message('opt4 ' + get_option('opt4')) + +exe = executable('test1', 'main.c') +test('test1', exe) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/48 reconfigure/meson_options.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/48 reconfigure/meson_options.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/48 reconfigure/meson_options.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/48 reconfigure/meson_options.txt" 2019-03-10 17:10:57.000000000 +0000 @@ -0,0 +1,4 @@ +option('opt1', type : 'string', value : 'default1') +option('opt2', type : 'string', value : 'default2') +option('opt3', type : 'string', value : 'default3') +option('opt4', type : 'string', value : 'default4') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/49 ldflagdedup/bob.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/49 ldflagdedup/bob.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/49 ldflagdedup/bob.c" 2018-12-09 14:27:23.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/49 ldflagdedup/bob.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#include - -int func() { - return 0; -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/49 ldflagdedup/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/49 ldflagdedup/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/49 ldflagdedup/meson.build" 2018-12-09 14:27:23.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/49 ldflagdedup/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -project('lddedup', 'c') - -# Chosen because its ldflags contains -Wl,--export-dynamic, -# which must be deduplicated. -gm = dependency('gmodule-2.0') - -lib = static_library('bob', 'bob.c', - dependencies: gm) - -executable('prog', 'prog.c', - link_with: lib, - dependencies: gm) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/49 ldflagdedup/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/49 ldflagdedup/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/49 ldflagdedup/prog.c" 2018-12-09 14:27:23.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/49 ldflagdedup/prog.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -#include - -int func(); - -int main(int argc, char **argv) { - return func(); -} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/49 testsetup default/envcheck.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/49 testsetup default/envcheck.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/49 testsetup default/envcheck.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/49 testsetup default/envcheck.py" 2019-03-10 17:10:57.000000000 +0000 @@ -0,0 +1,11 @@ +#!/usr/bin/env python3 + +import os + +assert('ENV_A' in os.environ) +assert('ENV_B' in os.environ) +assert('ENV_C' in os.environ) + +print('ENV_A is', os.environ['ENV_A']) +print('ENV_B is', os.environ['ENV_B']) +print('ENV_C is', os.environ['ENV_C']) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/49 testsetup default/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/49 testsetup default/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/49 testsetup default/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/49 testsetup default/meson.build" 2019-03-10 17:10:57.000000000 +0000 @@ -0,0 +1,23 @@ +project('testsetup default', 'c') + +envcheck = find_program('envcheck.py') + +# Defining ENV_A in test-env should overwrite ENV_A from test setup +env_1 = environment() +env_1.set('ENV_A', '1') +test('test-env', envcheck, env: env_1) + +# Defining default env which is used unless --setup is given or the +# env variable is defined in the test. +env_2 = environment() +env_2.set('ENV_A', '2') +env_2.set('ENV_B', '2') +env_2.set('ENV_C', '2') +add_test_setup('mydefault', env: env_2, is_default: true) + +# Defining a test setup that will update some of the env variables +# from the default test setup. +env_3 = env_2 +env_3.set('ENV_A', '3') +env_3.set('ENV_B', '3') +add_test_setup('other', env: env_3) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/4 suite selection/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/4 suite selection/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/4 suite selection/meson.build" 2017-01-16 19:04:35.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/4 suite selection/meson.build" 2019-05-05 19:11:16.000000000 +0000 @@ -11,3 +11,7 @@ test('mainprj-successful_test', executable('successful_test', 'successful_test.c'), suite : 'success') + +test('mainprj-successful_test_no_suite', + executable('no_suite_test', 'successful_test.c'), + suite : []) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/4 suite selection/subprojects/subprjfail/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/4 suite selection/subprojects/subprjfail/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/4 suite selection/subprojects/subprjfail/meson.build" 2017-01-16 19:04:35.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/4 suite selection/subprojects/subprjfail/meson.build" 2019-05-05 19:11:16.000000000 +0000 @@ -3,3 +3,7 @@ test('subprjfail-failing_test', executable('failing_test', 'failing_test.c'), suite : 'fail') + +test('subprjfail-failing_test_no_suite', + executable('failing_test_no_suite', 'failing_test.c'), + suite : []) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/4 suite selection/subprojects/subprjsucc/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/4 suite selection/subprojects/subprjsucc/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/4 suite selection/subprojects/subprjsucc/meson.build" 2017-01-16 19:04:35.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/4 suite selection/subprojects/subprjsucc/meson.build" 2019-05-05 19:11:16.000000000 +0000 @@ -3,3 +3,7 @@ test('subprjsucc-successful_test', executable('successful_test', 'successful_test.c'), suite : 'success') + +test('subprjsucc-successful_test_no_suite', + executable('successful_test_no_suite', 'successful_test.c'), + suite : []) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/50 pkgconfig csharp library/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/50 pkgconfig csharp library/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/50 pkgconfig csharp library/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/50 pkgconfig csharp library/meson.build" 2019-03-10 17:10:57.000000000 +0000 @@ -0,0 +1,10 @@ +project('pkgformat', 'cs', + version : '1.0') + +pkgg = import('pkgconfig') + +l = library('libsomething', 'somelib.cs') + +pkgg.generate(l, + version: '1.0', + description: 'A library that does something') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/50 pkgconfig csharp library/somelib.cs" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/50 pkgconfig csharp library/somelib.cs" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/50 pkgconfig csharp library/somelib.cs" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/50 pkgconfig csharp library/somelib.cs" 2019-03-10 17:10:57.000000000 +0000 @@ -0,0 +1,12 @@ +using System; + +namespace Abc +{ + public static class Something + { + public static bool Api1(this String str) + { + return str == "foo"; + } + } +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/51 noncross options/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/51 noncross options/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/51 noncross options/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/51 noncross options/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,14 @@ +project('std_remains', 'c', default_options: ['c_std=c99']) + +executable('prog', 'prog.c') + +# Check that native: true does not affect the use of c_std in +# non-cross builds + +if not meson.is_cross_build() + executable('prog2', 'prog.c', native: true) + + # Check that even deps marked as native are found + # by default when not cross compiling. + dependency('ylib', method: 'pkg-config') +endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/51 noncross options/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/51 noncross options/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/51 noncross options/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/51 noncross options/prog.c" 2019-08-25 19:17:02.000000000 +0000 @@ -0,0 +1 @@ +int main(int argc, char **argv) { return 0; } diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/51 noncross options/ylib.pc" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/51 noncross options/ylib.pc" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/51 noncross options/ylib.pc" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/51 noncross options/ylib.pc" 2019-08-25 19:17:02.000000000 +0000 @@ -0,0 +1,13 @@ +prefix=/usr +exec_prefix=${prefix} +libdir=${prefix}/lib/x86_64-linux-gnu +sharedlibdir=${libdir} +includedir=${prefix}/include + +Name: ylib +Description: ylib compression library +Version: 1.2.3 + +Requires: +Libs: -L${libdir} -L${sharedlibdir} -ly +Cflags: -I${includedir} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/52 ldflagdedup/bob.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/52 ldflagdedup/bob.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/52 ldflagdedup/bob.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/52 ldflagdedup/bob.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +#include + +int func() { + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/52 ldflagdedup/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/52 ldflagdedup/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/52 ldflagdedup/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/52 ldflagdedup/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,12 @@ +project('lddedup', 'c') + +# Chosen because its ldflags contains -Wl,--export-dynamic, +# which must be deduplicated. +gm = dependency('gmodule-2.0') + +lib = static_library('bob', 'bob.c', + dependencies: gm) + +executable('prog', 'prog.c', + link_with: lib, + dependencies: gm) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/52 ldflagdedup/prog.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/52 ldflagdedup/prog.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/52 ldflagdedup/prog.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/52 ldflagdedup/prog.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,7 @@ +#include + +int func(); + +int main(int argc, char **argv) { + return func(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/53 pkgconfig static link order/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/53 pkgconfig static link order/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/53 pkgconfig static link order/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/53 pkgconfig static link order/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,11 @@ +project('link order test', 'c') + +dep = library('dependency', []) +lib = static_library('something', [], link_with: dep) + +import('pkgconfig').generate( + name: 'libsomething', + description: 'test library', + libraries: lib, + version: '1' +) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/54 clang-format/.clang-format" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/54 clang-format/.clang-format" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/54 clang-format/.clang-format" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/54 clang-format/.clang-format" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +--- +BasedOnStyle: LLVM +IndentWidth: 4 +UseTab: Never +--- diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/54 clang-format/header_expected_h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/54 clang-format/header_expected_h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/54 clang-format/header_expected_h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/54 clang-format/header_expected_h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +#pragma once + +int fun(int argc); diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/54 clang-format/header_orig_h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/54 clang-format/header_orig_h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/54 clang-format/header_orig_h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/54 clang-format/header_orig_h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,9 @@ +#pragma once + +int +fun +( +int +argc +) +; diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/54 clang-format/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/54 clang-format/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/54 clang-format/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/54 clang-format/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,4 @@ +project('clangformat', 'c') + +executable('prog', 'prog.c') + diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/54 clang-format/prog_expected_c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/54 clang-format/prog_expected_c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/54 clang-format/prog_expected_c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/54 clang-format/prog_expected_c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,6 @@ +#include + +int main(int argc, char **argv) { + printf("Awful.\n"); + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/54 clang-format/prog_orig_c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/54 clang-format/prog_orig_c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/54 clang-format/prog_orig_c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/54 clang-format/prog_orig_c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,21 @@ +#include + + + + +int +main( +int +argc, +char** +argv) +{ +printf( +"Awful.\n" +) +; +return +0 +; +} + diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/55 introspect buildoptions/subprojects/projectBad/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/55 introspect buildoptions/subprojects/projectBad/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/55 introspect buildoptions/subprojects/projectBad/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/55 introspect buildoptions/subprojects/projectBad/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,9 @@ +pfggggaergaeg(sdgrgjgn)aga + +rgqeh +th +thtr +e +tb +tbqebt +tbqebttrtt diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/55 introspect buildoptions/subprojects/projectBad/meson_options.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/55 introspect buildoptions/subprojects/projectBad/meson_options.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/55 introspect buildoptions/subprojects/projectBad/meson_options.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/55 introspect buildoptions/subprojects/projectBad/meson_options.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +option('should_not_appear', type: 'integer', min: 0, value: 125) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/56 dedup compiler libs/app/app.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/56 dedup compiler libs/app/app.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/56 dedup compiler libs/app/app.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/56 dedup compiler libs/app/app.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,13 @@ +#include +#include +#include + +int +main(void) +{ + printf("start value = %d\n", liba_get()); + liba_add(2); + libb_mul(5); + printf("end value = %d\n", liba_get()); + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/56 dedup compiler libs/app/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/56 dedup compiler libs/app/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/56 dedup compiler libs/app/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/56 dedup compiler libs/app/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +executable('app', 'app.c', + dependencies: [liba_dep, libb_dep]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/56 dedup compiler libs/liba/liba.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/56 dedup compiler libs/liba/liba.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/56 dedup compiler libs/liba/liba.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/56 dedup compiler libs/liba/liba.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,18 @@ +#include "liba.h" + +static int val; + +void liba_add(int x) +{ + val += x; +} + +void liba_sub(int x) +{ + val -= x; +} + +int liba_get(void) +{ + return val; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/56 dedup compiler libs/liba/liba.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/56 dedup compiler libs/liba/liba.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/56 dedup compiler libs/liba/liba.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/56 dedup compiler libs/liba/liba.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,8 @@ +#ifndef LIBA_H_ +#define LIBA_H_ + +void liba_add(int x); +void liba_sub(int x); +int liba_get(void); + +#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/56 dedup compiler libs/liba/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/56 dedup compiler libs/liba/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/56 dedup compiler libs/liba/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/56 dedup compiler libs/liba/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,8 @@ +deps = [dependency('threads'), cc.find_library('dl'), cc.find_library('m')] + +liba = library('a', 'liba.c', + dependencies: deps) + +liba_dep = declare_dependency(link_with: liba, + include_directories: include_directories('.'), + dependencies: deps) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/56 dedup compiler libs/libb/libb.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/56 dedup compiler libs/libb/libb.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/56 dedup compiler libs/libb/libb.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/56 dedup compiler libs/libb/libb.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,7 @@ +#include +#include "libb.h" + +void libb_mul(int x) +{ + liba_add(liba_get() * (x - 1)); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/56 dedup compiler libs/libb/libb.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/56 dedup compiler libs/libb/libb.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/56 dedup compiler libs/libb/libb.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/56 dedup compiler libs/libb/libb.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,6 @@ +#ifndef _LIBB_H_ +#define _LIBB_H_ + +void libb_mul(int x); + +#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/56 dedup compiler libs/libb/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/56 dedup compiler libs/libb/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/56 dedup compiler libs/libb/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/56 dedup compiler libs/libb/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,6 @@ +libb = library('b', 'libb.c', + dependencies: liba_dep) + +libb_dep = declare_dependency(link_with: libb, + include_directories: include_directories('.'), + dependencies: liba_dep) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/56 dedup compiler libs/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/56 dedup compiler libs/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/56 dedup compiler libs/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/56 dedup compiler libs/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,7 @@ +project('temp', 'c') + +cc = meson.get_compiler('c') + +subdir('liba') +subdir('libb') +subdir('app') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/57 introspection/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/57 introspection/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/57 introspection/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/57 introspection/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,46 @@ +project('introspection', ['c', 'cpp'], version: '1.2.3', default_options: ['cpp_std=c++11', 'buildtype=debug']) + +dep1 = dependency('threads') +dep2 = dependency('zlib', required: false) +dep3 = dependency('bugDep1', required: get_option('test_opt1')) + +b1 = get_option('test_opt1') +b2 = get_option('test_opt2') +test_bool = b1 or b2 +test_bool = b1 and b2 + +set_variable('list_test_plusassign', []) +list_test_plusassign += ['bugs everywhere'] + +if false + dependency('somethingthatdoesnotexist', required: true) + dependency('look_i_have_a_fallback', fallback: ['oh_no', 'the_subproject_does_not_exist']) +endif + +subdir('sharedlib') +subdir('staticlib') + +var1 = '1' +var2 = 2.to_string() +var3 = 'test3' + +t1 = executable('test' + var1, ['t1.cpp'], link_with: [sharedlib], install: true, build_by_default: get_option('test_opt2')) +t2 = executable('test@0@'.format('@0@'.format(var2)), sources: ['t2.cpp'], link_with: [staticlib]) +t3 = executable(var3, 't3.cpp', link_with: [sharedlib, staticlib], dependencies: [dep1]) + +### BEGIN: Test inspired by taisei: https://github.com/taisei-project/taisei/blob/master/meson.build#L293 +systype = '@0@'.format(host_machine.system()) +systype = '@0@, @1@, @2@'.format(systype, host_machine.cpu_family(), host_machine.cpu()) +message(systype) +### END: Test inspired by taisei + +# Minimal code version to produce bug #5376 +# Code inspired by https://github.com/mesa3d/mesa/blob/974c4d679c23373dbed386c696e3e3bc1bfa23ae/meson.build#L1341-L1347 +osmesa_lib_name = 'OSMesa' +osmesa_bits = '8' +osmesa_lib_name = osmesa_lib_name + osmesa_bits +message(osmesa_lib_name) # Infinite recursion gets triggered here when the parameter osmesa_lib_name is resolved + +test('test case 1', t1) +test('test case 2', t2) +benchmark('benchmark 1', t3) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/57 introspection/meson_options.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/57 introspection/meson_options.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/57 introspection/meson_options.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/57 introspection/meson_options.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +option('test_opt1', type: 'boolean', value: false, description: 'simple boolean flag') +option('test_opt2', type: 'boolean', value: true, description: 'simple boolean flag') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/57 introspection/sharedlib/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/57 introspection/sharedlib/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/57 introspection/sharedlib/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/57 introspection/sharedlib/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +SRC_shared = ['shared.cpp'] +sharedlib = shared_library('sharedTestLib', SRC_shared) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/57 introspection/sharedlib/shared.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/57 introspection/sharedlib/shared.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/57 introspection/sharedlib/shared.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/57 introspection/sharedlib/shared.cpp" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,9 @@ +#include "shared.hpp" + +void SharedClass::doStuff() { + number++; +} + +int SharedClass::getNumber() const { + return number; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/57 introspection/sharedlib/shared.hpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/57 introspection/sharedlib/shared.hpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/57 introspection/sharedlib/shared.hpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/57 introspection/sharedlib/shared.hpp" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,10 @@ +#pragma once + +class SharedClass { + private: + int number = 42; + public: + SharedClass() = default; + void doStuff(); + int getNumber() const; +}; \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/57 introspection/staticlib/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/57 introspection/staticlib/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/57 introspection/staticlib/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/57 introspection/staticlib/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +SRC_static = ['static.c'] +staticlib = static_library('staticTestLib', SRC_static) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/57 introspection/staticlib/static.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/57 introspection/staticlib/static.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/57 introspection/staticlib/static.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/57 introspection/staticlib/static.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +#include "static.h" + +int add_numbers(int a, int b) { + return a + b; +} \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/57 introspection/staticlib/static.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/57 introspection/staticlib/static.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/57 introspection/staticlib/static.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/57 introspection/staticlib/static.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +#pragma once + +int add_numbers(int a, int b); \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/57 introspection/t1.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/57 introspection/t1.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/57 introspection/t1.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/57 introspection/t1.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,13 @@ +#include "sharedlib/shared.hpp" + +int main() { + SharedClass cl1; + if(cl1.getNumber() != 42) { + return 1; + } + cl1.doStuff(); + if(cl1.getNumber() != 43) { + return 2; + } + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/57 introspection/t2.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/57 introspection/t2.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/57 introspection/t2.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/57 introspection/t2.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,8 @@ +#include "staticlib/static.h" + +int main() { + if(add_numbers(1, 2) != 3) { + return 1; + } + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/57 introspection/t3.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/57 introspection/t3.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/57 introspection/t3.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/57 introspection/t3.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,16 @@ +#include "sharedlib/shared.hpp" +#include "staticlib/static.h" + +int main() { + for(int i = 0; i < 1000; add_numbers(i, 1)) { + SharedClass cl1; + if(cl1.getNumber() != 42) { + return 1; + } + cl1.doStuff(); + if(cl1.getNumber() != 43) { + return 2; + } + } + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/58 pkg_config_path option/build_extra_path/totally_made_up_dep.pc" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/58 pkg_config_path option/build_extra_path/totally_made_up_dep.pc" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/58 pkg_config_path option/build_extra_path/totally_made_up_dep.pc" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/58 pkg_config_path option/build_extra_path/totally_made_up_dep.pc" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,7 @@ +prefix=/ +libdir=${prefix}/lib +includedir=${prefix}/include + +Name: totally_made_up_dep +Description: completely and totally made up for a test case +Version: 4.5.6 diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/58 pkg_config_path option/host_extra_path/totally_made_up_dep.pc" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/58 pkg_config_path option/host_extra_path/totally_made_up_dep.pc" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/58 pkg_config_path option/host_extra_path/totally_made_up_dep.pc" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/58 pkg_config_path option/host_extra_path/totally_made_up_dep.pc" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,7 @@ +prefix=/ +libdir=${prefix}/lib +includedir=${prefix}/include + +Name: totally_made_up_dep +Description: completely and totally made up for a test case +Version: 1.2.3 \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/58 pkg_config_path option/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/58 pkg_config_path option/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/58 pkg_config_path option/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/58 pkg_config_path option/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,7 @@ +project('pkg_config_path option') + +build = dependency('totally_made_up_dep', native: true, method : 'pkg-config') +host = dependency('totally_made_up_dep', native: false, method : 'pkg-config') + +assert(build.version() == '4.5.6', 'wrong version for build machine dependency') +assert(host.version() == '1.2.3', 'wrong version for host machine dependency') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/59 introspect buildoptions/c_compiler.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/59 introspect buildoptions/c_compiler.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/59 introspect buildoptions/c_compiler.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/59 introspect buildoptions/c_compiler.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +#!/usr/bin/env python3 + +print('c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/59 introspect buildoptions/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/59 introspect buildoptions/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/59 introspect buildoptions/main.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/59 introspect buildoptions/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,6 @@ +#include + +int main() { + printf("Hello World"); + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/59 introspect buildoptions/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/59 introspect buildoptions/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/59 introspect buildoptions/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/59 introspect buildoptions/meson.build" 2019-09-16 21:20:45.000000000 +0000 @@ -0,0 +1,18 @@ +project('introspect buildargs', ['c'], default_options: ['c_std=c11', 'cpp_std=c++14', 'buildtype=release']) + +subA = subproject('projectA') + +target_name = 'MAIN' +target_src = ['main.c'] + +foo = false + +executable(target_name, target_src, build_by_default : foo) + +r = run_command(find_program('c_compiler.py')) +if r.returncode() != 0 + error('FAILED') +endif + +add_languages(r.stdout().strip(), required: true) +add_languages('afgggergearvearghergervergreaergaergasv', required: false) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/59 introspect buildoptions/meson_options.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/59 introspect buildoptions/meson_options.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/59 introspect buildoptions/meson_options.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/59 introspect buildoptions/meson_options.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,2 @@ +option('max_register_count', type: 'integer', min: 0, value: 125) +option('use_external_fmt', type: 'boolean', value: false) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/59 introspect buildoptions/subprojects/projectA/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/59 introspect buildoptions/subprojects/projectA/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/59 introspect buildoptions/subprojects/projectA/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/59 introspect buildoptions/subprojects/projectA/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +project('introspect subproject A', 'c', default_options: ['cpp_std=c++11', 'buildtype=debug']) + +add_languages('cpp') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/59 introspect buildoptions/subprojects/projectA/meson_options.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/59 introspect buildoptions/subprojects/projectA/meson_options.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/59 introspect buildoptions/subprojects/projectA/meson_options.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/59 introspect buildoptions/subprojects/projectA/meson_options.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +option('subproj_var', type: 'boolean', value: false) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/59 introspect buildoptions/subprojects/projectBad/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/59 introspect buildoptions/subprojects/projectBad/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/59 introspect buildoptions/subprojects/projectBad/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/59 introspect buildoptions/subprojects/projectBad/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,9 @@ +pfggggaergaeg(sdgrgjgn)aga + +rgqeh +th +thtr +e +tb +tbqebt +tbqebttrtt \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/59 introspect buildoptions/subprojects/projectBad/meson_options.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/59 introspect buildoptions/subprojects/projectBad/meson_options.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/59 introspect buildoptions/subprojects/projectBad/meson_options.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/59 introspect buildoptions/subprojects/projectBad/meson_options.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1 @@ +option('should_not_appear', type: 'integer', min: 0, value: 125) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/60 native file override/crossfile" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/60 native file override/crossfile" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/60 native file override/crossfile" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/60 native file override/crossfile" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,16 @@ +[paths] +bindir = 'binbar' +datadir = 'databar' +includedir = 'includebar' +infodir = 'infobar' +libdir = 'libbar' +libexecdir = 'libexecbar' +localedir = 'localebar' +localstatedir = 'localstatebar' +mandir = 'manbar' +prefix = '/prefix' +sbindir = 'sbinbar' +sharedstatedir = 'sharedstatebar' +sysconfdir = 'sysconfbar' + +; vim: ft=dosini diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/60 native file override/crossfile2" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/60 native file override/crossfile2" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/60 native file override/crossfile2" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/60 native file override/crossfile2" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,4 @@ +[paths] +bindir = 'binbar2' + +; vim: ft=dosini diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/60 native file override/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/60 native file override/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/60 native file override/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/60 native file override/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,10 @@ +project('native file overrides') + +foreach o : ['bindir', 'datadir', 'includedir', 'infodir', 'libdir', + 'libexecdir', 'localedir', 'localstatedir', 'mandir', 'prefix', + 'sbindir', 'sharedstatedir', 'sysconfdir'] + expected = get_option('def_' + o) + actual = get_option(o) + assert(expected == actual, + '@0@ should have been @1@, but was @2@!'.format(o, expected, actual)) +endforeach diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/60 native file override/meson_options.txt" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/60 native file override/meson_options.txt" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/60 native file override/meson_options.txt" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/60 native file override/meson_options.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,13 @@ +option('def_bindir', type: 'string', value : 'binfoo',) +option('def_datadir', type: 'string', value : 'datafoo',) +option('def_includedir', type: 'string', value : 'includefoo',) +option('def_infodir', type: 'string', value : 'infofoo',) +option('def_libdir', type: 'string', value : 'libfoo',) +option('def_libexecdir', type: 'string', value : 'libexecfoo',) +option('def_localedir', type: 'string', value : 'localefoo',) +option('def_localstatedir', type: 'string', value : 'localstatefoo',) +option('def_mandir', type: 'string', value : 'manfoo',) +option('def_prefix', type: 'string', value : '/prefix',) +option('def_sbindir', type: 'string', value : 'sbinfoo',) +option('def_sharedstatedir', type: 'string', value : 'sharedstatefoo',) +option('def_sysconfdir', type: 'string', value : 'sysconffoo',) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/60 native file override/nativefile" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/60 native file override/nativefile" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/60 native file override/nativefile" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/60 native file override/nativefile" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,16 @@ +[paths] +bindir = 'binfoo' +datadir = 'datafoo' +includedir = 'includefoo' +infodir = 'infofoo' +libdir = 'libfoo' +libexecdir = 'libexecfoo' +localedir = 'localefoo' +localstatedir = 'localstatefoo' +mandir = 'manfoo' +prefix = '/prefix' +sbindir = 'sbinfoo' +sharedstatedir = 'sharedstatefoo' +sysconfdir = 'sysconffoo' + +; vim: ft=dosini diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/61 identity cross/build_wrapper.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/61 identity cross/build_wrapper.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/61 identity cross/build_wrapper.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/61 identity cross/build_wrapper.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +#!/usr/bin/env python + +import subprocess, sys + +subprocess.call(["cc", "-DEXTERNAL_BUILD"] + sys.argv[1:]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/61 identity cross/host_wrapper.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/61 identity cross/host_wrapper.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/61 identity cross/host_wrapper.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/61 identity cross/host_wrapper.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,5 @@ +#!/usr/bin/env python + +import subprocess, sys + +subprocess.call(["cc", "-DEXTERNAL_HOST"] + sys.argv[1:]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/61 identity cross/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/61 identity cross/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/61 identity cross/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/61 identity cross/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,15 @@ +project('identity cross test', 'c') + +assert(meson.get_compiler('c', native: true).get_define( + 'GOT', + args : [ '-DARG_BUILD' ], + prefix : '#include "stuff.h"', + include_directories: include_directories('.'), +) == 'BUILD', 'did not get BUILD from native: true compiler') + +assert(meson.get_compiler('c', native: false).get_define( + 'GOT', + args : [ '-DARG_HOST' ], + prefix : '#include "stuff.h"', + include_directories: include_directories('.'), +) == 'HOST', 'did not get HOST from native: false compiler') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/61 identity cross/stuff.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/61 identity cross/stuff.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/61 identity cross/stuff.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/61 identity cross/stuff.h" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,27 @@ +#ifdef EXTERNAL_BUILD + #ifndef ARG_BUILD + #error "External is build but arg_build is not set." + #elif defined(ARG_HOST) + #error "External is build but arg_host is set." + #else + #define GOT BUILD + #endif +#endif + +#ifdef EXTERNAL_HOST + #ifndef ARG_HOST + #error "External is host but arg_host is not set." + #elif defined(ARG_BUILD) + #error "External is host but arg_build is set." + #else + #define GOT HOST + #endif +#endif + +#if defined(EXTERNAL_BUILD) && defined(EXTERNAL_HOST) + #error "Both external build and external host set." +#endif + +#if !defined(EXTERNAL_BUILD) && !defined(EXTERNAL_HOST) + #error "Neither external build nor external host is set." +#endif diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/62 pkgconfig relative paths/pkgconfig/librelativepath.pc" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/62 pkgconfig relative paths/pkgconfig/librelativepath.pc" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/62 pkgconfig relative paths/pkgconfig/librelativepath.pc" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/62 pkgconfig relative paths/pkgconfig/librelativepath.pc" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,9 @@ +prefix=../relativepath +exec_prefix=${prefix} +libdir=${exec_prefix}/lib + +Name: Relative path +Description: Relative path library +Version: 0.0.1 +Libs: -L${libdir} -lrelativepath +Cflags: diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/63 test env does not stack/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/63 test env does not stack/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/63 test env does not stack/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/63 test env does not stack/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,12 @@ +project('test env var stacking') + +testenv = environment() +testenv.set('TEST_VAR_SET', 'some-value') +testenv.set('TEST_VAR_APPEND', 'some-value') +testenv.set('TEST_VAR_PREPEND', 'some-value') + +testenv.append('TEST_VAR_APPEND', 'another-value-append', separator: ':') +testenv.prepend('TEST_VAR_PREPEND', 'another-value-prepend', separator: ':') +testenv.set('TEST_VAR_SET', 'another-value-set') + +test('check env', find_program('script.py'), env: testenv) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/63 test env does not stack/script.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/63 test env does not stack/script.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/63 test env does not stack/script.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/63 test env does not stack/script.py" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,9 @@ +#!/usr/bin/env python3 + +import os + +for name in ('append', 'prepend', 'set'): + envname = 'TEST_VAR_' + name.upper() + value = 'another-value-' + name + envvalue = os.environ[envname] + assert (envvalue == value), (name, envvalue) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/64 cmake_prefix_path/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/64 cmake_prefix_path/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/64 cmake_prefix_path/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/64 cmake_prefix_path/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,4 @@ +project('cmake prefix path test') + +d = dependency('mesontest', method : 'cmake') +assert(d.version() == '1.2.3', 'Got the wrong version!') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/64 cmake_prefix_path/prefix/lib/cmake/mesontest/mesontest-config.cmake" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/64 cmake_prefix_path/prefix/lib/cmake/mesontest/mesontest-config.cmake" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/64 cmake_prefix_path/prefix/lib/cmake/mesontest/mesontest-config.cmake" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/64 cmake_prefix_path/prefix/lib/cmake/mesontest/mesontest-config.cmake" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,4 @@ +set(MESONTEST_VERSION "1.2.3") +set(MESONTEST_LIBRARIES "foo.so") +set(MESONTEST_INCLUDE_DIR "") +set(MESONTEST_FOUND "TRUE") diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/65 cmake parser/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/65 cmake parser/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/65 cmake parser/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/65 cmake parser/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,19 @@ +project('61 cmake parser') + +dep = dependency('mesontest') + +# Test a bunch of variations of the set() command +assert(dep.get_variable(cmake : 'VAR_WITHOUT_SPACES') == 'NoSpaces', 'set() without spaces incorrect') +assert(dep.get_variable(cmake : 'VAR_WITH_SPACES') == 'With Spaces', 'set() with spaces incorrect') + +assert(dep.get_variable(cmake : 'VAR_WITHOUT_SPACES_PS') == 'NoSpaces', 'set(PARENT_SCOPE) without spaces incorrect') +assert(dep.get_variable(cmake : 'VAR_WITH_SPACES_PS') == 'With Spaces', 'set(PARENT_SCOPE) with spaces incorrect') + +assert(dep.get_variable(cmake : 'VAR_THAT_IS_UNSET', default_value : 'sentinal') == 'sentinal', 'set() to unset is incorrect') +assert(dep.get_variable(cmake : 'CACHED_STRING_NS') == 'foo', 'set(CACHED) without spaces is incorrect') +assert(dep.get_variable(cmake : 'CACHED_STRING_WS') == 'foo bar', 'set(CACHED STRING) with spaces is incorrect') +assert(dep.get_variable(cmake : 'CACHED_STRING_ARRAY_NS') == ['foo', 'bar'], 'set(CACHED STRING) without spaces is incorrect') +assert(dep.get_variable(cmake : 'CACHED_STRING_ARRAY_WS') == ['foo', 'foo bar', 'bar'], 'set(CACHED STRING[]) with spaces is incorrect') + +# We don't suppor this, so it should be unset. +assert(dep.get_variable(cmake : 'ENV{var}', default_value : 'sentinal') == 'sentinal', 'set(ENV) should be ignored') \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/65 cmake parser/prefix/lib/cmake/mesontest/mesontest-config.cmake" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/65 cmake parser/prefix/lib/cmake/mesontest/mesontest-config.cmake" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/65 cmake parser/prefix/lib/cmake/mesontest/mesontest-config.cmake" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/65 cmake parser/prefix/lib/cmake/mesontest/mesontest-config.cmake" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,63 @@ +# This should be enough to satisfy the basic parser +set(MESONTEST_VERSION "1.2.3") +set(MESONTEST_LIBRARIES "foo.so") +set(MESONTEST_INCLUDE_DIR "") +set(MESONTEST_FOUND "TRUE") + +## Tests for set() in its various forms + +# Basic usage +set(VAR_WITHOUT_SPACES "NoSpaces") +set(VAR_WITH_SPACES "With Spaces") + +# test of PARENT_SCOPE, requires a function to have a parent scope obviously... +function(foo) + set(VAR_WITHOUT_SPACES_PS "NoSpaces" PARENT_SCOPE) + set(VAR_WITH_SPACES_PS "With Spaces" PARENT_SCOPE) +endfunction(foo) +foo() + +# Using set() to unset values +set(VAR_THAT_IS_UNSET "foo") +set(VAR_THAT_IS_UNSET) + +# The more advanced form that uses CACHE +# XXX: Why don't we read the type and use that instead of always treat things as strings? +set(CACHED_STRING_NS "foo" CACHE STRING "docstring") +set(CACHED_STRING_WS "foo bar" CACHE STRING "docstring") +set(CACHED_STRING_ARRAY_NS "foo;bar" CACHE STRING "doc string") +set(CACHED_STRING_ARRAY_WS "foo;foo bar;bar" CACHE STRING "stuff" FORCE) + +set(CACHED_BOOL ON CACHE BOOL "docstring") + +set(CACHED_PATH_NS "foo/bar" CACHE PATH "docstring") +set(CACHED_PATH_WS "foo bar/fin" CACHE PATH "docstring") + +set(CACHED_FILEPATH_NS "foo/bar.txt" CACHE FILEPATH "docstring") +set(CACHED_FILEPATH_WS "foo bar/fin.txt" CACHE FILEPATH "docstring") + +# Set ENV, we don't support this so it shouldn't be showing up +set(ENV{var}, "foo") + + +## Tests for set_properties() +# We need something to attach properties too +add_custom_target(MESONTEST_FOO ALL) + +set_property(TARGET MESONTEST_FOO PROPERTY FOLDER "value") +set_property(TARGET MESONTEST_FOO APPEND PROPERTY FOLDER "name") +set_property(TARGET MESONTEST_FOO PROPERTY FOLDER "value") +set_property(TARGET MESONTEST_FOO APPEND_STRING PROPERTY FOLDER "name") + +set_property(TARGET MESONTEST_FOO PROPERTY FOLDER "value space") +set_property(TARGET MESONTEST_FOO PROPERTY FOLDER "value space") +set_property(TARGET MESONTEST_FOO APPEND PROPERTY FOLDER "name space") +set_property(TARGET MESONTEST_FOO PROPERTY FOLDER "value space") +set_property(TARGET MESONTEST_FOO APPEND_STRING PROPERTY FOLDER "name space") + +## Tests for set_target_properties() +set_target_properties(MESONTEST_FOO PROPERTIES FOLDER "value") +set_target_properties(MESONTEST_FOO PROPERTIES FOLDER "value space") +set_target_properties(MESONTEST_FOO PROPERTIES FOLDER "value" OUTPUT_NAME "another value") +set_target_properties(MESONTEST_FOO PROPERTIES FOLDER "value space" OUTPUT_NAME "another value") +set_target_properties(MESONTEST_FOO PROPERTIES FOLDER "value space" OUTPUT_NAME "value") \ No newline at end of file diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/66 alias target/main.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/66 alias target/main.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/66 alias target/main.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/66 alias target/main.c" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +int main(int argc, char *argv[]) { + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/66 alias target/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/66 alias target/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/66 alias target/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/66 alias target/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,15 @@ +project('alias target', 'c') + +python3 = import('python').find_installation() + +exe_target = executable('prog', 'main.c', + build_by_default : false) + +custom_target = custom_target('custom-target', + output : 'hello.txt', + command : [python3, '-c', 'print("hello")'], + capture : true, + build_by_default : false +) + +alias_target('build-all', [exe_target, custom_target]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/68 static archive stripping/app/appA.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/68 static archive stripping/app/appA.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/68 static archive stripping/app/appA.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/68 static archive stripping/app/appA.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,4 @@ +#include +#include + +int main() { printf("The answer is: %d\n", libA_func()); } diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/68 static archive stripping/app/appB.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/68 static archive stripping/app/appB.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/68 static archive stripping/app/appB.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/68 static archive stripping/app/appB.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,4 @@ +#include +#include + +int main() { printf("The answer is: %d\n", libB_func()); } diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/68 static archive stripping/app/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/68 static archive stripping/app/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/68 static archive stripping/app/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/68 static archive stripping/app/meson.build" 2019-09-16 21:20:45.000000000 +0000 @@ -0,0 +1,7 @@ +project('app', ['c']) + +a = dependency('test-a') +b = dependency('test-b') + +executable('appA', files('appA.c'), dependencies : a) +executable('appB', files('appB.c'), dependencies : b) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/68 static archive stripping/lib/libA.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/68 static archive stripping/lib/libA.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/68 static archive stripping/lib/libA.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/68 static archive stripping/lib/libA.c" 2019-09-16 21:20:45.000000000 +0000 @@ -0,0 +1,5 @@ +#include + +static int libA_func_impl(void) { return 0; } + +int libA_func(void) { return libA_func_impl(); } diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/68 static archive stripping/lib/libA.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/68 static archive stripping/lib/libA.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/68 static archive stripping/lib/libA.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/68 static archive stripping/lib/libA.h" 2019-09-16 21:20:45.000000000 +0000 @@ -0,0 +1 @@ +int libA_func(void); diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/68 static archive stripping/lib/libB.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/68 static archive stripping/lib/libB.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/68 static archive stripping/lib/libB.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/68 static archive stripping/lib/libB.c" 2019-09-16 21:20:45.000000000 +0000 @@ -0,0 +1,5 @@ +#include + +static int libB_func_impl(void) { return 0; } + +int libB_func(void) { return libB_func_impl(); } diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/68 static archive stripping/lib/libB.h" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/68 static archive stripping/lib/libB.h" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/68 static archive stripping/lib/libB.h" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/68 static archive stripping/lib/libB.h" 2019-09-16 21:20:45.000000000 +0000 @@ -0,0 +1 @@ +int libB_func(void); diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/68 static archive stripping/lib/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/68 static archive stripping/lib/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/68 static archive stripping/lib/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/68 static archive stripping/lib/meson.build" 2019-09-16 21:20:45.000000000 +0000 @@ -0,0 +1,23 @@ +project('lib', ['c']) + +pkg = import('pkgconfig') + +a = library('test-a', files('libA.c'), install: true) +install_headers(files('libA.h'), subdir: 'libA') +pkg.generate( + a, + version: '0.0', + description: 'test library libA', + filebase: 'test-a', + name: 'test library libA', + subdirs: 'libA') + +b = static_library('test-b', files('libB.c'), install: true) +install_headers(files('libB.h'), subdir: 'libB') +pkg.generate( + b, + version: '0.0', + description: 'test library libB', + filebase: 'test-b', + name: 'test library libB', + subdirs: 'libB') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/lib/func10.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/lib/func10.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/lib/func10.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/lib/func10.c" 2019-10-06 17:01:35.000000000 +0000 @@ -0,0 +1,4 @@ +int func10() +{ + return 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/lib/func11.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/lib/func11.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/lib/func11.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/lib/func11.c" 2019-10-06 17:01:35.000000000 +0000 @@ -0,0 +1,6 @@ +int func10(); + +int func11() +{ + return func10() + 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/lib/func12.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/lib/func12.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/lib/func12.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/lib/func12.c" 2019-10-06 17:01:35.000000000 +0000 @@ -0,0 +1,7 @@ +int func10(); +int func11(); + +int func12() +{ + return func10() + func11(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/lib/func14.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/lib/func14.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/lib/func14.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/lib/func14.c" 2019-10-06 17:01:35.000000000 +0000 @@ -0,0 +1,4 @@ +int func14() +{ + return 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/lib/func15.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/lib/func15.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/lib/func15.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/lib/func15.c" 2019-10-06 17:01:35.000000000 +0000 @@ -0,0 +1,6 @@ +int func14(); + +int func15() +{ + return func14() + 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/lib/func16.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/lib/func16.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/lib/func16.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/lib/func16.c" 2019-10-06 17:01:35.000000000 +0000 @@ -0,0 +1,6 @@ +int func15(); + +int func16() +{ + return func15() + 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/lib/func17.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/lib/func17.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/lib/func17.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/lib/func17.c" 2019-10-24 20:20:56.000000000 +0000 @@ -0,0 +1,4 @@ +int func17() +{ + return 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/lib/func18.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/lib/func18.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/lib/func18.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/lib/func18.c" 2019-10-24 20:20:56.000000000 +0000 @@ -0,0 +1,6 @@ +int func17(); + +int func18() +{ + return func17() + 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/lib/func19.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/lib/func19.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/lib/func19.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/lib/func19.c" 2019-10-24 20:20:56.000000000 +0000 @@ -0,0 +1,7 @@ +int func17(); +int func18(); + +int func19() +{ + return func17() + func18(); +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/lib/func1.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/lib/func1.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/lib/func1.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/lib/func1.c" 2019-10-06 17:01:35.000000000 +0000 @@ -0,0 +1,9 @@ +int func1() +{ + return 1; +} + +int func1b() +{ + return 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/lib/func2.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/lib/func2.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/lib/func2.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/lib/func2.c" 2019-10-06 17:01:35.000000000 +0000 @@ -0,0 +1,6 @@ +int func1(); + +int func2() +{ + return func1() + 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/lib/func3.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/lib/func3.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/lib/func3.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/lib/func3.c" 2019-10-06 17:01:35.000000000 +0000 @@ -0,0 +1,4 @@ +int func3() +{ + return 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/lib/func4.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/lib/func4.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/lib/func4.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/lib/func4.c" 2019-10-06 17:01:35.000000000 +0000 @@ -0,0 +1,6 @@ +int func3(); + +int func4() +{ + return func3() + 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/lib/func5.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/lib/func5.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/lib/func5.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/lib/func5.c" 2019-10-06 17:01:35.000000000 +0000 @@ -0,0 +1,4 @@ +int func5() +{ + return 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/lib/func6.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/lib/func6.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/lib/func6.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/lib/func6.c" 2019-10-06 17:01:35.000000000 +0000 @@ -0,0 +1,6 @@ +int func5(); + +int func6() +{ + return func5() + 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/lib/func7.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/lib/func7.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/lib/func7.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/lib/func7.c" 2019-10-06 17:01:35.000000000 +0000 @@ -0,0 +1,4 @@ +int func7() +{ + return 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/lib/func8.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/lib/func8.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/lib/func8.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/lib/func8.c" 2019-10-06 17:01:35.000000000 +0000 @@ -0,0 +1,6 @@ +int func7(); + +int func8() +{ + return func7() + 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/lib/func9.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/lib/func9.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/lib/func9.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/lib/func9.c" 2019-10-06 17:01:35.000000000 +0000 @@ -0,0 +1,6 @@ +int func8(); + +int func9() +{ + return func8() + 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/lib/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/lib/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/lib/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/lib/meson.build" 2019-10-24 20:20:56.000000000 +0000 @@ -0,0 +1,80 @@ +project('test static link libs', 'c') + +pkg = import('pkgconfig') + +# libfunc2 should contain both func1() and func2() symbols +libfunc1 = static_library('func1', 'func1.c', + install : false) +libfunc2 = static_library('func2', 'func2.c', + link_whole : libfunc1, + install : true) + +# Same as above, but with link_with instead of link_whole, +# libfunc4 should contain both func3() and func4() symbols +libfunc3 = static_library('func3', 'func3.c', + install : false) +libfunc4 = static_library('func4', 'func4.c', + link_with : libfunc3, + install : true) + +# Same as above, but also generate an pkg-config file. Use both_libraries() to +# make sure a complete .pc file gets generated. libfunc5 should not be mentioned +# into the .pc file because it's not installed. +libfunc5 = static_library('func5', 'func5.c', + install : false) +libfunc6 = both_libraries('func6', 'func6.c', + link_with : libfunc5, + install : true) +pkg.generate(libfunc6) + +# libfunc9 should contain both func8() and func9() but not func7() because that +# one gets installed. Also test that link_with and link_whole works the same way +# because libfunc8 is uninstalled. +libfunc7 = static_library('func7', 'func7.c', + install : true) +libfunc8 = static_library('func8', 'func8.c', + link_with : libfunc7, + install : false) +libfunc9_linkwith = static_library('func9_linkwith', 'func9.c', + link_with : libfunc8, + install : true) +libfunc9_linkwhole = static_library('func9_linkwhole', 'func9.c', + link_whole : libfunc8, + install : true) + +# Pattern found in mesa: +# - libfunc11 uses func10() +# - libfunc12 uses both func10() and func11() +# When a shared library link_whole on libfunc12, we ensure we don't include +# func10.c.o twice which would fail to link. +libfunc10 = static_library('func10', 'func10.c', + install : false) +libfunc11 = static_library('func11', 'func11.c', + link_with : libfunc10, + install : false) +libfunc12 = static_library('func12', 'func12.c', + link_with : [libfunc10, libfunc11], + install : false) +libfunc13 = shared_library('func13', link_whole : libfunc12) + +# libfunc16 should contain func14(), func15() and func16() +libfunc14 = static_library('func14', 'func14.c', + install : false) +libfunc15 = static_library('func15', 'func15.c', + link_with : libfunc14, + install : false) +libfunc16 = static_library('func16', 'func16.c', + link_with : libfunc15, + install : true) + +# Verify func17.c.o gets included only once into libfunc19, otherwise +# func19-shared would failed with duplicated symbol. +libfunc17 = static_library('func17', 'func17.c', + install : false) +libfunc18 = static_library('func18', 'func18.c', + link_with : libfunc17, + install : false) +libfunc19 = static_library('func19', 'func19.c', + link_whole : [libfunc17, libfunc18], + install : false) +shared_library('func19-shared', link_whole : [libfunc19]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/meson.build" 2019-10-06 17:01:35.000000000 +0000 @@ -0,0 +1,32 @@ +project('test static link', 'c') + +cc = meson.get_compiler('c') + +# Verify that installed libfunc2.a is usable +func2_dep = cc.find_library('func2') +test('test1', executable('test1', 'test1.c', dependencies : func2_dep)) + +# Verify that installed libfunc4.a is usable +func4_dep = cc.find_library('func4') +test('test2', executable('test2', 'test2.c', dependencies : func4_dep)) + +# Verify that installed pkg-config file is usable for both shared and static link +func6_static_dep = dependency('func6', static : true) +test('test3-static', executable('test3-static', 'test3.c', + dependencies : func6_static_dep)) +func6_shared_dep = dependency('func6', static : false) +test('test3-shared', executable('test3-shared', 'test3.c', + dependencies : func6_shared_dep)) + +# Verify that installed libfunc9.a contains func8() and func8() but not func7() +func7_dep = cc.find_library('func7') +func9_linkwhole_dep = cc.find_library('func9_linkwhole') +test('test4-linkwhole', executable('test4-linkwhole', 'test4.c', + dependencies : [func7_dep, func9_linkwhole_dep])) +func9_linkwith_dep = cc.find_library('func9_linkwith') +test('test4-linkwith', executable('test4-linkwith', 'test4.c', + dependencies : [func7_dep, func9_linkwith_dep])) + +# Verify that installed libfunc16.a is usable +libfunc16_dep = cc.find_library('func16') +test('test5', executable('test5', 'test5.c', dependencies: libfunc16_dep)) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/test1.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/test1.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/test1.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/test1.c" 2019-10-06 17:01:35.000000000 +0000 @@ -0,0 +1,7 @@ +int func1b(); +int func2(); + +int main(int argc, char *argv[]) +{ + return func2() + func1b() == 3 ? 0 : 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/test2.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/test2.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/test2.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/test2.c" 2019-10-06 17:01:35.000000000 +0000 @@ -0,0 +1,6 @@ +int func4(); + +int main(int argc, char *argv[]) +{ + return func4() == 2 ? 0 : 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/test3.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/test3.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/test3.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/test3.c" 2019-10-06 17:01:35.000000000 +0000 @@ -0,0 +1,6 @@ +int func6(); + +int main(int argc, char *argv[]) +{ + return func6() == 2 ? 0 : 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/test4.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/test4.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/test4.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/test4.c" 2019-10-06 17:01:35.000000000 +0000 @@ -0,0 +1,6 @@ +int func9(); + +int main(int argc, char *argv[]) +{ + return func9() == 3 ? 0 : 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/test5.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/test5.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 static link/test5.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 static link/test5.c" 2019-10-06 17:01:35.000000000 +0000 @@ -0,0 +1,6 @@ +int func16(); + +int main(int argc, char *argv[]) +{ + return func16() == 3 ? 0 : 1; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 test env value/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 test env value/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 test env value/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 test env value/meson.build" 2019-10-06 17:01:35.000000000 +0000 @@ -0,0 +1,10 @@ +project('test env value') + +testpy = find_program('test.py') + +val = ['1', '2', '3'] +foreach v: val + test('check env', testpy, args: [v], env: {'TEST_VAR': v}) +endforeach +test('check env', testpy, args: ['4'], env: environment({'TEST_VAR': '4'})) +test('check env', testpy, args: ['5'], env: environment(['TEST_VAR=5'])) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 test env value/test.py" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 test env value/test.py" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/69 test env value/test.py" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/69 test env value/test.py" 2019-10-06 17:01:35.000000000 +0000 @@ -0,0 +1,6 @@ +#!/usr/bin/env python3 + +import os +import sys + +assert(os.environ['TEST_VAR'] == sys.argv[1]) diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/70 clang-tidy/.clang-tidy" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/70 clang-tidy/.clang-tidy" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/70 clang-tidy/.clang-tidy" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/70 clang-tidy/.clang-tidy" 2019-10-06 17:01:35.000000000 +0000 @@ -0,0 +1 @@ +Checks: '-*,modernize-use-bool-literals' diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/70 clang-tidy/cttest.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/70 clang-tidy/cttest.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/70 clang-tidy/cttest.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/70 clang-tidy/cttest.cpp" 2019-10-06 17:01:35.000000000 +0000 @@ -0,0 +1,7 @@ +#include + +int main(int, char**) { + bool intbool = 1; + printf("Intbool is %d\n", (int)intbool); + return 0; +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/70 clang-tidy/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/70 clang-tidy/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/unit/70 clang-tidy/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/unit/70 clang-tidy/meson.build" 2019-10-06 17:01:35.000000000 +0000 @@ -0,0 +1,3 @@ +project('clangtidytest', 'cpp', default_options: 'cpp_std=c++14') + +executable('cttest', 'cttest.cpp') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/vala/2 multiple files/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/vala/2 multiple files/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/vala/2 multiple files/meson.build" 2018-12-09 16:33:29.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/vala/2 multiple files/meson.build" 2019-08-16 20:40:33.000000000 +0000 @@ -1,4 +1,5 @@ -project('multiple files', 'vala', 'c') +project('multiple files', 'c') +add_languages('vala') glib = dependency('glib-2.0') gobject = dependency('gobject-2.0') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/warning/1 version for string div/a/b.c" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/warning/1 version for string div/a/b.c" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/warning/1 version for string div/a/b.c" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/warning/1 version for string div/a/b.c" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,3 @@ +int main() +{ +} diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/warning/1 version for string div/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/warning/1 version for string div/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/warning/1 version for string div/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/warning/1 version for string div/meson.build" 2019-04-17 08:08:43.000000000 +0000 @@ -0,0 +1,3 @@ +project('warn on string division', 'c', meson_version: '>=0.48.0') + +executable('prog', 'a' / 'b.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/wasm/1 basic/hello.cpp" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/wasm/1 basic/hello.cpp" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/wasm/1 basic/hello.cpp" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/wasm/1 basic/hello.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1,7 @@ +#include + +int main() { + std::cout << "Hello World" << std::endl; + return 0; +} + diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/wasm/1 basic/hello.html" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/wasm/1 basic/hello.html" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/wasm/1 basic/hello.html" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/wasm/1 basic/hello.html" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,8 @@ + + + + + + + + diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/wasm/1 basic/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/wasm/1 basic/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/wasm/1 basic/meson.build" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/wasm/1 basic/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -0,0 +1,3 @@ +project('emcctest', 'cpp') + +executable('hello', 'hello.cpp') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/windows/12 resources with custom targets/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/windows/12 resources with custom targets/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/windows/12 resources with custom targets/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/windows/12 resources with custom targets/meson.build" 2019-02-07 09:08:55.000000000 +0000 @@ -3,7 +3,7 @@ # MinGW windres has a bug due to which it doesn't parse args with space properly: # https://github.com/mesonbuild/meson/pull/1346 # https://sourceware.org/bugzilla/show_bug.cgi?id=4933 -if meson.get_compiler('c').get_id() == 'gcc' and host_machine.system() == 'windows' +if ['gcc', 'clang'].contains(meson.get_compiler('c').get_id()) and host_machine.system() == 'windows' # Construct build_to_src and skip this test if it has spaces # because then the -I flag to windres will also have spaces # and we know the test will fail diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/windows/5 resources/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/windows/5 resources/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/windows/5 resources/meson.build" 2017-04-15 14:27:38.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/windows/5 resources/meson.build" 2019-02-07 09:08:55.000000000 +0000 @@ -3,7 +3,7 @@ # MinGW windres has a bug due to which it doesn't parse args with space properly: # https://github.com/mesonbuild/meson/pull/1346 # https://sourceware.org/bugzilla/show_bug.cgi?id=4933 -if meson.get_compiler('c').get_id() == 'gcc' and host_machine.system() == 'windows' +if ['gcc', 'clang'].contains(meson.get_compiler('c').get_id()) and host_machine.system() == 'windows' # Construct build_to_src and skip this test if it has spaces # because then the -I flag to windres will also have spaces # and we know the test will fail diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/windows/5 resources/res/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/windows/5 resources/res/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/windows/5 resources/res/meson.build" 2018-08-25 08:05:43.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/windows/5 resources/res/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -2,4 +2,9 @@ res = win.compile_resources('myres.rc', depend_files: 'sample.ico', - include_directories : inc) + include_directories : inc, + args : [['-DFOO'], '-DBAR']) + +# test that with MSVC tools, LIB/LINK invokes CVTRES with correct /MACHINE +static_library('reslib', res, 'dummy.c') +shared_library('shreslib', res, 'dummy.c') diff -Nru "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/windows/9 vs module defs generated/subdir/meson.build" "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/windows/9 vs module defs generated/subdir/meson.build" --- "/tmp/tmp36ZMnP/c47887eQDL/meson-0.49.0/test cases/windows/9 vs module defs generated/subdir/meson.build" 2018-10-31 09:31:20.000000000 +0000 +++ "/tmp/tmp36ZMnP/ZJZ5ujIAaH/meson-0.52.1/test cases/windows/9 vs module defs generated/subdir/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -7,3 +7,4 @@ ) shlib = shared_library('somedll', 'somedll.c', vs_module_defs : def_file) +shmod = shared_module('somemod', 'somedll.c', vs_module_defs : def_file) diff -Nru meson-0.49.0/tools/boost_names.py meson-0.52.1/tools/boost_names.py --- meson-0.49.0/tools/boost_names.py 2018-08-25 08:05:43.000000000 +0000 +++ meson-0.52.1/tools/boost_names.py 2019-11-28 17:37:44.000000000 +0000 @@ -132,7 +132,7 @@ # The python module uses an older build system format and is not easily parseable. # We add the python module libraries manually. modules.append(Module('python', 'Python', ['boost_python', 'boost_python3', 'boost_numpy', 'boost_numpy3'])) - for (root, dirs, files) in os.walk(LIBS): + for (root, _, files) in os.walk(LIBS): for f in files: if f == "libraries.json": projectdir = os.path.dirname(root) diff -Nru meson-0.49.0/tools/cmake2meson.py meson-0.52.1/tools/cmake2meson.py --- meson-0.49.0/tools/cmake2meson.py 2018-08-25 08:05:43.000000000 +0000 +++ meson-0.52.1/tools/cmake2meson.py 2019-11-28 17:37:44.000000000 +0000 @@ -14,9 +14,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -import sys, os +from typing import List +from pathlib import Path +import sys import re + class Token: def __init__(self, tid, value): self.tid = tid @@ -83,7 +86,7 @@ raise RuntimeError('Lexer got confused line %d column %d' % (lineno, col)) class Parser: - def __init__(self, code): + def __init__(self, code: str): self.stream = Lexer().lex(code) self.getsym() @@ -140,13 +143,13 @@ 'enable_testing': True, 'include': True} - def __init__(self, cmake_root): - self.cmake_root = cmake_root + def __init__(self, cmake_root: str): + self.cmake_root = Path(cmake_root).expanduser() self.indent_unit = ' ' self.indent_level = 0 - self.options = [] + self.options = [] # type: List[tuple] - def convert_args(self, args, as_array=True): + def convert_args(self, args: List[Token], as_array: bool = True): res = [] if as_array: start = '[' @@ -200,7 +203,7 @@ libcmd = 'static_library' args = [t.args[0]] + t.args[2:] else: - libcmd = 'static_library' + libcmd = 'library' args = t.args line = '%s_lib = %s(%s)' % (t.args[0].value, libcmd, self.convert_args(args, False)) elif t.name == 'add_test': @@ -223,13 +226,24 @@ l = 'cpp' args.append(l) args = ["'%s'" % i for i in args] - line = 'project(' + ', '.join(args) + ')' + line = 'project(' + ', '.join(args) + ", default_options : ['default_library=static'])" elif t.name == 'set': varname = t.args[0].value.lower() line = '%s = %s\n' % (varname, self.convert_args(t.args[1:])) elif t.name == 'if': postincrement = 1 - line = 'if %s' % self.convert_args(t.args, False) + try: + line = 'if %s' % self.convert_args(t.args, False) + except AttributeError: # complex if statements + line = t.name + for arg in t.args: + if isinstance(arg, Token): + line += ' ' + arg.value + elif isinstance(arg, list): + line += ' (' + for a in arg: + line += ' ' + a.value + line += ' )' elif t.name == 'elseif': preincrement = -1 postincrement = 1 @@ -251,32 +265,32 @@ outfile.write('\n') self.indent_level += postincrement - def convert(self, subdir=''): - if subdir == '': + def convert(self, subdir: Path = None): + if not subdir: subdir = self.cmake_root - cfile = os.path.join(subdir, 'CMakeLists.txt') + cfile = Path(subdir).expanduser() / 'CMakeLists.txt' try: - with open(cfile) as f: + with cfile.open() as f: cmakecode = f.read() except FileNotFoundError: - print('\nWarning: No CMakeLists.txt in', subdir, '\n') + print('\nWarning: No CMakeLists.txt in', subdir, '\n', file=sys.stderr) return p = Parser(cmakecode) - with open(os.path.join(subdir, 'meson.build'), 'w') as outfile: + with (subdir / 'meson.build').open('w') as outfile: for t in p.parse(): if t.name == 'add_subdirectory': # print('\nRecursing to subdir', - # os.path.join(self.cmake_root, t.args[0].value), + # self.cmake_root / t.args[0].value, # '\n') - self.convert(os.path.join(subdir, t.args[0].value)) + self.convert(subdir / t.args[0].value) # print('\nReturning to', self.cmake_root, '\n') self.write_entry(outfile, t) if subdir == self.cmake_root and len(self.options) > 0: self.write_options() def write_options(self): - filename = os.path.join(self.cmake_root, 'meson_options.txt') - with open(filename, 'w') as optfile: + filename = self.cmake_root / 'meson_options.txt' + with filename.open('w') as optfile: for o in self.options: (optname, description, default) = o if default is None: