swiftlang / swift

The Swift Programming Language
https://swift.org
Apache License 2.0
67.61k stars 10.37k forks source link

[SR-1358] Improved FindICU.cmake for more systems and static linking #43967

Open swift-ci opened 8 years ago

swift-ci commented 8 years ago
Previous ID SR-1358
Radar None
Original Reporter ewmailing (JIRA User)
Type Improvement
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 0 | |Component/s | | |Labels | Improvement, Android, CMake, ICU, Linux | |Assignee | None | |Priority | Medium | md5: 57487fce257e295f9be5f65704802b72

Issue Description:

This patch modifies FindICU.cmake and a few other files to support more systems and more configurations.

The existing ICU infrastructure was insufficient for multiple things.

This change fixes all these problems so Swift can be built on systems
like SteamOS/Steam-Runtime which don't supply libICU (and is based on
Ubuntu 12.04 which lacks a pkg-config). This allows you to supply
some other libICU which is a static library, and the Swift build system
will do the right thing. (It does not force static linking. So if you want static linking, only provide the static library.)

An explicit setting of ICU_ROOT (cmake -DICU_ROOT=/path/to/icu_root) or
setting an environmental variable called ICU_ROOT will allow alternative
paths to be searched.

I do want to point out that there is a popular FindICU.cmake floating out there that already handles this stuff and is pretty mature. I’m wondering a bit why you rewrote this from scratch considering ICU is a non-trivial library to deal with.

My patch is here:
https://github.com/ewmailing/swift/commit/f9cbb94148ae9d5d34e2313e129491d79ea8eb29

swift-ci commented 7 years ago

Comment by Hugh Bellamy (JIRA)

We can now find ICU without pkgconfig, this was fixed as part of the Windows port.
Not sure about the other points you mentioned

finagolfin commented 2 years ago

The libicu dependency of the standard library was removed last month:

https://github.com/apple/swift/pull/40340