Restore CRATE_TYPES staticlib for embedded Apple platforms

BUILD_SHARED_LIBS=OFF only changes which variant Corrosion's
interface target links, but Corrosion still builds both crate
types and tries to copy the cdylib output. CRATE_TYPES staticlib
is the correct way to prevent building cdylib on platforms that
don't support dynamic libraries.
This commit is contained in:
Luke Street
2026-02-20 12:24:13 -07:00
parent 58f04c6d9f
commit 257198279e
+4
View File
@@ -41,6 +41,10 @@ set(NOD_IMPORT_ARGS NO_DEFAULT_FEATURES)
if (NOD_FEATURES)
list(APPEND NOD_IMPORT_ARGS FEATURES ${NOD_FEATURES})
endif()
# Embedded Apple platforms don't support dynamic libraries
if (CMAKE_SYSTEM_NAME MATCHES "^(iOS|tvOS|watchOS|visionOS)$")
list(APPEND NOD_IMPORT_ARGS CRATE_TYPES staticlib)
endif()
# Import the nod-ffi crate using Corrosion.
corrosion_import_crate(
MANIFEST_PATH "${CMAKE_CURRENT_SOURCE_DIR}/nod-ffi/Cargo.toml"