Link libspnav statically (#9964)
Some checks are pending
Build all / Build All (push) Waiting to run
Build all / Flatpak (push) Waiting to run

* Link libspnav statically

* Find static libspnav

* Force linking libspnav.a
This commit is contained in:
Noisyfox 2025-06-21 19:08:59 +08:00 committed by GitHub
parent 7cbd0d2b74
commit 6ed9b08173
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 6 deletions

View file

@ -686,11 +686,9 @@ endif ()
find_path(SPNAV_INCLUDE_DIR spnav.h) find_path(SPNAV_INCLUDE_DIR spnav.h)
if (SPNAV_INCLUDE_DIR) if (SPNAV_INCLUDE_DIR)
find_library(HAVE_SPNAV spnav) find_library(SPNAV_LIB NAMES libspnav.a) # Force linking libspnav statically
if (HAVE_SPNAV) if (SPNAV_LIB)
add_definitions(-DHAVE_SPNAV) add_definitions(-DHAVE_SPNAV)
add_library(libspnav SHARED IMPORTED)
target_link_libraries(libspnav INTERFACE spnav)
message(STATUS "SPNAV library found") message(STATUS "SPNAV library found")
else() else()
message(STATUS "SPNAV library NOT found, Spacenavd not supported") message(STATUS "SPNAV library NOT found, Spacenavd not supported")

View file

@ -658,8 +658,8 @@ if (SLIC3R_STATIC)
target_compile_definitions(libslic3r_gui PUBLIC -DwxDEBUG_LEVEL=0) target_compile_definitions(libslic3r_gui PUBLIC -DwxDEBUG_LEVEL=0)
endif() endif()
if (HAVE_SPNAV) if (SPNAV_LIB)
target_link_libraries(libslic3r_gui spnav) target_link_libraries(libslic3r_gui ${SPNAV_LIB})
endif() endif()
if (SLIC3R_STATIC AND NOT SLIC3R_STATIC_EXCLUDE_CURL AND UNIX AND NOT APPLE) if (SLIC3R_STATIC AND NOT SLIC3R_STATIC_EXCLUDE_CURL AND UNIX AND NOT APPLE)