Files
edgetx-gx12/radio/src/targets/common/arm/CMakeLists.txt
T
Max PapernoandBertrand Songis e90bd0fd70 Enable Windows build with Qt5.5+ & MinGW-w64 (#4150)
* [Windows][MinGW] Update some WIN32 macro checks in source code to be MSVC-specific (not needed for GCC-based builds).

* [build] CMakeLists updates:
  Adjust for Windows MinGW builds: now fully compatible with Qt5.5+ and MinGW-w64 toolchain (included in Qt installs);
  Add option to specify path to required libraries/includes (instead of hard-coding `c:\programs`);
  Add package check for Python and use found executable name;
  Remove custom FindSdl package handler in favor of stock (and improved) CMake one (still works with Windows);
  Do not force SIMU_AUDIO and LUA_COMPILER in SIMU builds (leave it up to user);
  Add SIMU_LUA_COMPILER option specifically for SIMU builds (default = ON);

* [build][Windows] Rewrite/Fix Windows Companion `install` target, with two options:
    a) just copy supporting Qt and c++ DLLs to build folder so programs can be quickly be run from there (this is default and similar to the old behavior);
    b) full installation to CMAKE_INSTALL_PREFIX path, including all binaries, supporting DLLs, language files, and OTx utilities.
  Option b) can be selected with new WIN_DO_FULL_INSTALL parameter;
  Also cleans up the Linux install a bit and consolidates the OS X parts;

* [simulator][Windows] Add option to build Windows simulator with system console/terminal enabled (both standalone and when launched from Companion). Mostly useful for debug as it gives output messages much sooner in the startup process than the current debug console. Also helpful because you don't have to open it manually on every launch, and it remembers last window position and size. Possible candidate for a user-selectable runtime option in the future.

* [Windows] Fix MSVC build issues.

* [build] More build fixes:
  Use a customized FindSDL.cmake script again due to bugs and deficiencies in the official version (based on script from CMake v3.7);
  Fixes missing SDL DLL error in NSIS installer);
  Use string for Timers option (checkbox in GUI is confusing);
  Remove an unused variable.

* [simu][Windows] Fix f_getcwd() cutting off too many characters (fixes SD browser interactions).
2016-12-24 00:11:07 +01:00

136 lines
3.5 KiB
CMake

