Add option to generate compile-commands.json 21/243821/1 accepted/tizen/unified/20200914.131338 submit/tizen/20200913.215058
authorBartlomiej Grzelewski <b.grzelewski@samsung.com>
Wed, 9 Sep 2020 10:11:18 +0000 (12:11 +0200)
committerBartlomiej Grzelewski <b.grzelewski@samsung.com>
Thu, 10 Sep 2020 08:25:59 +0000 (10:25 +0200)
Run local build with --define "compile_commands 1" option to
generate compile-commands.json required to build mockups.

Change-Id: I749edefe0550665ccc660546b41f241f2020e3bc

CMakeLists.txt
packaging/org.tizen.screen-reader.spec

index 945533c291f44def634a422689f000802da2ef26..6fb7b09191b7bdb0724f08c8b5df751a12e04a45 100755 (executable)
@@ -5,8 +5,10 @@ ENABLE_TESTING()
 #AUX_SOURCE_DIRECTORY(${CMAKE_SOURCE_DIR}/src SRCS)
 
 #this values are required to generate mockups
-SET(CMAKE_EXPORT_COMPILE_COMMANDS "ON")
-ADD_DEFINITIONS("-DTIZEN_GTEST")
+IF("${COMPILE_COMMANDS}" STREQUAL "1")
+    SET(CMAKE_EXPORT_COMPILE_COMMANDS "ON")
+    ADD_DEFINITIONS("-DTIZEN_GTEST")
+ENDIF("${COMPILE_COMMANDS}" STREQUAL "1")
 
 SET(SRCS ${CMAKE_SOURCE_DIR}/src/app_tracker.c
         ${CMAKE_SOURCE_DIR}/src/flat_navi.c
index 29535d1e77d9f5b98eac7e30bdd35401aa978d96..02748467aff6eb48c08f8ab5ae8b4e45899e458e 100755 (executable)
@@ -1,4 +1,5 @@
 %{!?unittest:%global unittest 0}
+%{!?compile_commands:%global compile_commands 0}
 
 Name:       org.tizen.screen-reader
 Summary:    Screen Reader Assistive Technology
@@ -99,6 +100,7 @@ cmake . -DCMAKE_INSTALL_PREFIX="%{AppDir}" \
         -DTZ_SYS_RO_APP=%{TZ_SYS_RO_APP} \
         -DTZ_SYS_RO_PACKAGES=%{TZ_SYS_RO_PACKAGES} \
         -DSEC_FEATURE_TAPI_ENABLE=${SEC_FEATURE_TAPI_ENABLE} \
+        -DCOMPILE_COMMANDS=%{compile_commands} \
         -DUNITTEST=%{unittest}
 
 VERBOSE=1 make %{?jobs:-j%jobs} \