Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
swift-ci opened this issue Apr 29, 2016 · 2 comments
Open

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

swift-ci opened this issue Apr 29, 2016 · 2 comments
Labels
Android Platform: Android cmake ICU improvement Linux Platform: Linux

Comments

@swift-ci
Copy link
Collaborator

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.

  • It relied on pkg-config, which is problematic on systems that don't
    ship pkg-config (e.g. Ubuntu 12.04, Windows?)
  • It didn't allow an easy way for specifying alternative locations for ICU
    which is needed if you need to supply a non-system installed version.
    This form is also useful when you want to supply a static library
    version. (I will be submitting related issues about Android and SteamOS.)
  • It didn't handle linking when ICU was a static library. (libicudata is
    needed)
  • pkg-config also doesn't handle libicudata
  • pkg-config also can present problems for cross-compiling. (Android was
    also taken into account for this patch.)

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:
ewmailing@f9cbb94

@swift-ci
Copy link
Collaborator Author

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
Copy link
Contributor

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

#40340

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android Platform: Android cmake ICU improvement Linux Platform: Linux
Projects
None yet
Development

No branches or pull requests

2 participants