diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/rkcommon | |
Diffstat (limited to 'vcpkg/ports/rkcommon')
| -rw-r--r-- | vcpkg/ports/rkcommon/fix-static.patch | 28 | ||||
| -rw-r--r-- | vcpkg/ports/rkcommon/portfile.cmake | 33 | ||||
| -rw-r--r-- | vcpkg/ports/rkcommon/usage | 4 | ||||
| -rw-r--r-- | vcpkg/ports/rkcommon/vcpkg.json | 19 |
4 files changed, 84 insertions, 0 deletions
diff --git a/vcpkg/ports/rkcommon/fix-static.patch b/vcpkg/ports/rkcommon/fix-static.patch new file mode 100644 index 0000000..92a5483 --- /dev/null +++ b/vcpkg/ports/rkcommon/fix-static.patch @@ -0,0 +1,28 @@ +diff --git a/rkcommon/CMakeLists.txt b/rkcommon/CMakeLists.txt +index 2bfb993..9d61267 100644 +--- a/rkcommon/CMakeLists.txt ++++ b/rkcommon/CMakeLists.txt +@@ -55,6 +55,10 @@ if (RKCOMMON_TASKING_INTERNAL) + target_compile_definitions(${PROJECT_NAME} PRIVATE -DENKITS_BUILD_DLL) + endif() + ++if(BUILD_SHARED_LIBS) ++ target_compile_definitions(${PROJECT_NAME} PUBLIC rkcommon_SHARED) ++endif() ++ + if (RKCOMMON_ADDRSAN) + target_compile_definitions(${PROJECT_NAME} PUBLIC -DRKCOMMON_ADDRSAN) + endif() +diff --git a/rkcommon/common.h b/rkcommon/common.h +index a205770..07bf930 100644 +--- a/rkcommon/common.h ++++ b/rkcommon/common.h +@@ -26,7 +26,7 @@ typedef int ssize_t; + #include "unistd.h" + #endif + +-#ifdef _WIN32 ++#if defined(_WIN32) && defined(rkcommon_SHARED) + #ifdef rkcommon_EXPORTS + #define RKCOMMON_INTERFACE __declspec(dllexport) + #else diff --git a/vcpkg/ports/rkcommon/portfile.cmake b/vcpkg/ports/rkcommon/portfile.cmake new file mode 100644 index 0000000..e741971 --- /dev/null +++ b/vcpkg/ports/rkcommon/portfile.cmake @@ -0,0 +1,33 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO ospray/rkcommon + REF "v${VERSION}" + SHA512 48ced20506344250fd2b91875f8282c3b39828ac3eb0c8c0e2505dcc5cdb85a8f36dd328294f165aab66bdfe836b81b7a2c9f6f5c7ab49d281df5a3f95075548 + HEAD_REF master + PATCHES fix-static.patch +) + +file(REMOVE "${SOURCE_PATH}/cmake/rkcommon_redist_deps.cmake") +file(TOUCH "${SOURCE_PATH}/cmake/rkcommon_redist_deps.cmake") + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DBUILD_TESTING=OFF +) + +vcpkg_cmake_install() + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/rkcommon/common.h" "defined(rkcommon_SHARED)" "0") +else() + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/rkcommon/common.h" "defined(rkcommon_SHARED)" "1") +endif() + +vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/${PORT}-${VERSION}") + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME "copyright") +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") diff --git a/vcpkg/ports/rkcommon/usage b/vcpkg/ports/rkcommon/usage new file mode 100644 index 0000000..2d1db7b --- /dev/null +++ b/vcpkg/ports/rkcommon/usage @@ -0,0 +1,4 @@ +rkcommon provides CMake targets: + + find_package(rkcommon CONFIG REQUIRED) + target_link_libraries(main PRIVATE rkcommon::rkcommon) diff --git a/vcpkg/ports/rkcommon/vcpkg.json b/vcpkg/ports/rkcommon/vcpkg.json new file mode 100644 index 0000000..0f113ea --- /dev/null +++ b/vcpkg/ports/rkcommon/vcpkg.json @@ -0,0 +1,19 @@ +{ + "name": "rkcommon", + "version": "1.14.2", + "description": "This project represents a common set of C++ infrastructure and CMake utilities used by various components of IntelĀ® oneAPI Rendering Toolkit.", + "homepage": "https://github.com/ospray/rkcommon/", + "license": "Apache-2.0", + "supports": "x86 | x64", + "dependencies": [ + "tbb", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} |