Official Sheffield ARMBand micro:bit program
microbit/microbit-dal/source/CMakeLists.txt@0:b9164b348919, 2016-10-17 (annotated)
- Committer:
- MrBedfordVan
- Date:
- Mon Oct 17 12:41:20 2016 +0000
- Revision:
- 0:b9164b348919
Official Sheffield ARMBand Micro:bit program
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
MrBedfordVan | 0:b9164b348919 | 1 | # This file is no longer auto-generated to make the repository builds with GCC |
MrBedfordVan | 0:b9164b348919 | 2 | # and ARMCC no matter what. |
MrBedfordVan | 0:b9164b348919 | 3 | |
MrBedfordVan | 0:b9164b348919 | 4 | cmake_minimum_required(VERSION 2.8.12) |
MrBedfordVan | 0:b9164b348919 | 5 | |
MrBedfordVan | 0:b9164b348919 | 6 | enable_language(ASM) |
MrBedfordVan | 0:b9164b348919 | 7 | |
MrBedfordVan | 0:b9164b348919 | 8 | set(YOTTA_AUTO_MICROBIT-DAL_CPP_FILES |
MrBedfordVan | 0:b9164b348919 | 9 | "core/MemberFunctionCallback.cpp" |
MrBedfordVan | 0:b9164b348919 | 10 | "core/MicroBitCompat.cpp" |
MrBedfordVan | 0:b9164b348919 | 11 | "core/MicroBitDevice.cpp" |
MrBedfordVan | 0:b9164b348919 | 12 | "core/MicroBitFiber.cpp" |
MrBedfordVan | 0:b9164b348919 | 13 | "core/MicroBitFont.cpp" |
MrBedfordVan | 0:b9164b348919 | 14 | "core/MicroBitHeapAllocator.cpp" |
MrBedfordVan | 0:b9164b348919 | 15 | "core/MicroBitListener.cpp" |
MrBedfordVan | 0:b9164b348919 | 16 | "core/MicroBitSystemTimer.cpp" |
MrBedfordVan | 0:b9164b348919 | 17 | |
MrBedfordVan | 0:b9164b348919 | 18 | "types/ManagedString.cpp" |
MrBedfordVan | 0:b9164b348919 | 19 | "types/Matrix4.cpp" |
MrBedfordVan | 0:b9164b348919 | 20 | "types/MicroBitEvent.cpp" |
MrBedfordVan | 0:b9164b348919 | 21 | "types/MicroBitImage.cpp" |
MrBedfordVan | 0:b9164b348919 | 22 | "types/PacketBuffer.cpp" |
MrBedfordVan | 0:b9164b348919 | 23 | "types/RefCounted.cpp" |
MrBedfordVan | 0:b9164b348919 | 24 | |
MrBedfordVan | 0:b9164b348919 | 25 | "drivers/DynamicPwm.cpp" |
MrBedfordVan | 0:b9164b348919 | 26 | "drivers/MicroBitAccelerometer.cpp" |
MrBedfordVan | 0:b9164b348919 | 27 | "drivers/MicroBitButton.cpp" |
MrBedfordVan | 0:b9164b348919 | 28 | "drivers/MicroBitCompass.cpp" |
MrBedfordVan | 0:b9164b348919 | 29 | "drivers/MicroBitCompassCalibrator.cpp" |
MrBedfordVan | 0:b9164b348919 | 30 | "drivers/MicroBitDisplay.cpp" |
MrBedfordVan | 0:b9164b348919 | 31 | "drivers/MicroBitI2C.cpp" |
MrBedfordVan | 0:b9164b348919 | 32 | "drivers/MicroBitIO.cpp" |
MrBedfordVan | 0:b9164b348919 | 33 | "drivers/MicroBitLightSensor.cpp" |
MrBedfordVan | 0:b9164b348919 | 34 | "drivers/MicroBitMessageBus.cpp" |
MrBedfordVan | 0:b9164b348919 | 35 | "drivers/MicroBitMultiButton.cpp" |
MrBedfordVan | 0:b9164b348919 | 36 | "drivers/MicroBitPin.cpp" |
MrBedfordVan | 0:b9164b348919 | 37 | "drivers/MicroBitRadio.cpp" |
MrBedfordVan | 0:b9164b348919 | 38 | "drivers/MicroBitRadioDatagram.cpp" |
MrBedfordVan | 0:b9164b348919 | 39 | "drivers/MicroBitRadioEvent.cpp" |
MrBedfordVan | 0:b9164b348919 | 40 | "drivers/MicroBitSerial.cpp" |
MrBedfordVan | 0:b9164b348919 | 41 | "drivers/MicroBitStorage.cpp" |
MrBedfordVan | 0:b9164b348919 | 42 | "drivers/MicroBitThermometer.cpp" |
MrBedfordVan | 0:b9164b348919 | 43 | "drivers/TimedInterruptIn.cpp" |
MrBedfordVan | 0:b9164b348919 | 44 | |
MrBedfordVan | 0:b9164b348919 | 45 | "bluetooth/MicroBitAccelerometerService.cpp" |
MrBedfordVan | 0:b9164b348919 | 46 | "bluetooth/MicroBitBLEManager.cpp" |
MrBedfordVan | 0:b9164b348919 | 47 | "bluetooth/MicroBitButtonService.cpp" |
MrBedfordVan | 0:b9164b348919 | 48 | "bluetooth/MicroBitDFUService.cpp" |
MrBedfordVan | 0:b9164b348919 | 49 | "bluetooth/MicroBitEventService.cpp" |
MrBedfordVan | 0:b9164b348919 | 50 | "bluetooth/MicroBitIOPinService.cpp" |
MrBedfordVan | 0:b9164b348919 | 51 | "bluetooth/MicroBitLEDService.cpp" |
MrBedfordVan | 0:b9164b348919 | 52 | "bluetooth/MicroBitMagnetometerService.cpp" |
MrBedfordVan | 0:b9164b348919 | 53 | "bluetooth/MicroBitTemperatureService.cpp" |
MrBedfordVan | 0:b9164b348919 | 54 | "bluetooth/MicroBitUARTService.cpp" |
MrBedfordVan | 0:b9164b348919 | 55 | ) |
MrBedfordVan | 0:b9164b348919 | 56 | |
MrBedfordVan | 0:b9164b348919 | 57 | execute_process(WORKING_DIRECTORY "../../yotta_modules/${PROJECT_NAME}" COMMAND "git" "log" "--pretty=format:%h" "-n" "1" OUTPUT_VARIABLE git_hash) |
MrBedfordVan | 0:b9164b348919 | 58 | execute_process(WORKING_DIRECTORY "../../yotta_modules/${PROJECT_NAME}" COMMAND "git" "rev-parse" "--abbrev-ref" "HEAD" OUTPUT_VARIABLE git_branch OUTPUT_STRIP_TRAILING_WHITESPACE) |
MrBedfordVan | 0:b9164b348919 | 59 | |
MrBedfordVan | 0:b9164b348919 | 60 | if ("${git_branch}" STREQUAL "master") |
MrBedfordVan | 0:b9164b348919 | 61 | set(MICROBIT_DAL_VERSION_STRING "${YOTTA_MICROBIT_DAL_VERSION_STRING}") |
MrBedfordVan | 0:b9164b348919 | 62 | else() |
MrBedfordVan | 0:b9164b348919 | 63 | set(MICROBIT_DAL_VERSION_STRING "${YOTTA_MICROBIT_DAL_VERSION_STRING}-${git_branch}-g${git_hash}") |
MrBedfordVan | 0:b9164b348919 | 64 | endif() |
MrBedfordVan | 0:b9164b348919 | 65 | |
MrBedfordVan | 0:b9164b348919 | 66 | set(MICROBIT_DAL_VERSION_FLAGS "-DMICROBIT_DAL_VERSION=\\\"${MICROBIT_DAL_VERSION_STRING}\\\"") |
MrBedfordVan | 0:b9164b348919 | 67 | |
MrBedfordVan | 0:b9164b348919 | 68 | set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MICROBIT_DAL_VERSION_FLAGS}") |
MrBedfordVan | 0:b9164b348919 | 69 | |
MrBedfordVan | 0:b9164b348919 | 70 | if (YOTTA_CFG_MICROBIT_CONFIGFILE) |
MrBedfordVan | 0:b9164b348919 | 71 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${YOTTA_FORCE_INCLUDE_FLAG} \"${YOTTA_CFG_MICROBIT_CONFIGFILE}\"") |
MrBedfordVan | 0:b9164b348919 | 72 | endif () |
MrBedfordVan | 0:b9164b348919 | 73 | |
MrBedfordVan | 0:b9164b348919 | 74 | if(CMAKE_COMPILER_IS_GNUCC) |
MrBedfordVan | 0:b9164b348919 | 75 | file(REMOVE "asm/CortexContextSwitch.s") |
MrBedfordVan | 0:b9164b348919 | 76 | configure_file("asm/CortexContextSwitch.s.gcc" "asm/CortexContextSwitch.s" COPYONLY) |
MrBedfordVan | 0:b9164b348919 | 77 | else() |
MrBedfordVan | 0:b9164b348919 | 78 | file(REMOVE "asm/CortexContextSwitch.s") |
MrBedfordVan | 0:b9164b348919 | 79 | configure_file("asm/CortexContextSwitch.s.armcc" "asm/CortexContextSwitch.s" COPYONLY) |
MrBedfordVan | 0:b9164b348919 | 80 | endif() |
MrBedfordVan | 0:b9164b348919 | 81 | |
MrBedfordVan | 0:b9164b348919 | 82 | set(YOTTA_AUTO_MICROBIT-DAL_S_FILES |
MrBedfordVan | 0:b9164b348919 | 83 | "asm/CortexContextSwitch.s" |
MrBedfordVan | 0:b9164b348919 | 84 | ) |
MrBedfordVan | 0:b9164b348919 | 85 | |
MrBedfordVan | 0:b9164b348919 | 86 | add_library(microbit-dal |
MrBedfordVan | 0:b9164b348919 | 87 | ${YOTTA_AUTO_MICROBIT-DAL_CPP_FILES} |
MrBedfordVan | 0:b9164b348919 | 88 | ${YOTTA_AUTO_MICROBIT-DAL_S_FILES} |
MrBedfordVan | 0:b9164b348919 | 89 | ) |
MrBedfordVan | 0:b9164b348919 | 90 | |
MrBedfordVan | 0:b9164b348919 | 91 | yotta_postprocess_target(LIBRARY microbit-dal) |
MrBedfordVan | 0:b9164b348919 | 92 | |
MrBedfordVan | 0:b9164b348919 | 93 | target_link_libraries(microbit-dal |
MrBedfordVan | 0:b9164b348919 | 94 | mbed-classic |
MrBedfordVan | 0:b9164b348919 | 95 | ble |
MrBedfordVan | 0:b9164b348919 | 96 | ble-nrf51822 |
MrBedfordVan | 0:b9164b348919 | 97 | ) |
MrBedfordVan | 0:b9164b348919 | 98 | |
MrBedfordVan | 0:b9164b348919 | 99 | if(CMAKE_COMPILER_IS_GNUCC) |
MrBedfordVan | 0:b9164b348919 | 100 | message("suppressing ALL warnings from mbed-classic, ble, ble-nrf51822 & nrf51-sdk") |
MrBedfordVan | 0:b9164b348919 | 101 | target_compile_options(mbed-classic PRIVATE "-w") |
MrBedfordVan | 0:b9164b348919 | 102 | target_compile_options(ble PRIVATE "-w") |
MrBedfordVan | 0:b9164b348919 | 103 | target_compile_options(ble-nrf51822 PRIVATE "-w") |
MrBedfordVan | 0:b9164b348919 | 104 | target_compile_options(nrf51-sdk PRIVATE "-w") |
MrBedfordVan | 0:b9164b348919 | 105 | endif() |