@@ -79,48 +79,37 @@ set(WARNING_FLAGS_IAR "")
79
79
function (family_filter RESULT DIR)
80
80
get_filename_component (DIR ${DIR} ABSOLUTE BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR} )
81
81
82
- if (EXISTS "${DIR} /only.txt" )
83
- file (READ "${DIR} /only.txt" ONLYS)
84
- # Replace newlines with semicolon so that it is treated as a list by CMake
85
- string (REPLACE "\n " ";" ONLYS_LINES ${ONLYS} )
86
-
87
- # For each mcu
82
+ if (EXISTS "${DIR} /skip.txt" )
83
+ file (STRINGS "${DIR} /skip.txt" SKIPS_LINES)
88
84
foreach (MCU IN LISTS FAMILY_MCUS)
89
85
# For each line in only.txt
90
- foreach (_line ${ONLYS_LINES } )
91
- # If mcu:xxx exists for this mcu or board:xxx then include
92
- if (${_line} STREQUAL "mcu:${MCU} " OR ${_line} STREQUAL "board:${BOARD} " )
93
- set (${RESULT} 1 PARENT_SCOPE)
86
+ foreach (_line ${SKIPS_LINES } )
87
+ # If mcu:xxx exists for this mcu then skip
88
+ if (${_line} STREQUAL "mcu:${MCU} " OR ${_line} STREQUAL "board:${BOARD} " OR ${_line} STREQUAL "family: ${FAMILY} " )
89
+ set (${RESULT} 0 PARENT_SCOPE)
94
90
return ()
95
91
endif ()
96
92
endforeach ()
97
93
endforeach ()
94
+ endif ()
98
95
99
- # Didn't find it in only file so don't build
100
- set (${RESULT} 0 PARENT_SCOPE)
101
-
102
- elseif (EXISTS "${DIR} /skip.txt" )
103
- file (READ "${DIR} /skip.txt" SKIPS)
104
- # Replace newlines with semicolon so that it is treated as a list by CMake
105
- string (REPLACE "\n " ";" SKIPS_LINES ${SKIPS} )
106
-
107
- # For each mcu
96
+ if (EXISTS "${DIR} /only.txt" )
97
+ file (STRINGS "${DIR} /only.txt" ONLYS_LINES)
108
98
foreach (MCU IN LISTS FAMILY_MCUS)
109
99
# For each line in only.txt
110
- foreach (_line ${SKIPS_LINES } )
111
- # If mcu:xxx exists for this mcu then skip
112
- if (${_line} STREQUAL "mcu:${MCU} " )
113
- set (${RESULT} 0 PARENT_SCOPE)
100
+ foreach (_line ${ONLYS_LINES } )
101
+ # If mcu:xxx exists for this mcu or board:xxx then include
102
+ if (${_line} STREQUAL "mcu:${MCU} " OR ${_line} STREQUAL "board: ${BOARD} " OR ${_line} STREQUAL "family: ${FAMILY} " )
103
+ set (${RESULT} 1 PARENT_SCOPE)
114
104
return ()
115
105
endif ()
116
106
endforeach ()
117
107
endforeach ()
118
108
119
- # Didn't find in skip file so build
120
- set (${RESULT} 1 PARENT_SCOPE)
109
+ # Didn't find it in only file so don't build
110
+ set (${RESULT} 0 PARENT_SCOPE)
121
111
else ()
122
-
123
- # Didn't find skip or only file so build
112
+ # only.txt not exist so build
124
113
set (${RESULT} 1 PARENT_SCOPE)
125
114
endif ()
126
115
endfunction ()
0 commit comments