Skip to content

Commit f566c75

Browse files
committed
build: statically link ArgumentParserToolInfo always
Now that windows supports static linking as well (to a certain degree), alter the build of swift-argument-parser in CMake to use static linking for ArgumentParserToolInfo always irrespective of whether ArgumentParser is being built as a static library or a dynamic library. On Windows, in release mode, this saves ~32KiB. Additionally, because no tool directly links against this library, no binaries are further expanded by static linking, and we have one less file to distribute.
1 parent 7dd164a commit f566c75

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_library(ArgumentParserToolInfo
1+
add_library(ArgumentParserToolInfo STATIC
22
ToolInfo.swift)
33
# NOTE: workaround for CMake not setting up include flags yet
44
set_target_properties(ArgumentParserToolInfo PROPERTIES
@@ -7,5 +7,4 @@ target_compile_options(ArgumentParserToolInfo PRIVATE
77
$<$<BOOL:${BUILD_TESTING}>:-enable-testing>)
88

99

10-
_install_target(ArgumentParserToolInfo)
1110
set_property(GLOBAL APPEND PROPERTY ArgumentParser_EXPORTS ArgumentParserToolInfo)

0 commit comments

Comments
 (0)