mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-10-01 14:31:47 -09:00
package/poco: convert to CMake package
Currently when building with make, the cmake config files are not generated. This leads to problems when integrating the package in an application built with cmake. The CMake build system links the PDF component against the system libpng when POCO_UNBUNDLED is enabled, while the legacy make build system always used the bundled copy, so select libpng for the PDF component. POCO_NO_FPENVIRONMENT and POCO_NO_WSTRING are plain preprocessor defines rather than CMake options, so pass them through CMAKE_CXX_FLAGS. Poco is built as a set of shared libraries, so -latomic has to be passed via CMAKE_SHARED_LINKER_FLAGS as well. Disable File2Page along with PageCompiler, and tie the ActiveRecord compiler to the ActiveRecord component, to match what the legacy make build system omitted. This patch is based on this one: https://lists.buildroot.org/pipermail/buildroot/2026-April/801019.html Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Assisted-by: Claude:claude-opus-5 Signed-off-by: Bernd Kuhls <bernd@kuhls.net> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
committed by
Thomas Petazzoni
parent
5510a84de6
commit
66c1665642
@@ -94,6 +94,7 @@ config BR2_PACKAGE_POCO_NETSSL_OPENSSL
|
||||
|
||||
config BR2_PACKAGE_POCO_PDF
|
||||
bool "PDF"
|
||||
select BR2_PACKAGE_LIBPNG
|
||||
select BR2_PACKAGE_POCO_JSON
|
||||
select BR2_PACKAGE_POCO_UTIL
|
||||
select BR2_PACKAGE_POCO_XML
|
||||
|
||||
@@ -22,80 +22,60 @@ POCO_DEPENDENCIES = \
|
||||
$(if $(BR2_PACKAGE_POCO_DATA_SQLITE),sqlite) \
|
||||
$(if $(BR2_PACKAGE_POCO_DATA_PGSQL),postgresql) \
|
||||
$(if $(BR2_PACKAGE_POCO_NETSSL_OPENSSL),openssl) \
|
||||
$(if $(BR2_PACKAGE_POCO_PDF),libpng) \
|
||||
$(if $(BR2_PACKAGE_POCO_XML),expat)
|
||||
|
||||
POCO_OMIT = \
|
||||
Data/ODBC \
|
||||
PageCompiler \
|
||||
$(if $(BR2_PACKAGE_POCO_ACTIVERECORD),,ActiveRecord) \
|
||||
$(if $(BR2_PACKAGE_POCO_CPP_PARSER),,CppParser) \
|
||||
$(if $(BR2_PACKAGE_POCO_CRYPTO),,Crypto) \
|
||||
$(if $(BR2_PACKAGE_POCO_DATA),,Data) \
|
||||
$(if $(BR2_PACKAGE_POCO_DATA_MYSQL),,Data/MySQL) \
|
||||
$(if $(BR2_PACKAGE_POCO_DATA_SQLITE),,Data/SQLite) \
|
||||
$(if $(BR2_PACKAGE_POCO_DATA_PGSQL),,Data/PostgreSQL) \
|
||||
$(if $(BR2_PACKAGE_POCO_JSON),,JSON) \
|
||||
$(if $(BR2_PACKAGE_POCO_JWT),,JWT) \
|
||||
$(if $(BR2_PACKAGE_POCO_MONGODB),,MongoDB) \
|
||||
$(if $(BR2_PACKAGE_POCO_NET),,Net) \
|
||||
$(if $(BR2_PACKAGE_POCO_NETSSL_OPENSSL),,NetSSL_OpenSSL) \
|
||||
$(if $(BR2_PACKAGE_POCO_PDF),,PDF) \
|
||||
$(if $(BR2_PACKAGE_POCO_PROMETHEUS),,Prometheus) \
|
||||
$(if $(BR2_PACKAGE_POCO_REDIS),,Redis) \
|
||||
$(if $(BR2_PACKAGE_POCO_UTIL),,Util) \
|
||||
$(if $(BR2_PACKAGE_POCO_XML),,XML) \
|
||||
$(if $(BR2_PACKAGE_POCO_ZIP),,Zip)
|
||||
# PageCompiler and File2Page are code generators that are of no use on
|
||||
# the target, and ODBC support is not wired up in Buildroot.
|
||||
POCO_CONF_OPTS = \
|
||||
-DENABLE_DATA_ODBC=OFF \
|
||||
-DENABLE_PAGECOMPILER=OFF \
|
||||
-DENABLE_PAGECOMPILER_FILE2PAGE=OFF \
|
||||
-DENABLE_ACTIVERECORD=$(if $(BR2_PACKAGE_POCO_ACTIVERECORD),ON,OFF) \
|
||||
-DENABLE_ACTIVERECORD_COMPILER=$(if $(BR2_PACKAGE_POCO_ACTIVERECORD),ON,OFF) \
|
||||
-DENABLE_CPPPARSER=$(if $(BR2_PACKAGE_POCO_CPP_PARSER),ON,OFF) \
|
||||
-DENABLE_CRYPTO=$(if $(BR2_PACKAGE_POCO_CRYPTO),ON,OFF) \
|
||||
-DENABLE_DATA=$(if $(BR2_PACKAGE_POCO_DATA),ON,OFF) \
|
||||
-DENABLE_DATA_MYSQL=$(if $(BR2_PACKAGE_POCO_DATA_MYSQL),ON,OFF) \
|
||||
-DENABLE_DATA_SQLITE=$(if $(BR2_PACKAGE_POCO_DATA_SQLITE),ON,OFF) \
|
||||
-DENABLE_DATA_POSTGRESQL=$(if $(BR2_PACKAGE_POCO_DATA_PGSQL),ON,OFF) \
|
||||
-DENABLE_JSON=$(if $(BR2_PACKAGE_POCO_JSON),ON,OFF) \
|
||||
-DENABLE_JWT=$(if $(BR2_PACKAGE_POCO_JWT),ON,OFF) \
|
||||
-DENABLE_MONGODB=$(if $(BR2_PACKAGE_POCO_MONGODB),ON,OFF) \
|
||||
-DENABLE_NET=$(if $(BR2_PACKAGE_POCO_NET),ON,OFF) \
|
||||
-DENABLE_NETSSL=$(if $(BR2_PACKAGE_POCO_NETSSL_OPENSSL),ON,OFF) \
|
||||
-DENABLE_PDF=$(if $(BR2_PACKAGE_POCO_PDF),ON,OFF) \
|
||||
-DENABLE_PROMETHEUS=$(if $(BR2_PACKAGE_POCO_PROMETHEUS),ON,OFF) \
|
||||
-DENABLE_REDIS=$(if $(BR2_PACKAGE_POCO_REDIS),ON,OFF) \
|
||||
-DENABLE_UTIL=$(if $(BR2_PACKAGE_POCO_UTIL),ON,OFF) \
|
||||
-DENABLE_XML=$(if $(BR2_PACKAGE_POCO_XML),ON,OFF) \
|
||||
-DENABLE_ZIP=$(if $(BR2_PACKAGE_POCO_ZIP),ON,OFF) \
|
||||
-DPOCO_UNBUNDLED=ON
|
||||
|
||||
# POCO_NO_FPENVIRONMENT and POCO_NO_WSTRING are plain preprocessor
|
||||
# defines, not CMake options, so they have to be passed as compiler flags.
|
||||
POCO_CXXFLAGS = $(TARGET_CXXFLAGS)
|
||||
|
||||
ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y)
|
||||
POCO_CONF_OPTS += --no-fpenvironment --no-wstring
|
||||
POCO_CXXFLAGS += -DPOCO_NO_FPENVIRONMENT -DPOCO_NO_WSTRING
|
||||
endif
|
||||
|
||||
# architectures missing some FE_* in their fenv.h
|
||||
ifeq ($(BR2_sh4a),y)
|
||||
POCO_CONF_OPTS += --no-fpenvironment
|
||||
POCO_CXXFLAGS += -DPOCO_NO_FPENVIRONMENT
|
||||
endif
|
||||
|
||||
# disable fpenvironment for soft floating point configuration
|
||||
ifeq ($(BR2_SOFT_FLOAT),y)
|
||||
POCO_CONF_OPTS += --no-fpenvironment
|
||||
POCO_CXXFLAGS += -DPOCO_NO_FPENVIRONMENT
|
||||
endif
|
||||
|
||||
POCO_MAKE_TARGET = shared_release
|
||||
POCO_CONF_OPTS += -DCMAKE_CXX_FLAGS="$(POCO_CXXFLAGS)"
|
||||
|
||||
POCO_LDFLAGS=$(TARGET_LDFLAGS)
|
||||
ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
|
||||
POCO_LDFLAGS += -latomic
|
||||
POCO_CONF_OPTS += \
|
||||
-DCMAKE_EXE_LINKER_FLAGS=-latomic \
|
||||
-DCMAKE_SHARED_LINKER_FLAGS=-latomic
|
||||
endif
|
||||
|
||||
define POCO_CONFIGURE_CMDS
|
||||
(cd $(@D); $(TARGET_MAKE_ENV) ./configure \
|
||||
--config=Linux \
|
||||
--prefix=/usr \
|
||||
--ldflags="$(POCO_LDFLAGS)" \
|
||||
--omit="$(POCO_OMIT)" \
|
||||
$(POCO_CONF_OPTS) \
|
||||
--unbundled \
|
||||
--no-tests \
|
||||
--no-samples)
|
||||
endef
|
||||
|
||||
define POCO_BUILD_CMDS
|
||||
$(TARGET_MAKE_ENV) $(MAKE) POCO_TARGET_OSARCH=$(ARCH) CROSS_COMPILE=$(TARGET_CROSS) \
|
||||
POCO_MYSQL_INCLUDE=$(STAGING_DIR)/usr/include/mysql \
|
||||
POCO_MYSQL_LIB=$(STAGING_DIR)/usr/lib/mysql \
|
||||
POCO_PGSQL_INCLUDE=$(STAGING_DIR)/usr/include/postgresql \
|
||||
POCO_PGSQL_LIB=$(STAGING_DIR)/usr/lib/postgresql \
|
||||
DEFAULT_TARGET=$(POCO_MAKE_TARGET) -C $(@D)
|
||||
endef
|
||||
|
||||
define POCO_INSTALL_STAGING_CMDS
|
||||
$(TARGET_MAKE_ENV) $(MAKE) DESTDIR=$(STAGING_DIR) POCO_TARGET_OSARCH=$(ARCH) \
|
||||
DEFAULT_TARGET=$(POCO_MAKE_TARGET) install -C $(@D)
|
||||
endef
|
||||
|
||||
define POCO_INSTALL_TARGET_CMDS
|
||||
$(TARGET_MAKE_ENV) $(MAKE) DESTDIR=$(TARGET_DIR) POCO_TARGET_OSARCH=$(ARCH) \
|
||||
DEFAULT_TARGET=$(POCO_MAKE_TARGET) install -C $(@D)
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
||||
$(eval $(cmake-package))
|
||||
|
||||
Reference in New Issue
Block a user