File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -136,6 +136,12 @@ add_library(libhl SHARED
136136 ${std_srcs}
137137)
138138
139+ add_library (libhl-static STATIC
140+ ${pcre_srcs}
141+ src/gc.c
142+ ${std_srcs}
143+ )
144+
139145set (public_headers
140146 src/hl.h
141147 src/hlc.h
@@ -146,16 +152,29 @@ set_target_properties(libhl
146152 PUBLIC_HEADER "${public_headers} "
147153)
148154
155+ set_target_properties (libhl-static
156+ PROPERTIES
157+ PUBLIC_HEADER "${public_headers} "
158+ )
159+
149160if (WIN32 )
150161 set_target_properties (libhl
151162 PROPERTIES
152163 OUTPUT_NAME libhl
153164 )
165+ set_target_properties (libhl-static
166+ PROPERTIES
167+ OUTPUT_NAME libhl-static
168+ )
154169else ()
155170 set_target_properties (libhl
156171 PROPERTIES
157172 OUTPUT_NAME hl
158173 )
174+ set_target_properties (libhl-static
175+ PROPERTIES
176+ OUTPUT_NAME hl
177+ )
159178endif ()
160179
161180set_target_properties (libhl
@@ -165,6 +184,11 @@ set_target_properties(libhl
165184 COMPILE_DEFINITIONS "_USRDLL;LIBHL_EXPORTS;HAVE_CONFIG_H;PCRE2_CODE_UNIT_WIDTH=16"
166185)
167186
187+ set_target_properties (libhl-static
188+ PROPERTIES
189+ COMPILE_DEFINITIONS "_USRDLL;LIBHL_EXPORTS;HAVE_CONFIG_H;PCRE2_CODE_UNIT_WIDTH=16"
190+ )
191+
168192add_executable (hl
169193 src/code.c
170194 src/jit.c
@@ -355,6 +379,7 @@ install(
355379 TARGETS
356380 hl
357381 libhl
382+ libhl-static
358383 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
359384 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
360385 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
You can’t perform that action at this time.
0 commit comments