From 10e41a4729149d8d7652e841dbed7d2aa685b1d2 Mon Sep 17 00:00:00 2001 From: Vijai Kumar S Date: Mon, 25 Nov 2024 16:18:52 +0100 Subject: [PATCH 01/18] Fully tested VCPKG dependency management for lib3mf (Manifest mode) + All tests pass --- .gitmodules | 3 ++ CMakeLists.txt | 85 +++++++++++++++++++++---------- Include/Common/NMR_StringUtils.h | 2 +- Source/CMakeLists.txt | 13 +++-- Tests/CMakeLists.txt | 7 ++- Tests/CPP_Bindings/CMakeLists.txt | 24 +++++++-- vcpkg | 1 + vcpkg.json | 41 +++++++++++++++ 8 files changed, 137 insertions(+), 39 deletions(-) create mode 160000 vcpkg create mode 100644 vcpkg.json diff --git a/.gitmodules b/.gitmodules index db3aef4bb..de41d505f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -17,3 +17,6 @@ path = submodules/googletest url = https://github.com/google/googletest.git +[submodule "vcpkg"] + path = vcpkg + url = https://github.com/microsoft/vcpkg.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 5e1911e52..be241fa2e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,25 @@ cmake_policy(SET CMP0048 NEW) set_property(GLOBAL PROPERTY USE_FOLDERS ON) +option(USE_PACKAGED_SUBMODULES OFF) + +# Conditionally set the vcpkg toolchain file if USE_PACKAGED_SUBMODULES is OFF +if (USE_PACKAGED_SUBMODULES) + message("USE_PACKAGED_SUBMODULES is ON") + option(USE_INCLUDED_ZLIB "Use included zlib" ON) + option(USE_INCLUDED_LIBZIP "Use included libzip" ON) + option(USE_INCLUDED_SSL "Use included libressl" ON) +else() + message("USE_PACKAGED_SUBMODULES is OFF") + if (EXISTS "${CMAKE_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake") + message("Using VCPKG Toolchain") + set(CMAKE_TOOLCHAIN_FILE "${CMAKE_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake" CACHE STRING "Vcpkg toolchain file") + endif() + option(USE_INCLUDED_ZLIB "Use included zlib" OFF) + option(USE_INCLUDED_LIBZIP "Use included libzip" OFF) + option(USE_INCLUDED_SSL "Use included libressl" OFF) +endif() + include(GNUInstallDirs) @@ -28,9 +47,6 @@ set(CMAKE_INSTALL_BINDIR bin CACHE PATH "directory for installing binary files") set(CMAKE_INSTALL_LIBDIR lib CACHE PATH "directory for installing library files") set(CMAKE_INSTALL_INCLUDEDIR include/lib3mf CACHE PATH "directory for installing header files") -option(USE_INCLUDED_ZLIB "Use included zlib" ON) -option(USE_INCLUDED_LIBZIP "Use included libzip" ON) -option(USE_INCLUDED_SSL "Use included libressl" ON) option(BUILD_FOR_CODECOVERAGE "Build for code coverage analysis" OFF) option(STRIP_BINARIES "Strip binaries (on non-apple)" ON) option(USE_PLATFORM_UUID "Use UUID geneator that is provided by the OS (always ON for Windows)" OFF) @@ -144,23 +160,22 @@ endif() SOURCE_GROUP("Source Files\\Autogenerated" FILES ${ACT_GENERATED_SOURCE}) - -file(GLOB - LIBS_INCLUDE - LIST_DIRECTORIES true - ${CMAKE_CURRENT_SOURCE_DIR}/Libraries/*/Include -) -list(FILTER LIBS_INCLUDE EXCLUDE REGEX "zlib|libzip|libressl") -target_include_directories(${PROJECT_NAME} PRIVATE ${LIBS_INCLUDE}) - -# allow FASTFLOAT_ALLOWS_LEADING_PLUS -add_definitions(-DFASTFLOAT_ALLOWS_LEADING_PLUS=1) +if (USE_PACKAGED_SUBMODULES) + file(GLOB + LIBS_INCLUDE + LIST_DIRECTORIES true + ${CMAKE_CURRENT_SOURCE_DIR}/Libraries/*/Include + ) + list(FILTER LIBS_INCLUDE EXCLUDE REGEX "zlib|libzip|libressl") + target_include_directories(${PROJECT_NAME} PRIVATE ${LIBS_INCLUDE}) +endif () target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR_AUTOGENERATED}/Source) target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Include/API) target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Include) -if (USE_INCLUDED_LIBZIP) +# Libzip +if (USE_PACKAGED_SUBMODULES) # Something goes here to check if submodules exist and initialize the submodules if it does not target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Libraries/libzip/Include) if(MSVC) @@ -197,25 +212,41 @@ if (USE_INCLUDED_LIBZIP) target_compile_options(${PROJECT_NAME} PRIVATE "-DHAVE_STRCASECMP") target_compile_options(${PROJECT_NAME} PRIVATE "-DHAVE_UNISTD_H") endif() - else() - find_package(PkgConfig REQUIRED) - pkg_check_modules(LIBZIP REQUIRED libzip) - target_link_libraries(${PROJECT_NAME} ${LIBZIP_LIBRARIES}) + find_package(LIBZIP REQUIRED) + target_link_libraries(${PROJECT_NAME} PRIVATE libzip::zip) endif() - -if (USE_INCLUDED_ZLIB) +# ZLIB +if (USE_PACKAGED_SUBMODULES) target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Libraries/zlib/Include) else() - find_package(PkgConfig REQUIRED) - pkg_check_modules(ZLIB REQUIRED zlib) - target_link_libraries(${PROJECT_NAME} ${ZLIB_LIBRARIES}) + find_package(ZLIB REQUIRED) + target_link_libraries(${PROJECT_NAME} PRIVATE ZLIB::ZLIB) endif() -target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/submodules/fast_float/include) - +# Fast float +if (USE_PACKAGED_SUBMODULES) + target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/submodules/fast_float/include) + add_definitions(-DFASTFLOAT_ALLOWS_LEADING_PLUS=1) +else() + find_package(FastFloat CONFIG REQUIRED) + add_definitions(-DFASTFLOAT_ALLOWS_LEADING_PLUS=1) + target_link_libraries(${PROJECT_NAME} PRIVATE FastFloat::fast_float) +endif () + +# Base 64 +if(NOT USE_PACKAGED_SUBMODULES) + find_path(CPP_BASE64_INCLUDE_DIRS "cpp-base64/base64.cpp") + include_directories("${CPP_BASE64_INCLUDE_DIRS}/cpp-base64") + set(BASE64_SRC + ${CPP_BASE64_INCLUDE_DIRS}/cpp-base64/base64.h + ${CPP_BASE64_INCLUDE_DIRS}/cpp-base64/base64.cpp) + message("BASE64_SRC" ${BASE64_SRC}) + # Append BASE64_SRC to the target + target_sources(${PROJECT_NAME} PRIVATE ${BASE64_SRC}) +endif () set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "" IMPORT_PREFIX "" ) # This makes sure symbols are exported @@ -270,7 +301,7 @@ install(TARGETS ${PROJECT_NAME} install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR_AUTOGENERATED}/Bindings DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") ######################################################### -option(LIB3MF_TESTS "Switch whether the tests of lib3mf should be build" ON) +option(LIB3MF_TESTS "Switch whether the tests of lib3mf should be build" OFF) message("LIB3MF_TESTS ... " ${LIB3MF_TESTS}) if(LIB3MF_TESTS) diff --git a/Include/Common/NMR_StringUtils.h b/Include/Common/NMR_StringUtils.h index 4cafe3a76..b32bc76a1 100644 --- a/Include/Common/NMR_StringUtils.h +++ b/Include/Common/NMR_StringUtils.h @@ -37,7 +37,7 @@ and Exception-safe #include "Common/NMR_Types.h" #include "Common/NMR_Local.h" -#include +#include #include #include diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 27973c844..497d6964d 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -1,18 +1,23 @@ -if (USE_INCLUDED_LIBZIP) +# libzip related sources +if (USE_PACKAGED_SUBMODULES) file(GLOB LIBZIP_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "Libraries/libzip/Source/*.c") if (UNIX) file(GLOB LIBZIP_FILES_PLATFORM RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "Libraries/libzip/Source/unix/*.c") else() file(GLOB LIBZIP_FILES_PLATFORM RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "Libraries/libzip/Source/win/*.c") endif() -endif() +endif () -if (USE_INCLUDED_ZLIB) +# Zlib related sources +if (USE_PACKAGED_SUBMODULES) file(GLOB ZLIB_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "Libraries/zlib/Source/*.c") endif() -file (GLOB CPPBASE64_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "Libraries/cpp-base64/Source/*.cpp") +# Base 64 related sources +if(USE_PACKAGED_SUBMODULES) + file (GLOB CPPBASE64_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "Libraries/cpp-base64/Source/*.cpp") +endif () # sources set(SRCS_PLATFORM diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index e4352882a..5b393eea9 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1,6 +1,7 @@ enable_testing() -if (USE_INCLUDED_SSL) +if (USE_PACKAGED_SUBMODULES) + message("Using packaged LibreSSL") SET(LIBRESSL_APPS OFF CACHE BOOL "" FORCE) SET(LIBRESSL_TESTS OFF CACHE BOOL "" FORCE) SET(ENABLE_ASM OFF CACHE BOOL "" FORCE) @@ -10,9 +11,11 @@ if (USE_INCLUDED_SSL) SET_TARGET_PROPERTIES(crypto PROPERTIES FOLDER LibreSSL) SET_TARGET_PROPERTIES(ssl_obj PROPERTIES FOLDER LibreSSL) SET_TARGET_PROPERTIES(crypto_obj PROPERTIES FOLDER LibreSSL) +else() + message("Using vcpkg-managed LibreSSL") + find_package(LibreSSL REQUIRED CONFIG) endif() - add_definitions( -DTESTFILESPATH="${CMAKE_CURRENT_SOURCE_DIR}/TestFiles/") add_definitions( -DLTESTFILESPATH=L"${CMAKE_CURRENT_SOURCE_DIR}/TestFiles/") add_definitions( -DLOUTFILESPATH=L"${CMAKE_BINARY_DIR}/") diff --git a/Tests/CPP_Bindings/CMakeLists.txt b/Tests/CPP_Bindings/CMakeLists.txt index 63daeeff4..dd9bb00a2 100644 --- a/Tests/CPP_Bindings/CMakeLists.txt +++ b/Tests/CPP_Bindings/CMakeLists.txt @@ -3,7 +3,12 @@ SET(TESTNAME "Test_CPP_Bindings") -file(GLOB GTEST_SRC_FILES "${CMAKE_SOURCE_DIR}/Libraries/googletest/Source/*cc") +if (USE_PACKAGED_SUBMODULES) + file(GLOB GTEST_SRC_FILES "${CMAKE_SOURCE_DIR}/Libraries/googletest/Source/*cc") +else() + find_package(GTest CONFIG REQUIRED) +endif () + set(SRCS_UNITTEST ./Source/AllTests.cpp @@ -49,11 +54,16 @@ set(STARTUPPROJECT ${TESTNAME}) target_include_directories(${TESTNAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Include - ${CMAKE_SOURCE_DIR}/Libraries/googletest/Include - ${CMAKE_CURRENT_SOURCE_DIR}/../../Libraries/libressl/include ${CMAKE_CURRENT_SOURCE_DIR_AUTOGENERATED}/Bindings/Cpp ) +if(USE_PACKAGED_SUBMODULES) + target_include_directories(${TESTNAME} PRIVATE + ${CMAKE_SOURCE_DIR}/Libraries/googletest/Include + ${CMAKE_CURRENT_SOURCE_DIR}/../../Libraries/libressl/include + ) +endif () + # pthreads Needed for googletest if (LINUX) set(THREADS_PREFER_PTHREAD_FLAG ON) @@ -61,10 +71,14 @@ find_package(Threads REQUIRED) target_link_libraries(${TESTNAME} PRIVATE Threads::Threads) endif() -target_link_libraries(${TESTNAME} PRIVATE ${PROJECT_NAME} ssl crypto) +if (USE_PACKAGED_SUBMODULES) + target_link_libraries(${TESTNAME} PRIVATE ${PROJECT_NAME} ssl crypto) +else() + target_link_libraries(${TESTNAME} PRIVATE GTest::gtest GTest::gtest_main GTest::gmock GTest::gmock_main LibreSSL::SSL LibreSSL::Crypto ${PROJECT_NAME}) +endif () if (WIN32) -target_link_libraries(${TESTNAME} PRIVATE ws2_32) + target_link_libraries(${TESTNAME} PRIVATE ws2_32) endif() diff --git a/vcpkg b/vcpkg new file mode 160000 index 000000000..b2cb0da53 --- /dev/null +++ b/vcpkg @@ -0,0 +1 @@ +Subproject commit b2cb0da531c2f1f740045bfe7c4dac59f0b2b69c diff --git a/vcpkg.json b/vcpkg.json new file mode 100644 index 000000000..ebf13bbdb --- /dev/null +++ b/vcpkg.json @@ -0,0 +1,41 @@ +{ + "name": "lib3mf", + "version": "2.4.0", + "description": "lib3mf is an implementation of the 3D Manufacturing Format file standard", + "homepage": "https://github.com/3MFConsortium/lib3mf", + "license": "BSD-2-Clause", + "supports": "(windows & (x86 | x64) & !static & !staticcrt) | (linux & x64) | (osx & (x64 | arm64))", + "builtin-baseline": "b2cb0da531c2f1f740045bfe7c4dac59f0b2b69c", + "dependencies": [ + "cpp-base64", + { + "name": "fast-float", + "version>=": "6.1.6" + }, + { + "name": "libzip", + "default-features": false, + "version>=": "1.10.1" + }, + { + "name": "zlib", + "version>=": "1.3.1" + }, + { + "name" : "libressl", + "version>=": "3.9.2#2" + }, + { + "name": "gtest", + "version>=": "1.15.2" + }, + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} \ No newline at end of file From 846b5a6c8e990e84d8a6c433ede52cb438cd8388 Mon Sep 17 00:00:00 2001 From: Vijai Kumar S Date: Mon, 25 Nov 2024 16:47:41 +0100 Subject: [PATCH 02/18] . --- .github/workflows/build.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 946bb059d..f2a2d93e5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - submodules: true + submodules: recursive - name: Run version extraction script and set environment variable id: set-version run: | @@ -28,7 +28,7 @@ jobs: - run: sudo apt install -y valgrind uuid-dev - uses: actions/checkout@v4 with: - submodules: true + submodules: recursive - run: sh cmake/GenerateMake.sh - run: cmake --build . --target lib3mf_memcheck working-directory: ./build @@ -43,7 +43,7 @@ jobs: - run: sudo apt install -y uuid-dev - uses: actions/checkout@v4 with: - submodules: true + submodules: recursive - run: mkdir -p build - run: zip -r build/bindings.zip Autogenerated/Bindings - name: Archive bindings @@ -117,7 +117,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - submodules: true + submodules: recursive - run: sh cmake/GenerateMake.sh - run: cmake --build . working-directory: ./build @@ -148,7 +148,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - submodules: true + submodules: recursive - run: sh cmake/GenerateMake.sh "Debug" - run: cmake --build . working-directory: ./build @@ -166,7 +166,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - submodules: true + submodules: recursive - name: Install Prerequisites run: | brew install lcov @@ -196,7 +196,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - submodules: true + submodules: recursive - run: ./cmake/GenerateVS2019.bat - run: cmake --build . --config Release working-directory: ./build @@ -231,7 +231,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - submodules: true + submodules: recursive - run: ./cmake/GenerateVS2019.bat - run: cmake --build . --config Debug working-directory: ./build @@ -256,7 +256,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - submodules: true + submodules: recursive - run: ./cmake/GenerateVS2019_32bit.bat - run: cmake --build . --config Release working-directory: ./build_32bit @@ -279,7 +279,7 @@ jobs: - run: choco install mingw -y - uses: actions/checkout@v4 with: - submodules: true + submodules: recursive - run: ./cmake/GenerateMinGW.bat - run: cmake --build . working-directory: ./build From d2d0881bf497eeb9ac9bb29592e2742120ba3948 Mon Sep 17 00:00:00 2001 From: Vijai Kumar S Date: Mon, 25 Nov 2024 16:55:03 +0100 Subject: [PATCH 03/18] . --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index de41d505f..ea4649024 100644 --- a/.gitmodules +++ b/.gitmodules @@ -16,7 +16,7 @@ [submodule "submodules/googletest"] path = submodules/googletest url = https://github.com/google/googletest.git - [submodule "vcpkg"] path = vcpkg url = https://github.com/microsoft/vcpkg.git + shallow = false From a7d16ad1b23f700e5597e2ee8b90b73121ab30d7 Mon Sep 17 00:00:00 2001 From: Vijai Kumar S Date: Mon, 25 Nov 2024 17:35:11 +0100 Subject: [PATCH 04/18] remove vcpkg completely --- vcpkg | 1 - 1 file changed, 1 deletion(-) delete mode 160000 vcpkg diff --git a/vcpkg b/vcpkg deleted file mode 160000 index b2cb0da53..000000000 --- a/vcpkg +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b2cb0da531c2f1f740045bfe7c4dac59f0b2b69c From efb435d3d230f5eff8ce441983afc31071ce553e Mon Sep 17 00:00:00 2001 From: Vijai Kumar S Date: Mon, 25 Nov 2024 17:40:41 +0100 Subject: [PATCH 05/18] Re add vcpkg --- vcpkg | 1 + 1 file changed, 1 insertion(+) create mode 160000 vcpkg diff --git a/vcpkg b/vcpkg new file mode 160000 index 000000000..5e5d0e1cd --- /dev/null +++ b/vcpkg @@ -0,0 +1 @@ +Subproject commit 5e5d0e1cd7785623065e77eff011afdeec1a3574 From d677953962dc502e12ec1cb75cffb1640850215f Mon Sep 17 00:00:00 2001 From: Vijai Kumar S Date: Mon, 25 Nov 2024 17:42:44 +0100 Subject: [PATCH 06/18] Update vcpkg baseline --- vcpkg.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcpkg.json b/vcpkg.json index ebf13bbdb..01692f77d 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -5,7 +5,7 @@ "homepage": "https://github.com/3MFConsortium/lib3mf", "license": "BSD-2-Clause", "supports": "(windows & (x86 | x64) & !static & !staticcrt) | (linux & x64) | (osx & (x64 | arm64))", - "builtin-baseline": "b2cb0da531c2f1f740045bfe7c4dac59f0b2b69c", + "builtin-baseline": "5e5d0e1cd7785623065e77eff011afdeec1a3574", "dependencies": [ "cpp-base64", { From edd3a983c07568c127feb5ba1c7bc18dd3a4f241 Mon Sep 17 00:00:00 2001 From: Vijai Kumar S Date: Mon, 25 Nov 2024 17:47:48 +0100 Subject: [PATCH 07/18] include depth based on https://github.com/LittleCoinCoin/OpenUSD-setup-vcpkg-template/commit/49e7b009ab59d91dec6b8d6ea971fcdcd714913d#diff-c8003cc043ba79c8a452e9251b7faba94069bece5706625c152935da9f4420c2R37 --- .github/workflows/build.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f2a2d93e5..ff737f04f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,6 +12,7 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive + fetch-depth: 0 - name: Run version extraction script and set environment variable id: set-version run: | @@ -29,6 +30,7 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive + fetch-depth: 0 - run: sh cmake/GenerateMake.sh - run: cmake --build . --target lib3mf_memcheck working-directory: ./build @@ -44,6 +46,7 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive + fetch-depth: 0 - run: mkdir -p build - run: zip -r build/bindings.zip Autogenerated/Bindings - name: Archive bindings @@ -118,6 +121,7 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive + fetch-depth: 0 - run: sh cmake/GenerateMake.sh - run: cmake --build . working-directory: ./build @@ -149,6 +153,7 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive + fetch-depth: 0 - run: sh cmake/GenerateMake.sh "Debug" - run: cmake --build . working-directory: ./build @@ -167,6 +172,7 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive + fetch-depth: 0 - name: Install Prerequisites run: | brew install lcov @@ -197,6 +203,7 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive + fetch-depth: 0 - run: ./cmake/GenerateVS2019.bat - run: cmake --build . --config Release working-directory: ./build @@ -232,6 +239,7 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive + fetch-depth: 0 - run: ./cmake/GenerateVS2019.bat - run: cmake --build . --config Debug working-directory: ./build @@ -257,6 +265,7 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive + fetch-depth: 0 - run: ./cmake/GenerateVS2019_32bit.bat - run: cmake --build . --config Release working-directory: ./build_32bit @@ -280,6 +289,7 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive + fetch-depth: 0 - run: ./cmake/GenerateMinGW.bat - run: cmake --build . working-directory: ./build From 2fb7bff0c946c169956497c8420c54d18d20c15e Mon Sep 17 00:00:00 2001 From: Vijai Kumar S Date: Mon, 25 Nov 2024 18:28:46 +0100 Subject: [PATCH 08/18] set arm64 for osx --- CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index be241fa2e..07a47bde7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,15 @@ if (USE_PACKAGED_SUBMODULES) option(USE_INCLUDED_SSL "Use included libressl" ON) else() message("USE_PACKAGED_SUBMODULES is OFF") + # Set the vcpkg target triplet for macOS arm64, only on Apple platforms + if (APPLE) + if (NOT DEFINED ENV{VCPKG_TARGET_TRIPLET}) + set(VCPKG_TARGET_TRIPLET "arm64-osx" CACHE STRING "Target triplet for vcpkg on Apple") + endif() + message(STATUS "Using VCPKG_TARGET_TRIPLET=${VCPKG_TARGET_TRIPLET} for Apple platform") + else() + message(STATUS "Apple platform not detected, default triplet will be used") + endif() if (EXISTS "${CMAKE_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake") message("Using VCPKG Toolchain") set(CMAKE_TOOLCHAIN_FILE "${CMAKE_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake" CACHE STRING "Vcpkg toolchain file") From cf1e492c2e6f74b154afc82edd80a1be1e8d6dd0 Mon Sep 17 00:00:00 2001 From: Vijai Kumar S Date: Mon, 25 Nov 2024 20:05:07 +0100 Subject: [PATCH 09/18] Disable vcpkg for osx temporarily --- CMakeLists.txt | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 07a47bde7..8df95efbc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,11 @@ cmake_policy(SET CMP0048 NEW) set_property(GLOBAL PROPERTY USE_FOLDERS ON) option(USE_PACKAGED_SUBMODULES OFF) +if (APPLE) + message(STATUS "Detected Apple platform. Forcing USE_PACKAGED_SUBMODULES=ON (Universal binary issue)") + set(USE_PACKAGED_SUBMODULES ON CACHE BOOL "Use packaged submodules" FORCE) +endif() + # Conditionally set the vcpkg toolchain file if USE_PACKAGED_SUBMODULES is OFF if (USE_PACKAGED_SUBMODULES) message("USE_PACKAGED_SUBMODULES is ON") @@ -15,15 +20,6 @@ if (USE_PACKAGED_SUBMODULES) option(USE_INCLUDED_SSL "Use included libressl" ON) else() message("USE_PACKAGED_SUBMODULES is OFF") - # Set the vcpkg target triplet for macOS arm64, only on Apple platforms - if (APPLE) - if (NOT DEFINED ENV{VCPKG_TARGET_TRIPLET}) - set(VCPKG_TARGET_TRIPLET "arm64-osx" CACHE STRING "Target triplet for vcpkg on Apple") - endif() - message(STATUS "Using VCPKG_TARGET_TRIPLET=${VCPKG_TARGET_TRIPLET} for Apple platform") - else() - message(STATUS "Apple platform not detected, default triplet will be used") - endif() if (EXISTS "${CMAKE_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake") message("Using VCPKG Toolchain") set(CMAKE_TOOLCHAIN_FILE "${CMAKE_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake" CACHE STRING "Vcpkg toolchain file") From 1133580ca870b2695b43ffd74accda64d78d5ee7 Mon Sep 17 00:00:00 2001 From: Vijai Kumar S Date: Mon, 25 Nov 2024 20:12:34 +0100 Subject: [PATCH 10/18] . --- CI/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CI/Dockerfile b/CI/Dockerfile index efedb0943..ce8df9fe9 100644 --- a/CI/Dockerfile +++ b/CI/Dockerfile @@ -13,6 +13,7 @@ RUN \ glibc-langpack-en \ tar \ gzip \ + git \ zip \ rpm-build \ ${GCCTOOLSET} \ @@ -38,6 +39,7 @@ RUN ldd --version RUN cmake --version RUN cmake3 --version RUN gcc --version +RUN g++ --version ADD . lib3mf-repo From c38e1b3d8c19e58ca7453728c60f048c80c86b5a Mon Sep 17 00:00:00 2001 From: Vijai Kumar S Date: Mon, 25 Nov 2024 20:23:43 +0100 Subject: [PATCH 11/18] Explicitly set triplet for MinGW --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8df95efbc..131a0748d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,6 +20,9 @@ if (USE_PACKAGED_SUBMODULES) option(USE_INCLUDED_SSL "Use included libressl" ON) else() message("USE_PACKAGED_SUBMODULES is OFF") + if (CMAKE_GENERATOR MATCHES "MinGW") + set(VCPKG_TARGET_TRIPLET "x64-mingw") + endif () if (EXISTS "${CMAKE_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake") message("Using VCPKG Toolchain") set(CMAKE_TOOLCHAIN_FILE "${CMAKE_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake" CACHE STRING "Vcpkg toolchain file") From 31a77da2032278cd7ca68b9f2bae47f821f5163d Mon Sep 17 00:00:00 2001 From: Vijai Kumar S Date: Mon, 25 Nov 2024 20:27:32 +0100 Subject: [PATCH 12/18] . --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 131a0748d..c4d8e4a7c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,7 +21,7 @@ if (USE_PACKAGED_SUBMODULES) else() message("USE_PACKAGED_SUBMODULES is OFF") if (CMAKE_GENERATOR MATCHES "MinGW") - set(VCPKG_TARGET_TRIPLET "x64-mingw") + set(VCPKG_TARGET_TRIPLET "x64-mingw-dynamic") endif () if (EXISTS "${CMAKE_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake") message("Using VCPKG Toolchain") From d7f19db4bb716298b52df0afc0bda085a4f70845 Mon Sep 17 00:00:00 2001 From: Vijai Kumar S Date: Mon, 25 Nov 2024 20:49:45 +0100 Subject: [PATCH 13/18] debug mem_check --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ff737f04f..4424137f0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,6 +32,7 @@ jobs: submodules: recursive fetch-depth: 0 - run: sh cmake/GenerateMake.sh + - run: cmake --build . --target help - run: cmake --build . --target lib3mf_memcheck working-directory: ./build From 8727c125e76ea4d7107801f9f7a1008ec472d14b Mon Sep 17 00:00:00 2001 From: Vijai Kumar S Date: Tue, 3 Dec 2024 23:35:32 +0100 Subject: [PATCH 14/18] Turn tests on by default --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c4d8e4a7c..f97a87e69 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -309,7 +309,7 @@ install(TARGETS ${PROJECT_NAME} install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR_AUTOGENERATED}/Bindings DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") ######################################################### -option(LIB3MF_TESTS "Switch whether the tests of lib3mf should be build" OFF) +option(LIB3MF_TESTS "Switch whether the tests of lib3mf should be build" ON) message("LIB3MF_TESTS ... " ${LIB3MF_TESTS}) if(LIB3MF_TESTS) From ef45abf3b15b6d9c944bda67f3c91a6fcb39f033 Mon Sep 17 00:00:00 2001 From: Vijai Kumar S Date: Tue, 3 Dec 2024 23:41:48 +0100 Subject: [PATCH 15/18] . --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4424137f0..91c04e9bc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,6 +33,7 @@ jobs: fetch-depth: 0 - run: sh cmake/GenerateMake.sh - run: cmake --build . --target help + working-directory: ./build - run: cmake --build . --target lib3mf_memcheck working-directory: ./build From f1e4c12e0e6349c68c462071553d885e74235024 Mon Sep 17 00:00:00 2001 From: Vijai Kumar S Date: Wed, 4 Dec 2024 00:12:23 +0100 Subject: [PATCH 16/18] Check if other workflows in windows deployment work normally --- .github/workflows/build.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 91c04e9bc..d9e15bc72 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -424,12 +424,12 @@ jobs: - name: Unpack the SDK run: | unzip lib3mf_sdk.zip/lib3mf_sdk.zip - - name: Build CppDynamic - run: | - ./Examples/CppDynamic/GenerateVS2019.bat - cd Examples/CppDynamic/build - cmake --build . --config Release - ./Release/Example_ExtractInfo.exe ../../Files/Helix.3mf + # - name: Build CppDynamic + # run: | + # ./Examples/CppDynamic/GenerateVS2019.bat + # cd Examples/CppDynamic/build + # cmake --build . --config Release + # ./Release/Example_ExtractInfo.exe ../../Files/Helix.3mf - name: Build Cpp run: | ./Examples/Cpp/GenerateVS2019.bat From 33af8a2ce0715b0744947d86e30da11a1f92003f Mon Sep 17 00:00:00 2001 From: Vijai Kumar S Date: Wed, 4 Dec 2024 11:18:00 +0100 Subject: [PATCH 17/18] Debug windows failure --- .github/workflows/build.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d9e15bc72..2db15c43a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -424,12 +424,15 @@ jobs: - name: Unpack the SDK run: | unzip lib3mf_sdk.zip/lib3mf_sdk.zip - # - name: Build CppDynamic - # run: | - # ./Examples/CppDynamic/GenerateVS2019.bat - # cd Examples/CppDynamic/build - # cmake --build . --config Release - # ./Release/Example_ExtractInfo.exe ../../Files/Helix.3mf + - name: Build CppDynamic + run: | + ./Examples/CppDynamic/GenerateVS2019.bat + cd Examples/CppDynamic/build + cmake --build . --config Release + dir + dir ../ + dir ../../ + ./Release/Example_ExtractInfo.exe ../../Files/Helix.3mf - name: Build Cpp run: | ./Examples/Cpp/GenerateVS2019.bat From 8e7eb3c5477ffe9978e4502dd6cc41434496cfbf Mon Sep 17 00:00:00 2001 From: Vijai Kumar S Date: Wed, 4 Dec 2024 11:38:50 +0100 Subject: [PATCH 18/18] Looking into all the windows build directories --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2db15c43a..fa241b483 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -432,6 +432,8 @@ jobs: dir dir ../ dir ../../ + dir Release + dir x64 ./Release/Example_ExtractInfo.exe ../../Files/Helix.3mf - name: Build Cpp run: |