Skip to content

Commit

Permalink
fix: Fixed conf file loading.
Browse files Browse the repository at this point in the history
* Properly locate conf files for the shield dir name.
  • Loading branch information
petejohanson committed Jun 5, 2022
1 parent 1e8224c commit 505c481
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions app/cmake/ZephyrBuildConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -121,24 +121,23 @@ if(DEFINED SHIELD)
list(LENGTH S_PIECES S_PIECES_LEN)
while(NOT S_PIECES STREQUAL "")
list(POP_BACK S_PIECES)
list(JOIN S_PIECES "_" S_SUBSTR)
if (S_SUBSTR STREQUAL ${shield_dir_name})
list(JOIN S_PIECES "_" s_substr)
if ("%{s_substr}" STREQUAL "" OR "${s_substr}" STREQUAL ${shield_dir_name})
break()
endif()
list(APPEND shield_candidate_names ${S_SUBSTR})
list(APPEND shield_candidate_names ${s_substr})
endwhile()
endforeach()
endif()

if (ZMK_CONFIG)
if (EXISTS ${ZMK_CONFIG})
message(STATUS "ZMK Config directory: ${ZMK_CONFIG}")
list(APPEND DTS_ROOT ${ZMK_CONFIG})
list(PREPEND KEYMAP_DIRS "${ZMK_CONFIG}")

if (DEFINED SHIELD)
foreach (s ${shield_candidate_names})
if (DEFINED $SHIELD_DIR_${s})
foreach (s ${shield_candidate_names} ${SHIELD_AS_LIST})
if (DEFINED ${SHIELD_DIR_${s}})
get_filename_component(shield_dir_name ${SHIELD_DIR_${s}} NAME)
endif()
list(APPEND overlay_candidates "${ZMK_CONFIG}/${s}_${BOARD}.overlay")
Expand Down

0 comments on commit 505c481

Please sign in to comment.