diff --git a/CMakeLists.txt b/CMakeLists.txt index 8af3d66470..edcdc15237 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,6 +57,7 @@ option(BUILD_UNIT_TESTS "Build gtest unit test" OFF) option(PACKAGE_FILE_ASSOCIATION "File types association" OFF) option(BUILD_PCH "Build using precompiled headers." OFF) +option(BUILD_SHARED_LIB_IN_DEBUG "Build shared libs if possible in debug" ON) option(QML_LOAD_FROM_SOURCE "Load qml files from source (not resource)" OFF) option(USE_SYSTEM_FREETYPE "Use system FreeType" OFF) # requires freetype >= 2.5.2, does not work on win diff --git a/build/module.cmake b/build/module.cmake index 9a023e8a62..04cd626914 100644 --- a/build/module.cmake +++ b/build/module.cmake @@ -40,12 +40,14 @@ if (_build_type STREQUAL "debug") endif() set(LIBRARY_TYPE STATIC) -if (IS_DEBUG_BUILD) - include(GetPlatformInfo) - if (PLATFORM_IS_LINUX) - set(LIBRARY_TYPE SHARED) - endif(PLATFORM_IS_LINUX) -endif(IS_DEBUG_BUILD) +if (BUILD_SHARED_LIB_IN_DEBUG) + if (IS_DEBUG_BUILD) + include(GetPlatformInfo) + if (PLATFORM_IS_LINUX) + set(LIBRARY_TYPE SHARED) + endif(PLATFORM_IS_LINUX) + endif(IS_DEBUG_BUILD) +endif(BUILD_SHARED_LIB_IN_DEBUG) if (MODULE_QRC) qt5_add_resources(RCC_SOURCES ${MODULE_QRC})