Skip to content

Commit bac1701

Browse files
committed
merge with latest master
2 parents e302fbd + 1d9dcf3 commit bac1701

Some content is hidden

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

42 files changed

+1019
-109
lines changed

.github/workflows/cmake.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ env:
1717
jobs:
1818
windows:
1919
name: windows/msvc - ${{ matrix.link }}
20-
runs-on: windows-2019
20+
runs-on: windows-2022
2121
strategy:
2222
fail-fast: false
2323
matrix:
@@ -44,18 +44,15 @@ jobs:
4444
- name: Create Build Environment & Configure Cmake
4545
shell: bash
4646
working-directory: ./build
47-
# For unknown reasons, we fail to create file in windows ci environment.
48-
# So examples, drogon_ctl and integration tests can not be built in windows ci.
49-
# We should try to enable them again in the future.
5047
run: |
5148
[[ ${{ matrix.link }} == "SHARED" ]] && shared="ON" || shared="OFF"
5249
cmake .. \
5350
-DCMAKE_BUILD_TYPE=Debug \
5451
-DBUILD_TESTING=on \
5552
-DBUILD_SHARED_LIBS=$shared \
5653
-DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" \
57-
-DBUILD_CTL=OFF \
58-
-DBUILD_EXAMPLES=OFF \
54+
-DBUILD_CTL=ON \
55+
-DBUILD_EXAMPLES=ON \
5956
-DUSE_SPDLOG=ON \
6057
-DCMAKE_INSTALL_PREFIX=../install \
6158
-DCMAKE_POLICY_DEFAULT_CMP0091=NEW \
@@ -102,7 +99,6 @@ jobs:
10299

103100
- name: Prepare for testing
104101
run: |
105-
brew tap homebrew/services
106102
brew services restart postgresql@14
107103
brew services start mariadb
108104
brew services start redis
@@ -179,12 +175,12 @@ jobs:
179175
sudo apt-get --purge remove postgresql postgresql-doc postgresql-common postgresql-client-common
180176
sudo apt-get -y install postgresql-all
181177
182-
- name: Install g++-13
183-
if: startsWith(matrix.compiler.cxx, 'g++') && matrix.compiler.ver == 13
178+
- name: Install g++
179+
if: startsWith(matrix.compiler.cxx, 'g++') && (matrix.compiler.ver == 13 || matrix.compiler.ver == 9)
184180
run: |
185181
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
186182
sudo apt-get install g++-${{ matrix.compiler.ver }}
187-
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 13
183+
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${{ matrix.compiler.ver }} ${{ matrix.compiler.ver }}
188184
189185
- name: Install Clang
190186
if: startsWith(matrix.compiler.cxx, 'clang') && matrix.compiler.ver < 13

.github/workflows/codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
6161
# Initializes the CodeQL tools for scanning.
6262
- name: Initialize CodeQL
63-
uses: github/codeql-action/init@v3
63+
uses: github/codeql-action/init@v4
6464
with:
6565
languages: ${{ matrix.language }}
6666
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -75,6 +75,6 @@ jobs:
7575
run: ninja && sudo ninja install
7676

7777
- name: Perform CodeQL Analysis
78-
uses: github/codeql-action/analyze@v3
78+
uses: github/codeql-action/analyze@v4
7979
with:
8080
category: "/language:${{matrix.language}}"

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ build/
3535
cmake-build-debug/
3636
cmake-build-debug-visual-studio/
3737
.idea/
38-
lib/inc/drogon/version.h
3938
html/
4039
latex/
4140
.vscode

