diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2017-04-04 11:39:09 +0100 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2017-04-06 22:47:15 +0100 |
commit | fd47ef3a274e85f4391808f7bbade2a807ab53df (patch) | |
tree | 1487bec8072ee67d6f4ae2d1ccf9979dfc3b13e4 | |
parent | 5af98a5ee8e8065932e9ebcaa45dd6fd42a54bdf (diff) | |
download | meson-fd47ef3a274e85f4391808f7bbade2a807ab53df.zip meson-fd47ef3a274e85f4391808f7bbade2a807ab53df.tar.gz meson-fd47ef3a274e85f4391808f7bbade2a807ab53df.tar.bz2 |
Use '.exe' extension for executables for Cygwin
Use '.exe' extension for executables for Cygwin when building and installing
-rw-r--r-- | mesonbuild/build.py | 3 | ||||
-rw-r--r-- | mesonbuild/scripts/meson_exe.py | 6 | ||||
-rw-r--r-- | mesonbuild/scripts/meson_install.py | 2 | ||||
-rwxr-xr-x | mesontest.py | 6 | ||||
-rwxr-xr-x | run_project_tests.py | 2 | ||||
-rwxr-xr-x | run_unittests.py | 2 | ||||
-rw-r--r-- | test cases/failing/19 target clash/meson.build | 2 |
7 files changed, 16 insertions, 7 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py index 895cc7f..537c91b 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -997,7 +997,8 @@ class Executable(BuildTarget): self.prefix = '' if not hasattr(self, 'suffix'): # Executable for Windows or C#/Mono - if for_windows(is_cross, environment) or 'cs' in self.compilers: + if (for_windows(is_cross, environment) or + for_cygwin(is_cross, environment) or 'cs' in self.compilers): self.suffix = 'exe' else: self.suffix = '' diff --git a/mesonbuild/scripts/meson_exe.py b/mesonbuild/scripts/meson_exe.py index 5c5c317..643e1af 100644 --- a/mesonbuild/scripts/meson_exe.py +++ b/mesonbuild/scripts/meson_exe.py @@ -29,8 +29,12 @@ def is_windows(): platname = platform.system().lower() return platname == 'windows' or 'mingw' in platname +def is_cygwin(): + platname = platform.system().lower() + return 'cygwin' in platname + def run_with_mono(fname): - if fname.endswith('.exe') and not is_windows(): + if fname.endswith('.exe') and not (is_windows() or is_cygwin()): return True return False diff --git a/mesonbuild/scripts/meson_install.py b/mesonbuild/scripts/meson_install.py index 8fb9e04..af84f64 100644 --- a/mesonbuild/scripts/meson_install.py +++ b/mesonbuild/scripts/meson_install.py @@ -193,7 +193,7 @@ def run_install_script(d): def is_elf_platform(): platname = platform.system().lower() - if platname == 'darwin' or platname == 'windows': + if platname == 'darwin' or platname == 'windows' or platname == 'cygwin': return False return True diff --git a/mesontest.py b/mesontest.py index d626ba7..c4d1178 100755 --- a/mesontest.py +++ b/mesontest.py @@ -36,6 +36,10 @@ def is_windows(): platname = platform.system().lower() return platname == 'windows' or 'mingw' in platname +def is_cygwin(): + platname = platform.system().lower() + return 'cygwin' in platname + def determine_worker_count(): varname = 'MESON_TESTTHREADS' if varname in os.environ: @@ -150,7 +154,7 @@ def write_json_log(jsonlogfile, test_name, result): jsonlogfile.write(json.dumps(jresult) + '\n') def run_with_mono(fname): - if fname.endswith('.exe') and not is_windows(): + if fname.endswith('.exe') and not (is_windows() or is_cygwin()): return True return False diff --git a/run_project_tests.py b/run_project_tests.py index a6cada3..302ca36 100755 --- a/run_project_tests.py +++ b/run_project_tests.py @@ -218,7 +218,7 @@ def platform_fix_name(fname): if fname.endswith('?exe'): fname = fname[:-4] - if mesonlib.is_windows(): + if mesonlib.is_windows() or mesonlib.is_cygwin(): return fname + '.exe' return fname diff --git a/run_unittests.py b/run_unittests.py index 14badc2..1b24d08 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -28,7 +28,7 @@ from mesonbuild.mesonlib import is_windows, is_osx, is_cygwin from mesonbuild.environment import detect_ninja, Environment from mesonbuild.dependencies import PkgConfigDependency, ExternalProgram -if is_windows(): +if is_windows() or is_cygwin(): exe_suffix = '.exe' else: exe_suffix = '' diff --git a/test cases/failing/19 target clash/meson.build b/test cases/failing/19 target clash/meson.build index 070631b..fbc757c 100644 --- a/test cases/failing/19 target clash/meson.build +++ b/test cases/failing/19 target clash/meson.build @@ -7,7 +7,7 @@ project('clash', 'c') # This test might fail to work on different backends or when # output location is redirected. -if host_machine.system() == 'windows' +if host_machine.system() == 'windows' or host_machine.system() == 'cygwin' error('This is expected.') endif |