diff --git a/meson.build b/meson.build index 9a98f0c86a0..ff51fab280c 100644 --- a/meson.build +++ b/meson.build @@ -930,17 +930,24 @@ tcl_version = get_option('tcl_version') tcl_dep = not_found_dep if not tclopt.disabled() - # via pkg-config - tcl_dep = dependency(tcl_version, required: false) + if host_system != 'windows' + # via pkg-config + tcl_dep = dependency(tcl_version, required: false) - if not tcl_dep.found() - tcl_dep = cc.find_library(tcl_version, - required: tclopt, - dirs: test_lib_d) - endif + if not tcl_dep.found() + tcl_dep = cc.find_library(tcl_version, + required: tclopt, + dirs: test_lib_d) + endif - if not cc.has_header('tcl.h', dependencies: tcl_dep, required: tclopt) - tcl_dep = not_found_dep + if not cc.has_header('tcl.h', dependencies: tcl_dep, required: tclopt) + tcl_dep = not_found_dep + endif + else + tcl_dep = dependency(tcl_version, required: false) + if not tcl_dep.found() + tcl_dep = cc.find_library(tcl_version, required: tclopt, dirs: postgres_lib_d) + endif endif endif