Skip to content

Commit

Permalink
- Adding ARM cross compilation toolchain
Browse files Browse the repository at this point in the history
- Fixing some cross compilation issues
- Fixing non standard include
  • Loading branch information
sithhell committed Apr 21, 2015
1 parent 3172c9a commit 9303e9a
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 4 deletions.
15 changes: 15 additions & 0 deletions cmake/toolchains/ARM-gcc.cmake
@@ -0,0 +1,15 @@
set(CMAKE_SYSTEM_NAME Linux)

This comment has been minimized.

Copy link
@hkaiser

hkaiser Apr 21, 2015

Member

You missed the copyright and license in this file


set(CMAKE_CROSSCOMPILING ON)

# Set the gcc Compiler
set(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++-4.8)
set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc-4.8)

set(HPX_WITH_GENERIC_CONTEXT_COROUTINES ON CACHE BOOL "enable generic coroutines")

set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

This comment has been minimized.

Copy link
@hkaiser

hkaiser Apr 21, 2015

Member

Shouldn't that cause some doc changes as well? Did you forget to commit those?

2 changes: 1 addition & 1 deletion hpx/util/hardware/timestamp.hpp
Expand Up @@ -19,7 +19,7 @@
|| defined(_M_IX86) || defined(__X86__) || defined(_X86_) \
|| defined(__THW_INTEL__) || defined(__I86__) || defined(__INTEL__)
#include <hpx/util/hardware/timestamp/linux_x86_32.hpp>
#elif defined(__ANDROID__) && defined(ANDROID)
#elif (defined(__ANDROID__) && defined(ANDROID)) || defined(__arm__)
#include <hpx/util/hardware/timestamp/linux_generic.hpp>
#elif defined(__powerpc__)
#include <hpx/util/hardware/timestamp/linux_generic.hpp>
Expand Down
19 changes: 18 additions & 1 deletion tests/unit/build/CMakeLists.txt
Expand Up @@ -14,12 +14,24 @@ macro(create_cmake_test name hpx_dir)
add_custom_target(${name}.make_build_dir
COMMAND "${CMAKE_COMMAND}" -E make_directory "${build_dir}" VERBATIM
)
set(ADDITIONAL_CMAKE_OPTIONS)
if(CMAKE_TOOLCHAIN_FILE)
set(ADDITIONAL_CMAKE_OPTIONS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE})
endif()
if(CMAKE_MAKE_COMMAND)
set(ADDITIONAL_CMAKE_OPTIONS ${ADDITIONAL_CMAKE_OPTIONS} -DCMAKE_MAKE_COMMAND=${CMAKE_MAKE_COMMAND})
endif()
if(CMAKE_SYSROOT)
set(ADDITIONAL_CMAKE_OPTIONS ${ADDITIONAL_CMAKE_OPTIONS} -DCMAKE_SYSROOT=${CMAKE_SYSROOT})
endif()

This comment has been minimized.

Copy link
@hkaiser

hkaiser Apr 21, 2015

Member

I always assumed that we have the convention to name all non-cached cmake variables using lower case letters only. Am I wrong?

This comment has been minimized.

Copy link
@sithhell

sithhell Apr 21, 2015

Author Member

I don't remember that convention and I'm totally impartial... This convention would have to be applied in a lot of places though.

add_custom_target(${name}.make_configure
COMMAND
"${CMAKE_COMMAND}" -E chdir "${build_dir}" "${CMAKE_COMMAND}"
"${hpx_SOURCE_DIR}/tests/unit/build/src"
-DHPX_DIR=${hpx_dir}
${ADDITIONAL_CMAKE_OPTIONS}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS_SAFE}
-DCMAKE_BUILD_TYPE=$<CONFIGURATION> VERBATIM)
add_dependencies(${name}.make_configure ${name}.make_build_dir hpx iostreams_component)
Expand Down Expand Up @@ -99,7 +111,12 @@ set(tests
build_dir
install_dir)

foreach(system cmake pkgconfig)
set(build_systems cmake)
if(NOT CMAKE_TOOLCHAIN_FILE)
set(build_systems ${build_sytems} pkgconfig)
endif()

foreach(system ${build_systems})
add_hpx_pseudo_target(tests.unit.build.${system})
foreach(test ${tests})
add_hpx_pseudo_target(tests.unit.build.${system}.${test})
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/util/stencil3_iterator.cpp
Expand Up @@ -9,7 +9,7 @@

#include <hpx/util/transform_iterator.hpp>

#include <strstream>
#include <sstream>

///////////////////////////////////////////////////////////////////////////////
namespace test
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/util/transform_iterator.cpp
Expand Up @@ -9,7 +9,7 @@

#include <hpx/util/transform_iterator.hpp>

#include <strstream>
#include <sstream>
#include <iterator>
#include <vector>
#include <algorithm>
Expand Down

0 comments on commit 9303e9a

Please sign in to comment.