diff --git a/cmake/init.cmake b/cmake/init.cmake index aac350ce0b..e97cfa476e 100644 --- a/cmake/init.cmake +++ b/cmake/init.cmake @@ -61,4 +61,12 @@ endif () if (APPLE) set(CMAKE_XCODE_ATTRIBUTE_OTHER_CODE_SIGN_FLAGS "--deep") -endif() \ No newline at end of file +endif() + +if (UNIX) + # Static libs result in duplicated constructor and destructor calls on Linux + # and crashes on exit, and perhaps loss of global state on plugin loads. + # + # This will need to be looked at closely before Linux can have a static build. + set(BUILD_SHARED_LIBS ON) +endif () diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index f800f9c8aa..155d90efcb 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -142,6 +142,9 @@ if (APPLE) list(APPEND INTERFACE_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/icon/${INTERFACE_ICON_FILENAME}) endif() +if (UNIX) + set(BUILD_SHARED_LIBS ON) +endif () # create the executable, make it a bundle on OS X if (APPLE)