Skip to content

Commit 97e8a48

Browse files
committed
Hopefully fix build on x86 linux
1 parent 2ce1941 commit 97e8a48

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

src/native/external/zstd.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ include(FetchContent)
55
FetchContent_Declare(
66
zstd
77
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/zstd/build/cmake
8+
EXCLUDE_FROM_ALL
89
)
910

1011
set(ZSTD_BUILD_PROGRAMS OFF)

src/native/libs/System.IO.Compression.Native/CMakeLists.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ endif()
2727
if (STATIC_LIBS_ONLY)
2828
# For every vendored library that we're actually vendoring (and not referencing the system one)
2929
# mark it as "no interprocedural optimization" so that it's compatible with our NativeAOT shipping story.
30-
foreach(VENDORED_LIB IN LISTS BROTLI_LIBRARIES ITEMS libzstd_static zlib)
30+
foreach(VENDORED_LIB IN LISTS BROTLI_LIBRARIES ITEMS libzstd zlib)
3131
if (TARGET ${VENDORED_LIB})
3232
set_target_properties(${VENDORED_LIB} PROPERTIES INTERPROCEDURAL_OPTIMIZATION OFF)
3333
endif()
@@ -79,7 +79,7 @@ if (CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI)
7979
target_include_directories(System.IO.Compression.Native PRIVATE ${BROTLI_INCLUDE_DIRS})
8080
target_link_libraries(System.IO.Compression.Native PRIVATE ${BROTLI_LIBRARIES})
8181

82-
target_link_libraries(System.IO.Compression.Native PRIVATE libzstd_static)
82+
target_link_libraries(System.IO.Compression.Native PRIVATE libzstd)
8383

8484
if (NOT CLR_CMAKE_TARGET_ARCH_WASM AND NOT CLR_CMAKE_TARGET_MACCATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_USE_SYSTEM_BROTLI)
8585
set(DEF_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/System.IO.Compression.Native_unixexports.src)
@@ -116,7 +116,7 @@ if (CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI)
116116
endif()
117117

118118
if (NOT CLR_CMAKE_USE_SYSTEM_ZSTD)
119-
target_link_libraries(System.IO.Compression.Native-Static PUBLIC libzstd_static)
119+
target_link_libraries(System.IO.Compression.Native-Static PUBLIC libzstd)
120120
endif()
121121

122122
set_target_properties(System.IO.Compression.Native-Static PROPERTIES OUTPUT_NAME System.IO.Compression.Native CLEAN_DIRECT_OUTPUT 1)
@@ -140,15 +140,15 @@ if (CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI)
140140
endif()
141141

142142
if (NOT CLR_CMAKE_USE_SYSTEM_ZSTD)
143-
install (TARGETS libzstd_static DESTINATION ${STATIC_LIB_DESTINATION} COMPONENT libs)
143+
install (TARGETS libzstd DESTINATION ${STATIC_LIB_DESTINATION} COMPONENT libs)
144144
endif()
145145

146146
if (NOT CLR_CMAKE_USE_SYSTEM_ZLIB)
147147
install (TARGETS zlib DESTINATION ${STATIC_LIB_DESTINATION} COMPONENT libs)
148148
endif()
149149
if (CLR_CMAKE_TARGET_ARCH_WASM)
150150
install (TARGETS zlib DESTINATION sharedFramework COMPONENT runtime)
151-
install (TARGETS libzstd_static DESTINATION sharedFramework COMPONENT runtime)
151+
install (TARGETS libzstd DESTINATION sharedFramework COMPONENT runtime)
152152
endif()
153153
else ()
154154
set(NATIVE_LIBS_EXTRA)
@@ -172,7 +172,7 @@ else ()
172172
endif()
173173

174174
if (NOT CLR_CMAKE_USE_SYSTEM_ZSTD)
175-
target_link_libraries(System.IO.Compression.Native PUBLIC libzstd_static)
175+
target_link_libraries(System.IO.Compression.Native PUBLIC libzstd)
176176
endif()
177177

178178
target_include_directories(System.IO.Compression.Native PUBLIC ${BROTLI_INCLUDE_DIRS})
@@ -193,7 +193,7 @@ else ()
193193
endif()
194194

195195
if (NOT CLR_CMAKE_USE_SYSTEM_ZSTD)
196-
target_link_libraries(System.IO.Compression.Native-Static PUBLIC libzstd_static)
196+
target_link_libraries(System.IO.Compression.Native-Static PUBLIC libzstd)
197197
endif()
198198

199199
target_include_directories(System.IO.Compression.Native-Static PUBLIC ${BROTLI_INCLUDE_DIRS})
@@ -210,7 +210,7 @@ else ()
210210
endif()
211211

212212
if (NOT CLR_CMAKE_USE_SYSTEM_ZSTD)
213-
target_link_libraries(System.IO.Compression.Native.Aot PUBLIC libzstd_static)
213+
target_link_libraries(System.IO.Compression.Native.Aot PUBLIC libzstd)
214214
endif()
215215

216216
target_include_directories(System.IO.Compression.Native.Aot PUBLIC ${BROTLI_INCLUDE_DIRS})
@@ -244,7 +244,7 @@ else ()
244244
install_static_library(zlib aotsdk nativeaot)
245245
endif()
246246
if (NOT CLR_CMAKE_USE_SYSTEM_ZSTD)
247-
install_static_library(libzstd_static aotsdk nativeaot)
247+
install_static_library(libzstd aotsdk nativeaot)
248248
endif()
249249
endif()
250250

0 commit comments

Comments
 (0)