Skip to content

Commit

Permalink
Merge branch 'develop' into trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
mhekkel committed Dec 5, 2023
2 parents c0d26c4 + 46ad719 commit 4769e5d
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 37 deletions.
39 changes: 10 additions & 29 deletions .github/workflows/cmake-multi-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,44 +13,23 @@ jobs:
runs-on: ${{ matrix.os }}

strategy:
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
fail-fast: false

# Set up a matrix to run the following 3 configurations:
# 1. <Windows, Release, latest MSVC compiler toolchain on the default runner image, default generator>
# 2. <Linux, Release, latest GCC compiler toolchain on the default runner image, default generator>
# 3. <Linux, Release, latest Clang compiler toolchain on the default runner image, default generator>
#
# To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list.
matrix:
os: [ubuntu-latest, windows-latest]
build_type: [Release]
build_shared_libs: [BUILD_SHARED_LIBS=ON, BUILD_SHARED_LIBS=OFF]
# c_compiler: [gcc, clang, cl]
c_compiler: [gcc, cl]
os: [ubuntu-latest, windows-latest, macos-latest]
build_type: [ Release ]
include:
- os: windows-latest
c_compiler: cl
cpp_compiler: cl
- os: ubuntu-latest
c_compiler: gcc
cpp_compiler: g++
# - os: ubuntu-latest
# c_compiler: clang
# cpp_compiler: clang++
exclude:
- os: windows-latest
c_compiler: gcc
- os: windows-latest
c_compiler: clang
- os: ubuntu-latest
c_compiler: cl
- os: macos-latest
cpp_compiler: clang++

steps:
- uses: actions/checkout@v3

- name: Set reusable strings
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.
id: strings
shell: bash
run: |
Expand All @@ -70,20 +49,22 @@ jobs:
platform_version: 2019
toolset: msvc

- name: Install Boost macOS
if: matrix.os == 'macos-latest'
run: >
brew install boost
- name: Configure CMake
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-D${{ matrix.build_shared_libs }}
-S ${{ github.workspace }}
- name: Build
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}

- name: Test
working-directory: ${{ steps.strings.outputs.build-output-dir }}
run: ctest --build-config ${{ matrix.build_type }}
run: ctest --build-config ${{ matrix.build_type }} --output-on-failure
19 changes: 12 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Copyright Maarten L. Hekkelman, 2023
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
# Copyright Maarten L. Hekkelman, 2023
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

cmake_minimum_required(VERSION 3.22)

project(libzeep VERSION 6.0.10 LANGUAGES CXX)
project(libzeep VERSION 6.0.11 LANGUAGES CXX)

list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)

Expand Down Expand Up @@ -181,7 +181,6 @@ if(ZEEP_BUILD_LIBRARY)
${PROJECT_SOURCE_DIR}/lib-http/src/access-control.cpp
${PROJECT_SOURCE_DIR}/lib-http/src/connection.cpp
${PROJECT_SOURCE_DIR}/lib-http/src/controller.cpp
${PROJECT_SOURCE_DIR}/lib-http/src/controller-rsrc.cpp
${PROJECT_SOURCE_DIR}/lib-http/src/crypto.cpp
${PROJECT_SOURCE_DIR}/lib-http/src/daemon.cpp
${PROJECT_SOURCE_DIR}/lib-http/src/el-processing.cpp
Expand Down Expand Up @@ -214,6 +213,11 @@ if(ZEEP_BUILD_LIBRARY)
${PROJECT_SOURCE_DIR}/lib-xml/src/xpath.cpp
)

if(USE_RSRC)
list(APPEND ZEEP_SRC
${PROJECT_SOURCE_DIR}/lib-http/src/controller-rsrc.cpp)
endif()

