Skip to content

Commit 4d6f4e4

Browse files
Artem Gindinsonigcbot
authored andcommitted
Produce debug information packages for IGC
Generate debug symbols during `Release` builds. For all configurations, pack IGC debug symbols into `.ddeb` archives and copy those into the artifacts folder alongside the regular Debian packages. For reference on the chosen CMake version limitations, see CMake GitLab issue: https://gitlab.kitware.com/cmake/cmake/-/issues/21356.
1 parent 76c4cdf commit 4d6f4e4

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

IGC/CMakeLists.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,17 @@ set_source_files_properties(${IGC_CODEGEN_DIR}/MDNodeFunctions.gen PROPERTIES GE
210210
# The section must be after project definition and its supported languages because otherwise
211211
# used variables are not available yet.
212212

213+
# Generate debug symbols even in release mode, thus making it possible to produce
214+
# separate Debian/RPM debug information packages.
215+
# FIXME: Instead of hacking the release build flags, consider using CMake's
216+
# RelWithDebInfo build type.
217+
if(UNIX)
218+
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -g")
219+
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -g")
220+
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -g")
221+
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -g")
222+
endif()
223+
213224

214225
# Populating global property with list of debug configurations (based on pattern).
215226
set(_debugConfigs)
@@ -2062,6 +2073,11 @@ if(UNIX)
20622073
set(CPACK_ARCHIVE_IGC-OPENCL_FILE_NAME "intel-igc-opencl-${CPACK_PACKAGE_VERSION}.${CPACK_PACKAGE_ARCHITECTURE}")
20632074
set(CPACK_ARCHIVE_IGC-OPENCL-DEVEL_FILE_NAME "intel-igc-opencl-devel-${CPACK_PACKAGE_VERSION}.${CPACK_PACKAGE_ARCHITECTURE}")
20642075

2076+
# Create separate debug symbol packages if the CMake/CPack version in use
2077+
# provides stable support for that functionality.
2078+
if (NOT CMAKE_VERSION VERSION_LESS 3.20)
2079+
set(CPACK_DEBIAN_DEBUGINFO_PACKAGE ON)
2080+
endif()
20652081
set(CPACK_DEB_COMPONENT_INSTALL ON)
20662082
set(CPACK_RPM_COMPONENT_INSTALL ON)
20672083
set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)

scripts/buildIGC.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,5 +106,6 @@ make -j`nproc`
106106
echo "[Build Status] make DONE"
107107
cpack
108108
mkdir DEB-FILES && mv ./*.deb ./DEB-FILES
109+
mkdir DEB-FILES/dbgsym && mv ./*.ddeb ./DEB-FILES/dbgsym
109110
echo "[Build Status] cpack DONE"
110111
echo "====================BUILD IGC========================="

0 commit comments

Comments
 (0)