Skip to content

Commit 2a5c188

Browse files
committed
Switch library type from STATIC to OBJECT to fix the Zephyr sample
1 parent c753b49 commit 2a5c188

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

nrfx-blink-sdk/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ add_compile_options(
3434

3535
target_sources(app PRIVATE Stubs.c)
3636

37-
add_library(app_swift STATIC Main.swift)
37+
# The Swift code providing "main" needs to be in an OBJECT library (instead of STATIC library) to make sure it actually gets linker.
38+
# A STATIC library would get dropped from linking because Zephyr provides a default weak empty main definition.
39+
add_library(app_swift OBJECT Main.swift)
40+
3841
add_dependencies(app_swift syscall_list_h_target)
3942
target_compile_options(app_swift PRIVATE
4043
-parse-as-library

0 commit comments

Comments
 (0)