forked from TypesettingTools/Aegisub
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
11 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,100 +1,14 @@ | ||
diff --git a/meson.build b/meson.build | ||
index 688b368859..dc9d18acd5 100644 | ||
index 1ac3baa2b3..ae31c53c02 100644 | ||
--- a/meson.build | ||
+++ b/meson.build | ||
@@ -1037,7 +1037,7 @@ check_components = [ | ||
['user32', ['windows.h', 'winuser.h'], ['GetShellWindow'], ['user32']], | ||
['vfw32', ['windows.h', 'vfw.h'], ['capCreateCaptureWindow'], ['vfw3']], | ||
['vaapi', ['va/va.h'], ['vaInitialize'], ['va']], | ||
- ['zlib', ['zlib.h'], ['zlibVersion'], ['z']], | ||
+ ['zlib', ['zlib.h'], ['zlibVersion'], ['z'], {'meson-dep': 'zlib'}], | ||
|
||
# Libraries with preconditions | ||
['vaapi_drm', ['va/va.h', 'va/va_drm.h'], ['vaGetDisplayDRM'], ['va', 'va-drm'], | ||
@@ -1925,6 +1925,7 @@ foreach check : all_checks | ||
prefix = '' | ||
|
||
found = true | ||
+ skipchecks = false | ||
|
||
preconditions = opts.get('preconditions', []) | ||
|
||
@@ -1980,6 +1981,11 @@ foreach check : all_checks | ||
req = false | ||
endif | ||
dep = cc.find_library(link_with, required : req) | ||
+ if not dep.found() and opts.has_key('meson-dep') | ||
+ dep = dependency(opts.get('meson-dep'), required: false) | ||
+ # We can't do compiler checks for non-external dependencies, so skip them and trust the meson dependency | ||
+ skipchecks = true | ||
+ endif | ||
found = found and dep.found() | ||
extra_deps += dep | ||
endforeach | ||
@@ -2009,7 +2015,8 @@ foreach check : all_checks | ||
else | ||
dep = dependency(pkg_name, required : req) | ||
endif | ||
- found = dep.found() and dep.type_name() != 'internal' | ||
+ found = dep.found() | ||
+ skipchecks = dep.type_name() == 'internal' # same here, trust the meson dependency | ||
extra_deps += dep | ||
endif | ||
endif | ||
@@ -2023,14 +2030,14 @@ foreach check : all_checks | ||
endif | ||
|
||
if not conf.has(header.underscorify()) | ||
- has_header = cc.has_header(header, dependencies: extra_deps) | ||
+ has_header = skipchecks or cc.has_header(header, dependencies: extra_deps) | ||
conf.set10(header.underscorify().to_lower(), has_header) | ||
found = found and has_header | ||
endif | ||
endforeach | ||
endif | ||
|
||
- if found | ||
+ if found and not skipchecks | ||
n_funcs_found = 0 | ||
foreach symbol : funcs | ||
if check_type == 'header-func' | ||
@@ -2050,7 +2057,7 @@ foreach check : all_checks | ||
endif | ||
endif | ||
|
||
- if found | ||
+ if found and not skipchecks | ||
n_defines_found = 0 | ||
foreach symbol : defines | ||
if cc.get_define(symbol, dependencies : extra_deps, prefix: prefix, args : c_args + project_c_args) != '' | ||
@@ -2060,15 +2067,15 @@ foreach check : all_checks | ||
found = n_defines_found == defines.length() | ||
endif | ||
|
||
- if found and compiles != '' | ||
+ if found and compiles != '' and not skipchecks | ||
found = cc.compiles('\n\n'.join([prefix, compiles]), dependencies : extra_deps, args : c_args + project_c_args, name: name) | ||
endif | ||
|
||
- if found and links != '' | ||
+ if found and links != '' and not skipchecks | ||
found = cc.links('\n\n'.join([prefix, links]), dependencies : extra_deps, args : c_args + project_c_args, name: name) | ||
endif | ||
|
||
- if found and type != '' | ||
+ if found and type != '' and not skipchecks | ||
found = cc.has_type(type, prefix : prefix, dependencies : extra_deps, args : c_args + project_c_args) | ||
endif | ||
|
||
@@ -3087,6 +3094,11 @@ foreach a: arch_list | ||
endforeach | ||
|
||
foreach have: have_list | ||
+ if have == 'unistd_h' and conf.get(have) == 0 | ||
+ # an atrocious hack to get this working with the zlib subproject on windows... | ||
+ # zlib also uses a HAVE_UNISTD_H define, but it checks it with #ifdef and not #if | ||
+ continue | ||
+ endif | ||
final_conf.set('HAVE_@0@'.format(have.to_upper()), conf.get(have.to_lower())) | ||
endforeach | ||
|
||
@@ -3054,6 +3061,8 @@ if host_machine.system() == 'windows' | ||
makedef_args += ['--os', 'win'] | ||
elif host_machine.system() in ['darwin', 'ios'] | ||
makedef_args += ['--os', 'darwin'] | ||
+else | ||
+ makedef_args += ['--os', 'linux'] | ||
endif | ||
|
||
final_conf = configuration_data() | ||
|