From 3fc16f05b513f26aa5da614673116074f5d60396 Mon Sep 17 00:00:00 2001 From: Marvin Scholz Date: Wed, 6 Sep 2023 03:12:55 +0200 Subject: Add compiler.has_define Adds a new method to the compiler object, has_define. This makes it possible to check if a preprocessor macro/define is set or not. This is especially helpful if the define in question is empty, for example: #define MESON_EMPTY_DEFINE This would yield the same results as a missing define with the existing get_define method, as it would return an empty string for both cases. Therefore this additional method is needed. --- docs/yaml/objects/compiler.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'docs/yaml') diff --git a/docs/yaml/objects/compiler.yaml b/docs/yaml/objects/compiler.yaml index d5d7df569..977cbdf0d 100644 --- a/docs/yaml/objects/compiler.yaml +++ b/docs/yaml/objects/compiler.yaml @@ -327,6 +327,17 @@ methods: type: str description: The define to check. +- name: has_define + returns: bool + since: 1.3.0 + description: | + Returns true if the given preprocessor symbol is *defined*. + kwargs_inherit: compiler._common + posargs: + definename: + type: str + description: The define to check. + - name: compiles returns: bool description: Returns true if the code compiles. -- cgit v1.2.3