Package: cmake-extras
Version: 1.10-1
User: [email protected]
Usertags: ftcbfs
Control: affects -1 + src:dbus-cpp
We keep revisiting GMock. This time around dbus-cpp. It fails to cross
build. When it builds GMock, it detects the C compiler as /usr/bin/cc
and figures that it doesn't work. This happens e.g. when compiling for
arm64 on amd64, because both architectures have architecture-dependent
compiler flags and while CFLAGS is forwarded via the environment, the C
compiler is not, so the amd64 compiler is unhappy about the arm64 flags.
So we actually need to forward the C compiler as well (in addition to
the C++ compiler we are already forwarding). Please find another patch
attached.
Helmut
--- cmake-extras-1.10.orig/src/GMock/GMockConfig.cmake
+++ cmake-extras-1.10/src/GMock/GMockConfig.cmake
@@ -145,7 +145,9 @@ ExternalProject_Add(GMock SOURCE_DIR "${
"${findgmock_gmock_main_lib}"
"${findgmock_gmock_lib}"
INSTALL_COMMAND ""
- CMAKE_ARGS "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}"
+ CMAKE_ARGS "-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}"
+ "-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}"
+ "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}"
"-DCMAKE_CXX_FLAGS=${findgmock_cxx_flags}"
"-DBUILD_SHARED_LIBS=${GMOCK_BUILD_SHARED_LIBS}")