if(HTTP_SERVER_HAS_PREFORK)
list(APPEND ZEEP_HEADERS ${PROJECT_SOURCE_DIR}/include/zeep/http/preforked-server.hpp)
list(APPEND ZEEP_SRC ${PROJECT_SOURCE_DIR}/lib-http/src/preforked-server.cpp)
Expand Down Expand Up @@ -277,7 +281,7 @@ if(ZEEP_BUILD_LIBRARY)
${CMAKE_INSTALL_FULL_LIBDIR}/cmake/zeep/zeepConfig*.cmake
${CMAKE_INSTALL_FULL_LIBDIR}/cmake/zeep/zeepTargets*.cmake)

if (OLD_CONFIG_FILES)
if(OLD_CONFIG_FILES)
message(STATUS "Installation will remove old config files: ${OLD_CONFIG_FILES}")
install(CODE "file(REMOVE ${OLD_CONFIG_FILES})")
endif()
Expand All @@ -302,6 +306,7 @@ if(ZEEP_BUILD_LIBRARY)
set(LIBZEEP_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set(LIBZEEP_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set(LIBZEEP_VERSION_PATCH ${PROJECT_VERSION_PATCH})

configure_file("${PROJECT_SOURCE_DIR}/include/zeep/config.hpp.in" "${PROJECT_SOURCE_DIR}/include/zeep/config.hpp" @ONLY)
endif(ZEEP_BUILD_LIBRARY)

Expand Down
3 changes: 3 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Version 6.0.11
- Builds on macOS again, I hope

Version 6.0.10
- Fix html_controller and rest_controller to pass
path parameters decoded.
Expand Down
10 changes: 10 additions & 0 deletions include/zeep/config.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@
#cmakedefine01 WEBAPP_USES_RESOURCES
#endif

/// We can use resources to store the contents of a docroot e.g.
/// which makes web applications really portable. However, for
/// this feature we need a working mrc
/// (https://github.com/mhekkel/mrc) and that is limited to
/// Windows and operating systems using the ELF executable format.

#ifndef USE_RSRC
#cmakedefine01 USE_RSRC
#endif

/// The current version of libzeep

#define LIBZEEP_VERSION "@LIBZEEP_VERSION@"
Expand Down
7 changes: 6 additions & 1 deletion include/zeep/http/template-processor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class file_loader : public resource_loader
std::filesystem::path m_docroot;
};

#if USE_RSRC
// -----------------------------------------------------------------------
/// \brief actual implementation of a zeep::resource_loader that loads resources from memory
///
Expand All @@ -99,6 +100,7 @@ class rsrc_loader : public resource_loader
private:
std::filesystem::file_time_type mRsrcWriteTime = {};
};
#endif

// --------------------------------------------------------------------

Expand Down Expand Up @@ -228,11 +230,14 @@ class html_template_processor : public basic_template_processor
};

using file_based_html_template_processor = html_template_processor<file_loader>;

#if USE_RSRC
using rsrc_based_html_template_processor = html_template_processor<rsrc_loader>;
#endif

/// \brief the actual definition of zeep::template_processor

#if WEBAPP_USES_RESOURCES
#if WEBAPP_USES_RESOURCES and USE_RSRC
using template_processor = rsrc_based_html_template_processor;
#else
using template_processor = file_based_html_template_processor;
Expand Down
8 changes: 8 additions & 0 deletions lib-http/test/processor-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -414,11 +414,19 @@ BOOST_AUTO_TEST_CASE(test_15)
</data>
)"_xml;

#ifdef __APPLE__ // no, really.. Danish macOS users are different
auto doc_test = R"(<?xml version="1.0"?>
<data>
<test> 7 August 2019, 12:14</test>
</data>
)"_xml;
#else
auto doc_test = R"(<?xml version="1.0"?>
<data>
<test> 7 august 2019, 12:14</test>
</data>
)"_xml;
#endif

zeep::http::template_processor p(DOCROOT);
zeep::http::tag_processor_v2 tp;
Expand Down

0 comments on commit 4769e5d

Please sign in to comment.