summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChun-wei Fan <fanchunwei@src.gnome.org>2019-07-24 14:51:10 +0800
committerChun-wei Fan <fanchunwei@src.gnome.org>2019-11-19 05:49:35 +0800
commit1dd3bc0a35035d96124f11b8fbb915c669489bb1 (patch)
tree351b21c73a55085612581fa4e3620844c164492f
parent3bceb3a9d3d0d6ec5409f751feb69fd10ccdfb16 (diff)
demos: Define _USE_MATH_DEFINES on MSVC-style compilers
This is required for the use of M_PI.
-rw-r--r--demos/meson.build6
1 files changed, 6 insertions, 0 deletions
diff --git a/demos/meson.build b/demos/meson.build
index 70f7c1f..3f9d306 100644
--- a/demos/meson.build
+++ b/demos/meson.build
@@ -18,6 +18,11 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
+extra_demo_cflags = []
+if cc.get_argument_syntax() == 'msvc'
+ extra_demo_cflags = ['-D_USE_MATH_DEFINES']
+endif
+
demos = [
'gradient-test',
'alpha-test',
@@ -51,6 +56,7 @@ if dep_gtk.found()
executable(
d,
[d + '.c', config_h, version_h],
+ c_args : extra_demo_cflags,
link_with : [libdemo, libtestutils],
dependencies : [dep_glib, dep_gtk, dep_openmp, idep_pixman],
)