Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 41da94f

Browse files
committed
meson: Make detection of python more robust
Previously we errored out if no python installation could be found (but we did handle not having enough of python installed to build plpython against). Presumably nobody hit this so far, as python is likely installed due to meson requiring python. Author: Tristan Partin <tristan@neon.tech> Discussion: https://postgr.es/m/CSPIJVUDZFKX.3KHMOAVGF94RV@c3po Backpatch: 16-, where meson support was added
1 parent 52f22cd commit 41da94f

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

meson.build

+7-5
Original file line numberDiff line numberDiff line change
@@ -1056,15 +1056,17 @@ endif
10561056
###############################################################
10571057

10581058
pyopt = get_option('plpython')
1059+
python3_dep = not_found_dep
10591060
if not pyopt.disabled()
10601061
pm = import('python')
10611062
python3_inst = pm.find_installation(required: pyopt)
1062-
python3_dep = python3_inst.dependency(embed: true, required: pyopt)
1063-
if not cc.check_header('Python.h', dependencies: python3_dep, required: pyopt)
1064-
python3_dep = not_found_dep
1063+
if python3_inst.found()
1064+
python3_dep = python3_inst.dependency(embed: true, required: pyopt)
1065+
# Remove this check after we depend on Meson >= 1.1.0
1066+
if not cc.check_header('Python.h', dependencies: python3_dep, required: pyopt)
1067+
python3_dep = not_found_dep
1068+
endif
10651069
endif
1066-
else
1067-
python3_dep = not_found_dep
10681070
endif
10691071

10701072

0 commit comments

Comments
 (0)