Skip to content

Commit 5466e49

Browse files
committed
Fix ping-pong, rx-sensi and tx-cw compiling issues.
1 parent 90b2812 commit 5466e49

File tree

3 files changed

+64
-0
lines changed

3 files changed

+64
-0
lines changed

src/apps/ping-pong/CMakeLists.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,19 @@ cmake_minimum_required(VERSION 3.6)
2222
# Options
2323
#---------------------------------------------------------------------------------------
2424

25+
# Allow selection of region
26+
option(REGION_EU868 "Region EU868" ON)
27+
option(REGION_US915 "Region US915" OFF)
28+
option(REGION_CN779 "Region CN779" OFF)
29+
option(REGION_EU433 "Region EU433" OFF)
30+
option(REGION_AU915 "Region AU915" OFF)
31+
option(REGION_AS923 "Region AS923" OFF)
32+
option(REGION_CN470 "Region CN470" OFF)
33+
option(REGION_KR920 "Region KR920" OFF)
34+
option(REGION_IN865 "Region IN865" OFF)
35+
option(REGION_RU864 "Region RU864" OFF)
36+
set(REGION_LIST REGION_EU868 REGION_US915 REGION_CN779 REGION_EU433 REGION_AU915 REGION_AS923 REGION_CN470 REGION_KR920 REGION_IN865 REGION_RU864)
37+
2538
# Allow switching of modulation
2639
set(MODULATION_LIST LORA FSK)
2740
set(MODULATION LORA CACHE STRING "Default modulation is LoRa")
@@ -41,6 +54,13 @@ add_executable(${PROJECT_NAME}
4154
$<TARGET_OBJECTS:${BOARD}>
4255
)
4356

57+
# Loops through all regions and add compile time definitions for the enabled ones.
58+
foreach( REGION ${REGION_LIST} )
59+
if(${REGION})
60+
target_compile_definitions(${PROJECT_NAME} PUBLIC -D"${REGION}")
61+
endif()
62+
endforeach()
63+
4464
if(MODULATION STREQUAL LORA)
4565
target_compile_definitions(${PROJECT_NAME} PRIVATE USE_MODEM_LORA)
4666
elseif(MODULATION STREQUAL FSK)

src/apps/rx-sensi/CMakeLists.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,19 @@ cmake_minimum_required(VERSION 3.6)
2222
# Options
2323
#---------------------------------------------------------------------------------------
2424

25+
# Allow selection of region
26+
option(REGION_EU868 "Region EU868" ON)
27+
option(REGION_US915 "Region US915" OFF)
28+
option(REGION_CN779 "Region CN779" OFF)
29+
option(REGION_EU433 "Region EU433" OFF)
30+
option(REGION_AU915 "Region AU915" OFF)
31+
option(REGION_AS923 "Region AS923" OFF)
32+
option(REGION_CN470 "Region CN470" OFF)
33+
option(REGION_KR920 "Region KR920" OFF)
34+
option(REGION_IN865 "Region IN865" OFF)
35+
option(REGION_RU864 "Region RU864" OFF)
36+
set(REGION_LIST REGION_EU868 REGION_US915 REGION_CN779 REGION_EU433 REGION_AU915 REGION_AS923 REGION_CN470 REGION_KR920 REGION_IN865 REGION_RU864)
37+
2538
# Allow switching of modulation
2639
set(MODULATION_LIST LORA FSK)
2740
set(MODULATION LORA CACHE STRING "Default modulation is LoRa")
@@ -41,6 +54,13 @@ add_executable(${PROJECT_NAME}
4154
$<TARGET_OBJECTS:${BOARD}>
4255
)
4356

57+
# Loops through all regions and add compile time definitions for the enabled ones.
58+
foreach( REGION ${REGION_LIST} )
59+
if(${REGION})
60+
target_compile_definitions(${PROJECT_NAME} PUBLIC -D"${REGION}")
61+
endif()
62+
endforeach()
63+
4464
if(MODULATION STREQUAL LORA)
4565
target_compile_definitions(${PROJECT_NAME} PRIVATE USE_MODEM_LORA)
4666
elseif(MODULATION STREQUAL FSK)

src/apps/tx-cw/CMakeLists.txt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,23 @@
1818
project(tx-cw)
1919
cmake_minimum_required(VERSION 3.6)
2020

21+
#---------------------------------------------------------------------------------------
22+
# Options
23+
#---------------------------------------------------------------------------------------
24+
25+
# Allow selection of region
26+
option(REGION_EU868 "Region EU868" ON)
27+
option(REGION_US915 "Region US915" OFF)
28+
option(REGION_CN779 "Region CN779" OFF)
29+
option(REGION_EU433 "Region EU433" OFF)
30+
option(REGION_AU915 "Region AU915" OFF)
31+
option(REGION_AS923 "Region AS923" OFF)
32+
option(REGION_CN470 "Region CN470" OFF)
33+
option(REGION_KR920 "Region KR920" OFF)
34+
option(REGION_IN865 "Region IN865" OFF)
35+
option(REGION_RU864 "Region RU864" OFF)
36+
set(REGION_LIST REGION_EU868 REGION_US915 REGION_CN779 REGION_EU433 REGION_AU915 REGION_AS923 REGION_CN470 REGION_KR920 REGION_IN865 REGION_RU864)
37+
2138
#---------------------------------------------------------------------------------------
2239
# Target
2340
#---------------------------------------------------------------------------------------
@@ -32,6 +49,13 @@ add_executable(${PROJECT_NAME}
3249
$<TARGET_OBJECTS:${BOARD}>
3350
)
3451

52+
# Loops through all regions and add compile time definitions for the enabled ones.
53+
foreach( REGION ${REGION_LIST} )
54+
if(${REGION})
55+
target_compile_definitions(${PROJECT_NAME} PUBLIC -D"${REGION}")
56+
endif()
57+
endforeach()
58+
3559
target_compile_definitions(${PROJECT_NAME} PUBLIC
3660
$<BUILD_INTERFACE:$<TARGET_PROPERTY:mac,INTERFACE_COMPILE_DEFINITIONS>>
3761
)

0 commit comments

Comments
 (0)