Private
Public Access
2
0

npm: Fix npm builds for ARM hosts

NPM builds don't support cross compiling and will always compile for the host.
Binding.gyp now uses mraa_NPM_SRCS instead of mraa_LIB_SRCS_NOAUTO which
contains all platforms. Cmake now uses mraa_LIB_PLAT_SRCS_NOAUTO to provide all
the sources. NPM builds will build objects for all platforms reguardless of
space which does meann slightly bigger binaries.

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll
2015-07-24 13:07:00 +00:00
parent 5717bba0d4
commit 9c0753cb18
5 changed files with 38 additions and 21 deletions

View File

@@ -18,6 +18,22 @@ set (mraa_LIB_SRCS_NOAUTO
${PROJECT_SOURCE_DIR}/src/uart/uart.c
)
set (mraa_LIB_X86_SRCS_NOAUTO
${PROJECT_SOURCE_DIR}/src/x86/x86.c
${PROJECT_SOURCE_DIR}/src/x86/intel_galileo_rev_d.c
${PROJECT_SOURCE_DIR}/src/x86/intel_galileo_rev_g.c
${PROJECT_SOURCE_DIR}/src/x86/intel_edison_fab_c.c
${PROJECT_SOURCE_DIR}/src/x86/intel_de3815.c
${PROJECT_SOURCE_DIR}/src/x86/intel_minnow_max.c
)
set (mraa_LIB_ARM_SRCS_NOAUTO
${PROJECT_SOURCE_DIR}/src/arm/arm.c
${PROJECT_SOURCE_DIR}/src/arm/raspberry_pi.c
${PROJECT_SOURCE_DIR}/src/arm/beaglebone.c
${PROJECT_SOURCE_DIR}/src/arm/banana.c
)
if (X86PLAT)
add_subdirectory(x86)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DX86PLAT=1")
@@ -29,7 +45,7 @@ if (ARMPLAT)
endif()
set (mraa_LIB_SRCS
${mraa_LIB_SRCS_NOAUTO}
${mraa_LIB_PLAT_SRCS_NOAUTO}
# autogenerated version file
${CMAKE_CURRENT_BINARY_DIR}/version.c
)