Resolved C++14 Cmake build issues so correctly building to C99/C++14 standards
This commit is contained in:
parent
ada9425357
commit
14bd790701
|
@ -1,6 +1,16 @@
|
|||
cmake_minimum_required(VERSION 3.10)
|
||||
project(pinetime VERSION 0.14.0 LANGUAGES C CXX ASM)
|
||||
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
|
||||
# set(CMAKE_GENERATOR "Unix Makefiles")
|
||||
set(CMAKE_C_EXTENSIONS OFF)
|
||||
set(CMAKE_C_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
set(NRF_TARGET "nrf52")
|
||||
|
||||
if (NOT ARM_NONE_EABI_TOOLCHAIN_PATH)
|
||||
|
|
|
@ -36,9 +36,6 @@ macro(nRF5x_setup)
|
|||
set(CMAKE_OSX_SYSROOT "/")
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "")
|
||||
|
||||
# language standard/version settings
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
|
||||
# CPU specyfic settings
|
||||
if (NRF_TARGET MATCHES "nrf51")
|
||||
|
@ -86,8 +83,8 @@ macro(nRF5x_setup)
|
|||
set(CMAKE_CXX_FLAGS "${COMMON_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -g3")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
|
||||
set(CMAKE_ASM_FLAGS "-MP -MD -std=c99 -x assembler-with-cpp")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "-mthumb -mabi=aapcs -std=gnu++98 -std=c99 -L ${NRF5_SDK_PATH}/modules/nrfx/mdk -T${NRF5_LINKER_SCRIPT} ${CPU_FLAGS} -Wl,--gc-sections --specs=nano.specs -lc -lnosys -lm")
|
||||
set(CMAKE_ASM_FLAGS "-MP -MD -x assembler-with-cpp")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "-mthumb -mabi=aapcs -L ${NRF5_SDK_PATH}/modules/nrfx/mdk -T${NRF5_LINKER_SCRIPT} ${CPU_FLAGS} -Wl,--gc-sections --specs=nano.specs -lc -lnosys -lm")
|
||||
# note: we must override the default cmake linker flags so that CMAKE_C_FLAGS are not added implicitly
|
||||
set(CMAKE_C_LINK_EXECUTABLE "${CMAKE_C_COMPILER} <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
|
||||
set(CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_C_COMPILER} <LINK_FLAGS> <OBJECTS> -lstdc++ -o <TARGET> <LINK_LIBRARIES>")
|
||||
|
|
|
@ -3,16 +3,6 @@ cmake_minimum_required(VERSION 3.10)
|
|||
project(pinetime-app C CXX ASM)
|
||||
|
||||
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
|
||||
# set(CMAKE_GENERATOR "Unix Makefiles")
|
||||
set(CMAKE_C_EXTENSIONS OFF)
|
||||
set(CMAKE_C_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
# define some variables just for this example to determine file locations
|
||||
set(NRF_PROJECT_NAME pinetime-app)
|
||||
set(NRF_BOARD pca10040)
|
||||
|
@ -805,8 +795,6 @@ target_compile_options(${EXECUTABLE_NAME} PUBLIC
|
|||
set_target_properties(${EXECUTABLE_NAME} PROPERTIES
|
||||
SUFFIX ".out"
|
||||
LINK_FLAGS "-mthumb -mabi=aapcs -L ${NRF5_SDK_PATH}/modules/nrfx/mdk -T${NRF5_LINKER_SCRIPT} -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Wl,--gc-sections --specs=nano.specs -lc -lnosys -lm -Wl,-Map=${EXECUTABLE_FILE_NAME}.map"
|
||||
CXX_STANDARD 11
|
||||
C_STANDARD 99
|
||||
)
|
||||
|
||||
add_custom_command(TARGET ${EXECUTABLE_NAME}
|
||||
|
@ -837,8 +825,6 @@ target_compile_options(${EXECUTABLE_MCUBOOT_NAME} PUBLIC
|
|||
set_target_properties(${EXECUTABLE_MCUBOOT_NAME} PROPERTIES
|
||||
SUFFIX ".out"
|
||||
LINK_FLAGS "-mthumb -mabi=aapcs -L ${NRF5_SDK_PATH}/modules/nrfx/mdk -T${NRF5_LINKER_SCRIPT_MCUBOOT} -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Wl,--gc-sections --specs=nano.specs -lc -lnosys -lm -Wl,-Map=${EXECUTABLE_MCUBOOT_FILE_NAME}.map"
|
||||
CXX_STANDARD 11
|
||||
C_STANDARD 99
|
||||
)
|
||||
|
||||
add_custom_command(TARGET ${EXECUTABLE_MCUBOOT_NAME}
|
||||
|
@ -866,8 +852,6 @@ target_compile_options(${EXECUTABLE_GRAPHICS_NAME} PUBLIC
|
|||
set_target_properties(${EXECUTABLE_GRAPHICS_NAME} PROPERTIES
|
||||
SUFFIX ".out"
|
||||
LINK_FLAGS "-mthumb -mabi=aapcs -L ${NRF5_SDK_PATH}/modules/nrfx/mdk -T${NRF5_LINKER_SCRIPT} -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Wl,--gc-sections --specs=nano.specs -lc -lnosys -lm -Wl,-Map=${EXECUTABLE_GRAPHICS_FILE_NAME}.map"
|
||||
CXX_STANDARD 11
|
||||
C_STANDARD 99
|
||||
)
|
||||
|
||||
add_custom_command(TARGET ${EXECUTABLE_GRAPHICS_NAME}
|
||||
|
|
|
@ -24,6 +24,8 @@
|
|||
#include "drivers/Hrs3300.h"
|
||||
#include "main.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
using namespace Pinetime::System;
|
||||
|
||||
void IdleTimerCallback(TimerHandle_t xTimer) {
|
||||
|
@ -82,9 +84,9 @@ void SystemTask::Work() {
|
|||
motorController.Init();
|
||||
|
||||
|
||||
displayApp.reset(new Pinetime::Applications::DisplayApp(lcd, lvgl, touchPanel, batteryController, bleController,
|
||||
displayApp = std::make_unique<Pinetime::Applications::DisplayApp>(lcd, lvgl, touchPanel, batteryController, bleController,
|
||||
dateTimeController, watchdogView, *this, notificationManager,
|
||||
heartRateController));
|
||||
heartRateController);
|
||||
displayApp->Start();
|
||||
|
||||
batteryController.Update();
|
||||
|
|
Loading…
Reference in New Issue
Block a user