CMakeLists.txt

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ CMAKE_DEPENDENT_OPTION(BUILD_REDIS "Build with redis support" ON "BUILD_ORM" OFF
2424
CMAKE_DEPENDENT_OPTION(USE_SPDLOG "Allow using the spdlog logging library" OFF "USE_SUBMODULE" OFF)
2525

2626
set(DROGON_MAJOR_VERSION 1)
27-
set(DROGON_MINOR_VERSION 9)
28-
set(DROGON_PATCH_VERSION 10)
27+
set(DROGON_MINOR_VERSION 10)
28+
set(DROGON_PATCH_VERSION 11)
2929
set(DROGON_VERSION
3030
${DROGON_MAJOR_VERSION}.${DROGON_MINOR_VERSION}.${DROGON_PATCH_VERSION})
3131
set(DROGON_VERSION_STRING "${DROGON_VERSION}")
@@ -121,6 +121,7 @@ endif()
121121
target_include_directories(
122122
${PROJECT_NAME}
123123
PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/lib/inc>
124+
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/lib/inc>
124125
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/orm_lib/inc>
125126
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/nosql_lib/redis/inc>
126127
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>
@@ -352,21 +353,21 @@ set(private_headers
352353
third_party/eric-hpack-core/hpack.h
353354
lib/src/MultipartStreamParser.h)
354355

355-
if (NOT WIN32)
356+
if (NOT WIN32 AND NOT CMAKE_SYSTEM_NAME STREQUAL "iOS")
356357
set(DROGON_SOURCES
357358
${DROGON_SOURCES}
358359
lib/src/SharedLibManager.cc)
359360
set(private_headers
360361
${private_headers}
361362
lib/src/SharedLibManager.h)
362-
else (NOT WIN32)
363+
elseif(WIN32)
363364
set(DROGON_SOURCES
364365
${DROGON_SOURCES}
365366
third_party/mman-win32/mman.c)
366367
set(private_headers
367368
${private_headers}
368369
third_party/mman-win32/mman.h)
369-
endif (NOT WIN32)
370+
endif()
370371

371372
if (BUILD_POSTGRESQL)
372373
# find postgres
@@ -520,7 +521,7 @@ execute_process(COMMAND "git" rev-parse HEAD
520521
OUTPUT_VARIABLE GIT_SHA1
521522
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
522523
configure_file("${PROJECT_SOURCE_DIR}/cmake/templates/version.h.in"
523-
"${PROJECT_SOURCE_DIR}/lib/inc/drogon/version.h" @ONLY)
524+
"${CMAKE_CURRENT_BINARY_DIR}/lib/inc/drogon/version.h" @ONLY)
524525

525526
if (DROGON_CXX_STANDARD EQUAL 20)
526527
option(USE_COROUTINE "Enable C++20 coroutine support" ON)
@@ -533,6 +534,15 @@ if (BUILD_EXAMPLES)
533534
endif (BUILD_EXAMPLES)
534535

535536
if (BUILD_CTL)
537+
if (CMAKE_CROSSCOMPILING)
538+
find_program(HOST_DROGON_CTL _drogon_ctl)
539+
if (NOT HOST_DROGON_CTL)
540+
message(FATAL_ERROR "_drogon_ctl not found on host system")
541+
endif()
542+
set(DROGON_CTL "${HOST_DROGON_CTL}")
543+
else (CMAKE_CROSSCOMPILING)
544+
set(DROGON_CTL "$<TARGET_FILE:_drogon_ctl>")
545+
endif (CMAKE_CROSSCOMPILING)
536546
add_subdirectory(drogon_ctl)
537547
endif (BUILD_CTL)
538548

@@ -593,7 +603,7 @@ set(DROGON_HEADERS
593603
lib/inc/drogon/WebSocketConnection.h
594604
lib/inc/drogon/WebSocketController.h
595605
lib/inc/drogon/drogon.h
596-
lib/inc/drogon/version.h
606+
${CMAKE_CURRENT_BINARY_DIR}/lib/inc/drogon/version.h
597607
lib/inc/drogon/drogon_callbacks.h
598608
lib/inc/drogon/PubSubService.h
599609
lib/inc/drogon/drogon_test.h

ChangeLog.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,48 @@ All notable changes to this project will be documented in this file.
4242
* Technically supports handling server push. But no API to expose it to the user yet
4343
* Does not support setting HTTP request dependency and priority
4444
* Does not support trailers
45+
46+
### Changed
47+
48+
- Add toString method to all models
49+
50+
## [1.9.11] - 2025-06-20
51+
52+
### API changes list
53+
54+
- Add a new overload for execSqlCoro.
55+
56+
### Changed
57+
58+
- Do not write to source directory during build.
59+
60+
- Improve Postgres connection stability.
61+
62+
- Add handleFatalError in handleClosed.
63+
64+
- Add -o|--output option to drogon_ctl create models.
65+
66+
- Add qrcode for WeChat official account to the README file.
67+
68+
- Support for iOS compiling.
69+
70+
- Add cors example to demonstrate cross-origin support in drogon.
71+
72+
- Add support for continuation frame in WebSocketMessageParser.
73+
74+
- Add RawParameter API to pass raw SQL parameters.
75+
76+
- Upgrade Windows image and re-enable tests on Windows.
77+
78+
### Fixed
79+
80+
- Fix a bug in isAutoCreationClass<T>.
81+
82+
- Fix CI on MacOS.
83+
84+
- Fix issue with precision loss of double-type parameters in ORM inputs.
85+
86+
4587
## [1.9.10] - 2025-02-20
4688

4789
### API changes list
@@ -1843,7 +1885,13 @@ All notable changes to this project will be documented in this file.
18431885

18441886
## [1.0.0-beta1] - 2019-06-11
18451887

1888+
<<<<<<< HEAD
18461889
[Unreleased]: https://github.com/an-tao/drogon/compare/v1.9.10...HEAD
1890+
=======
1891+
[Unreleased]: https://github.com/an-tao/drogon/compare/v1.9.11...HEAD
1892+
1893+
[1.9.11]: https://github.com/an-tao/drogon/compare/v1.9.10...v1.9.11
1894+
>>>>>>> master
18471895
18481896
[1.9.10]: https://github.com/an-tao/drogon/compare/v1.9.9...v1.9.10
18491897

@@ -1854,10 +1902,13 @@ All notable changes to this project will be documented in this file.
18541902
[1.9.7]: https://github.com/an-tao/drogon/compare/v1.9.6...v1.9.7
18551903

18561904
[1.9.6]: https://github.com/an-tao/drogon/compare/v1.9.5...v1.9.6
1905+
<<<<<<< HEAD
18571906

18581907
[1.10.0-beta.2]: https://github.com/drogonframework/drogon/compare/v1.10.0-beta.1...v1.10.0-beta.2
18591908

18601909
[1.10.0-beta.1]: https://github.com/drogonframework/drogon/compare/v1.10.0-beta.0...v1.10.0-beta.1
1910+
=======
1911+
>>>>>>> master
18611912
18621913
[1.9.5]: https://github.com/an-tao/drogon/compare/v1.9.4...v1.9.5
18631914

README.zh-CN.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,3 +197,9 @@ class User : public drogon::HttpController<User>
197197
## QQ交流群:1137909452
198198

199199
欢迎交流探讨。
200+
201+
## 微信公众号:
202+
203+
![](https://github.com/an-tao/drogon/wiki/images/qrcode_wechat.jpg)
204+
205+
会不定期推送一些Drogon的使用技巧和更新信息,欢迎关注。

cmake_modules/FindHiredis.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,8 @@ if(Hiredis_FOUND)
3838
"${HIREDIS_INCLUDE_DIRS}"
3939
INTERFACE_LINK_LIBRARIES
4040
"${HIREDIS_LIBRARIES}")
41-
endif(Hiredis_FOUND)
41+
endif(Hiredis_FOUND)
42+
43+
if(WIN32 AND MINGW)
44+
target_link_libraries(Hiredis_lib INTERFACE ws2_32 secur32 crypt32 bcrypt zstd curl shlwapi)
45+
endif()

cmake_modules/FindMySQL.cmake

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,17 @@ find_package_handle_standard_args(MySQL
130130
MYSQL_INCLUDE_DIRS)
131131
# Copy the results to the output variables.
132132
if(MySQL_FOUND)
133-
add_library(MySQL_lib INTERFACE IMPORTED)
134-
set_target_properties(MySQL_lib
135-
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
136-
"${MYSQL_INCLUDE_DIRS}"
137-
INTERFACE_LINK_LIBRARIES
138-
"${MYSQL_LIBRARIES}")
133+
add_library(MySQL_lib UNKNOWN IMPORTED)
134+
set_target_properties(MySQL_lib PROPERTIES
135+
INTERFACE_INCLUDE_DIRECTORIES "${MYSQL_INCLUDE_DIRS}"
136+
IMPORTED_LOCATION "${MYSQL_LIBRARIES}")
137+
find_package(OpenSSL QUIET) # try to find openssl
138+
if(OpenSSL_FOUND)
139+
target_link_libraries(MySQL_lib INTERFACE $<LINK_ONLY:OpenSSL::SSL> $<LINK_ONLY:OpenSSL::Crypto>)
140+
message(STATUS "mysql: OpenSSL found!")
141+
else()
142+
message(STATUS "mysql: OpenSSL missing!")
143+
endif()
139144
else(MySQL_FOUND)
140145
set(MYSQL_LIBRARIES)
141146
set(MYSQL_INCLUDE_DIRS)

drogon_ctl/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ foreach(cspFile ${SCP_LIST})
4343
get_filename_component(classname ${cspFile} NAME_WE)
4444
message(STATUS "view classname:" ${classname})
4545
add_custom_command(OUTPUT ${classname}.h ${classname}.cc
46-
COMMAND $<TARGET_FILE:_drogon_ctl>
46+
COMMAND ${DROGON_CTL}
4747
ARGS
4848
create
4949
view
@@ -63,6 +63,7 @@ if(APPLE)
6363
target_link_libraries(drogon_ctl PRIVATE resolv)
6464
endif()
6565
message(STATUS "bin:" ${INSTALL_BIN_DIR})
66+
install(TARGETS _drogon_ctl RUNTIME DESTINATION ${INSTALL_BIN_DIR})
6667
install(TARGETS drogon_ctl RUNTIME DESTINATION ${INSTALL_BIN_DIR})
6768
if(WIN32)
6869
set(CTL_FILE $<TARGET_FILE:drogon_ctl>)

drogon_ctl/create.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ std::string create::detail()
4242
"create a plugin named class_name\n\n"
4343
"drogon_ctl create project <project_name> //"
4444
"create a project named project_name\n\n"
45-
"drogon_ctl create model <model_path> [--table=<table_name>] [-f]//"
45+
"drogon_ctl create model <model_path> [-o <output path>] "
46+
"[--table=<table_name>] [-f]//"
4647
"create model classes in model_path\n";
4748
}
4849

0 commit comments

Comments
 (0)