Make it possible to compile chromium-efl on desktop using clang
authorPiotr Tworek <p.tworek@samsung.com>
Thu, 8 Jan 2015 13:17:04 +0000 (14:17 +0100)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 06:57:09 +0000 (06:57 +0000)
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 <p.tworek@samsung.com>
tizen_src/.gitignore
tizen_src/build/common.sh
tizen_src/build/gyp_chromiumefl.sh

index 41cf58d..1ad67f3 100644 (file)
@@ -1,4 +1,5 @@
 *.o
+*.dwo
 *.orig
 /*.list
 /out.*
index 3c83b0f..e0fa945 100644 (file)
@@ -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
         ;;
index 798742b..535a77c 100755 (executable)
@@ -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