Skip to content

Commit 8284a13

Browse files
committed
fixup! mingw: rely on MSYS2's metadata instead of hard-coding it
1 parent e2683ce commit 8284a13

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

meson.build

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1271,7 +1271,6 @@ elif host_machine.system() == 'windows'
12711271

12721272
libgit_c_args += [
12731273
'-DDETECT_MSYS_TTY',
1274-
'-DENSURE_MSYSTEM_IS_SET',
12751274
'-DNATIVE_CRLF',
12761275
'-DNOGDI',
12771276
'-DNO_POSIX_GOODIES',
@@ -1281,6 +1280,18 @@ elif host_machine.system() == 'windows'
12811280
'-D__USE_MINGW_ANSI_STDIO=0',
12821281
]
12831282

1283+
msystem = get_option('msystem')
1284+
if msystem != ''
1285+
mingw_prefix = get_option('mingw_prefix')
1286+
if mingw_prefix == ''
1287+
mingw_prefix = '/' + msystem.to_lower()
1288+
endif
1289+
libgit_c_args += [
1290+
'-DENSURE_MSYSTEM_IS_SET="' + msystem + '"',
1291+
'-DMINGW_PREFIX="' + mingw_prefix + '"'
1292+
]
1293+
endif
1294+
12841295
libgit_dependencies += compiler.find_library('ntdll')
12851296
libgit_include_directories += 'compat/win32'
12861297
if compiler.get_id() == 'msvc'

meson_options.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ option('runtime_prefix', type: 'boolean', value: false,
2121
description: 'Resolve ancillary tooling and support files relative to the location of the runtime binary instead of hard-coding them into the binary.')
2222
option('sane_tool_path', type: 'array', value: [],
2323
description: 'An array of paths to pick up tools from in case the normal tools are broken or lacking.')
24+
option('msystem', type: 'string', value: '',
25+
description: 'Fall-back on Windows when MSYSTEM is not set.')
26+
option('mingw_prefix', type: 'string', value: '',
27+
description: 'Fall-back on Windows when MINGW_PREFIX is not set.')
2428

2529
# Build information compiled into Git and other parts like documentation.
2630
option('build_date', type: 'string', value: '',

0 commit comments

Comments
 (0)