Skip to content

Update to work with newer CMake and PIC32MM #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Modules/Platform/MicrochipMCU-C-XC32.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ set(CMAKE_FIND_ROOT_PATH ${MICROCHIP_XC32_PATH})
set(CMAKE_C_COMPILER xc32-gcc)
set(MICROCHIP_C_COMPILER_ID XC32)

add_compile_options(
"-mprocessor=${MICROCHIP_MCU_MODEL}"
string(APPEND CMAKE_C_FLAGS_INIT
" -mprocessor=${MICROCHIP_MCU_MODEL} "
)
string(APPEND CMAKE_C_LINK_FLAGS
" -mprocessor=${MICROCHIP_MCU_MODEL}"
string(APPEND CMAKE_CXX_FLAGS_INIT
" -mprocessor=${MICROCHIP_MCU_MODEL} "
)
3 changes: 2 additions & 1 deletion toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ list(APPEND MICROCHIP_FAMILIES_16

# known 32-bit MCU families
list(APPEND MICROCHIP_FAMILIES_32
PIC32MM
PIC32MX
PIC32MZ
)
Expand All @@ -97,7 +98,7 @@ elseif(MICROCHIP_MCU STREQUAL "generic32")
set(MICROCHIP_MCU_MODEL "generic")
set(CMAKE_SYSTEM_PROCESSOR "PIC_32")

elseif(MICROCHIP_MCU MATCHES "^(dsPIC|PIC)(32M[XZ]|[0-9]+[A-Z])([A-Z0-9]+)$")
elseif(MICROCHIP_MCU MATCHES "^(dsPIC|PIC)(32M[MXZ]|[0-9]+[A-Z])([A-Z0-9]+)$")
set(MICROCHIP_MCU_FAMILY "${CMAKE_MATCH_1}${CMAKE_MATCH_2}")
set(MICROCHIP_MCU_MODEL "${CMAKE_MATCH_2}${CMAKE_MATCH_3}")

Expand Down