Fix build system: MSVC static, UserInterface, clangInterpreter linking#563
Open
0xeb wants to merge 1 commit intoroot-project:masterfrom
Open
Fix build system: MSVC static, UserInterface, clangInterpreter linking#5630xeb wants to merge 1 commit intoroot-project:masterfrom
0xeb wants to merge 1 commit intoroot-project:masterfrom
Conversation
Three build fixes for embedding cling as a static library: 1. Suppress dllexport on MSVC static builds: AddClang.cmake sets CLANG_BUILD_STATIC for clang targets but not cling targets, causing __declspec(dllexport) symbols to leak into consumer DLLs. Add the same definition for cling targets when building static on MSVC. 2. Build UserInterface unconditionally: clingUserInterface is a runtime dependency of cling.exe, libcling, and embedders, but was gated behind CLING_INCLUDE_TESTS. Building with -DLLVM_INCLUDE_TESTS=OFF silently skipped it, causing link failures. 3. Link clangInterpreter into libcling.so: needed for ReplCodeCompleter autocomplete support in shared library builds.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three build fixes for embedding cling as a static library:
MSVC static build dllexport suppression:
AddClang.cmakesetsCLANG_BUILD_STATICfor clang targets but not cling targets, causing__declspec(dllexport)symbols to leak into consumer DLLs. This adds the same definition for cling targets when building static on MSVC.Build UserInterface unconditionally:
clingUserInterfaceis a runtime dependency ofcling.exe,libcling, and embedders, but was gated behindCLING_INCLUDE_TESTS. Building with-DLLVM_INCLUDE_TESTS=OFFsilently skipped it, causing link failures.Link clangInterpreter into libcling.so: Needed for
ReplCodeCompleterautocomplete support in shared library builds.Test plan
/MTstatic), and MinGW cross-build