diff --git a/meson.build b/meson.build index 9fc822ca0e..b5ceadc58f 100644 --- a/meson.build +++ b/meson.build @@ -800,7 +800,7 @@ endif libm = cc.find_library('m', required: false) -if targetos == 'windows' +if host_os == 'windows' threads = declare_dependency() meson.override_dependency('threads', threads) else @@ -1935,7 +1935,7 @@ have_gtk_clipboard = get_option('gtk_clipboard').enabled() # xemu: GTK is required in Linux builds for file selection interfaces. In the # future, this may be relaxed in the future with alternative options. -require_gtk = targetos == 'linux' +require_gtk = host_os == 'linux' if require_gtk or get_option('gtk') \ .disable_auto_if(not have_system) \ diff --git a/ui/meson.build b/ui/meson.build index eace7858b7..6b0bd6cf3c 100644 --- a/ui/meson.build +++ b/ui/meson.build @@ -43,9 +43,13 @@ xemu_cocoa = dependency('appleframeworks', modules: 'Cocoa') xemu_ss.add(xemu_cocoa) endif -xemu_ss.add(when: 'CONFIG_LINUX', if_true: [gtk, files('xemu-os-utils-linux.c')]) -xemu_ss.add(when: 'CONFIG_WIN32', if_true: files('xemu-os-utils-windows.c')) -xemu_ss.add(when: 'CONFIG_DARWIN', if_true: files('xemu-os-utils-macos.m')) +if host_os == 'linux' + xemu_ss.add([gtk, files('xemu-os-utils-linux.c')]) +elif host_os == 'windows' + xemu_ss.add(files('xemu-os-utils-windows.c')) +elif host_os == 'darwin' + xemu_ss.add(files('xemu-os-utils-macos.m')) +endif xemu_ss.add(imgui, implot, stb_image, noc, sdl, opengl, openssl, fa, fpng, json, httplib, fatx) system_ss.add_all(xemu_ss) diff --git a/ui/thirdparty/meson.build b/ui/thirdparty/meson.build index baa38cb771..c40caaad77 100644 --- a/ui/thirdparty/meson.build +++ b/ui/thirdparty/meson.build @@ -34,10 +34,14 @@ implot = declare_dependency(link_with: libimplot, include_directories: 'implot') noc_ss = ss.source_set() -noc_ss.add(when: 'CONFIG_LINUX', if_true: [gtk, files('noc_file_dialog/noc_file_dialog_gtk.c')]) -noc_ss.add(when: 'CONFIG_WIN32', if_true: files('noc_file_dialog/noc_file_dialog_win32.cc')) -noc_ss.add(when: 'CONFIG_DARWIN', if_true: files('noc_file_dialog/noc_file_dialog_macos.m')) -noc_ss = noc_ss.apply(config_all, strict: false) +if host_os == 'linux' + noc_ss.add([gtk, files('noc_file_dialog/noc_file_dialog_gtk.c')]) +elif host_os == 'windows' + noc_ss.add(files('noc_file_dialog/noc_file_dialog_win32.cc')) +elif host_os == 'darwin' + noc_ss.add(files('noc_file_dialog/noc_file_dialog_macos.m')) +endif +noc_ss = noc_ss.apply(config_target, strict: false) noclib = static_library('noc', sources: noc_ss.sources(), dependencies: noc_ss.dependencies(), @@ -64,7 +68,7 @@ json = declare_dependency(include_directories: 'json') httplib_proj = subproject('cpp-httplib', default_options: ['cpp-httplib_openssl=enabled']) httplib_deps = [httplib_proj.get_variable('cpp_httplib_dep')] -if targetos == 'windows' +if host_os == 'windows' httplib_deps += [crypt32] endif httplib = declare_dependency(dependencies: httplib_deps) diff --git a/ui/xui/meson.build b/ui/xui/meson.build index 2fe5b2c64a..1f2f8d3aed 100644 --- a/ui/xui/meson.build +++ b/ui/xui/meson.build @@ -22,4 +22,6 @@ xemu_ss.add(files( 'widgets.cc', )) -xemu_ss.add(when: 'CONFIG_WIN32', if_true: files('update.cc')) +if host_os == 'windows' + xemu_ss.add(files('update.cc')) +endif diff --git a/util/meson.build b/util/meson.build index f7985a9bac..9b7056e8f9 100644 --- a/util/meson.build +++ b/util/meson.build @@ -64,7 +64,9 @@ util_ss.add(files('int128.c')) util_ss.add(files('memalign.c')) util_ss.add(files('interval-tree.c')) util_ss.add(files('lockcnt.c')) -util_ss.add(when: 'CONFIG_WIN32', if_true: files('miniz/miniz.c')) +if host_os == 'windows' + util_ss.add(files('miniz/miniz.c')) +endif util_ss.add(files('fast-hash.c')) util_ss.add(files('mstring.c')) diff --git a/winpcap-loader/meson.build b/winpcap-loader/meson.build index 3c3265921f..715fc6c5b3 100644 --- a/winpcap-loader/meson.build +++ b/winpcap-loader/meson.build @@ -1,3 +1,3 @@ -softmmu_ss.add(when: 'CONFIG_WIN32', if_true: files( - 'loader.c', -)) +if host_os == 'windows' + system_ss.add('loader.c') +endif