Commit Graph

82 Commits

Author SHA1 Message Date
Jussi Pakkanen befd26985c Fix test case numbers. 2022-07-07 10:04:51 -07:00
Eli Schwartz 04c728a126 compilers/c++: Add MSVC option to make the __cplusplus define accurate
Otherwise it always returns the value for c++98, starting with MSVC 2017
15.7 or later. Earlier versions are not affected by this mis-feature.

See: https://docs.microsoft.com/en-us/cpp/build/reference/zc-cplusplus?view=msvc-160

This was originally applied as 0b97d58548
but later reverted because it made the CI red. Try it again, now.

Original-patch-by: Dylan Baker <dylan@pnwbakers.com>
Co-authored-by: Dylan Baker <dylan@pnwbakers.com>
2022-05-08 14:40:54 -04:00
Andres Freund a161873948 backend/vs: process link dependencies.
Partially-Fixes: #1799
2021-10-04 22:34:57 -04:00
Jesse Natalie 01ddf3ac13 Add test for https://github.com/mesonbuild/meson/issues/9235 2021-09-20 15:34:58 -07:00
Xavier Claessens ea02c1c48a msvc: Assume UTF8 source by default
Currently every project that uses UTF8 for its source files must add
'/utf-8' argument otherwise they don't work non-English locale MSVC.

Since meson.build itself is assumed to be UTF8 by default, seems better
to assume it for source files by default too.

For example:
- https://gitlab.freedesktop.org/gstreamer/gst-build/-/blob/master/meson.build#L62
- https://gitlab.gnome.org/GNOME/glib/-/blob/main/meson.build#L29
2021-09-01 19:26:36 +03:00
Eli Schwartz 59d4f771d2
editorconfig: add setting to trim trailing whitespace
and clean up all outstanding issues

Skip 'test cases/common/141 special characters/meson.build' since it
intentionally uses trailing newlines.
2021-08-15 09:36:18 -04:00
Jussi Pakkanen a90d2925dd Revert "compilers/c++: Add MSVC option to make the __cplusplus define accurate"
This reverts commit 0b97d58548.
2021-08-15 13:18:35 +03:00
Dylan Baker 0b97d58548 compilers/c++: Add MSVC option to make the __cplusplus define accurate
Otherwise it always returns the value for c++98, starting with MSVC 2017
15.7 or later. Earlier versions are not affected by this mis-feature
2021-08-11 21:54:16 +03:00
Eli Schwartz 4340bf34fa
various python neatness cleanups
All changes were created by running

"pyupgrade --py3-only --keep-percent-format"

and committing the results. I have not touched string formatting for
now.

- use set literals
- simplify .format() parameter naming
- remove __future__
- remove default "r" mode for open()
- use OSError rather than compatibility aliases
- remove stray parentheses in function(generator) scopes
2021-03-04 17:11:26 -05:00
Jussi Pakkanen 1a0603835e Add win_subsystem kwarg. Closes #7765. 2020-10-07 18:55:25 +03:00
Elliot Haisley 063b74ebba fix msvc not recognising b_ndebug
fixes #7404
2020-07-19 15:26:30 +03:00
Daniel Mensinger 8e60b8c146
test: merge installed_files.txt into test.json 2020-02-25 21:47:42 +01:00
Nirbheek Chauhan c5c0c467fe tests/windows/16: Use pefile module instead of objdump/dumpbin
The pefile module is a CI dependency now, so we can use that instead
of objdump/dumpbin which greatly simplifies the test. Of course, this
module is also cross-platform so it will work if we add cross-win32 CI
at some point.
2020-01-22 19:34:05 +05:30
Sebastien Bacher 82f6790d5c Use python3 in some tests which were still using python
The unversioned command is deprecated and removed from some distributions
2020-01-21 04:26:50 +10:00
Michael Hirsch, Ph.D acee448fb9 ci/test: unused args for Windows 2019-12-04 10:59:40 +02:00
Michael Hirsch, Ph.D 83b4e981c4 Use strict function prototypes 2019-11-18 22:21:36 +02:00
Michael Hirsch, Ph.D 1baa1c9222 use '-Werror=unused-parameter' for gcc/clang on project tests and -fimplicit-none on fortran
Fortran: check for undeclared variables by forcing implicit none everywhere
C/C++: check for unused parameters and return types

removed unused variables from test cases

ci: do missing return and unused arg check with Github Actions
2019-11-17 13:24:42 +02:00
Jakub Adam 9c456e2baf tests: Don't expect any *.pdb files installed in 'lib'
Static libraries don't have PDB files. A PDB that would previously end
up installed alongside a static library belonged in fact to the dynamic
version of the same library built at the same time.

