From faf8d3118a3e7a12345c2ad444006475e65898ef Mon Sep 17 00:00:00 2001 From: df8oe Date: Tue, 6 Jun 2017 09:23:55 +0200 Subject: [PATCH] added Linux support to cmake --- CMakeLists.txt | 14 +++++++++----- main.c | 6 +++--- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index edbf738..0984f7c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,12 +3,16 @@ include(CMakeForceCompiler) SET(CMAKE_SYSTEM_NAME "Generic") SET(CMAKE_SYSTEM_VERSION 1) -set(TOOLCHAIN_DIR D:/Programy/arm_gcc/bin/) - -CMAKE_FORCE_C_COMPILER(${TOOLCHAIN_DIR}/arm-none-eabi-gcc.exe GNU) -CMAKE_FORCE_CXX_COMPILER(${TOOLCHAIN_DIR}/arm-none-eabi-g++.exe GNU) - +if(UNIX) + set(TOOLCHAIN_DIR /opt/gcc-arm-none-eabi-5_4-2016q3/bin/) + CMAKE_FORCE_C_COMPILER(${TOOLCHAIN_DIR}/arm-none-eabi-gcc GNU) + CMAKE_FORCE_CXX_COMPILER(${TOOLCHAIN_DIR}/arm-none-eabi-g++ GNU) +else() + set(TOOLCHAIN_DIR D:/Programy/arm_gcc/bin/) + CMAKE_FORCE_C_COMPILER(${TOOLCHAIN_DIR}/arm-none-eabi-gcc.exe GNU) + CMAKE_FORCE_CXX_COMPILER(${TOOLCHAIN_DIR}/arm-none-eabi-g++.exe GNU) +endif() project(STM32_RTTY C ASM CXX) diff --git a/main.c b/main.c index 23ea18e..60350fe 100644 --- a/main.c +++ b/main.c @@ -172,8 +172,8 @@ int main(void) { radio_enable_tx(); uint8_t rtty_before_aprs_left = RTTY_TO_APRS_RATIO; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wmissing-noreturn" +//#pragma clang diagnostic push +//#pragma clang diagnostic ignored "-Wmissing-noreturn" while (1) { if (tx_on == 0 && tx_enable) { if (rtty_before_aprs_left){ @@ -197,7 +197,7 @@ int main(void) { __WFI(); } } -#pragma clang diagnostic pop +//#pragma clang diagnostic pop } void send_rtty_packet() {