Skip to content

Commit a30a517

Browse files
openvdb: fix windows build (#4199)
* openvdb: fix windows build * fix linux * add patch * Update xmake.lua
1 parent 32b8609 commit a30a517

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
diff --git a/cmake/FindBlosc.cmake b/cmake/FindBlosc.cmake
2+
index 5ccf524..65f68c9 100644
3+
--- a/cmake/FindBlosc.cmake
4+
+++ b/cmake/FindBlosc.cmake
5+
@@ -191,12 +191,12 @@ list(APPEND _BLOSC_LIBRARYDIR_SEARCH_DIRS
6+
# Library suffix handling
7+
8+
set(_BLOSC_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
9+
-set(_BLOSC_ORIG_CMAKE_FIND_LIBRARY_PREFIXES ${CMAKE_FIND_LIBRARY_PREFIXES})
10+
+# set(_BLOSC_ORIG_CMAKE_FIND_LIBRARY_PREFIXES ${CMAKE_FIND_LIBRARY_PREFIXES})
11+
12+
if(MSVC)
13+
if(BLOSC_USE_STATIC_LIBS)
14+
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
15+
- set(CMAKE_FIND_LIBRARY_PREFIXES "${CMAKE_FIND_LIBRARY_PREFIXES};lib")
16+
+ # set(CMAKE_FIND_LIBRARY_PREFIXES "${CMAKE_FIND_LIBRARY_PREFIXES};lib")
17+
endif()
18+
else()
19+
if(BLOSC_USE_STATIC_LIBS)
20+
@@ -249,9 +249,9 @@ endforeach()
21+
# Reset library suffix
22+
23+
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_BLOSC_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
24+
-set(CMAKE_FIND_LIBRARY_PREFIXES ${_BLOSC_ORIG_CMAKE_FIND_LIBRARY_PREFIXES})
25+
+# set(CMAKE_FIND_LIBRARY_PREFIXES ${_BLOSC_ORIG_CMAKE_FIND_LIBRARY_PREFIXES})
26+
unset(_BLOSC_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES)
27+
-unset(_BLOSC_ORIG_CMAKE_FIND_LIBRARY_PREFIXES)
28+
+# unset(_BLOSC_ORIG_CMAKE_FIND_LIBRARY_PREFIXES)
29+
30+
if(Blosc_LIBRARY_DEBUG AND Blosc_LIBRARY_RELEASE)
31+
# if the generator is multi-config or if CMAKE_BUILD_TYPE is set for

packages/o/openvdb/xmake.lua

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ package("openvdb")
1616
add_versions("v10.1.0", "2746236e29659a0d35ab90d832f7c7987dd2537587a1a2f9237d9c98afcd5817")
1717
add_versions("v11.0.0", "6314ff1db057ea90050763e7b7d7ed86d8224fcd42a82cdbb9c515e001b96c74")
1818

19+
add_patches(">=10.1.0", "patches/10.1.0/blosc-dep.patch", "a1a5adf4ae2c75c3a3a390b25654dd7785b88d15e459a1620fc0b42b20f81ba0")
20+
1921
add_deps("cmake")
2022
add_deps("boost >1.73", {configs = {regex = true, system = true, iostreams = true}})
2123

@@ -67,7 +69,15 @@ package("openvdb")
6769
io.replace("cmake/FindBlosc.cmake", "${BUILD_TYPE} ${_BLOSC_LIB_NAME}", "${BUILD_TYPE} blosc libblosc", {plain = true})
6870
io.replace("cmake/FindBlosc.cmake", "lz4 snappy zlib zstd", "lz4", {plain = true})
6971
io.replace("cmake/FindTBB.cmake", "Tbb_${COMPONENT}_LIB_TYPE STREQUAL STATIC", "TRUE", {plain = true})
70-
local configs = {"-DOPENVDB_BUILD_DOCS=OFF", "-DUSE_PKGCONFIG=OFF", "-DBoost_USE_STATIC_LIBS=ON", "-DUSE_CCACHE=OFF", "-DBLOSC_USE_EXTERNAL_SOURCES=ON"}
72+
73+
local configs = {
74+
"-DOPENVDB_BUILD_DOCS=OFF",
75+
"-DUSE_PKGCONFIG=OFF",
76+
"-DBoost_USE_STATIC_LIBS=ON",
77+
"-DUSE_CCACHE=OFF",
78+
"-DBLOSC_USE_EXTERNAL_SOURCES=ON"
79+
}
80+
7181
if package:config("shared") then
7282
table.insert(configs, "-DOPENVDB_CORE_SHARED=ON")
7383
table.insert(configs, "-DOPENVDB_CORE_STATIC=OFF")
@@ -84,6 +94,7 @@ package("openvdb")
8494
end
8595
table.insert(configs, "-DOPENVDB_BUILD_VDB_LOD=" .. (package:config("lod") and "ON" or "OFF"))
8696
table.insert(configs, "-DOPENVDB_BUILD_VDB_PRINT=" .. (package:config("print") and "ON" or "OFF"))
97+
table.insert(configs, "-DOPENVDB_BUILD_BINARIES=" .. (package:config("print") and "ON" or "OFF"))
8798
table.insert(configs, "-DOPENVDB_BUILD_VDB_RENDER=" .. (package:config("render") and "ON" or "OFF"))
8899
table.insert(configs, "-DOPENVDB_BUILD_VDB_VIEW=" .. (package:config("view") and "ON" or "OFF"))
89100
if package:version():ge("10.0") then

0 commit comments

Comments
 (0)