This was because the former minstall.Installer implementation, when
installing a file target, also blindly copied any *.pdb file it found
whose filename was matching the target. So, for example installing
foo.dll and foo.a would also install two copies of foo.pdb into both
bin/ and lib/, which doesn't seem like the right thing to do - foo.pdb
should only get installed with foo.dll.
2019-10-09 15:50:20 +02:00
Marc-André Lureau 341d245e68 Accept vs_module_defs for modules
Like shared libraries, modules may have vs_module_defs.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2019-07-17 19:19:56 +03:00
ePirat b347f00dc0 Fix windres module argument flattening 2019-07-05 22:20:16 +03:00
Jon Turney 818c1619cc
Testcase for library where the first object is an arch-neutral .res file 2019-01-05 19:39:14 +00:00
Jon Turney 54c680c4ba
Apply work-around for windres bug with msys2 clang also
The windres bug with paths with spaces appears irrespective of compiler
2018-12-09 20:40:29 +00:00
Jon Turney e116b94833
Install modules in a subdir to fit with platform name mangling
Take advantage of fix_platform_name's new tricks in test '122 shared
module'
2018-11-06 13:19:47 +00:00
Jon Turney 075168d492
Handle only llvm-objdump being available
llvm-objdump currently doesn't appear to output the Windows subsystem, so
that part of the test needs to be skipped.
2018-11-04 15:42:06 +00:00
Jussi Pakkanen c4a9f59dc4 Move VS C++17 test to a unit test since it requires env setup. 2018-10-24 17:19:36 +03:00
Nicole Mazzuca f1546e289c add cpp_std support for MSVC 2018-10-22 19:14:00 +03:00
Marco Trevisan (Treviño) 81e7a0981b run_project_tests: remove pdb workaround, just use filters
And ignore .dll.a files in non cygwin gcc instances
2018-09-14 20:19:35 +02:00
Marco Trevisan (Treviño) b484f2ae22 test cases: add missing files to installed_files.txt
All these are marked as files to be installed, so we need list them.
2018-09-14 08:45:48 +02:00
Jussi Pakkanen 19617f8661
Merge pull request #4036 from jon-turney/fix_issue_3999
Fix compiling multiple Windows resources using pathnames with non-unique basenames
2018-08-21 00:56:10 +03:00
Jussi Pakkanen 972535a6ac Condense test dirs. 2018-08-19 12:39:46 +03:00
Jon Turney 2a3cd335fd
Extend test case to cover issue #3999
Extend test case for issue #3575 for Windows resource files with the same
name to cover the case where duplicate outputs exist due to use of
pathnames.

Also Test using file objects as well as literal filenames
2018-08-16 20:34:37 +01:00
Jon Turney 67c8f532c6 Extend test to check subsystem set by executable(gui_app:) 2018-08-15 06:17:58 -07:00
Jon Turney 399f8553b7 Add a test for Windows console application with main function in a library
Currently, this test fails for ninja/VisualC, as we don't pass
/SUBSYSTEM:CONSOLE to the linker, and it guesses wrongly that this is a GUI
app

https://lists.freedesktop.org/archives/mesa-dev/2018-June/197844.html
2018-08-15 06:17:58 -07:00
Jussi Pakkanen 17bfbb99e5 Condense test dirs. 2018-07-31 19:22:24 +03:00
Jon Turney 09c03a409b Test windows.compile_resource() when depends: is a custom_target
This test covers the case where the resource script references a file which
is created by a custom_target (in this case, an icon).

Put icon in a separate directory to ensure we excercise setting the include
path to the directory which contains it.
2018-06-18 10:52:21 +00:00
Jussi Pakkanen 8014a42f57
Merge pull request #3715 from jon-turney/duplicate-rsrc-script-name
Use a unique name for windows resource compilation custom target
2018-06-17 17:28:09 +03:00
Jon Turney 4bc6b68bae Also test that the resource has the expected contents 2018-06-11 11:49:12 +01:00
Jon Turney 80ce5e0817 Test for Windows resource compilation reusing the same script name
Extended from the test case in #3575.

This exercises File objects and string filenames for the same resource
script filename at different paths.
2018-06-07 22:52:22 +01:00
Jon Turney e9462ce206 Install shared_module implibs
On Windows, if we are going to link with a shared module, we need the
implib.

Use case: The Xorg server builds some X protocol extensions as modules.  The
implibs for these modules need to be shipped as part of the SDK, to enable
building of 3rd party extensions which reference symbols in (and hence on
Windows, need to be linked with) these modules.
2018-06-07 12:57:39 +00:00
Jon Turney ac480c1857 Extend test_rc_depends_files test case
Extend test_rc_depends_files test case to also cover depfile generation for
a resource file generated by a custom_target
2018-06-03 21:06:23 +00:00
Jon Turney 7a15214a69 Have the windows.resource_compiler() preprocesor write a depfile
When using binutils's windres, we can instruct it to invoke the preprocessor
in such a way that it writes a depfile, so that dependencies on #included
files are automatically tracked.

Not implemented for MSVC tools, so skip testing it in that case.
2018-06-03 21:06:23 +00:00
Jon Turney d78fa6ffe3 Install implib where expected if default install_dir: is explicitly given
Install the implib into the default import lib directory if an explicit
install_dir: is given, but the value happens to be the same as the default.
2018-06-03 20:57:03 +00:00
Mathieu Duponchelle 9e7b0dd704 test extra paths: move test to windows 2018-06-02 11:42:48 +00:00
Jon Turney aa27f7cec9 Add a depend_files: keyword to windows.compile_resources()
Expose depend_files: from the custom_target this creates.

This is the change suggested in #2815, with tests and documentation added.

Fixes #2789 (duplicate #2830)
2018-06-01 20:21:09 +00:00
Andrei Alexeyev 46f5d7a31c
Fix test cases/windows/13 resources with custom targets
Analogous to #2851
2018-01-12 23:40:11 +02:00
Andrei Alexeyev f8bd1c5ff2
windows.compile_resources: fix compiling multiple resources within one project 2018-01-12 23:36:48 +02:00
Andrei Alexeyev ef7cb9f280
[windows] make compile_resources use custom targets instead of generators 2018-01-12 23:36:48 +02:00
Jon Turney 500c39cb07 Fix test cases/windows/5 resources
Currently, this test only tries to load a predefined icon, so the resource
compilation and linking can be completely removed from the meson.build and
it still passes.

Change to try to load the icon contained in the resources we compile.
2017-12-31 19:11:34 +02:00
Jon Turney 8f859a5105 Make the name of the executable implib configurable 2017-07-20 21:11:56 +01:00
Jon Turney 3110c209f7 Consolidate windows tests which are divided between mingw and msvc 2017-07-20 21:11:56 +01:00