mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-15 01:08:27 +00:00
build(meson): don't require python3 (#1267)
Thanks to abf3a67dd0
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/
This commit is contained in:
parent
9452c0a4b6
commit
1be1b3a86d
2 changed files with 3 additions and 4 deletions
|
@ -19,7 +19,6 @@ project(
|
||||||
# Check just in case downstream decides to edit the source
|
# Check just in case downstream decides to edit the source
|
||||||
# and add a project version
|
# and add a project version
|
||||||
version = meson.project_version()
|
version = meson.project_version()
|
||||||
python3 = find_program('python3')
|
|
||||||
if version == 'undefined'
|
if version == 'undefined'
|
||||||
cxx = meson.get_compiler('cpp')
|
cxx = meson.get_compiler('cpp')
|
||||||
version = cxx.get_define('CPPHTTPLIB_VERSION',
|
version = cxx.get_define('CPPHTTPLIB_VERSION',
|
||||||
|
@ -28,8 +27,6 @@ if version == 'undefined'
|
||||||
assert(version != '', 'failed to get version from httplib.h')
|
assert(version != '', 'failed to get version from httplib.h')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
message('cpp-httplib version ' + version)
|
|
||||||
|
|
||||||
deps = [dependency('threads')]
|
deps = [dependency('threads')]
|
||||||
args = []
|
args = []
|
||||||
|
|
||||||
|
@ -64,6 +61,8 @@ endif
|
||||||
cpp_httplib_dep = dependency('', required: false)
|
cpp_httplib_dep = dependency('', required: false)
|
||||||
|
|
||||||
if get_option('cpp-httplib_compile')
|
if get_option('cpp-httplib_compile')
|
||||||
|
python3 = find_program('python3')
|
||||||
|
|
||||||
httplib_ch = custom_target(
|
httplib_ch = custom_target(
|
||||||
'split',
|
'split',
|
||||||
input: 'httplib.h',
|
input: 'httplib.h',
|
||||||
|
|
|
@ -5,5 +5,5 @@
|
||||||
option('cpp-httplib_openssl', type: 'feature', value: 'auto', description: 'Enable OpenSSL support')
|
option('cpp-httplib_openssl', type: 'feature', value: 'auto', description: 'Enable OpenSSL support')
|
||||||
option('cpp-httplib_zlib', type: 'feature', value: 'auto', description: 'Enable zlib support')
|
option('cpp-httplib_zlib', type: 'feature', value: 'auto', description: 'Enable zlib support')
|
||||||
option('cpp-httplib_brotli', type: 'feature', value: 'auto', description: 'Enable Brotli support')
|
option('cpp-httplib_brotli', type: 'feature', value: 'auto', description: 'Enable Brotli support')
|
||||||
option('cpp-httplib_compile', type: 'boolean', value: false, description: 'Split the header into a compilable header & source file')
|
option('cpp-httplib_compile', type: 'boolean', value: false, description: 'Split the header into a compilable header & source file (requires python3)')
|
||||||
option('cpp-httplib_test', type: 'boolean', value: false, description: 'Build tests')
|
option('cpp-httplib_test', type: 'boolean', value: false, description: 'Build tests')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue