From: Piotr Tworek
Date: Thu, 8 Jan 2015 13:17:04 +0000 (+0100)
Subject: Make it possible to compile chromium-efl on desktop using clang
X-Git-Tag: submit/tizen/20201118.160233~1457
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e3581b7561fa7920846e7d457ef4e9f7ba25f542;p=platform%2Fframework%2Fweb%2Fchromium-efl.git
Make it possible to compile chromium-efl on desktop using clang
Chromium provided version of clang has certain adventages over GCC:
* The compiler checks the code for coding style violations. It treats
them as warnings.
* Diagnostic messages displayed by the compiler are much more readable.
They use colors to signify the type of problem (red - error, yellow -
warning, etc), add custom ASCI art like indicators showing where the
problem is, display tips how the problem can be fixed.
* Chromium.org has switched to clang as the default compiler some time
around M38.
This patch makes it easy to build chromium-efl using clang. It's enough
to pass --clang flag to build_desktop.sh. The feature uses clang version
shipped together with chromium sources so the user does not need to
install anything on his/her system.
Reviewed by: Antonio Gomes, SeungSeop Park (OOO ~ 4/Jan/2015), Viatcheslav Ostapenko
Reviewed by: Antonio Gomes, Daniel Waślicki, Kamil Klimek, SeungSeop Park
Change-Id: I2e3966098aa397b6712c761709880ed9a5fa5294
Signed-off-by: Piotr Tworek
---
diff --git a/tizen_src/.gitignore b/tizen_src/.gitignore
index 41cf58d..1ad67f3 100644
--- a/tizen_src/.gitignore
+++ b/tizen_src/.gitignore
@@ -1,4 +1,5 @@
*.o
+*.dwo
*.orig
/*.list
/out.*
diff --git a/tizen_src/build/common.sh b/tizen_src/build/common.sh
index 3c83b0f..e0fa945 100644
--- a/tizen_src/build/common.sh
+++ b/tizen_src/build/common.sh
@@ -10,6 +10,8 @@ if [[ -z "${CHROME_SRC}" ]]; then
export CHROME_SRC="${TOPDIR}/src"
fi
+export CLANG_DIR="${TOPDIR}/src/third_party/llvm-build/Release+Asserts/"
+
function applyPatch {
directory=$1
shift
@@ -55,6 +57,7 @@ OPTIONS:
-h, --help Show this message
--build-ewk-unittests Build ewk unittests
--ccache Configure ccache installed in your system
+ --clang Use chromium's clang compiler to build the sources
--content-shell Build content_shell application
--debug Build debug version of chromium-efl (out.${host_arch}/Debug instead of out.${host_arch}/Release)
-jN Set number of jobs, just like with make or ninja
@@ -73,6 +76,7 @@ function parseHostBuildScriptParams() {
export SKIP_GYP=0
export USE_CCACHE=0
+ export USE_CLANG=0
export FORCE_JHBUILD=0
export SKIP_NINJA=0
export BUILD_EWK_UNITTESTS=0
@@ -95,6 +99,9 @@ function parseHostBuildScriptParams() {
export USE_CCACHE=1
source $TOPDIR/build/ccache_env.sh ${platform}
;;
+ --clang)
+ export USE_CLANG=1
+ ;;
--content-shell)
export BUILD_CONTENT_SHELL=1
;;
diff --git a/tizen_src/build/gyp_chromiumefl.sh b/tizen_src/build/gyp_chromiumefl.sh
index 798742b..535a77c 100755
--- a/tizen_src/build/gyp_chromiumefl.sh
+++ b/tizen_src/build/gyp_chromiumefl.sh
@@ -40,7 +40,6 @@ fi
COMMON_GYP_PARAMETERS="
-Duse_libjpeg_turbo=1
-Dproprietary_codecs=1
- -Dclang=0
-Dtizen_multimedia_support=1
-Duse_aura=0
-Duse_efl=1
@@ -52,7 +51,10 @@ if [[ $BUILD_CONTENT_SHELL == 1 ]]; then
fi
add_desktop_flags() {
- ADDITIONAL_GYP_PARAMETERS+="-Dbuilding_for_tizen=0"
+ ADDITIONAL_GYP_PARAMETERS+="-Dbuilding_for_tizen=0
+ -Dclang=${USE_CLANG}
+ -Dmake_clang_dir=${CLANG_DIR}
+ "
}
add_arm_flags() {
@@ -71,6 +73,7 @@ add_tizen_flags() {
-Duse_kerberos=0
-Duse_gconf=0
-Duse_alsa=0
+ -Dclang=0
-Dlinux_use_bundled_gold=0
-Dlinux_use_bundled_binutils=0
-Dprebuilt_ld_gold_dir=${TOPDIR}/build/prebuild