Skip to content

Commit 1be1b3a

Browse files
authored
build(meson): don't require python3 (#1267)
Thanks to abf3a67 the use of python3 isn't required anymore to configure the build, so I moved the find_program('python3') inside the "if compile" block. This makes it possible to configure cpp-httplib on systems where python isn't available with tools like muon: https://sr.ht/~lattis/muon/
1 parent 9452c0a commit 1be1b3a

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

meson.build

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ project(
1919
# Check just in case downstream decides to edit the source
2020
# and add a project version
2121
version = meson.project_version()
22-
python3 = find_program('python3')
2322
if version == 'undefined'
2423
cxx = meson.get_compiler('cpp')
2524
version = cxx.get_define('CPPHTTPLIB_VERSION',
@@ -28,8 +27,6 @@ if version == 'undefined'
2827
assert(version != '', 'failed to get version from httplib.h')
2928
endif
3029

31-
message('cpp-httplib version ' + version)
32-
3330
deps = [dependency('threads')]
3431
args = []
3532

@@ -64,6 +61,8 @@ endif
6461
cpp_httplib_dep = dependency('', required: false)
6562

6663
if get_option('cpp-httplib_compile')
64+
python3 = find_program('python3')
65+
6766
httplib_ch = custom_target(
6867
'split',
6968
input: 'httplib.h',

meson_options.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
option('cpp-httplib_openssl', type: 'feature', value: 'auto', description: 'Enable OpenSSL support')
66
option('cpp-httplib_zlib', type: 'feature', value: 'auto', description: 'Enable zlib support')
77
option('cpp-httplib_brotli', type: 'feature', value: 'auto', description: 'Enable Brotli support')
8-
option('cpp-httplib_compile', type: 'boolean', value: false, description: 'Split the header into a compilable header & source file')
8+
option('cpp-httplib_compile', type: 'boolean', value: false, description: 'Split the header into a compilable header & source file (requires python3)')
99
option('cpp-httplib_test', type: 'boolean', value: false, description: 'Build tests')

0 commit comments

Comments
 (0)