From 4ac7481033b4c3980bc6266e669c3241785436bf Mon Sep 17 00:00:00 2001 From: Wook Song Date: Mon, 26 Aug 2019 11:29:28 +0900 Subject: [PATCH] [Meson] Support macOS In order to support macOS, this patch updates the meson build script in the source root directory to pass macro definition, '__MACOS__', to the compiler. Signed-off-by: Wook Song --- meson.build | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/meson.build b/meson.build index d2b1660..f3dd45b 100644 --- a/meson.build +++ b/meson.build @@ -17,6 +17,21 @@ add_project_arguments('-DVERSION="' + meson.project_version() + '"', language: [ cc = meson.get_compiler('c') cxx = meson.get_compiler('cpp') +build_platform = '' + +if get_option('enable-tizen') + # Pass __TIZEN__ to the compiler + add_project_arguments('-D__TIZEN__=1', language: ['c', 'cpp']) + build_platform = 'tizen' +elif not meson.is_cross_build() + if cc.get_id() == 'clang' and cxx.get_id() == 'clang' + if build_machine.system() == 'darwin' + # Pass __MACOS__ to the compiler + add_project_arguments('-D__MACOS__=1', language: ['c', 'cpp']) + build_platform = 'macos' + endif + endif +endif warning_flags = [ '-Wredundant-decls', -- 2.7.4