diff --git a/nix/build-all.py b/nix/build-all.py index 0f93b4bf34..af5256c5ed 100644 --- a/nix/build-all.py +++ b/nix/build-all.py @@ -1112,9 +1112,9 @@ if "libxml2" in targets: if "OpenCOLLADA" in targets: patches = ["./patches/opencollada/pr622_and_disable_subdirs.patch"] - # This patch allows static libraries config on Unix, - # because the config is weird and doesn't allow non-shared libraries on Unix. - patches.append("./patches/opencollada/allow_static_libraries_config_on_unix.patch") + # OpenCOLLADAConfig.cmake.in hardcodes shared-lib targets on Unix regardless of + # whether shared libs were actually built. We make it follow `USE_SHARED` instead. + patches.append("./patches/opencollada/config_select_libs_by_use_shared.patch") if "wasm" in flags: # This is necessary for the WASM build, because recent versions of diff --git a/nix/patches/opencollada/allow_static_libraries_config_on_unix.patch b/nix/patches/opencollada/config_select_libs_by_use_shared.patch similarity index 95% rename from nix/patches/opencollada/allow_static_libraries_config_on_unix.patch rename to nix/patches/opencollada/config_select_libs_by_use_shared.patch index 936d5c2029..4548fd71aa 100644 --- a/nix/patches/opencollada/allow_static_libraries_config_on_unix.patch +++ b/nix/patches/opencollada/config_select_libs_by_use_shared.patch @@ -7,7 +7,7 @@ index d765b108..6800c2a7 100644 # Set the library variable -if(UNIX) -+if(0) ++if(@USE_SHARED@) set(OPENCOLLADA_LIBRARIES ftoa_shared buffer_shared