From 6636816ca7cb4a04c52f3f8b5a2ad0e2ae9d0377 Mon Sep 17 00:00:00 2001 From: "j.spijker@ultimaker.com" Date: Thu, 14 Apr 2022 12:00:50 +0200 Subject: [PATCH] Allow static build of the Python Module Contributes to CURA-8640 --- cmake/SIPMacros.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmake/SIPMacros.cmake b/cmake/SIPMacros.cmake index 5ef42243..51645245 100644 --- a/cmake/SIPMacros.cmake +++ b/cmake/SIPMacros.cmake @@ -50,7 +50,12 @@ function(add_sip_module MODULE_TARGET) # create the target library and link all the files (generated and user specified message(STATUS "SIP: Linking the interface target against the shared library") set(sip_sources "${sip_c}" "${sip_cpp}" "${usr_src}") - add_library("sip_${MODULE_TARGET}" SHARED ${sip_sources}) + + if (BUILD_SHARED_LIBS) + add_library("sip_${MODULE_TARGET}" SHARED ${sip_sources}) + else() + add_library("sip_${MODULE_TARGET}" STATIC ${sip_sources}) + endif() # Make sure that the library name of the target is the same as the MODULE_TARGET with the appropriate extension target_link_libraries("sip_${MODULE_TARGET}" PRIVATE "${MODULE_TARGET}")