diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 109b3ed2e..469ca7b46 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 diff --git a/CMakeLists.txt b/CMakeLists.txt index 1b9f06e04..77cf119be 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 (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24") + find_package(Python3 COMPONENTS Development.SABIModule) + endif() endif() find_package(Doxygen) diff --git a/build.ps1 b/build.ps1 index a8b71976e..8d6e46da5 100644 --- a/build.ps1 +++ b/build.ps1 @@ -52,6 +52,7 @@ foreach($type in @("Debug", "RelWithDebInfo")) { $buildpath = $platform+$type & $vcvars $platform "&&" $cmake --fresh -B $buildpath -S $libdigidocpp "-G$generator" ` "-DCMAKE_BUILD_TYPE=$type" ` + "-DCMAKE_VERBOSE_MAKEFILE=YES" ` "-DCMAKE_INSTALL_PREFIX=$platform" ` "-DCMAKE_INSTALL_LIBDIR=bin" ` "-DCMAKE_TOOLCHAIN_FILE=$vcpkg_dir/scripts/buildsystems/vcpkg.cmake" ` diff --git a/libdigidocpp.i b/libdigidocpp.i index ef2e5884f..6f105691b 100644 --- a/libdigidocpp.i +++ b/libdigidocpp.i @@ -22,14 +22,8 @@ %module(directors="1") digidoc %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 +#define Py_LIMITED_API 0x03040000 %} %{ #include "libdigidocpp.i.h" 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..60a8dba4a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -198,7 +198,12 @@ 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_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