CMake: Qt Creator Static build support

This adds the build system feature that allows Qt Creator's libraries
and plugins to be compiled statically.

Fixes some symbol clashes when all plugins are linked into the same
executable.

Support for actually loading static plugins will be added in a separate
commit.

The feature is controlled by QTC_STATIC_BUILD which by default is OFF.

Change-Id: I1fab7953c43e42dc75619e35660029ee067106df
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Cristian Adam
2022-04-21 14:10:09 +02:00
parent 58b0a5056c
commit 88781a003f
88 changed files with 330 additions and 132 deletions
+6 -2
View File
@@ -22,9 +22,7 @@ else()
endif()
set(YAML_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/../src/libs/3rdparty/yaml-cpp)
add_qtc_library(yaml-cpp
DEFINES YAML_CPP_DLL yaml_cpp_EXPORTS
INCLUDES ${YAML_SOURCE_DIR}/include
PUBLIC_DEFINES YAML_CPP_DLL
PUBLIC_INCLUDES ${YAML_SOURCE_DIR}/include
PROPERTIES AUTOMOC OFF AUTOUIC OFF
SOURCES
@@ -116,6 +114,12 @@ else()
${YAML_SOURCE_DIR}/src/tag.h
${YAML_SOURCE_DIR}/src/token.h
)
if (NOT QTC_STATIC_BUILD)
extend_qtc_target(yaml-cpp
DEFINES yaml_cpp_EXPORTS
PUBLIC_DEFINES YAML_CPP_DLL)
endif()
if(TARGET yaml-cpp)
set(yaml-cpp_FOUND 1)
set_package_properties(yaml-cpp PROPERTIES DESCRIPTION "using internal src/libs/3rdparty/yaml-cpp")