Skip to content

Commit c519125

Browse files
author
Bartosz Grabias
committed
[XC8] Added support for static libraries
1 parent 50f68e1 commit c519125

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Modules/Compiler/XC8-C.cmake

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,18 @@ string(APPEND CMAKE_C_LINK_EXECUTABLE
4242
" <OBJECTS> <LINK_LIBRARIES>"
4343
" -o<TARGET>"
4444
)
45+
46+
set(CMAKE_STATIC_LIBRARY_SUFFIX_C ".lpp")
47+
48+
set(CMAKE_C_CREATE_STATIC_LIBRARY)
49+
string(APPEND CMAKE_C_CREATE_STATIC_LIBRARY
50+
"<CMAKE_C_COMPILER> <LINK_FLAGS>"
51+
# don't output the copyright notice on every invocation
52+
"-Q"
53+
# use the configured license mode and fail if it's not available
54+
" --mode=${MICROCHIP_XC8_MODE} --nofallback"
55+
# build for the configured MCU model
56+
" --chip=${MICROCHIP_MCU_MODEL}"
57+
" <OBJECTS> <LINK_LIBRARIES>"
58+
" --output=lpp -o<TARGET>"
59+
)

0 commit comments

Comments
 (0)