Update Ubuntu 20 build instructions.

GitOrigin-RevId: 8407d77b8e93a0a63c55fd1770dd089ebbb749a6
This commit is contained in:
levlam 2020-08-07 07:09:20 +03:00
parent 2097934da5
commit 824744b74e

View File

@ -561,6 +561,19 @@ function onOptionsChanged() {
install_dir = '../example/java/td'; install_dir = '../example/java/td';
} }
function getClangVersionSuffix() {
switch (linux_distro) {
case 'Ubuntu 14':
return '-3.9';
case 'Ubuntu 18':
return '-6.0';
case 'Ubuntu 20':
return '-10';
default:
return ''; // use default version
}
}
var commands = []; var commands = [];
var php = "php"; var php = "php";
@ -612,18 +625,9 @@ function onOptionsChanged() {
packages += ' default-jdk'; packages += ' default-jdk';
} }
if (use_clang) { if (use_clang) {
if (linux_distro === 'Ubuntu 18' || linux_distro === 'Ubuntu 20') { packages += ' clang' + getClangVersionSuffix() + ' libc++-dev';
packages += ' clang-6.0 libc++-dev libc++abi-dev'; if (linux_distro === 'Debian 10' || linux_distro === 'Ubuntu 18' || linux_distro === 'Ubuntu 20') {
} else { packages += ' libc++abi-dev';
if (linux_distro === 'Ubuntu 14') {
packages += ' clang-3.9';
} else {
packages += ' clang';
}
packages += ' libc++-dev';
if (linux_distro === 'Debian 10') {
packages += ' libc++abi-dev';
}
} }
} else { } else {
packages += ' g++'; packages += ' g++';
@ -672,7 +676,7 @@ function onOptionsChanged() {
commands.push('git clone https://github.com/tdlib/td.git'); commands.push('git clone https://github.com/tdlib/td.git');
commands.push('cd td'); commands.push('cd td');
commands.push('git checkout v1.6.0'); // commands.push('git checkout v1.6.0');
if (use_vcpkg) { if (use_vcpkg) {
commands.push('git clone https://github.com/Microsoft/vcpkg.git'); commands.push('git clone https://github.com/Microsoft/vcpkg.git');
@ -786,14 +790,13 @@ function onOptionsChanged() {
var prefix = ''; var prefix = '';
if (os_linux) { if (os_linux) {
if (use_clang) { if (use_clang) {
if (linux_distro === 'Ubuntu 18' || linux_distro === 'Ubuntu 20') { var clang_version_suffix = getClangVersionSuffix();
prefix = 'CC=/usr/bin/clang-6.0 CXX=/usr/bin/clang++-6.0 '; prefix = 'CC=/usr/bin/clang' + clang_version_suffix + ' CXX=/usr/bin/clang++' + clang_version_suffix + ' ';
options.push('-DCMAKE_AR=/usr/bin/llvm-ar-6.0'); if (use_lto) {
options.push('-DCMAKE_NM=/usr/bin/llvm-nm-6.0'); options.push('-DCMAKE_AR=/usr/bin/llvm-ar' + clang_version_suffix);
options.push('-DCMAKE_OBJDUMP=/usr/bin/llvm-objdump-6.0'); options.push('-DCMAKE_NM=/usr/bin/llvm-nm' + clang_version_suffix);
options.push('-DCMAKE_RANLIB=/usr/bin/llvm-ranlib-6.0'); options.push('-DCMAKE_OBJDUMP=/usr/bin/llvm-objdump' + clang_version_suffix);
} else { options.push('-DCMAKE_RANLIB=/usr/bin/llvm-ranlib' + clang_version_suffix);
prefix = 'CC=/usr/bin/clang CXX=/usr/bin/clang++ ';
} }
} else if (linux_distro === 'Ubuntu 14') { } else if (linux_distro === 'Ubuntu 14') {
prefix = 'CC=/usr/bin/gcc-4.9 CXX=/usr/bin/g++-4.9 '; prefix = 'CC=/usr/bin/gcc-4.9 CXX=/usr/bin/g++-4.9 ';