Skip to content

Commit 7e2f756

Browse files
authored
{xip_ram_perms,picoboot_flash_id}/CMakeLists.txt: unset environment variables CFLAGS, CXXFLAGS and LDFLAGS (#140)
If the user set these environment variables to influence the picotool build, unset them here so that they do not influence the pico-sdk build. This is especially required for flags that are not supported by arm-none-eabi compilers.
1 parent 333a03b commit 7e2f756

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

picoboot_flash_id/CMakeLists.txt

+8
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ if (NOT USE_PRECOMPILED)
66
# default build type
77
set(CMAKE_BUILD_TYPE "MinSizeRel" CACHE STRING "build type")
88

9+
# If the user set these environment variables to influence the picotool
10+
# build, unset them here so that they do not influence the pico-sdk
11+
# build. This is especially required for flags that are not supported
12+
# by arm-none-eabi compilers.
13+
unset(ENV{CFLAGS})
14+
unset(ENV{CXXFLAGS})
15+
unset(ENV{LDFLAGS})
16+
917
include(${PICO_SDK_PATH}/external/pico_sdk_import.cmake)
1018
project(flash_id C CXX ASM)
1119
pico_sdk_init()

xip_ram_perms/CMakeLists.txt

+8
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ if (NOT USE_PRECOMPILED)
55

66
set(PICO_NO_PICOTOOL 1)
77

8+
# If the user set these environment variables to influence the picotool
9+
# build, unset them here so that they do not influence the pico-sdk
10+
# build. This is especially required for flags that are not supported
11+
# by arm-none-eabi compilers.
12+
unset(ENV{CFLAGS})
13+
unset(ENV{CXXFLAGS})
14+
unset(ENV{LDFLAGS})
15+
816
# Pull in SDK (must be before project)
917
include(${PICO_SDK_PATH}/external/pico_sdk_import.cmake)
1018

0 commit comments

Comments
 (0)