Skip to content
Merged
Show file tree
Hide file tree
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
43 changes: 20 additions & 23 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,28 @@ jobs:

strategy:
matrix:
api-version: ['6.0', '6.5']
arch: [arm, arm64, x86]
api-version: ["6.0", "6.5", "8.0"]
arch: [arm, arm64, x86, x64]
include:
- arch: arm
triple: arm-linux-gnueabi
- arch: arm64
triple: aarch64-linux-gnu
- arch: x86
triple: i686-linux-gnu
- arch: x64
triple: x86-64-linux-gnu
exclude:
- api-version: "6.0"
arch: x64
- api-version: "6.5"
arch: x64
- api-version: "8.0"
arch: arm
- api-version: "8.0"
arch: arm64
- api-version: "8.0"
arch: x86

steps:
- uses: actions/checkout@v4
Expand All @@ -43,32 +56,16 @@ jobs:
gclient config --name=src --unmanaged https://github.com/${{ github.repository }}
gclient sync -v --no-history --shallow

- name: Generate Tizen 6.0 sysroot
if: ${{ matrix.api-version == '6.0' }}
run: src/tools/generate_sysroot.py --out src/sysroot-6.0
- name: Generate Tizen ${{ matrix.api-version }} sysroot
run: src/tools/generate_sysroot.py --api-version ${{ matrix.api-version }} --out src/sysroot-${{ matrix.api-version }}

- name: Generate Tizen 6.5 sysroot
if: ${{ matrix.api-version == '6.5' }}
run: src/tools/generate_sysroot.py --api-version 6.5 --out src/sysroot-6.5

- name: Build for Tizen 6.0
if: ${{ matrix.api-version == '6.0' }}
run: |
src/tools/gn \
--target-cpu ${{ matrix.arch }} \
--target-toolchain /usr/lib/llvm-17 \
--target-sysroot src/sysroot-6.0/${{ matrix.arch }} \
--target-dir build
ninja -C src/out/build

- name: Build for Tizen 6.5
if: ${{ matrix.api-version == '6.5' }}
- name: Build for Tizen ${{ matrix.api-version }}
run: |
src/tools/gn \
--target-cpu ${{ matrix.arch }} \
--target-toolchain /usr/lib/llvm-17 \
--target-sysroot src/sysroot-6.5/${{ matrix.arch }} \
--api-version 6.5 \
--target-sysroot src/sysroot-${{ matrix.api-version }}/${{ matrix.arch }} \
--api-version ${{ matrix.api-version }} \
--target-dir build
ninja -C src/out/build

