From fb28bd89efb1c2dd93e28a75c3a5ae8eea72fe92 Mon Sep 17 00:00:00 2001 From: FrankXie Date: Thu, 23 Feb 2023 00:37:11 -0800 Subject: [PATCH 1/7] [fmilib] change to the github and update to fix bug of libexpat --- ports/fmilib/portfile.cmake | 17 ++++++----------- ports/fmilib/vcpkg.json | 3 +-- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/ports/fmilib/portfile.cmake b/ports/fmilib/portfile.cmake index 77a5c9c773ef08..0689feedebf0e1 100644 --- a/ports/fmilib/portfile.cmake +++ b/ports/fmilib/portfile.cmake @@ -1,16 +1,11 @@ -vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION} - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) -vcpkg_download_distfile(ARCHIVE - URLS "https://jmodelica.org/fmil/FMILibrary-${VERSION}-src.zip" - FILENAME "FMILibrary-${VERSION}-src.zip" - SHA512 86e4b5019d8f2a76b01141411845d977fb3949617604de0b34351f23647e3e8b378477de184e1c4f2f59297bc4c7de3155e0edba9099b8924594a36b37b04cc8 -) - -vcpkg_extract_source_archive( - SOURCE_PATH - ARCHIVE "${ARCHIVE}" +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO modelon-community/fmi-library + REF "${VERSION}" + SHA512 65c2dc11116737e4e2ee91a4ec58d2cf24003774fd6d9b8b1d6521f046be9e8f8a963ebedb50a161ad264927062f41ce757c84563cfe628d47614910e8730349 + HEAD_REF master PATCHES 0001-remove-install-prefix.patch 0002-include-sys-stat.h-for-mkdir.patch diff --git a/ports/fmilib/vcpkg.json b/ports/fmilib/vcpkg.json index 624a2964269fb2..266296649b6680 100644 --- a/ports/fmilib/vcpkg.json +++ b/ports/fmilib/vcpkg.json @@ -1,7 +1,6 @@ { "name": "fmilib", - "version": "2.0.3", - "port-version": 5, + "version": "2.4.1", "description": "FMI library is intended as a foundation for applications interfacing FMUs (Functional Mockup Units) that follow FMI Standard. This version of the library supports FMI 1.0 and FMI2.0.", "homepage": "https://www.fmi-standard.org/", "license": null, From cdba79bc73ce3d3837f914be16ea7df3ae2ee2a8 Mon Sep 17 00:00:00 2001 From: FrankXie Date: Thu, 23 Feb 2023 22:26:11 -0800 Subject: [PATCH 2/7] add license --- ports/fmilib/vcpkg.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/fmilib/vcpkg.json b/ports/fmilib/vcpkg.json index 266296649b6680..4c2c5535f1c180 100644 --- a/ports/fmilib/vcpkg.json +++ b/ports/fmilib/vcpkg.json @@ -3,7 +3,7 @@ "version": "2.4.1", "description": "FMI library is intended as a foundation for applications interfacing FMUs (Functional Mockup Units) that follow FMI Standard. This version of the library supports FMI 1.0 and FMI2.0.", "homepage": "https://www.fmi-standard.org/", - "license": null, + "license": "BSD-3-Clause", "dependencies": [ { "name": "vcpkg-cmake", From 7c3c8387df5b866f641b368405c6d7ff1f88a164 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Fri, 24 Feb 2023 09:14:39 +0100 Subject: [PATCH 3/7] Cleanup and devendor expat, minizip, zlib --- ports/fmilib/0001-remove-install-prefix.patch | 48 ---------------- .../0002-include-sys-stat.h-for-mkdir.patch | 20 ------- ports/fmilib/devendor-sublibs.diff | 50 +++++++++++++++++ ports/fmilib/fix-mergestaticlibs.diff | 56 +++++++++++++++++++ ports/fmilib/portfile.cmake | 55 ++++++++---------- ...t-targets.patch => unofficial-export.diff} | 16 +++--- ports/fmilib/unofficial-fmilib-config.cmake | 4 ++ ports/fmilib/vcpkg.json | 5 +- scripts/ci.baseline.txt | 2 - versions/baseline.json | 4 +- versions/f-/fmilib.json | 5 ++ 11 files changed, 151 insertions(+), 114 deletions(-) delete mode 100644 ports/fmilib/0001-remove-install-prefix.patch delete mode 100644 ports/fmilib/0002-include-sys-stat.h-for-mkdir.patch create mode 100644 ports/fmilib/devendor-sublibs.diff create mode 100644 ports/fmilib/fix-mergestaticlibs.diff rename ports/fmilib/{0003-export-targets.patch => unofficial-export.diff} (59%) create mode 100644 ports/fmilib/unofficial-fmilib-config.cmake diff --git a/ports/fmilib/0001-remove-install-prefix.patch b/ports/fmilib/0001-remove-install-prefix.patch deleted file mode 100644 index 42ba75701e5a15..00000000000000 --- a/ports/fmilib/0001-remove-install-prefix.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 04bb359c724308e30268840c64932ea1d05b9077 Mon Sep 17 00:00:00 2001 -From: Nicole Mazzuca -Date: Wed, 23 Sep 2020 10:00:23 -0700 -Subject: [PATCH 1/2] remove install prefix - ---- - CMakeLists.txt | 4 ---- - 1 file changed, 4 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index f7372bf..f3c11f1 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -26,7 +26,6 @@ set(FMILIBRARYHOME ${FMILibrary_SOURCE_DIR}) - set(FMILIBRARYBUILD ${FMILibrary_BINARY_DIR}) - - # User configuration options and parameters --SET(FMILIB_INSTALL_PREFIX ${FMILibrary_BINARY_DIR}/../install CACHE PATH "Prefix prepended to install directories") - set(FMILIB_THIRDPARTYLIBS ${FMILibrary_SOURCE_DIR}/ThirdParty CACHE PATH "Path to the ThirdParty library dir" ) - set(FMILIB_FMI_STANDARD_HEADERS ${FMILIB_THIRDPARTYLIBS}/FMI/default CACHE PATH "Path to the FMI standard headers dir" ) - -@@ -84,7 +83,6 @@ IF(NOT CMAKE_BUILD_TYPE) - SET(CMAKE_BUILD_TYPE ${FMILIB_DEFAULT_BUILD_TYPE}) - ENDIF(NOT CMAKE_BUILD_TYPE) - --SET(CMAKE_INSTALL_PREFIX ${FMILIB_INSTALL_PREFIX} CACHE INTERNAL "Prefix prepended to install directories" FORCE) - - # debug_message is used to trace the build script - function(debug_message) -@@ -350,7 +348,6 @@ endfunction() - - if(FMILIB_GENERATE_DOXYGEN_DOC) - -- file(MAKE_DIRECTORY "${FMILIB_INSTALL_PREFIX}/doc") - - set(DOXYFILE_IN ${FMILIBRARYHOME}/Config.cmake/fmilib_doxydoc.conf CACHE INTERNAL "Doxygen config file") - set(DOXYFILE_IMAGE_DIR "${FMILIBRARYHOME}/images" CACHE INTERNAL "Doxygen images" FORCE) -@@ -372,7 +369,6 @@ if(FMILIB_GENERATE_DOXYGEN_DOC) - set(DOXYFILE_SOURCE_DIR "${FMILIBRARYBUILD}/doc" CACHE INTERNAL "Doxygen default source dir" FORCE) - set(DOXYFILE_EXTRA_SOURCES "${DOXYFILE_EXTRA_SOURCES} \"${FMILIBRARYHOME}/Test\"") - -- set(DOXYFILE_OUTPUT_DIR "${FMILIB_INSTALL_PREFIX}/doc") - - set(DOXYFILE_STRIP_FROM_PATH "${FMILIBRARYHOME}") - --- -2.24.3 (Apple Git-128) - diff --git a/ports/fmilib/0002-include-sys-stat.h-for-mkdir.patch b/ports/fmilib/0002-include-sys-stat.h-for-mkdir.patch deleted file mode 100644 index a39617e4743a70..00000000000000 --- a/ports/fmilib/0002-include-sys-stat.h-for-mkdir.patch +++ /dev/null @@ -1,20 +0,0 @@ -From 080876bf3735efeedaab0b211d2be7b3c3524d97 Mon Sep 17 00:00:00 2001 -From: Nicole Mazzuca -Date: Wed, 23 Sep 2020 10:03:30 -0700 -Subject: [PATCH 2/2] include sys/stat.h for mkdir - ---- - ThirdParty/Minizip/minizip/miniunz.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/ThirdParty/Minizip/minizip/miniunz.c b/ThirdParty/Minizip/minizip/miniunz.c -index 2264705..e0167d5 100644 ---- a/ThirdParty/Minizip/minizip/miniunz.c -+++ b/ThirdParty/Minizip/minizip/miniunz.c -@@ -53,5 +53,6 @@ - #else - # include - # include -+# include - #endif - diff --git a/ports/fmilib/devendor-sublibs.diff b/ports/fmilib/devendor-sublibs.diff new file mode 100644 index 00000000000000..02c39dbdab3a41 --- /dev/null +++ b/ports/fmilib/devendor-sublibs.diff @@ -0,0 +1,50 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b01aba5..583e15b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -230,7 +230,7 @@ configure_file ( + "${FMILibrary_BINARY_DIR}/fmilib_config.h" + ) + +-set(FMILIB_SHARED_SUBLIBS ${FMIXML_LIBRARIES} ${FMIZIP_LIBRARIES} ${FMICAPI_LIBRARIES} expat minizip zlib c99snprintf) ++set(FMILIB_SHARED_SUBLIBS ${FMIXML_LIBRARIES} ${FMIZIP_LIBRARIES} ${FMICAPI_LIBRARIES} c99snprintf) + set(FMILIB_SUBLIBS ${FMIIMPORT_LIBRARIES} ${JMUTIL_LIBRARIES} ${FMILIB_SHARED_SUBLIBS}) + set(FMILIB_SHARED_SRC ${FMIIMPORTSOURCE} ${JMUTILSOURCE} ${FMIIMPORTHEADERS}) + +diff --git a/Config.cmake/fmixml.cmake b/Config.cmake/fmixml.cmake +index ddd3c1f..3bafac3 100644 +--- a/Config.cmake/fmixml.cmake ++++ b/Config.cmake/fmixml.cmake +@@ -137,6 +137,7 @@ set(FMIXMLSOURCE + src/FMI2/fmi2_xml_variable.c + ) + ++if(0) + include(ExternalProject) + + # The *_POSTFIX variables are set because it makes it easier to determine the name of +@@ -211,7 +212,10 @@ if(FMILIB_INSTALL_SUBLIBS) + DESTINATION lib) + endif() + ++endif(0) + set(EXPAT_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/ExpatEx/install/include) ++find_package(expat CONFIG REQUIRED) ++add_library(expat ALIAS expat::expat) + + include_directories("${EXPAT_INCLUDE_DIRS}" "${FMILIB_THIRDPARTYLIBS}/FMI/" "${FMIXMLGENDIR}/FMI1" "${FMIXMLGENDIR}/FMI2") + +diff --git a/Config.cmake/fmizip.cmake b/Config.cmake/fmizip.cmake +index 091fc4d..c53555f 100644 +--- a/Config.cmake/fmizip.cmake ++++ b/Config.cmake/fmizip.cmake +@@ -20,7 +20,8 @@ if(NOT FMIZIPDIR) + + set(FMIZIP_LIBRARIES fmizip) + +- add_subdirectory(Config.cmake/Minizip) ++ find_package(minizip CONFIG REQUIRED) ++ add_library(minizip ALIAS minizip::minizip) + + include_directories("${FMIZIPDIR}/include" "${FMILIB_THIRDPARTYLIBS}/Minizip/minizip" "${FMILIB_THIRDPARTYLIBS}/FMI" "${FMILIB_THIRDPARTYLIBS}/Zlib/zlib-1.2.6" "${FMILibrary_BINARY_DIR}/zlib") + diff --git a/ports/fmilib/fix-mergestaticlibs.diff b/ports/fmilib/fix-mergestaticlibs.diff new file mode 100644 index 00000000000000..423d621d22ac4d --- /dev/null +++ b/ports/fmilib/fix-mergestaticlibs.diff @@ -0,0 +1,56 @@ +diff --git a/Config.cmake/mergestaticlibs.cmake b/Config.cmake/mergestaticlibs.cmake +index 858a026..c58ed6f 100644 +--- a/Config.cmake/mergestaticlibs.cmake ++++ b/Config.cmake/mergestaticlibs.cmake +@@ -28,6 +28,19 @@ function(merge_static_libs outlib ) + set(multiconfig TRUE) + endif() + ++ set(link_libs "") ++ foreach(lib IN LISTS libs) ++ get_target_property(lib_link_libs "${lib}" INTERFACE_LINK_LIBRARIES) ++ if(lib_link_libs) ++ list(APPEND link_libs ${lib_link_libs}) ++ endif() ++ endforeach() ++ list(REMOVE_ITEM link_libs ${libs}) ++ foreach(lib IN LISTS libs) ++ list(REMOVE_ITEM link_libs "$") ++ endforeach() ++ target_link_libraries(${outlib} PRIVATE ${link_libs}) ++ + # First get the file names of the libraries to be merged + foreach(lib ${libs}) + get_target_property(libtype ${lib} TYPE) +@@ -36,11 +49,11 @@ function(merge_static_libs outlib ) + endif() + if(multiconfig) + foreach(CONFIG_TYPE ${CMAKE_CONFIGURATION_TYPES}) +- get_target_property("libfile_${CONFIG_TYPE}" ${lib} "LOCATION_${CONFIG_TYPE}") ++ set(outfile "$") + list(APPEND libfiles_${CONFIG_TYPE} ${libfile_${CONFIG_TYPE}}) + endforeach() + else() +- get_target_property(libfile ${lib} LOCATION) ++ set(outfile "$") + list(APPEND libfiles "${libfile}") + endif(multiconfig) + endforeach() +@@ -71,7 +84,7 @@ function(merge_static_libs outlib ) + if(multiconfig) + message(FATAL_ERROR "Multiple configurations are not supported") + endif() +- get_target_property(outfile ${outlib} LOCATION) ++ set(outfile "$") + add_custom_command(TARGET ${outlib} POST_BUILD + COMMAND rm ${outfile} + COMMAND /usr/bin/libtool -static -o ${outfile} +@@ -82,7 +95,7 @@ function(merge_static_libs outlib ) + if(multiconfig) + message(FATAL_ERROR "Multiple configurations are not supported") + endif() +- get_target_property(outfile ${outlib} LOCATION) ++ set(outfile "$") + message(STATUS "outfile location is ${outfile}") + foreach(lib ${libfiles}) + # objlistfile will contain the list of object files for the library diff --git a/ports/fmilib/portfile.cmake b/ports/fmilib/portfile.cmake index 0689feedebf0e1..374c43f3d932bc 100644 --- a/ports/fmilib/portfile.cmake +++ b/ports/fmilib/portfile.cmake @@ -7,56 +7,47 @@ vcpkg_from_github( SHA512 65c2dc11116737e4e2ee91a4ec58d2cf24003774fd6d9b8b1d6521f046be9e8f8a963ebedb50a161ad264927062f41ce757c84563cfe628d47614910e8730349 HEAD_REF master PATCHES - 0001-remove-install-prefix.patch - 0002-include-sys-stat.h-for-mkdir.patch - 0003-export-targets.patch + devendor-sublibs.diff + fix-mergestaticlibs.diff + unofficial-export.diff ) -# Note that if you have configured and built both static and shared library on Windows -# but want to link with the static library compile time define "FMILIB_BUILDING_LIBRARY" must be set. -if ((NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") AND VCPKG_LIBRARY_LINKAGE STREQUAL static) - SET(FMILIB_BUILDING_LIBRARY ON) -else() - SET(FMILIB_BUILDING_LIBRARY OFF) -endif() - -# Use static run-time libraries (/MT or /MTd code generation flags) -# This is only used when generating Microsoft Visual Studio solutions. If the options is on then the library will -# be built against static runtime, otherwise - dynamic runtime (/MD or /MDd). Make sure the client code is using -# matching runtime -if ((NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") AND VCPKG_CRT_LINKAGE STREQUAL static) - SET(FMILIB_BUILD_WITH_STATIC_RTLIB ON) -else() - SET(FMILIB_BUILD_WITH_STATIC_RTLIB OFF) -endif() - -# On LINUX position independent code (-fPIC) must be used on all files to be linked into a shared library (.so file). -# On other systems this is not needed (either is default or relocation is done). Set this option to OFF if you -# are building an application on Linux and use static library only -if ((VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin") AND VCPKG_LIBRARY_LINKAGE STREQUAL static) - SET(FMILIB_BUILD_FOR_SHARED_LIBS OFF) -else() - SET(FMILIB_BUILD_FOR_SHARED_LIBS ON) -endif() +file(REMOVE RECURSE + "${SOURCE_PATH}/ThirdParty/Expat" + "${SOURCE_PATH}/ThirdParty/Minizip" + "${SOURCE_PATH}/ThirdParty/Zlib" +) +string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" FMILIB_BUILD_WITH_STATIC_RTLIB) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_SHARED) vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" OPTIONS + -Wno-dev -DFMILIB_BUILD_TESTS=OFF -DFMILIB_BUILD_STATIC_LIB=${BUILD_STATIC} -DFMILIB_BUILD_SHARED_LIB=${BUILD_SHARED} - -DFMILIB_BUILDING_LIBRARY=${FMILIB_BUILDING_LIBRARY} -DFMILIB_BUILD_WITH_STATIC_RTLIB=${FMILIB_BUILD_WITH_STATIC_RTLIB} + -DFMILIB_GENERATE_DOXYGEN_DOC=OFF + OPTIONS_DEBUG + "-DFMILIB_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}/debug" + OPTIONS_RELEASE + "-DFMILIB_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}" MAYBE_UNUSED_VARIABLES - FMILIB_BUILDING_LIBRARY + FMILIB_BUILD_WITH_STATIC_RTLIB ) vcpkg_cmake_install() vcpkg_copy_pdbs() +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/unofficial-fmilib-config.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/unofficial-fmilib") vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-fmilib) -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE + "${CURRENT_PACKAGES_DIR}/debug/include" + "${CURRENT_PACKAGES_DIR}/debug/doc" + "${CURRENT_PACKAGES_DIR}/doc" +) + vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.md") diff --git a/ports/fmilib/0003-export-targets.patch b/ports/fmilib/unofficial-export.diff similarity index 59% rename from ports/fmilib/0003-export-targets.patch rename to ports/fmilib/unofficial-export.diff index 30c62866116cef..f621e18da9386e 100644 --- a/ports/fmilib/0003-export-targets.patch +++ b/ports/fmilib/unofficial-export.diff @@ -1,23 +1,21 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index f3c11f1..2461ecb 100644 +index 583e15b..0319e3a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -299,10 +299,18 @@ endif() +@@ -300,10 +300,17 @@ endif() file(COPY "${FMILIBRARYHOME}/Config.cmake/fmilib.h" DESTINATION "${FMILibrary_BINARY_DIR}") --install(TARGETS ${FMILIB_TARGETS} -+TARGET_INCLUDE_DIRECTORIES(${FMILIB_TARGETS} INTERFACE $) -+ -+install(TARGETS ${FMILIB_TARGETS} EXPORT unofficial-fmilib-config ++target_include_directories(${FMILIB_TARGETS} INTERFACE $) + install(TARGETS ${FMILIB_TARGETS} ++ EXPORT unofficial-fmilib-targets ARCHIVE DESTINATION lib LIBRARY DESTINATION lib - RUNTIME DESTINATION lib + RUNTIME DESTINATION bin +) -+ -+install(EXPORT unofficial-fmilib-config -+ FILE unofficial-fmilib-config.cmake ++install(EXPORT unofficial-fmilib-targets ++ FILE unofficial-fmilib-targets.cmake + NAMESPACE unofficial::fmilib:: + DESTINATION share/unofficial-fmilib ) diff --git a/ports/fmilib/unofficial-fmilib-config.cmake b/ports/fmilib/unofficial-fmilib-config.cmake new file mode 100644 index 00000000000000..2becf8bd19e295 --- /dev/null +++ b/ports/fmilib/unofficial-fmilib-config.cmake @@ -0,0 +1,4 @@ +include(CMakeFindDependencyMacro) +find_dependency(expat CONFIG) +find_dependency(minizip CONFIG) +include("${CMAKE_CURRENT_LIST_DIR}/unofficial-fmilib-config.cmake") diff --git a/ports/fmilib/vcpkg.json b/ports/fmilib/vcpkg.json index 4c2c5535f1c180..a1c33a540a951c 100644 --- a/ports/fmilib/vcpkg.json +++ b/ports/fmilib/vcpkg.json @@ -5,6 +5,8 @@ "homepage": "https://www.fmi-standard.org/", "license": "BSD-3-Clause", "dependencies": [ + "expat", + "minizip", { "name": "vcpkg-cmake", "host": true @@ -12,6 +14,7 @@ { "name": "vcpkg-cmake-config", "host": true - } + }, + "zlib" ] } diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index 228537909c7005..1d5b1a5f1026a2 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -233,8 +233,6 @@ fmi4cpp:arm-uwp=fail fmi4cpp:x64-uwp=fail fmilib:arm64-windows=fail fmilib:arm-uwp=fail -fmilib:x64-linux=fail -fmilib:x64-uwp=fail fontconfig:x64-uwp=fail fontconfig:arm-uwp=fail foonathan-memory:arm64-windows=fail diff --git a/versions/baseline.json b/versions/baseline.json index 1b8f59b705a87f..33bec7265f2795 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -2481,8 +2481,8 @@ "port-version": 0 }, "fmilib": { - "baseline": "2.0.3", - "port-version": 5 + "baseline": "2.4.1", + "port-version": 0 }, "fmt": { "baseline": "9.1.0", diff --git a/versions/f-/fmilib.json b/versions/f-/fmilib.json index d23ced287e6115..e58bdeabb4fa7b 100644 --- a/versions/f-/fmilib.json +++ b/versions/f-/fmilib.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "534f2b1d3dbe8aaada7f5d15778b27c3e9936b20", + "version": "2.4.1", + "port-version": 0 + }, { "git-tree": "c30d1f2f0827e03141bda90fe3ae2b462f93c116", "version": "2.0.3", From 7f1761dfa85e1161406df68fcf06c92b5792608a Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Fri, 24 Feb 2023 14:23:25 +0100 Subject: [PATCH 4/7] Merge target objects, not archives --- ports/fmilib/fix-mergestaticlibs.diff | 62 ++++++--------------------- versions/f-/fmilib.json | 2 +- 2 files changed, 14 insertions(+), 50 deletions(-) diff --git a/ports/fmilib/fix-mergestaticlibs.diff b/ports/fmilib/fix-mergestaticlibs.diff index 423d621d22ac4d..05fbcc432e58df 100644 --- a/ports/fmilib/fix-mergestaticlibs.diff +++ b/ports/fmilib/fix-mergestaticlibs.diff @@ -1,56 +1,20 @@ diff --git a/Config.cmake/mergestaticlibs.cmake b/Config.cmake/mergestaticlibs.cmake -index 858a026..c58ed6f 100644 +index 858a026..67eccb7 100644 --- a/Config.cmake/mergestaticlibs.cmake +++ b/Config.cmake/mergestaticlibs.cmake -@@ -28,6 +28,19 @@ function(merge_static_libs outlib ) - set(multiconfig TRUE) - endif() +@@ -21,6 +21,15 @@ function(merge_static_libs outlib ) + file(WRITE ${dummyfile} "const char * dummy = \"${dummyfile}\";") -+ set(link_libs "") + add_library(${outlib} STATIC ${dummyfile}) + foreach(lib IN LISTS libs) -+ get_target_property(lib_link_libs "${lib}" INTERFACE_LINK_LIBRARIES) -+ if(lib_link_libs) -+ list(APPEND link_libs ${lib_link_libs}) ++ target_sources(${outlib} PRIVATE "$") ++ get_target_property(link_libs ${lib} INTERFACE_LINK_LIBRARIES) ++ if(link_libs) ++ list(REMOVE_ITEM link_libs ${libs}) ++ target_link_libraries(${outlib} ${link_libs}) + endif() + endforeach() -+ list(REMOVE_ITEM link_libs ${libs}) -+ foreach(lib IN LISTS libs) -+ list(REMOVE_ITEM link_libs "$") -+ endforeach() -+ target_link_libraries(${outlib} PRIVATE ${link_libs}) -+ - # First get the file names of the libraries to be merged - foreach(lib ${libs}) - get_target_property(libtype ${lib} TYPE) -@@ -36,11 +49,11 @@ function(merge_static_libs outlib ) - endif() - if(multiconfig) - foreach(CONFIG_TYPE ${CMAKE_CONFIGURATION_TYPES}) -- get_target_property("libfile_${CONFIG_TYPE}" ${lib} "LOCATION_${CONFIG_TYPE}") -+ set(outfile "$") - list(APPEND libfiles_${CONFIG_TYPE} ${libfile_${CONFIG_TYPE}}) - endforeach() - else() -- get_target_property(libfile ${lib} LOCATION) -+ set(outfile "$") - list(APPEND libfiles "${libfile}") - endif(multiconfig) - endforeach() -@@ -71,7 +84,7 @@ function(merge_static_libs outlib ) - if(multiconfig) - message(FATAL_ERROR "Multiple configurations are not supported") - endif() -- get_target_property(outfile ${outlib} LOCATION) -+ set(outfile "$") - add_custom_command(TARGET ${outlib} POST_BUILD - COMMAND rm ${outfile} - COMMAND /usr/bin/libtool -static -o ${outfile} -@@ -82,7 +95,7 @@ function(merge_static_libs outlib ) - if(multiconfig) - message(FATAL_ERROR "Multiple configurations are not supported") - endif() -- get_target_property(outfile ${outlib} LOCATION) -+ set(outfile "$") - message(STATUS "outfile location is ${outfile}") - foreach(lib ${libfiles}) - # objlistfile will contain the list of object files for the library ++ return() + + if("${CMAKE_CFG_INTDIR}" STREQUAL ".") + set(multiconfig FALSE) diff --git a/versions/f-/fmilib.json b/versions/f-/fmilib.json index e58bdeabb4fa7b..77504b4ca48549 100644 --- a/versions/f-/fmilib.json +++ b/versions/f-/fmilib.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "534f2b1d3dbe8aaada7f5d15778b27c3e9936b20", + "git-tree": "baaa1c989c9aec02af59c983dfe4edacedaedaf6", "version": "2.4.1", "port-version": 0 }, From 3fc965fa6f90f9b66d21d7b1db22166834a701be Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Sat, 25 Feb 2023 00:17:48 +0100 Subject: [PATCH 5/7] Update "supports" and ci baseline --- ports/fmilib/vcpkg.json | 1 + scripts/ci.baseline.txt | 2 -- versions/f-/fmilib.json | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ports/fmilib/vcpkg.json b/ports/fmilib/vcpkg.json index d622f997718ef7..ca6b7029d31df7 100644 --- a/ports/fmilib/vcpkg.json +++ b/ports/fmilib/vcpkg.json @@ -5,6 +5,7 @@ "description": "FMI library is intended as a foundation for applications interfacing FMUs (Functional Mockup Units) that follow FMI Standard. This version of the library supports FMI 1.0 and FMI2.0.", "homepage": "https://www.fmi-standard.org/", "license": "BSD-3-Clause", + "supports": "!uwp", "dependencies": [ "expat", "minizip", diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index 002042b39c7eb1..c1f326605827c8 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -231,8 +231,6 @@ fluidlite:x64-windows=skip fluidlite:x86-windows=skip fmi4cpp:arm-uwp=fail fmi4cpp:x64-uwp=fail -fmilib:arm64-windows=fail -fmilib:arm-uwp=fail fontconfig:x64-uwp=fail fontconfig:arm-uwp=fail foonathan-memory:arm64-windows=fail diff --git a/versions/f-/fmilib.json b/versions/f-/fmilib.json index cb7aba0c5dfd97..2012b968e306cc 100644 --- a/versions/f-/fmilib.json +++ b/versions/f-/fmilib.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "a379afad4c3f9101731abf2586737c601552ebdb", + "git-tree": "d35eca9266a58eb09290520991ac885a3125c9a3", "version": "2.4.1", "port-version": 1 }, From 442bc480a705b777c42ef0f67bd7d834a883013f Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Sun, 26 Feb 2023 18:23:31 +0100 Subject: [PATCH 6/7] zlib is a transitive dependency --- ports/fmilib/vcpkg.json | 3 +-- versions/f-/fmilib.json | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ports/fmilib/vcpkg.json b/ports/fmilib/vcpkg.json index ca6b7029d31df7..d2dac18800e5f9 100644 --- a/ports/fmilib/vcpkg.json +++ b/ports/fmilib/vcpkg.json @@ -16,7 +16,6 @@ { "name": "vcpkg-cmake-config", "host": true - }, - "zlib" + } ] } diff --git a/versions/f-/fmilib.json b/versions/f-/fmilib.json index 2012b968e306cc..597bb0e134b430 100644 --- a/versions/f-/fmilib.json +++ b/versions/f-/fmilib.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "d35eca9266a58eb09290520991ac885a3125c9a3", + "git-tree": "3b9f60967d07557e89e533ad37394d91e289c546", "version": "2.4.1", "port-version": 1 }, From d71fb687a824409fc828e566ee4ad58d1a481acd Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Sun, 26 Feb 2023 18:27:58 +0100 Subject: [PATCH 7/7] Fix config --- ports/fmilib/unofficial-fmilib-config.cmake | 2 +- versions/f-/fmilib.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/fmilib/unofficial-fmilib-config.cmake b/ports/fmilib/unofficial-fmilib-config.cmake index 2becf8bd19e295..154b57aec962f5 100644 --- a/ports/fmilib/unofficial-fmilib-config.cmake +++ b/ports/fmilib/unofficial-fmilib-config.cmake @@ -1,4 +1,4 @@ include(CMakeFindDependencyMacro) find_dependency(expat CONFIG) find_dependency(minizip CONFIG) -include("${CMAKE_CURRENT_LIST_DIR}/unofficial-fmilib-config.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/unofficial-fmilib-targets.cmake") diff --git a/versions/f-/fmilib.json b/versions/f-/fmilib.json index 597bb0e134b430..756e21d91a92ad 100644 --- a/versions/f-/fmilib.json +++ b/versions/f-/fmilib.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "3b9f60967d07557e89e533ad37394d91e289c546", + "git-tree": "aa8b7d569a23fd953d1e4de558a034a6d9f95e33", "version": "2.4.1", "port-version": 1 },