set(TIMERS 3 CACHE STRING "Timers count (2 or 3)")
option(CLI "Command Line Interface" OFF)
option(DEBUG "Debug mode" OFF)
option(LOG_TELEMETRY "Telemetry Logs on SD card" OFF)
option(TRACE_SD_CARD "Traces SD enabled" OFF)
option(TRACE_FATFS "Traces FatFS enabled" OFF)
option(TRACE_AUDIO "Traces audio enabled" OFF)
option(DEBUG_TRACE_BUFFER "Debug Trace Screen" OFF)
option(MULTIMODULE "DIY Multiprotocol TX Module (https://github.com/pascallanger/DIY-Multiprotocol-TX-Module)" OFF)
option(SUPPORT_D16_EU_ONLY "XJT module only supports D16-EU and LR12-EU" OFF) # TODO rename to XJT_EU_ONLY
option(DEBUG_INTERRUPTS "Count interrupts" OFF)
option(DEBUG_USB_INTERRUPTS "Count individual USB interrupts" OFF)
option(DEBUG_TASKS "Task switching statistics" OFF)
option(DEBUG_TIMERS "Time critical parts of the code" OFF)
if(TIMERS EQUAL 3)
add_definitions(-DTIMERS=3)
else()
add_definitions(-DTIMERS=2)
endif()
if(LOG_TELEMETRY)
add_definitions(-DLOG_TELEMETRY)
endif()
if(TRACE_SD_CARD)
add_definitions(-DTRACE_SD_CARD)
set(DEBUG ON)
set(DEBUG_TRACE_BUFFER ON)
endif()
if(TRACE_FATFS)
add_definitions(-DTRACE_FATFS)
set(DEBUG ON)
set(DEBUG_TRACE_BUFFER ON)
endif()
if(TRACE_AUDIO)
add_definitions(-DTRACE_AUDIO)
set(DEBUG ON)
set(DEBUG_TRACE_BUFFER ON)
endif()
if(DEBUG_TRACE_BUFFER)
add_definitions(-DDEBUG_TRACE_BUFFER)
endif()
if(DEBUG_INTERRUPTS)
add_definitions(-DDEBUG_INTERRUPTS)
set(DEBUG ON)
if(DEBUG_USB_INTERRUPTS)
add_definitions(-DDEBUG_USB_INTERRUPTS)
endif()
endif()
if(DEBUG_TASKS)
add_definitions(-DDEBUG_TASKS)
set(DEBUG ON)
endif()
if(DEBUG_TIMERS)
add_definitions(-DDEBUG_TIMERS)
set(DEBUG ON)
endif()
if(CLI)
add_definitions(-DCLI)
set(FIRMWARE_SRC ${FIRMWARE_SRC} cli.cpp)
set(SRC ${SRC} dump.cpp)
elseif(DEBUG)
set(SRC ${SRC} dump.cpp)
endif()
if(DEBUG)
add_definitions(-DDEBUG)
endif()
if(SUPPORT_D16_EU_ONLY)
add_definitions(-DMODULE_D16_EU_ONLY_SUPPORT)
endif()
if(HAPTIC)
add_definitions(-DHAPTIC)
set(SRC ${SRC} haptic.cpp)
set(TARGET_SRC ${TARGET_SRC} haptic_driver.cpp)
endif()
if(MULTIMODULE)
add_definitions(-DMULTIMODULE)
set(SRC ${SRC} pulses/multi_arm.cpp telemetry/spektrum.cpp telemetry/flysky_ibus.cpp telemetry/multi.cpp)
endif()
add_definitions(-DCPUARM -DVIRTUAL_INPUTS)
add_definitions(-DTELEMETRY_FRSKY -DTELEMETRY_FRSKY_SPORT -DFRSKY_HUB -DGPS -DPXX -DDSM2)
add_definitions(-DBOLD_FONT -DBATTGRAPH -DTHRTRACE -DGAUGES)
add_definitions(-DREQUIRED_SDCARD_VERSION="${SDCARD_VERSION}")
include_directories(${COOS_DIR} ${COOS_DIR}/kernel ${COOS_DIR}/portable)
foreach(LANGUAGE ${TTS_LANGUAGES})
set(SRC ${SRC} translations/tts_${LANGUAGE}.cpp)
endforeach()
set(SRC
${SRC}
main_arm.cpp
tasks_arm.cpp
audio_arm.cpp
io/frsky_sport.cpp
telemetry/telemetry.cpp
telemetry/telemetry_holders.cpp
telemetry/telemetry_sensors.cpp
telemetry/frsky.cpp
telemetry/frsky_d_arm.cpp
telemetry/frsky_sport.cpp
crc16.cpp
vario.cpp
)
set(FIRMWARE_TARGET_SRC
${FIRMWARE_TARGET_SRC}
diskio.cpp
)
set(TARGET_SRC
${TARGET_SRC}
pulses_driver.cpp
keys_driver.cpp
adc_driver.cpp
trainer_driver.cpp
audio_driver.cpp
telemetry_driver.cpp
)
set(FIRMWARE_SRC
${FIRMWARE_SRC}
${COOS_DIR}/kernel/core.c
${COOS_DIR}/kernel/hook.c
${COOS_DIR}/kernel/task.c
${COOS_DIR}/kernel/event.c
${COOS_DIR}/kernel/time.c
${COOS_DIR}/kernel/timer.c
${COOS_DIR}/kernel/flag.c
${COOS_DIR}/kernel/mutex.c
${COOS_DIR}/kernel/serviceReq.c
${COOS_DIR}/portable/GCC/port.c
${COOS_DIR}/portable/arch.c
)
set(PULSES_SRC
${PULSES_SRC}
pulses_arm.cpp
ppm_arm.cpp
pxx_arm.cpp
dsm2_arm.cpp
)