Skip to content

Commit 1c0d4f1

Browse files
committed
cmake: Do not use -fdebug-prefix-map when building for RPM packages because this interferes with rpmbuild.
1 parent 318b5d0 commit 1c0d4f1

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

cdk/cmake/compiler/GCC.cmake

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,22 @@
3232
# Ensure relative source locations in debug entries
3333
#
3434

35-
foreach(LANG C CXX)
36-
foreach(TYPE DEBUG RELWITHDEBINFO)
37-
set(CMAKE_${LANG}_FLAGS_${TYPE}
38-
"-fdebug-prefix-map=${CMAKE_SOURCE_DIR}=. ${CMAKE_${LANG}_FLAGS_${TYPE}}"
39-
)
40-
endforeach(TYPE)
41-
endforeach(LANG)
35+
option(DEBUG_PREFIX_MAP
36+
"Set -fdebug-prefix-map option to ensure relative source locations in debug entries."
37+
ON
38+
)
39+
40+
if(DEBUG_PREFIX_MAP)
41+
42+
foreach(LANG C CXX)
43+
foreach(TYPE DEBUG RELWITHDEBINFO)
44+
set(CMAKE_${LANG}_FLAGS_${TYPE}
45+
"-fdebug-prefix-map=${CMAKE_SOURCE_DIR}=. ${CMAKE_${LANG}_FLAGS_${TYPE}}"
46+
)
47+
endforeach(TYPE)
48+
endforeach(LANG)
49+
50+
endif(DEBUG_PREFIX_MAP)
4251

4352
#
4453
# Deal with broken optimization in gcc 4.8.

packaging/mysql-connector-c++.spec.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ test suite for MySQL Connector/C++
130130
%endif
131131

132132
%global __cmake_explicit_opts -DCMAKE_INSTALL_PREFIX="%_prefix" -DCMAKE_C_FLAGS:STRING="%optflags" -DCMAKE_CXX_FLAGS:STRING="%optflags"
133-
%global __cmake_common_opts -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_INCLUDEDIR=%{_includedir}/mysql-cppconn-8 -DWITH_JDBC=ON -DWITH_SSL=system %{__cmake_test_opts} %{?mysql_opt}
133+
%global __cmake_common_opts -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_INCLUDEDIR=%{_includedir}/mysql-cppconn-8 -DWITH_JDBC=ON -DWITH_SSL=system %{__cmake_test_opts} %{?mysql_opt} -DDEBUG_PREFIX_MAP=OFF
134134

135135
%if 0%{?rhel}
136136
%global __cmake_cmd cmake3 %{__cmake_common_opts} %{__cmake_explicit_opts} ..

0 commit comments

Comments
 (0)