2015-09-15 14:17:21 +00:00
|
|
|
# This file is no longer auto-generated to make the repository builds with GCC
|
|
|
|
# and ARMCC no matter what.
|
|
|
|
|
2015-10-27 20:00:10 +00:00
|
|
|
cmake_minimum_required(VERSION 2.8.12)
|
2015-09-15 14:17:21 +00:00
|
|
|
|
|
|
|
enable_language(ASM)
|
|
|
|
|
|
|
|
set(YOTTA_AUTO_MICROBIT-DAL_CPP_FILES
|
2016-03-24 14:00:11 +00:00
|
|
|
"core/MemberFunctionCallback.cpp"
|
|
|
|
"core/MicroBitCompat.cpp"
|
|
|
|
"core/MicroBitDevice.cpp"
|
|
|
|
"core/MicroBitFiber.cpp"
|
|
|
|
"core/MicroBitFont.cpp"
|
|
|
|
"core/MicroBitHeapAllocator.cpp"
|
|
|
|
"core/MicroBitListener.cpp"
|
|
|
|
"core/MicroBitSystemTimer.cpp"
|
2018-05-29 17:09:48 +00:00
|
|
|
"core/MicroBitUtil.cpp"
|
2016-03-24 14:00:11 +00:00
|
|
|
|
2018-05-29 17:09:48 +00:00
|
|
|
"types/CoordinateSystem.cpp"
|
2016-03-24 14:00:11 +00:00
|
|
|
"types/ManagedString.cpp"
|
|
|
|
"types/MicroBitEvent.cpp"
|
|
|
|
"types/MicroBitImage.cpp"
|
|
|
|
"types/PacketBuffer.cpp"
|
|
|
|
"types/RefCounted.cpp"
|
|
|
|
|
|
|
|
"drivers/DynamicPwm.cpp"
|
|
|
|
"drivers/MicroBitAccelerometer.cpp"
|
|
|
|
"drivers/MicroBitButton.cpp"
|
|
|
|
"drivers/MicroBitCompass.cpp"
|
|
|
|
"drivers/MicroBitCompassCalibrator.cpp"
|
|
|
|
"drivers/MicroBitDisplay.cpp"
|
|
|
|
"drivers/MicroBitI2C.cpp"
|
|
|
|
"drivers/MicroBitIO.cpp"
|
|
|
|
"drivers/MicroBitLightSensor.cpp"
|
|
|
|
"drivers/MicroBitMessageBus.cpp"
|
|
|
|
"drivers/MicroBitMultiButton.cpp"
|
|
|
|
"drivers/MicroBitPin.cpp"
|
2016-11-07 18:53:04 +00:00
|
|
|
"drivers/MicroBitQuadratureDecoder.cpp"
|
2016-03-24 14:00:11 +00:00
|
|
|
"drivers/MicroBitRadio.cpp"
|
|
|
|
"drivers/MicroBitRadioDatagram.cpp"
|
|
|
|
"drivers/MicroBitRadioEvent.cpp"
|
|
|
|
"drivers/MicroBitSerial.cpp"
|
|
|
|
"drivers/MicroBitStorage.cpp"
|
|
|
|
"drivers/MicroBitThermometer.cpp"
|
2016-04-25 11:05:15 +00:00
|
|
|
"drivers/TimedInterruptIn.cpp"
|
2016-09-15 06:19:09 +00:00
|
|
|
"drivers/MicroBitFlash.cpp"
|
2016-09-16 16:31:20 +00:00
|
|
|
"drivers/MicroBitFile.cpp"
|
2016-09-15 06:19:09 +00:00
|
|
|
"drivers/MicroBitFileSystem.cpp"
|
2018-05-29 17:09:48 +00:00
|
|
|
"drivers/FXOS8700.cpp"
|
|
|
|
"drivers/MMA8653.cpp"
|
|
|
|
"drivers/MAG3110.cpp"
|
|
|
|
"drivers/LSM303Accelerometer.cpp"
|
|
|
|
"drivers/LSM303Magnetometer.cpp"
|
2018-04-16 16:27:14 +00:00
|
|
|
"drivers/MicroBitMemoryMap.cpp"
|
2016-03-24 14:00:11 +00:00
|
|
|
|
|
|
|
"bluetooth/MicroBitAccelerometerService.cpp"
|
|
|
|
"bluetooth/MicroBitBLEManager.cpp"
|
|
|
|
"bluetooth/MicroBitButtonService.cpp"
|
|
|
|
"bluetooth/MicroBitDFUService.cpp"
|
2016-11-30 10:43:53 +00:00
|
|
|
"bluetooth/MicroBitEddystone.cpp"
|
2016-03-24 14:00:11 +00:00
|
|
|
"bluetooth/MicroBitEventService.cpp"
|
|
|
|
"bluetooth/MicroBitIOPinService.cpp"
|
|
|
|
"bluetooth/MicroBitLEDService.cpp"
|
|
|
|
"bluetooth/MicroBitMagnetometerService.cpp"
|
|
|
|
"bluetooth/MicroBitTemperatureService.cpp"
|
2016-03-26 19:53:28 +00:00
|
|
|
"bluetooth/MicroBitUARTService.cpp"
|
2018-04-16 16:27:14 +00:00
|
|
|
"bluetooth/MicroBitPartialFlashingService.cpp"
|
|
|
|
|
2015-09-15 14:17:21 +00:00
|
|
|
)
|
|
|
|
|
2015-10-18 16:54:37 +00:00
|
|
|
execute_process(WORKING_DIRECTORY "../../yotta_modules/${PROJECT_NAME}" COMMAND "git" "log" "--pretty=format:%h" "-n" "1" OUTPUT_VARIABLE git_hash)
|
|
|
|
execute_process(WORKING_DIRECTORY "../../yotta_modules/${PROJECT_NAME}" COMMAND "git" "rev-parse" "--abbrev-ref" "HEAD" OUTPUT_VARIABLE git_branch OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
|
|
|
2015-10-27 19:25:21 +00:00
|
|
|
if ("${git_branch}" STREQUAL "master")
|
2015-10-18 16:54:37 +00:00
|
|
|
set(MICROBIT_DAL_VERSION_STRING "${YOTTA_MICROBIT_DAL_VERSION_STRING}")
|
|
|
|
else()
|
|
|
|
set(MICROBIT_DAL_VERSION_STRING "${YOTTA_MICROBIT_DAL_VERSION_STRING}-${git_branch}-g${git_hash}")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(MICROBIT_DAL_VERSION_FLAGS "-DMICROBIT_DAL_VERSION=\\\"${MICROBIT_DAL_VERSION_STRING}\\\"")
|
|
|
|
|
|
|
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MICROBIT_DAL_VERSION_FLAGS}")
|
|
|
|
|
2015-09-15 14:17:21 +00:00
|
|
|
if (YOTTA_CFG_MICROBIT_CONFIGFILE)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${YOTTA_FORCE_INCLUDE_FLAG} \"${YOTTA_CFG_MICROBIT_CONFIGFILE}\"")
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
if(CMAKE_COMPILER_IS_GNUCC)
|
|
|
|
file(REMOVE "asm/CortexContextSwitch.s")
|
|
|
|
configure_file("asm/CortexContextSwitch.s.gcc" "asm/CortexContextSwitch.s" COPYONLY)
|
|
|
|
else()
|
|
|
|
file(REMOVE "asm/CortexContextSwitch.s")
|
|
|
|
configure_file("asm/CortexContextSwitch.s.armcc" "asm/CortexContextSwitch.s" COPYONLY)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(YOTTA_AUTO_MICROBIT-DAL_S_FILES
|
|
|
|
"asm/CortexContextSwitch.s"
|
|
|
|
)
|
|
|
|
|
|
|
|
add_library(microbit-dal
|
|
|
|
${YOTTA_AUTO_MICROBIT-DAL_CPP_FILES}
|
|
|
|
${YOTTA_AUTO_MICROBIT-DAL_S_FILES}
|
|
|
|
)
|
|
|
|
|
|
|
|
yotta_postprocess_target(LIBRARY microbit-dal)
|
|
|
|
|
|
|
|
target_link_libraries(microbit-dal
|
|
|
|
mbed-classic
|
|
|
|
ble
|
|
|
|
ble-nrf51822
|
|
|
|
)
|
2015-10-27 19:53:37 +00:00
|
|
|
|
|
|
|
if(CMAKE_COMPILER_IS_GNUCC)
|
2016-01-13 19:51:49 +00:00
|
|
|
message("suppressing ALL warnings from mbed-classic, ble, ble-nrf51822 & nrf51-sdk")
|
2015-10-27 19:53:37 +00:00
|
|
|
target_compile_options(mbed-classic PRIVATE "-w")
|
|
|
|
target_compile_options(ble PRIVATE "-w")
|
|
|
|
target_compile_options(ble-nrf51822 PRIVATE "-w")
|
2016-01-13 19:51:49 +00:00
|
|
|
target_compile_options(nrf51-sdk PRIVATE "-w")
|
2015-10-27 19:53:37 +00:00
|
|
|
endif()
|