Skip to content

Commit d492d5f

Browse files
tejlmandkeith-packard
authored andcommitted
cmake: Guard CMAKE_BUILD_TYPE when integrating with Zephyr
Zephyr controls compile and linker flags, such as optimization using Kconfig and not CMAKE_BUILD_TYPE. Therefore disable the setting of CMAKE_BUILD_TYPE when Zephyr is used to avoid situations like `-Os -O2` when compiling Zephyr with Picolibc. Signed-off-by: Torsten Rasmussen <[email protected]>
1 parent f757b3f commit d492d5f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ project(Picolibc VERSION 1.8.8 LANGUAGES C ASM)
4040
# Set a default build type if none was specified
4141
set(default_build_type "MinSizeRel")
4242

43-
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
43+
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES AND NOT DEFINED ZEPHYR_BASE)
4444
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
4545
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
4646
STRING "Choose the type of build." FORCE)

0 commit comments

Comments
 (0)