Skip to content

Commit 7a23a03

Browse files
authored
Reorganise external libs to separate subdirectory (#4996)
* chore(PCRE): properly detect library type on newer macOS * chore(ZLIB): move source files to own zlib directory and update CMake files. * chore(PCRE): move source files to own pcre2 directory and update CMake files. * chore(UTF8PROC): move source files to own utf8proc directory and update CMake files. * chore(ZLIB): remove header files * chore(PDJSON): move source files to own pdjson directory and update CMake files. * chore(SQLite3): move source files to own sqlite3 directory and update CMake files. * chore(UNBUNDLED): Correct includes. * chore(expat): move source files to own expat directory and update CMake files. * chore(wepoll): move source files to own wepoll directory and update CMake files. * chore(7zip): move source files to own 7zip directory and update CMake files. * chore(CMake): fix compile and link flags for dependent static libraries * chore(CMake): set PCRE2_STATIC when building PCRE2. * chore(SQLite3): Set SQLITE_THREADSAFE for unbundled build, add warnings. * chore(CMake): Modifications to build and link properly static target libraries (using OBJECT library type and link using BUILD_LOCAL_INTERFACE) * chore(CMake): fix order of includes in main CMakeLists.txt. * chore(CI): Build mysql tests with cmake. * chore(CI): Build mongodb, redis, sqlite no parser tests with cmake. * chore(CI): Build odbc tests with cmake. * chore(CI): Build more ations with cmake, other fixes. * chore(CI): Fixes for macOS * chore(CMake): extract hpdf and png files to own directories in dependencies * fix(CMake): include dependencies after all module dependencies are resolved. * fix(CMake): Improve dependency handling of dependencies to compile them only when necessary. * fix(CMake): PDF: move t4.h to proper directory, modify include. * fix(CMake): Fixes to link properly on all platforms. * fix(CMAKE): Wrong ENABLE for SQLITE * enh(PDF): Remove dependencies on hpdf headers from Poco::PDF interface and make usage of hpdf only internal. * enh(CI): Convert more jobs to use cmake. * enh(CI): Convert macOS sanitizer jobs to use cmake. * enh(mkrelease): Copy dependencies when creating release package. * eng(CMake): Add missing POCO_SO option to enable/disable small object optimization. * enh(CI): Run linux sanitizer with cmake, various fixes and improvements. * fix(CMake): bundled build: ZLIB::ZLIB is already linked with Foundation, no need to link again to Poco::Zip * fix(CI): vptr undefined sanitizer causes foundation tests to fail when linking, disable it * chore(tests): Minor code improvements. * fix(AsyncNotificationCenter): fix a data race with member _listsEmpty by making it atomic. * eng(CI): Add a few more time sensitive tests to cppignore.lnx * chore(Thread): Code updates. * eng(CI): Add a few more time sensitive tests to cppignore.lnx * fix(AsyncNotificationCenter): must join threads to avoid data race in dtor. * chore(CI): Pass TSAN_OPTIONS to jobs where necessary * chore(CI): run rests without sudo, compile with parallelism * chore(CI): Use POCO_MINIMAL_BUILD to simplify CMake configure lines. * chore(CI): Add 32-bit Windows VS build * chore(CMake): Printout cmake generator platform. * chore(CMake): linux-gcc-make-armv7l -> linux-gcc-cmake-armv7l * chore(ci): windows-2025-msvc-cmake-32bit -> windows-2025-msvc-cmake-Win32 * chore(CI): Convert all remaining jobs to CMake. * chore(make): Prevent building with make. * chore(CodeQL): exclude all external code from CodeQL checks. * chore(macOS): Set min support version to 13.3 to properly support C++20 standard.
1 parent ac27082 commit 7a23a03

File tree

377 files changed

+2377
-27338
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

377 files changed

+2377
-27338
lines changed

.github/workflows/ci.yml

Lines changed: 331 additions & 382 deletions
Large diffs are not rendered by default.

.github/workflows/packages-qa.yml

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -72,29 +72,6 @@ jobs:
7272
overwrite: true
7373
retention-days: 1
7474

75-
linux-gcc-make-mkrelease:
76-
runs-on: ubuntu-22.04
77-
needs: mkrelease
78-
steps:
79-
- uses: actions/download-artifact@v4
80-
with:
81-
name: posix-archives
82-
- run: sudo apt -y update && sudo apt -y install libssl-dev unixodbc-dev redis-server libmysqlclient-dev
83-
- run: rm poco-*-all.tar.gz
84-
- run: mkdir poco && cd poco && tar xfz ../poco-*.tar.gz --strip-components=1
85-
- run: cd poco && ./configure --everything && make all -s -j`nproc`
86-
87-
linux-gcc-make-mkrelease-all:
88-
runs-on: ubuntu-22.04
89-
needs: mkrelease
90-
steps:
91-
- uses: actions/download-artifact@v4
92-
with:
93-
name: posix-archives
94-
- run: sudo apt -y update && sudo apt -y install libssl-dev unixodbc-dev redis-server libmysqlclient-dev
95-
- run: mkdir poco && cd poco && tar xfz ../poco-*-all.tar.gz --strip-components=1
96-
- run: cd poco && ./configure --everything && make all -s -j`nproc`
97-
9875
linux-gcc-cmake-mkrelease:
9976
runs-on: ubuntu-22.04
10077
needs: mkrelease
@@ -118,31 +95,6 @@ jobs:
11895
- run: mkdir poco && cd poco && tar xfz ../poco-*-all.tar.gz --strip-components=1
11996
- run: cmake -Spoco -Bcmake-build -GNinja -DENABLE_PDF=OFF -DENABLE_TESTS=ON && cmake --build cmake-build --target all
12097

121-
windows-2022-msvc-buildwin-x64-mkrelease-all:
122-
runs-on: windows-2022
123-
needs: mkrelease_win
124-
steps:
125-
- uses: actions/download-artifact@v4
126-
with:
127-
name: windows-archives
128-
- run: |
129-
7z x poco-*-all.zip
130-
cd poco-*-all
131-
.\buildwin.ps1 -poco_base . -vs 170 -action build -linkmode all -config release -platform x64 -samples -tests -omit "Crypto,NetSSL_OpenSSL,Data/MySQL,Data/PostgreSQL,JWT"
132-
133-
windows-2022-msvc-buildwin-x64-mkrelease:
134-
runs-on: windows-2022
135-
needs: mkrelease_win
136-
steps:
137-
- uses: actions/download-artifact@v4
138-
with:
139-
name: windows-archives
140-
- run: |
141-
rm poco-*-all.zip
142-
7z x poco-*.zip
143-
cd poco-*
144-
.\buildwin.ps1 -poco_base . -vs 170 -action build -linkmode all -config release -platform x64 -samples -tests
145-
14698
windows-2022-msvc-cmake-mkrelease-all:
14799
runs-on: windows-2022
148100
needs: mkrelease_win

CMakeLists.txt

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
cmake_minimum_required(VERSION 3.15.0)
1+
cmake_minimum_required(VERSION 3.26.0)
2+
3+
# MacOS version that has support for C++20
4+
# Must be set before the project.
5+
set(CMAKE_OSX_DEPLOYMENT_TARGET "13.3" CACHE STRING "macOS minimum supported target")
26

37
project(Poco)
48

@@ -227,6 +231,9 @@ option(POCO_UNBUNDLED
227231
option(POCO_SQLITE_UNBUNDLED
228232
"Set to OFF|ON (default is OFF) to control linking sqlite dependency as external" OFF)
229233

234+
option(POCO_SOO
235+
"Set to OFF|ON (default is ON) to control small object optimization in Poco::Foundation" ON)
236+
230237
if (POCO_UNBUNDLED)
231238
set(POCO_SQLITE_UNBUNDLED ON CACHE BOOL "Enable Unbundled SQLite" FORCE)
232239
endif()
@@ -257,10 +264,12 @@ if(ENABLE_FUZZING)
257264
endif()
258265

259266
if(POCO_UNBUNDLED)
260-
message(STATUS "Using external sqlite, zlib, pcre2, expat, libpng, ...")
261-
elseif (POCO_SQLITE_UNBUNDLED)
262-
message(STATUS "Using external sqlite")
263-
message(STATUS "Using internal zlib, pcre2, expat, libpng, ...")
267+
if (POCO_SQLITE_UNBUNDLED)
268+
message(STATUS "Using external sqlite")
269+
message(STATUS "Using internal zlib, pcre2, expat, libpng, ...")
270+
else()
271+
message(STATUS "Using external sqlite, zlib, pcre2, expat, libpng, ...")
272+
endif()
264273
else()
265274
message(STATUS "Using internal sqlite, zlib, pcre2, expat, libpng, ...")
266275
endif()
@@ -402,6 +411,8 @@ endif()
402411

403412
# - add required subdirectories
404413

414+
add_subdirectory(dependencies)
415+
405416
if(ENABLE_FOUNDATION)
406417
add_subdirectory(Foundation)
407418
list(APPEND Poco_COMPONENTS "Foundation")
@@ -623,8 +634,8 @@ install(
623634
Devel
624635
)
625636

626-
message(STATUS "CMake ${CMAKE_VERSION} successfully configured ${PROJECT_NAME} using ${CMAKE_GENERATOR} generator")
627-
message(STATUS "${PROJECT_NAME} package version: ${PROJECT_VERSION}")
637+
message(STATUS "CMake '${CMAKE_VERSION}' successfully configured '${PROJECT_NAME}'")
638+
message(STATUS "${PROJECT_NAME} package version: '${PROJECT_VERSION}'")
628639
if(BUILD_SHARED_LIBS)
629640
message(STATUS "Building dynamic libraries")
630641
else()
@@ -637,6 +648,8 @@ endif()
637648
message(STATUS "[cmake] Build for OS type: ${CMAKE_SYSTEM_NAME}")
638649
message(STATUS "[cmake] Build for OS version: ${CMAKE_SYSTEM_VERSION}")
639650
message(STATUS "[cmake] Build for CPU type: ${CMAKE_SYSTEM_PROCESSOR}")
651+
message(STATUS "[cmake] Generator: ${CMAKE_GENERATOR}")
652+
message(STATUS "[cmake] Generator platorm: ${CMAKE_GENERATOR_PLATFORM}")
640653
message(STATUS "[cmake] Build type: ${CMAKE_BUILD_TYPE}")
641654
string(TOUPPER "${CMAKE_BUILD_TYPE}" BUILD_TYPE)
642655
message(STATUS "[cmake] Build with C++ flags: ${CMAKE_CXX_FLAGS_${BUILD_TYPE}} ${CMAKE_CXX_FLAGS}")

Data/SQLite/CMakeLists.txt

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,19 @@ POCO_SOURCES_AUTO(SQLITE_SRCS ${SRCS_G})
66
file(GLOB_RECURSE HDRS_G "include/*.h")
77
POCO_HEADERS_AUTO(SQLITE_SRCS ${HDRS_G})
88

9-
if(POCO_SQLITE_UNBUNDLED)
10-
find_package(SQLite3 REQUIRED)
11-
else()
12-
# sqlite3
13-
POCO_SOURCES(SQLITE_SRCS sqlite3
14-
src/sqlite3.c
15-
)
16-
endif()
17-
189
# Version Resource
1910
if(MSVC AND BUILD_SHARED_LIBS)
2011
source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc)
2112
list(APPEND SQLITE_SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc)
2213
endif()
2314

2415
add_library(DataSQLite ${SQLITE_SRCS})
16+
if (POCO_UNBUNDLED)
17+
target_link_libraries(DataSQLite PRIVATE SQLite::SQLite3)
18+
target_compile_definitions(DataSQLite PUBLIC POCO_SQLITE_UNBUNDLED)
19+
else()
20+
target_link_libraries(DataSQLite PRIVATE "$<BUILD_LOCAL_INTERFACE:SQLite::SQLite3>")
21+
endif()
2522

2623
add_library(Poco::DataSQLite ALIAS DataSQLite)
2724
set_target_properties(DataSQLite
@@ -38,28 +35,6 @@ target_include_directories(DataSQLite
3835
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
3936
)
4037

41-
if(POCO_SQLITE_UNBUNDLED)
42-
target_link_libraries(DataSQLite PUBLIC SQLite::SQLite3)
43-
target_compile_definitions(DataSQLite PUBLIC POCO_SQLITE_UNBUNDLED)
44-
target_compile_definitions(DataSQLite PRIVATE
45-
SQLITE_THREADSAFE=1
46-
)
47-
else()
48-
target_compile_definitions(DataSQLite PRIVATE
49-
SQLITE_THREADSAFE=1
50-
SQLITE_DISABLE_LFS
51-
SQLITE_OMIT_UTF16
52-
SQLITE_OMIT_PROGRESS_CALLBACK
53-
SQLITE_OMIT_COMPLETE
54-
SQLITE_OMIT_TCL_VARIABLE
55-
SQLITE_OMIT_DEPRECATED
56-
)
57-
option(ENABLE_DATA_SQLITE_FTS5 "Enable SQLite FTS5 Extension" OFF)
58-
if(ENABLE_DATA_SQLITE_FTS5)
59-
target_compile_definitions(DataSQLite PRIVATE SQLITE_ENABLE_FTS5)
60-
endif()
61-
endif()
62-
6338
POCO_INSTALL(DataSQLite)
6439
POCO_GENERATE_PACKAGE(DataSQLite)
6540

Data/SQLite/include/Poco/Data/SQLite/Binder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include "Poco/Data/LOB.h"
2424
#include "Poco/Any.h"
2525
#include "Poco/Dynamic/Var.h"
26-
#include "sqlite3.h"
26+
#include <sqlite3.h>
2727

2828

2929
namespace Poco {

Data/SQLite/include/Poco/Data/SQLite/Extractor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#include "Poco/UTFString.h"
3434
#include "Poco/Any.h"
3535
#include "Poco/Dynamic/Var.h"
36-
#include "sqlite3.h"
36+
#include <sqlite3.h>
3737
#include <vector>
3838
#include <utility>
3939

Data/SQLite/src/Connector.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,7 @@
1515
#include "Poco/Data/SQLite/Connector.h"
1616
#include "Poco/Data/SQLite/SessionImpl.h"
1717
#include "Poco/Data/SessionFactory.h"
18-
#if defined(POCO_SQLITE_UNBUNDLED)
1918
#include <sqlite3.h>
20-
#else
21-
#include "sqlite3.h"
22-
#endif
23-
2419

2520
namespace Poco {
2621
namespace Data {

Data/SQLite/src/Extractor.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,7 @@
2121
#include "Poco/DateTimeParser.h"
2222
#include "Poco/Exception.h"
2323
#include "Poco/Debugger.h"
24-
#if defined(POCO_SQLITE_UNBUNDLED)
2524
#include <sqlite3.h>
26-
#else
27-
#include "sqlite3.h"
28-
#endif
2925
#include <cstdlib>
3026

3127

Data/SQLite/src/SQLiteStatementImpl.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,7 @@
1818
#include "Poco/String.h"
1919
#include <cstdlib>
2020
#include <cstring>
21-
#if defined(POCO_SQLITE_UNBUNDLED)
2221
#include <sqlite3.h>
23-
#else
24-
#include "sqlite3.h"
25-
#endif
2622

2723

2824
namespace Poco {

Data/SQLite/src/SessionImpl.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,7 @@
2121
#include "Poco/String.h"
2222
#include "Poco/Mutex.h"
2323
#include "Poco/Data/DataException.h"
24-
#if defined(POCO_SQLITE_UNBUNDLED)
2524
#include <sqlite3.h>
26-
#else
27-
#include "sqlite3.h"
28-
#endif
2925
#include <cstdlib>
3026

3127

0 commit comments

Comments
 (0)