Mir

Merge lp:~kdub/mir/fix-1493895 into lp:mir

Proposed by Kevin DuBois
Status: Merged
Approved by: Cemil Azizoglu
Approved revision: no longer in the source branch.
Merged at revision: 2920
Proposed branch: lp:~kdub/mir/fix-1493895
Merge into: lp:mir
Diff against target: 37 lines (+13/-3)
2 files modified
cmake/FindGtestGmock.cmake (+6/-1)
cmake/LinuxCrossCompile.cmake (+7/-2)
To merge this branch: bzr merge lp:~kdub/mir/fix-1493895
Reviewer Review Type Date Requested Status
Cemil Azizoglu (community) Approve
Alan Griffiths Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+270550@code.launchpad.net

Commit message

fix sbuild cross compilation failure by passing the compiler variables to the gtest/gmock sub-project instead of our toolchain file. Also allow for setting MIR_TARGET_MACHINE and MIR_GCC_VARIANT via cmake -DMIR_TARGET_MACHINE=... (previously it was had to be set in the environment)

fixes: lp: #1493895

Description of the change

fix sbuild cross compilation failure by passing the compiler variables to the gtest/gmock sub-project instead of our toolchain file. Also allow for setting MIR_TARGET_MACHINE and MIR_GCC_VARIANT via cmake -DMIR_TARGET_MACHINE=... (previously it was had to be set in the environment)

fixes: lp: #1493895

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

OK

review: Approve
Revision history for this message
Cemil Azizoglu (cemil-azizoglu) wrote :

ok

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'cmake/FindGtestGmock.cmake'
2--- cmake/FindGtestGmock.cmake 2015-09-02 10:04:23 +0000
3+++ cmake/FindGtestGmock.cmake 2015-09-09 18:37:59 +0000
4@@ -29,7 +29,12 @@
5 list(APPEND GTEST_CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER})
6 list(APPEND GTEST_CMAKE_ARGS -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER})
7 if (${CMAKE_CROSSCOMPILING})
8- list(APPEND GTEST_CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_MODULE_PATH}/LinuxCrossCompile.cmake)
9+ if(DEFINED MIR_NDK_PATH)
10+ list(APPEND GTEST_CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_MODULE_PATH}/LinuxCrossCompile.cmake)
11+ else()
12+ list(APPEND GTEST_CMAKE_ARGS -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER})
13+ list(APPEND GTEST_CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER})
14+ endif()
15 endif()
16
17 ExternalProject_Add(
18
19=== modified file 'cmake/LinuxCrossCompile.cmake'
20--- cmake/LinuxCrossCompile.cmake 2015-09-02 10:29:38 +0000
21+++ cmake/LinuxCrossCompile.cmake 2015-09-09 18:37:59 +0000
22@@ -2,8 +2,13 @@
23 set(CMAKE_SYSTEM_VERSION 1)
24
25 set(MIR_NDK_PATH $ENV{MIR_NDK_PATH} CACHE STRING "path of mir android bundle")
26-set(MIR_TARGET_MACHINE $ENV{MIR_TARGET_MACHINE} CACHE STRING "target machine")
27-set(MIR_GCC_VARIANT $ENV{MIR_GCC_VARIANT} CACHE STRING "gcc variant required")
28+
29+if (NOT DEFINED MIR_TARGET_MACHINE)
30+ set(MIR_TARGET_MACHINE $ENV{MIR_TARGET_MACHINE} CACHE STRING "target machine")
31+endif()
32+if (NOT DEFINED MIR_GCC_VARIANT)
33+ set(MIR_GCC_VARIANT $ENV{MIR_GCC_VARIANT} CACHE STRING "gcc variant required")
34+endif()
35
36 set(CMAKE_C_COMPILER /usr/bin/${MIR_TARGET_MACHINE}-gcc${MIR_GCC_VARIANT})
37 set(CMAKE_CXX_COMPILER /usr/bin/${MIR_TARGET_MACHINE}-g++${MIR_GCC_VARIANT})

Subscribers

People subscribed via source and target branches