Address - 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.
@@ -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']
-else
- extra_native_cflags = []
-endif
-if cross_cc.has_argument('-fvisibility=hidden')
- extra_cross_cflags = ['-fvisibility=hidden']
+if cc.has_argument('-fvisibility=hidden')
+ extra_cflags = ['-fvisibility=hidden']
else
- extra_cross_cflags = []
+ extra_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
