Exclude static linking for TV build 02/321302/1 accepted/tizen_unified accepted/tizen_unified_x tizen accepted/tizen/unified/20250319.072543 accepted/tizen/unified/x/20250319.090605
authorUnsung Lee <unsung.lee@samsung.com>
Tue, 18 Mar 2025 05:49:00 +0000 (14:49 +0900)
committerUnsung Lee <unsung.lee@samsung.com>
Tue, 18 Mar 2025 12:02:48 +0000 (21:02 +0900)
Exclude code of static linking in spec and CMakeLists for TV build environment.
This is because there are no static packages in TV build environment.

Change-Id: I3e720b12e6efee4bffe73caef84700c9886e4701
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
delta-verifier/CMakeLists.txt
packaging/update-control.spec

index 57e4f56f47c59a7a5e4af6a43a7e4cf3fa243fce..ac2042b306b9d66913b169e8e5308aae0a7816c5 100644 (file)
@@ -4,19 +4,31 @@ SET(SRCS
                delta-verifier.c
 )
 
-SET(ADD_LIBS libcapi-system-info.a libcapi-base-common.a libglib-2.0.a libc.a libdlog.a)
-
 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -I./include")
 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIE")
-SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie -static")
 
 SET(EXECNAME "delta-verifier")
 ADD_EXECUTABLE(${EXECNAME} ${SRCS})
 
+if(STATIC_LINKING EQUAL 1)
+SET(ADD_LIBS libcapi-system-info.a libcapi-base-common.a libglib-2.0.a libc.a libdlog.a)
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie -static")
+
 SET_TARGET_PROPERTIES(${EXECNAME} PROPERTIES
     LINK_SEARCH_START_STATIC ON
     LINK_SEARCH_END_STATIC ON
 )
+else()
+SET(ADD_LIBS "")
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(${PROJECT_NAME}_pkgs REQUIRED capi-system-info)
+
+FOREACH(flag ${${PROJECT_NAME}_pkgs_CFLAGS})
+       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+endif()
 
 TARGET_LINK_LIBRARIES(${EXECNAME} PRIVATE ${${PROJECT_NAME}_pkgs_LDFLAGS} "-g" "-pthread" ${ADD_LIBS})
 INSTALL(TARGETS ${EXECNAME} DESTINATION bin)
index ae11629e6d260a86c1b44376cf045df899c27866..16374842a2951bf8278f0dba92efa0fa854652ee 100644 (file)
@@ -1,3 +1,9 @@
+%if "%{?tizen_profile_name}" == "tv"
+%define WITH_VD 1
+%else
+%define WITH_VD 0
+%endif
+
 # update manager
 %define dbus_conf_directory %{_sysconfdir}/dbus-1/system.d
 %define dbus_conf_file update-manager.conf
@@ -30,11 +36,13 @@ BuildRequires:  pkgconfig(vconf)
 BuildRequires:  pkgconfig(libsyscommon-plugin-api-update-control)
 BuildRequires:  libtar-devel
 BuildRequires:  python3-setuptools
+%if "%{?WITH_VD}" == "0"
 BuildRequires:  glibc-devel-static
 BuildRequires:  glib2-devel-static
 BuildRequires:  capi-system-info-devel-static
 BuildRequires:  capi-base-common-devel-static
 BuildRequires:  libdlog-devel-static
+%endif
 
 %description
 An Update Control library in Tizen C API
@@ -81,7 +89,12 @@ export CFLAGS+=" -Wno-stringop-truncation"
         -DFULLVER=%{version} \
         -DDEBUG_MODE=on \
         -DBINARY_PATH=%{_bindir} \
-        -DGCOV=%{?gcov:1}%{!?gcov:0}
+        -DGCOV=%{?gcov:1}%{!?gcov:0} \
+%if "%{?WITH_VD}" == "1"
+        -DSTATIC_LINKING=0
+%else
+        -DSTATIC_LINKING=1
+%endif
 
 %__make %{?jobs:-j%jobs}