From abc4405a76df5f621adb9c72bfef432c21c66f85 Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Thu, 6 Aug 2020 20:44:14 -0500 Subject: [PATCH] Address #459 - Update meson.build Don't search for cross compilerUnless needed. This should help prevent issues building Meson on debian. Also fix issue using the wrong set of flags to build the native janet interpreter vs. the cross compiled janet interpreter. --- meson.build | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/meson.build b/meson.build index cf631a4f..80bb3f13 100644 --- a/meson.build +++ b/meson.build @@ -178,30 +178,28 @@ libjanet = library('janet', janetc, # Extra c flags - adding -fvisibility=hidden matches the Makefile and # shaves off about 10k on linux x64, likely similar on other platforms. -native_cc = meson.get_compiler('c', native: true) -cross_cc = meson.get_compiler('c', native: false) -if native_cc.has_argument('-fvisibility=hidden') - extra_native_cflags = ['-fvisibility=hidden'] +if cc.has_argument('-fvisibility=hidden') + extra_cflags = ['-fvisibility=hidden'] else - extra_native_cflags = [] + extra_cflags = [] endif -if cross_cc.has_argument('-fvisibility=hidden') - extra_cross_cflags = ['-fvisibility=hidden'] -else - extra_cross_cflags = [] -endif - janet_mainclient = executable('janet', janetc, mainclient_src, include_directories : incdir, dependencies : [m_dep, dl_dep, thread_dep], - c_args : extra_native_cflags, + c_args : extra_cflags, install : true) if meson.is_cross_build() + native_cc = meson.get_compiler('c', native: true) + if native_cc.has_argument('-fvisibility=hidden') + extra_native_cflags = ['-fvisibility=hidden'] + else + extra_native_cflags = [] + endif janet_nativeclient = executable('janet-native', janetc, mainclient_src, include_directories : incdir, dependencies : [m_dep, dl_dep, thread_dep], - c_args : extra_cross_cflags, + c_args : extra_native_cflags, native : true) else janet_nativeclient = janet_mainclient