build: default to system tomlplusplus and CLI11
This commit is contained in:
parent
60967bbc8d
commit
265ab87997
8 changed files with 91 additions and 22 deletions
2
Brewfile
2
Brewfile
|
|
@ -3,3 +3,5 @@ brew 'cmake'
|
||||||
brew 'openssl'
|
brew 'openssl'
|
||||||
brew 'ninja'
|
brew 'ninja'
|
||||||
brew 'googletest'
|
brew 'googletest'
|
||||||
|
brew 'tomlplusplus'
|
||||||
|
brew 'cli11'
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ Enhancements:
|
||||||
- #7519 Rename project to Deskflow (was Synergy Community Edition)
|
- #7519 Rename project to Deskflow (was Synergy Community Edition)
|
||||||
- #7533 Always upgrade packages on Arch Linux in deps script
|
- #7533 Always upgrade packages on Arch Linux in deps script
|
||||||
- #7539 Lint and add comment to PR on lint failure
|
- #7539 Lint and add comment to PR on lint failure
|
||||||
|
- #7544 Use system deps for `tomlplusplus` and `CLI11`
|
||||||
|
|
||||||
# 1.16.1
|
# 1.16.1
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -532,7 +532,7 @@ macro(configure_gtest)
|
||||||
# If there are any problems like this in future, please do feel free send us a patch! :)
|
# If there are any problems like this in future, please do feel free send us a patch! :)
|
||||||
option(SYSTEM_GTEST "Use system GoogleTest" ${DEFAULT_SYSTEM_GTEST})
|
option(SYSTEM_GTEST "Use system GoogleTest" ${DEFAULT_SYSTEM_GTEST})
|
||||||
if(SYSTEM_GTEST)
|
if(SYSTEM_GTEST)
|
||||||
message(STATUS "Using system GoogleTest")
|
message(VERBOSE "Using system GoogleTest")
|
||||||
find_package(GTest)
|
find_package(GTest)
|
||||||
if(GTEST_FOUND)
|
if(GTEST_FOUND)
|
||||||
# Ordinarily, we'd use GTEST_LIBRARIES, but it seems that these do not always export
|
# Ordinarily, we'd use GTEST_LIBRARIES, but it seems that these do not always export
|
||||||
|
|
@ -637,23 +637,62 @@ macro(configure_wintoast)
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
macro(configure_tomlplusplus)
|
macro(configure_tomlplusplus)
|
||||||
file(GLOB TOMLPLUSPLUS_DIR ${CMAKE_SOURCE_DIR}/subprojects/tomlplusplus-*)
|
file(GLOB tomlplusplus_dir ${CMAKE_SOURCE_DIR}/subprojects/tomlplusplus-*)
|
||||||
if(TOMLPLUSPLUS_DIR)
|
|
||||||
set(HAVE_TOMLPLUSPLUS true)
|
if(tomlplusplus_dir)
|
||||||
add_definitions(-DHAVE_TOMLPLUSPLUS=1)
|
set(DEFAULT_SYSTEM_TOMLPLUSPLUS OFF)
|
||||||
include_directories(${TOMLPLUSPLUS_DIR}/include)
|
|
||||||
else()
|
else()
|
||||||
message(WARNING "Subproject 'tomlplusplus' not found")
|
set(DEFAULT_SYSTEM_TOMLPLUSPLUS ON)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
option(DEFAULT_SYSTEM_TOMLPLUSPLUS "Use system tomlplusplus"
|
||||||
|
${DEFAULT_SYSTEM_TOMLPLUSPLUS})
|
||||||
|
if(DEFAULT_SYSTEM_TOMLPLUSPLUS)
|
||||||
|
message(VERBOSE "Using system tomlplusplus")
|
||||||
|
find_package(tomlplusplus)
|
||||||
|
if(tomlplusplus_FOUND)
|
||||||
|
message(STATUS "tomlplusplus version: ${tomlplusplus_VERSION}")
|
||||||
|
else()
|
||||||
|
message(WARNING "System tomlplusplus not found")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
if(EXISTS ${tomlplusplus_dir})
|
||||||
|
set(HAVE_TOMLPLUSPLUS true)
|
||||||
|
add_definitions(-DHAVE_TOMLPLUSPLUS=1)
|
||||||
|
include_directories(${tomlplusplus_dir}/include)
|
||||||
|
else()
|
||||||
|
message(WARNING "Local tomlplusplus subproject not found")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
macro(configure_cli11)
|
macro(configure_cli11)
|
||||||
file(GLOB CLI11_DIR ${CMAKE_SOURCE_DIR}/subprojects/CLI11-*)
|
file(GLOB cli11_dir ${CMAKE_SOURCE_DIR}/subprojects/CLI11-*)
|
||||||
if(CLI11_DIR)
|
|
||||||
set(HAVE_CLI11 true)
|
if(cli11_dir)
|
||||||
add_definitions(-DHAVE_CLI11=1)
|
set(DEFAULT_SYSTEM_CLI11 OFF)
|
||||||
include_directories(${CLI11_DIR}/include)
|
|
||||||
else()
|
else()
|
||||||
message(WARNING "Subproject 'CLI11' not found")
|
set(DEFAULT_SYSTEM_CLI11 ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
option(SYSTEM_CLI11 "Use system CLI11" ${DEFAULT_SYSTEM_CLI11})
|
||||||
|
if(SYSTEM_CLI11)
|
||||||
|
message(VERBOSE "Using system CLI11")
|
||||||
|
find_package(CLI11)
|
||||||
|
if(CLI11_FOUND)
|
||||||
|
message(STATUS "CLI11 version: ${CLI11_VERSION}")
|
||||||
|
else()
|
||||||
|
message(WARNING "System CLI11 not found")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
if(EXISTS ${CLI11_dir})
|
||||||
|
set(HAVE_CLI11 true)
|
||||||
|
add_definitions(-DHAVE_CLI11=1)
|
||||||
|
include_directories(${cli11_dir}/include)
|
||||||
|
else()
|
||||||
|
message(WARNING "Local CLI11 subproject not found")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
endif()
|
||||||
|
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
|
||||||
18
config.yaml
18
config.yaml
|
|
@ -50,8 +50,10 @@ config:
|
||||||
libgmock-dev \
|
libgmock-dev \
|
||||||
libpugixml-dev \
|
libpugixml-dev \
|
||||||
libei-dev \
|
libei-dev \
|
||||||
libportal-dev
|
libportal-dev \
|
||||||
optional: [libei-dev, libportal-dev]
|
libtomlplusplus-dev \
|
||||||
|
libcli11-dev
|
||||||
|
optional: [libei-dev, libportal-dev, libtomlplusplus-dev]
|
||||||
|
|
||||||
linuxmint:
|
linuxmint:
|
||||||
<<: *debian
|
<<: *debian
|
||||||
|
|
@ -82,7 +84,9 @@ config:
|
||||||
gmock-devel \
|
gmock-devel \
|
||||||
pugixml-devel \
|
pugixml-devel \
|
||||||
libei-devel \
|
libei-devel \
|
||||||
libportal-devel
|
libportal-devel \
|
||||||
|
tomlplusplus-devel \
|
||||||
|
cli11-devel
|
||||||
optional: [libei-devel, libportal-devel]
|
optional: [libei-devel, libportal-devel]
|
||||||
|
|
||||||
# RHEL is not actually supported yet, since it doesn't have Qt6 libs.
|
# RHEL is not actually supported yet, since it doesn't have Qt6 libs.
|
||||||
|
|
@ -128,7 +132,9 @@ config:
|
||||||
googlemock-devel \
|
googlemock-devel \
|
||||||
pugixml-devel \
|
pugixml-devel \
|
||||||
libei-devel \
|
libei-devel \
|
||||||
libportal-devel
|
libportal-devel \
|
||||||
|
tomlplusplus-devel \
|
||||||
|
cli11-devel
|
||||||
|
|
||||||
arch: &arch
|
arch: &arch
|
||||||
dependencies:
|
dependencies:
|
||||||
|
|
@ -149,7 +155,9 @@ config:
|
||||||
libportal \
|
libportal \
|
||||||
qt6-base \
|
qt6-base \
|
||||||
qt6-tools \
|
qt6-tools \
|
||||||
gtk3
|
gtk3 \
|
||||||
|
tomlplusplus \
|
||||||
|
cli11
|
||||||
|
|
||||||
manjaro:
|
manjaro:
|
||||||
<<: *arch
|
<<: *arch
|
||||||
|
|
|
||||||
17
meson.build
17
meson.build
|
|
@ -5,13 +5,24 @@
|
||||||
|
|
||||||
project('deskflow', 'cpp')
|
project('deskflow', 'cpp')
|
||||||
|
|
||||||
subproject('tomlplusplus')
|
|
||||||
subproject('cli11')
|
|
||||||
|
|
||||||
if host_machine.system() == 'windows'
|
if host_machine.system() == 'windows'
|
||||||
subproject('wintoast')
|
subproject('wintoast')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
system_tomlplusplus = get_option('system-tomlplusplus')
|
||||||
|
if system_tomlplusplus
|
||||||
|
dependency('tomlplusplus', required: false)
|
||||||
|
else
|
||||||
|
subproject('tomlplusplus')
|
||||||
|
endif
|
||||||
|
|
||||||
|
system_cli11 = get_option('system-cli11')
|
||||||
|
if system_cli11
|
||||||
|
dependency('cli11', required: false)
|
||||||
|
else
|
||||||
|
subproject('cli11')
|
||||||
|
endif
|
||||||
|
|
||||||
system_gtest = get_option('system-gtest')
|
system_gtest = get_option('system-gtest')
|
||||||
if system_gtest
|
if system_gtest
|
||||||
dependency('gtest', required: false)
|
dependency('gtest', required: false)
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
option('system-gtest', type: 'boolean', value: true, description: 'Use system gtest')
|
option('system-gtest', type: 'boolean', value: true, description: 'Use system gtest')
|
||||||
option('system-libportal', type: 'boolean', value: true, description: 'Use system libportal')
|
option('system-libportal', type: 'boolean', value: true, description: 'Use system libportal')
|
||||||
option('system-libei', type: 'boolean', value: true, description: 'Use system libei')
|
option('system-libei', type: 'boolean', value: true, description: 'Use system libei')
|
||||||
|
option('system-tomlplusplus', type: 'boolean', value: true, description: 'Use system tomlplusplus')
|
||||||
|
option('system-cli11', type: 'boolean', value: true, description: 'Use system cli11')
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,9 @@ install_freebsd() {
|
||||||
qt6-tools \
|
qt6-tools \
|
||||||
gtk3 \
|
gtk3 \
|
||||||
googletest \
|
googletest \
|
||||||
pugixml
|
pugixml \
|
||||||
|
tomlplusplus \
|
||||||
|
cli11
|
||||||
}
|
}
|
||||||
|
|
||||||
install_openbsd() {
|
install_openbsd() {
|
||||||
|
|
|
||||||
|
|
@ -24,8 +24,12 @@ meson_bin = env.get_python_executable("meson")
|
||||||
def setup(no_system_list, static_list):
|
def setup(no_system_list, static_list):
|
||||||
cmd = [meson_bin, "setup", build_dir]
|
cmd = [meson_bin, "setup", build_dir]
|
||||||
|
|
||||||
|
# TODO: These special Windows exceptions should probably be in Meson
|
||||||
|
# or somewhere other than this script, as it's a bit hacky.
|
||||||
if env.is_windows():
|
if env.is_windows():
|
||||||
cmd.append("-Dsystem-gtest=false")
|
cmd.append("-Dsystem-gtest=false")
|
||||||
|
cmd.append("-Dsystem-tomlplusplus=false")
|
||||||
|
cmd.append("-Dsystem-cli11=false")
|
||||||
|
|
||||||
for subproject in no_system_list or []:
|
for subproject in no_system_list or []:
|
||||||
cmd.append(f"-Dsystem-{subproject}=false")
|
cmd.append(f"-Dsystem-{subproject}=false")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue