-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[scintilla] Add static linking to Scintilla #13529
Conversation
you should not call |
<IntrinsicFunctions>true</IntrinsicFunctions> | ||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
<LanguageStandard>stdcpp17</LanguageStandard> | ||
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes to the RuntimeLibrary force usage of the static CRT. They should be pulled into a separate patch, conditioned on VCPKG_CRT_LINKAGE
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I assumed that static triplets always links CRT statically.
I've separated these two options, and now CRT can be linked dynamically.
Tested with two community triplets x64/x86-windows-static-md
– works fine.
Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! 😄
ports/scintilla/portfile.cmake
Outdated
vcpkg_install_msbuild( | ||
SOURCE_PATH ${SOURCE_PATH} | ||
PROJECT_SUBPATH Win32/SciLexer.vcxproj | ||
INCLUDES_SUBPATH include | ||
LICENSE_SUBPATH License.txt | ||
ALLOW_ROOT_INCLUDES | ||
) | ||
|
||
vcpkg_copy_pdbs() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please include a trailing newline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Included.
@@ -13,10 +11,20 @@ vcpkg_extract_source_archive_ex( | |||
REF 4.2.3 | |||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
) | |
PATCHES ${PATCHES} | |
) |
You can then conditionally set PATCHES
based on VCPKG_CRT_LINKAGE
:
if(VCPKG_CRT_LINKAGE STREQUAL "static")
set(PATCHES 0001-static-build.patch)
else()
set(PATCHES)
endif()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the tip.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ras0219-msft could you please approve the change. I would like to update Scintilla to the newest version in another PR, but this one is hanging for so long.
this PR should fix this problem and let CI test the port maybe? |
@cenit Thanks. I have a question about other triplets. Maybe all other currently marked as So, maybe it would be better to just skip those build rather than expecting them to fail?
|
No leave them as fail. |
Removed |
LGTM, sorry for the long delay on this PR and thanks for addressing my comment! |
Describe the pull request
Static linking is officially supported by Scintilla. See https://www.scintilla.org/ScintillaDoc.html, at the bottom of the document, section "Building Scintilla". This PR adds static linking on Windows.
Tested successfully:
x64-windows
x64-windows-static
x64-windows-static-md
x86-windows
x86-windows-static
x86-windows-static-md
Yes, it does.