Expand Down
10 changes: 8 additions & 2 deletions build/config/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,12 @@ config("compiler") {
cflags += [
"-m64",
"-march=x86-64",
"--target=x86_64-linux-gnu",
]
ldflags += [
"-m64",
"--target=x86_64-linux-gnu",
]
ldflags += [ "-m64" ]
} else if (target_cpu == "x86") {
cflags += [
"-m32",
Expand Down Expand Up @@ -115,7 +119,7 @@ config("no_system_cxx") {
config("system_cxx") {
assert(sysroot_path != "")

if (target_cpu == "arm64") {
if (target_cpu == "arm64" || target_cpu == "x64") {
lib_path = "${sysroot_path}/usr/lib64"
} else {
lib_path = "${sysroot_path}/usr/lib"
Expand All @@ -127,6 +131,8 @@ config("system_cxx") {
gcc_target_triple = "aarch64-tizen-linux-gnu"
} else if (target_cpu == "x86") {
gcc_target_triple = "i586-tizen-linux-gnu"
} else if (target_cpu == "x64") {
gcc_target_triple = "x86_64-tizen-linux-gnu"
} else {
assert(false, "Unknown target_cpu: " + target_cpu)
}
Expand Down
2 changes: 1 addition & 1 deletion flutter/shell/platform/tizen/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ template("embedder") {
defines += invoker.defines
defines += [ "FLUTTER_ENGINE_NO_PROTOTYPES" ]

if (api_version == "6.5") {
if (api_version != "6.0") {
sources += [
"flutter_tizen_nui.cc",
"tizen_clipboard.cc",
Expand Down
2 changes: 1 addition & 1 deletion flutter/third_party/accessibility/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ config("accessibility_config") {
"${sysroot_path}/usr/include/glib-2.0",
]

if (target_cpu == "arm64") {
if (target_cpu == "arm64" || target_cpu == "x64") {
include_dirs += [ "${sysroot_path}/usr/lib64/glib-2.0/include" ]
} else {
include_dirs += [ "${sysroot_path}/usr/lib/glib-2.0/include" ]
Expand Down
6 changes: 3 additions & 3 deletions tools/download_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# Downloads the latest engine artifacts for use by the linker.
def main():
engine_dir = Path(__file__).parent.parent / 'engine'
github_url = 'https://github.com/flutter-tizen/engine/releases'
github_url = 'https://github.com/flutter-tizen/flutter/releases'

stamp = ''
stamp_file = engine_dir / 'engine.stamp'
Expand All @@ -41,8 +41,8 @@ def main():
shutil.rmtree(engine_dir)
engine_dir.mkdir()

names = ['tizen-arm-release.zip',
'tizen-arm64-release.zip', 'tizen-x86-debug.zip']
names = ['tizen-arm-release.zip', 'tizen-arm64-release.zip',
'tizen-x86-debug.zip', 'tizen-x64-release.zip']
for filename in names:
arch = filename.split('-')[1]
print('Downloading libflutter_engine.so for {}...'.format(arch))
Expand Down
36 changes: 28 additions & 8 deletions tools/generate_sysroot.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,19 +128,30 @@


def generate_sysroot(sysroot: Path, api_version: float, arch: str, quiet=False):
target = 'standard'

if arch == 'arm':
tizen_arch = 'armv7l'
elif arch == 'arm64':
tizen_arch = 'aarch64'
elif arch == 'x86':
tizen_arch = 'i686'
target = 'emulator'
elif arch == 'x64':
tizen_arch = 'x86_64'
target = 'emulator'
else:
sys.exit('Unknown arch: ' + arch)

base_repo = 'http://download.tizen.org/snapshots/TIZEN/Tizen-{}/Tizen-{}-Base/latest/repos/standard/packages'.format(
api_version, api_version)
unified_repo = 'http://download.tizen.org/snapshots/TIZEN/Tizen-{}/Tizen-{}-Unified/latest/repos/standard/packages'.format(
api_version, api_version)
if api_version >= 10.0:
base_repo = 'http://download.tizen.org/snapshots/TIZEN/Tizen/Tizen-Base/reference/repos/standard/packages/'
unified_repo = 'http://download.tizen.org/snapshots/TIZEN/Tizen/Tizen-Unified/reference/repos//{}/packages'.format(
target)
else:
base_repo = 'http://download.tizen.org/snapshots/TIZEN/Tizen-{}/Tizen-{}-Base/reference/repos/standard/packages'.format(
api_version, api_version)
unified_repo = 'http://download.tizen.org/snapshots/TIZEN/Tizen-{}/Tizen-{}-Unified/reference/repos/{}/packages'.format(
api_version, api_version, target)

# Retrieve html documents.
documents = {}
Expand Down Expand Up @@ -189,13 +200,16 @@ def generate_sysroot(sysroot: Path, api_version: float, arch: str, quiet=False):
# Create symbolic links.
asm = sysroot / 'usr' / 'include' / 'asm'
if not asm.exists():
os.symlink('asm-' + arch, asm)
if arch == 'x64':
os.symlink('asm-x86', asm)
else:
os.symlink('asm-' + arch, asm)
pkgconfig = sysroot / 'usr' / 'lib' / 'pkgconfig'
if arch == 'arm64' and not pkgconfig.exists():
if (arch == 'arm64' or arch == 'x64') and not pkgconfig.exists():
os.symlink('../lib64/pkgconfig', pkgconfig)

# Copy objects required by the linker, such as crtbeginS.o and libgcc.a.
if arch == 'arm64':
if arch == 'arm64' or arch == 'x64':
libpath = sysroot / 'usr' / 'lib64'
else:
libpath = sysroot / 'usr' / 'lib'
Expand Down Expand Up @@ -228,7 +242,13 @@ def main():
outpath = Path(__file__).parent.parent / 'sysroot'
outpath.mkdir(exist_ok=True)

for arch in ['arm', 'arm64', 'x86']:
arches = ['arm', 'arm64', 'x86']
if args.api_version >= 10.0:
arches = ['arm', 'arm64', 'x64']
elif args.api_version >= 8.0:
arches = ['arm', 'arm64', 'x86', 'x64']

for arch in arches:
sysroot = outpath / arch
if args.force and sysroot.is_dir():
shutil.rmtree(sysroot)
Expand Down
4 changes: 3 additions & 1 deletion tools/gn
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ def get_target_triple(target_cpu):
return 'aarch64-linux-gnu'
elif target_cpu == 'x86':
return 'i686-linux-gnu'
elif target_cpu == 'x64':
return 'x86_64-linux-gnu'
else:
sys.exit('Unknown target CPU.')

Expand Down Expand Up @@ -95,7 +97,7 @@ def parse_args(args):
parser.add_argument('--unoptimized', default=False, action='store_true')

parser.add_argument('--target-cpu', type=str, required=True,
choices=['arm', 'x86', 'arm64'])
choices=['arm', 'x86', 'arm64', 'x64'])

parser.add_argument('--target-toolchain', type=str, required=True)
parser.add_argument('--target-sysroot', type=str)
Expand Down