1
mirror of https://github.com/mpv-player/mpv synced 2024-07-11 23:47:56 +02:00

build: support multiple headers in check_statement

This feature will be used in the next commit.
This commit is contained in:
Stefano Pigozzi 2013-12-26 16:45:01 +01:00
parent 1cbb32cca2
commit dbf879be14

View File

@ -41,10 +41,13 @@ def check_libs(libs, function):
def check_statement(header, statement, **kw_ext):
def fn(ctx, dependency_identifier, **kw):
fragment = """
#include <{0}>
int main(int argc, char **argv)
{{ {1}; return 0; }} """.format(header, statement)
headers = header
if not isinstance(headers, list):
headers = [header]
hs = "\n".join(["#include <{0}>".format(h) for h in headers])
fragment = ("{0}\n"
"int main(int argc, char **argv)\n"
"{{ {1}; return 0; }}").format(hs, statement)
opts = __merge_options__(dependency_identifier,
{'fragment':fragment},
__define_options__(dependency_identifier),