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)
if (SPNAV_INCLUDE_DIR)
find_library(HAVE_SPNAV spnav)
if (HAVE_SPNAV)
find_library(SPNAV_LIB NAMES libspnav.a) # Force linking libspnav statically
if (SPNAV_LIB)
add_definitions(-DHAVE_SPNAV)
add_library(libspnav SHARED IMPORTED)
target_link_libraries(libspnav INTERFACE spnav)
message(STATUS "SPNAV library found")
else()
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)
endif()
if (HAVE_SPNAV)
target_link_libraries(libslic3r_gui spnav)
if (SPNAV_LIB)
target_link_libraries(libslic3r_gui ${SPNAV_LIB})
endif()
if (SLIC3R_STATIC AND NOT SLIC3R_STATIC_EXCLUDE_CURL AND UNIX AND NOT APPLE)