Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,33 @@ $ swiftc <inputs> -target armv6m-none-none-eabi -enable-experimental-feature Emb
$ ld ... -o binary output.o $(dirname `which swiftc`)/../lib/swift/embedded/armv6m-none-none-eabi/libswiftUnicodeDataTables.a
```

Alternatively in a CMake build try something like the below which will check a Swiftly based install.

Update the `COMPILER_TARGET` variable to the architecture desired.

```CMake
set(COMPILER_TARGET "riscv32-none-none-eabi")

find_program(SWIFTLY "swiftly")
IF(SWIFTLY)
execute_process(COMMAND swiftly use --print-location OUTPUT_VARIABLE toolchain_path OUTPUT_STRIP_TRAILING_WHITESPACE)
cmake_path(SET additional_lib_path NORMALIZE "${toolchain_path}/usr/lib/swift/embedded/${COMPILER_TARGET}")
ELSE()
get_filename_component(compiler_bin_dir ${CMAKE_Swift_COMPILER} DIRECTORY)
cmake_path(SET additional_lib_path NORMALIZE "${compiler_bin_dir}/../lib/swift/embedded/${COMPILER_TARGET}")
ENDIF()

target_link_directories(${COMPONENT_LIB} PUBLIC "${additional_lib_path}")
target_link_libraries(${COMPONENT_LIB}
-Wl,--whole-archive
swiftUnicodeDataTables
-Wl,--no-whole-archive
)

## decomment the below line to troubleshoot path issues if needed.
# message(" ----------::: ${additional_lib_path} :::---------- ")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this line be included?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean the message? I'm fine with removing it. Alternatively, I can add a mention about its roll in trouble shooting if people unfamiliar with CMake might find that helpful.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add the extra comment, but still willing to remove it if it's distracting.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah okay so it's just a debug message. I wasn't sure if it was meant to be part of the official example here. It could be noted separately for debugging if you like.

```

**Unicode data tables are required for (list not exhaustive):**

- Comparing String objects for equality
Expand Down