Browse Source

cmake: Test gcc toolchain is support armv7-a or not

Signed-off-by: sndnvaps <sndnvaps@gmail.com>
pull/48/head
sndnvaps 8 years ago
parent
commit
9133efb3ba
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      CMakeLists.txt

+ 8
- 0
CMakeLists.txt View File

@@ -1,6 +1,10 @@
cmake_minimum_required(VERSION 2.8)
project(WiringPi_lib)

include(CheckCCompilerFlag)
CHECK_C_COMPILER_FLAG("-march=armv7-a" COMPILER_SUPPORT_ARMV7_A)
if (COMPILER_SUPPORT_ARMV7_A)
MESSAGE("GCC Support armv7-a")
add_subdirectory(devLib)
add_subdirectory(gpio)
#add_subdirectory(pins)
@@ -20,3 +24,7 @@ SET(CPACK_PACKAGE_DESCRIPTION "WiringPi Library for RaspberryPi")
SET(CPACK_PACKAGE_CONTACT "sndnvaps@gmail.com")
INCLUDE(CPack)

else( not COMPILER_SUPPORT_ARMV7_A)
MESSAGE("GCC Not support armv7-a")
MESSAGE("You need to use Cross-Compiler to build it")
endif()

Loading…
Cancel
Save