Skip to content

Commit 0c1de71

Browse files
authored
Update SwiftFoundationICU to embed data files in the binary (#14)
* Update SwiftFoundationICU to embed data files in the binary * Split the data into four chunks as opposed to 5 and added byte alignment attribute since it's required by ICU
1 parent 95da015 commit 0c1de71

16 files changed

+957757
-208
lines changed

Package.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,7 @@ let package = Package(
7272
"ICUIO",
7373
"ICUStubData"
7474
],
75-
path: "swift/FoundationICU",
76-
resources: [
77-
.copy("icudt70l.dat"),
78-
.copy("icutz44l.dat"),
79-
]),
75+
path: "swift/FoundationICU"),
8076
.target(
8177
name: "ICUCommon",
8278
path: "icuSources/common",

icuSources/common/icu_packaged_data.h

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// This source file is part of the Swift.org open source project
4+
//
5+
// Copyright (c) 2023 Apple Inc. and the Swift project authors
6+
// Licensed under Apache License v2.0 with Runtime Library Exception
7+
//
8+
// See https://swift.org/LICENSE.txt for license information
9+
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10+
//
11+
//===----------------------------------------------------------------------===//
12+
13+
#ifndef ICU_PACKAGED_DATA_H
14+
#define ICU_PACKAGED_DATA_H
15+
16+
#include "icu_packaged_main_data.0.inc.h"
17+
#include "icu_packaged_main_data.1.inc.h"
18+
#include "icu_packaged_main_data.2.inc.h"
19+
#include "icu_packaged_main_data.3.inc.h"
20+
21+
#include "icu_packaged_timezone_data.0.inc.h"
22+
#include "icu_packaged_timezone_data.1.inc.h"
23+
#include "icu_packaged_timezone_data.2.inc.h"
24+
#include "icu_packaged_timezone_data.3.inc.h"
25+
26+
uint8_t const _ICUPackagedMainData[] __attribute__ ((aligned (8))) = {
27+
__ICU_PACKAGED_MAIN_DATA_CHUNK_0,
28+
__ICU_PACKAGED_MAIN_DATA_CHUNK_1,
29+
__ICU_PACKAGED_MAIN_DATA_CHUNK_2,
30+
__ICU_PACKAGED_MAIN_DATA_CHUNK_3
31+
};
32+
33+
uint8_t const _ICUPackagedTimeZoneData[] __attribute__ ((aligned (8))) = {
34+
__ICU_PACKAGED_TIMEZONE_DATA_CHUNK_0,
35+
__ICU_PACKAGED_TIMEZONE_DATA_CHUNK_1,
36+
__ICU_PACKAGED_TIMEZONE_DATA_CHUNK_2,
37+
__ICU_PACKAGED_TIMEZONE_DATA_CHUNK_3
38+
};
39+
40+
#endif // ifndef ICU_PACKAGED_DATA_H

icuSources/common/icu_packaged_main_data.0.inc.h

Lines changed: 237572 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)