|
1 | 1 | cmake_minimum_required(VERSION 3.15)
|
2 | 2 |
|
3 | 3 | # User is responsible to one mandatory option:
|
4 |
| -# FREERTOS_PORT |
| 4 | +# FREERTOS_PORT, if not specified and native port detected, uses the native compile. |
5 | 5 | #
|
6 | 6 | # User is responsible for one library target:
|
7 | 7 | # freertos_config ,typcially an INTERFACE library
|
@@ -49,16 +49,14 @@ endif()
|
49 | 49 | set(FREERTOS_HEAP "4" CACHE STRING "FreeRTOS heap model number. 1 .. 5. Or absolute path to custom heap source file")
|
50 | 50 |
|
51 | 51 | # FreeRTOS port option
|
52 |
| -set(FREERTOS_PORT "" CACHE STRING "FreeRTOS port name") |
53 |
| - |
54 | 52 | if(NOT FREERTOS_PORT)
|
55 |
| - message(FATAL_ERROR " FREERTOS_PORT is not set. Please specify it from top-level CMake file (example):\n" |
| 53 | + message(WARNING " FREERTOS_PORT is not set. Please specify it from top-level CMake file (example):\n" |
56 | 54 | " set(FREERTOS_PORT GCC_ARM_CM4F CACHE STRING \"\")\n"
|
57 | 55 | " or from CMake command line option:\n"
|
58 | 56 | " -DFREERTOS_PORT=GCC_ARM_CM4F\n"
|
59 | 57 | " \n"
|
60 | 58 | " Available port options:\n"
|
61 |
| - " A_CUSTOM_PORT - Compiler: UserDefined Target: User Defined\n" |
| 59 | + " A_CUSTOM_PORT - Compiler: User Defined Target: User Defined\n" |
62 | 60 | " BCC_16BIT_DOS_FLSH186 - Compiler: BCC Target: 16 bit DOS Flsh186\n"
|
63 | 61 | " BCC_16BIT_DOS_PC - Compiler: BCC Target: 16 bit DOS PC\n"
|
64 | 62 | " CCS_ARM_CM3 - Compiler: CCS Target: ARM Cortex-M3\n"
|
@@ -203,6 +201,14 @@ if(NOT FREERTOS_PORT)
|
203 | 201 | " CDK_THEAD_CK802 - Compiler: CDK Target: T-head CK802\n"
|
204 | 202 | " XCC_XTENSA - Compiler: XCC Target: Xtensa\n"
|
205 | 203 | " WIZC_PIC18 - Compiler: WizC Target: PIC18")
|
| 204 | + # Native FREERTOS_PORT for Linux and Windows MINGW builds |
| 205 | + if(UNIX) |
| 206 | + message(STATUS " Auto-Detected Unix, setting FREERTOS_PORT=GCC_POSIX") |
| 207 | + set(FREERTOS_PORT GCC_POSIX CACHE STRING "FreeRTOS port name") |
| 208 | + elseif(MINGW) |
| 209 | + message(STATUS " Auto-Detected MINGW, setting FREERTOS_PORT=MSVC_MINGW") |
| 210 | + set(FREERTOS_PORT MSVC_MINGW CACHE STRING "FreeRTOS port name") |
| 211 | + endif() |
206 | 212 | elseif((FREERTOS_PORT STREQUAL "A_CUSTOM_PORT") AND (NOT TARGET freertos_kernel_port) )
|
207 | 213 | message(FATAL_ERROR " FREERTOS_PORT is set to A_CUSTOM_PORT. Please specify the custom port target with all necessary files. For example:\n"
|
208 | 214 | " Assuming a directory of:\n"
|
|
0 commit comments