aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/3rdparty/cplusplus
diff options
context:
space:
mode:
authorCristian Adam <cristian.adam@qt.io>2022-04-21 14:10:09 +0200
committerCristian Adam <cristian.adam@qt.io>2022-04-29 07:16:53 +0000
commit88781a003ffd5f699f70b06d2d99325cf4e60c0f (patch)
tree2b4c888fbcdf57a870302d4d6e68cefef7e19a62 /src/libs/3rdparty/cplusplus
parent58b0a5056c3afe922a2fe8570735da03fb9c3db5 (diff)
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>
Diffstat (limited to 'src/libs/3rdparty/cplusplus')
-rw-r--r--src/libs/3rdparty/cplusplus/CMakeLists.txt7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libs/3rdparty/cplusplus/CMakeLists.txt b/src/libs/3rdparty/cplusplus/CMakeLists.txt
index f2515c9c3a..41c653aa48 100644
--- a/src/libs/3rdparty/cplusplus/CMakeLists.txt
+++ b/src/libs/3rdparty/cplusplus/CMakeLists.txt
@@ -1,6 +1,5 @@
add_qtc_library(3rd_cplusplus OBJECT
PUBLIC_DEPENDS Qt5::Core Utils
- DEFINES CPLUSPLUS_BUILD_LIB
SOURCES
AST.cpp AST.h
ASTClone.cpp
@@ -45,6 +44,12 @@ add_qtc_library(3rd_cplusplus OBJECT
PROPERTIES POSITION_INDEPENDENT_CODE ON
)
+set(export_symbol_declaration DEFINES CPLUSPLUS_BUILD_LIB)
+if (QTC_STATIC_BUILD)
+ set(export_symbol_declaration PUBLIC_DEFINES CPLUSPLUS_BUILD_STATIC_LIB)
+endif()
+extend_qtc_target(3rd_cplusplus ${export_symbol_declaration})
+
if(TARGET 3rd_cplusplus)
qtc_enable_release_for_debug_configuration()
if (BUILD_WITH_PCH)