diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 109b3ed2e..7407ca70b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -60,17 +60,12 @@ jobs: cd /Library zip -q -r ${OLDPWD}/libdigidocpp.${{ matrix.target }}.zip libdigidocpp.* - name: Archive artifacts - if: matrix.target == 'macos' - uses: actions/upload-artifact@v4 - with: - name: macOS - path: build/macos/libdigidocpp*.* - - name: Archive artifacts - if: matrix.target != 'macos' uses: actions/upload-artifact@v4 with: name: ${{ matrix.target }} - path: libdigidocpp*.zip + path: | + build/macos/libdigidocpp*.* + libdigidocpp*.zip fedora: name: Build on Fedora ${{ matrix.container }} runs-on: ubuntu-latest @@ -161,7 +156,10 @@ jobs: VCPKG_DEFAULT_TRIPLET: ${{ matrix.platform }}-windows VCPKG_INSTALLED_DIR: ${{ github.workspace }}/vcpkg_installed_${{ matrix.platform }} - name: Install dependencies - run: choco install doxygen.install -y > $null + run: | + choco install doxygen.install -y > $null + Invoke-WebRequest -UserAgent "Wget" "https://sourceforge.net/projects/swig/files/swigwin/swigwin-4.2.1/swigwin-4.2.1.zip/download" -OutFile swig.zip + tar xf swig.zip - uses: actions/setup-python@v5 if: matrix.platform == 'x86' with: @@ -172,7 +170,7 @@ jobs: & .\build.ps1 ` -vcvars "${{ matrix.vcvars }}" ` -platform ${{ matrix.platform }} ` - -swig C:/ProgramData/chocolatey/bin/swig.exe ` + -swig ${{ github.workspace }}/swigwin-4.2.1/swig.exe ` -doxygen "C:/Program files/doxygen/bin/doxygen.exe" ` -boost - name: Archive artifacts diff --git a/CMakeLists.txt b/CMakeLists.txt index 1b9f06e04..42c18ff70 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -78,6 +78,9 @@ find_package(SWIG) if(SWIG_FOUND) find_package(JNI) find_package(Python3 COMPONENTS Interpreter Development) + if((WIN32 OR APPLE) AND CMAKE_VERSION VERSION_GREATER_EQUAL "3.24") + find_package(Python3 COMPONENTS Development.SABIModule) + endif() endif() find_package(Doxygen) diff --git a/libdigidocpp.i b/libdigidocpp.i index ef2e5884f..5b4466c54 100644 --- a/libdigidocpp.i +++ b/libdigidocpp.i @@ -23,12 +23,7 @@ %begin %{ #ifdef _MSC_VER -#if 1 #define SWIG_PYTHON_INTERPRETER_NO_DEBUG -#include -#else // Python debug symbols are installed -#define PY_NO_LINK_LIB -#endif #endif %} %{ diff --git a/prepare_osx_build_environment.sh b/prepare_osx_build_environment.sh index 1f6426a83..a1215e7ee 100755 --- a/prepare_osx_build_environment.sh +++ b/prepare_osx_build_environment.sh @@ -168,7 +168,7 @@ function openssl { do case "${ARGS}" in *simulator*) CC="" CFLAGS="-arch ${ARCH}" ./Configure iossimulator-xcrun --prefix=${TARGET_PATH} no-shared no-dso no-module no-engine no-tests no-ui-console enable-ec_nistp_64_gcc_128 ;; - *catalyst*) CC="" CFLAGS="-target ${ARCH}-apple-ios-macabi" ./Configure darwin64-${ARCH} --prefix=${TARGET_PATH} no-shared no-dso no-module no-engine no-tests no-ui-console enable-ec_nistp_64_gcc_128 ;; + *catalyst*) CC="" CFLAGS="-target ${ARCH}-apple-ios${IPHONEOS_DEPLOYMENT_TARGET}-macabi" ./Configure darwin64-${ARCH} --prefix=${TARGET_PATH} no-shared no-dso no-module no-engine no-tests no-ui-console enable-ec_nistp_64_gcc_128 ;; *iphone*) CC="" CFLAGS="" ./Configure ios64-xcrun --prefix=${TARGET_PATH} no-shared no-dso no-module no-engine no-tests no-ui-console enable-ec_nistp_64_gcc_128 ;; *) CC="" CFLAGS="" ./Configure darwin64-${ARCH} --prefix=${TARGET_PATH} shared no-module no-tests enable-ec_nistp_64_gcc_128 esac diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d457b3431..21fea9b42 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -198,7 +198,13 @@ if(SWIG_FOUND) set(CMAKE_SWIG_OUTDIR ${CMAKE_CURRENT_BINARY_DIR}) swig_add_library(digidoc_python LANGUAGE python SOURCES ../libdigidocpp.i) target_compile_definitions(digidoc_python PRIVATE TARGET_NAME="$") - target_link_libraries(digidoc_python digidocpp digidocpp_util digidocpp_ver Python3::Module) + target_link_libraries(digidoc_python digidocpp digidocpp_util digidocpp_ver) + if(TARGET Python3::SABIModule) + target_compile_definitions(digidoc_python PRIVATE Py_LIMITED_API=0x03090000) + target_link_libraries(digidoc_python Python3::SABIModule) + else() + target_link_libraries(digidoc_python Python3::Module) + endif() #configure_file(setup.py.cmake setup.py) #install(CODE "execute_process(COMMAND python3 ${CMAKE_CURRENT_BINARY_DIR}/setup.py install)") if(NOT Python3_SITELIB) diff --git a/src/XMLDocument.h b/src/XMLDocument.h index 2cea1de81..63820d912 100644 --- a/src/XMLDocument.h +++ b/src/XMLDocument.h @@ -186,8 +186,8 @@ struct XMLElem struct XMLName { - std::string_view name; - std::string_view ns; + std::string_view name {}; + std::string_view ns {}; }; struct XMLNode: public XMLElem diff --git a/src/XmlConf.cpp b/src/XmlConf.cpp index 0dbd930a7..1a1ace3d6 100644 --- a/src/XmlConf.cpp +++ b/src/XmlConf.cpp @@ -600,7 +600,7 @@ SET1CONST(string, setProxyPass, proxyPass) * @fn void digidoc::XmlConfV5::setPKCS12Cert(const std::string &cert) * @copydoc digidoc::XmlConf::setPKCS12Cert(const std::string &cert) */ -SET1CONSTEX(string, setPKCS12Cert, {}) +SET1CONSTEX(string, setPKCS12Cert, (void)value) /** * @fn void digidoc::XmlConf::setPKCS12Pass(const std::string &pass) @@ -625,7 +625,7 @@ SET1CONSTEX(string, setPKCS12Cert, {}) * @fn void digidoc::XmlConfV5::setPKCS12Pass(const std::string &pass) * @copydoc digidoc::XmlConf::setPKCS12Pass(const std::string &pass) */ -SET1CONSTEX(string, setPKCS12Pass, {}) +SET1CONSTEX(string, setPKCS12Pass, (void)value) /** * @fn void digidoc::XmlConf::setTSUrl(const std::string &url) @@ -700,7 +700,7 @@ SET1CONST(string, setVerifyServiceUri, verifyServiceUri) * @fn void digidoc::XmlConfV5::setPKCS12Disable(bool disable) * @copydoc digidoc::XmlConf::setPKCS12Disable(bool disable) */ -SET1EX(bool, setPKCS12Disable, {}) +SET1EX([[maybe_unused]] bool, setPKCS12Disable, {}) /** * @fn void digidoc::XmlConf::setProxyTunnelSSL(bool enable) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index e5849555c..ed94a3c18 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -12,8 +12,6 @@ target_link_libraries(TSLTests digidocpp digidocpp_util Boost::unit_test_framewo if(WIN32) string(REPLACE "/EHsc" "/EHa" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) set_target_properties(unittests TSLTests PROPERTIES COMPILE_FLAGS "/bigobj") -else() - set_target_properties(unittests TSLTests PROPERTIES COMPILE_FLAGS "-Wno-unused-parameter -Wno-unused-variable") endif() add_test(NAME runtest COMMAND ${CMAKE_CURRENT_BINARY_DIR}/unittests --build_info=YES --report_level=no --logger=${TEST_FORMAT},all,${CMAKE_CURRENT_BINARY_DIR}/libdigidocpp.xml -- ${CMAKE_CURRENT_SOURCE_DIR}/data