Possibility to link curl and glew dynamically in static mode.

This commit is contained in:
tamasmeszaros 2021-08-19 16:56:22 +02:00
parent 40f78ca31c
commit 421089ebc8
2 changed files with 4 additions and 4 deletions

View File

@ -405,7 +405,7 @@ else()
target_link_libraries(libcurl INTERFACE crypt32) target_link_libraries(libcurl INTERFACE crypt32)
endif() endif()
if (SLIC3R_STATIC) if (SLIC3R_STATIC AND NOT SLIC3R_STATIC_EXCLUDE_CURL)
if (NOT APPLE) if (NOT APPLE)
# libcurl is always linked dynamically to the system libcurl on OSX. # libcurl is always linked dynamically to the system libcurl on OSX.
# On other systems, libcurl is linked statically if SLIC3R_STATIC is set. # On other systems, libcurl is linked statically if SLIC3R_STATIC is set.
@ -456,13 +456,13 @@ set(OpenGL_GL_PREFERENCE "LEGACY")
find_package(OpenGL REQUIRED) find_package(OpenGL REQUIRED)
# Find glew or use bundled version # Find glew or use bundled version
if (SLIC3R_STATIC) if (SLIC3R_STATIC AND NOT SLIC3R_STATIC_EXCLUDE_GLEW)
set(GLEW_USE_STATIC_LIBS ON) set(GLEW_USE_STATIC_LIBS ON)
set(GLEW_VERBOSE ON) set(GLEW_VERBOSE ON)
endif() endif()
find_package(GLEW) find_package(GLEW)
if (NOT GLEW_FOUND) if (NOT TARGET GLEW::GLEW)
message(STATUS "GLEW not found, using bundled version.") message(STATUS "GLEW not found, using bundled version.")
add_library(glew STATIC ${LIBDIR}/glew/src/glew.c) add_library(glew STATIC ${LIBDIR}/glew/src/glew.c)
set(GLEW_FOUND TRUE) set(GLEW_FOUND TRUE)

View File

@ -268,7 +268,7 @@ if(APPLE)
target_link_libraries(libslic3r_gui ${DISKARBITRATION_LIBRARY}) target_link_libraries(libslic3r_gui ${DISKARBITRATION_LIBRARY})
endif() endif()
if (SLIC3R_STATIC AND UNIX AND NOT APPLE) if (SLIC3R_STATIC AND NOT SLIC3R_STATIC_EXCLUDE_CURL AND UNIX AND NOT APPLE)
target_compile_definitions(libslic3r_gui PRIVATE OPENSSL_CERT_OVERRIDE) target_compile_definitions(libslic3r_gui PRIVATE OPENSSL_CERT_OVERRIDE)
endif () endif ()