-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [rkcommon] add port * v db * Fix static builds and supports * format manifest * v db * Add usage file. --------- Co-authored-by: Billy Robert O'Neal III <[email protected]>
- Loading branch information
1 parent
ce4d499
commit a4e94e9
Showing
6 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
diff --git a/rkcommon/CMakeLists.txt b/rkcommon/CMakeLists.txt | ||
index 3f80e4de3..72ac948b2 100644 | ||
--- a/rkcommon/CMakeLists.txt | ||
+++ b/rkcommon/CMakeLists.txt | ||
@@ -55,6 +55,10 @@ endif() | ||
|
||
target_compile_definitions(${PROJECT_NAME} PUBLIC ${EXTRA_COMPILE_DEFINITIONS}) | ||
|
||
+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 175ecfa84..b43f34ab9 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
vcpkg_from_github( | ||
OUT_SOURCE_PATH SOURCE_PATH | ||
REPO ospray/rkcommon | ||
REF 0b8856cd9278474b56dc5bcff516a4b9482cf147 | ||
SHA512 836e888e33406f6825b8f5570894402460b3ae65a68ca8aeecf2c8e712f70e9392fdbb2131d538dbf47fc48a0664568e1fd60968452c7517cfeb17c0e608fecf | ||
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}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
rkcommon provides CMake targets: | ||
|
||
find_package(rkcommon CONFIG REQUIRED) | ||
target_link_libraries(main PRIVATE rkcommon::rkcommon) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"name": "rkcommon", | ||
"version": "1.10.0", | ||
"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 | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"versions": [ | ||
{ | ||
"git-tree": "49683a2cd8b631ffd2d2f47bc8affc258a5f836e", | ||
"version": "1.10.0", | ||
"port-version": 0 | ||
} | ||
] | ||
} |