Skip to content

Commit bba294b

Browse files
authored
Merge pull request arduino#238 from arduino/fix-230
Define the `compiler.optimization_flags` allows for specifying the desired optimization level during compilation.
2 parents 031f36e + 9f7e168 commit bba294b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

platform.txt

+7-3
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,19 @@ compiler.warning_flags.default=
1414
compiler.warning_flags.more=-Wall
1515
compiler.warning_flags.all=-Wall -Wextra
1616

17+
compiler.optimization_flags=-Os
18+
compiler.optimization_flags.release=-Os
19+
compiler.optimization_flags.debug=-Og
20+
1721
compiler.path={build.compiler_path}
1822
compiler.c.cmd={build.crossprefix}gcc
19-
compiler.c.flags=-c {compiler.warning_flags} -Os -g3 -nostdlib {build.defines} -MMD -std=gnu11 -mcpu={build.mcu} {build.float-abi} {build.fpu} -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -fmessage-length=0 -fno-builtin
23+
compiler.c.flags=-c {compiler.warning_flags} {compiler.optimization_flags} -g3 -nostdlib {build.defines} -MMD -std=gnu11 -mcpu={build.mcu} {build.float-abi} {build.fpu} -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -fmessage-length=0 -fno-builtin
2024
compiler.c.elf.cmd={build.crossprefix}g++
2125
compiler.c.elf.flags=-Wl,--gc-sections --specs=nosys.specs {compiler.warning_flags} -mcpu={build.mcu} {build.float-abi} {build.fpu}
2226
compiler.S.cmd={build.crossprefix}g++
23-
compiler.S.flags=-c -g -x assembler-with-cpp -Os -mcpu={build.mcu} {build.float-abi} {build.fpu} -fsigned-char -ffunction-sections -fdata-sections
27+
compiler.S.flags=-c -g -x assembler-with-cpp {compiler.optimization_flags} -mcpu={build.mcu} {build.float-abi} {build.fpu} -fsigned-char -ffunction-sections -fdata-sections
2428
compiler.cpp.cmd={build.crossprefix}g++
25-
compiler.cpp.flags=-c {compiler.warning_flags} -Os -g3 -fno-use-cxa-atexit -fno-rtti -fno-exceptions -MMD -nostdlib {build.defines} -MMD -std=gnu++17 -mcpu={build.mcu} {build.float-abi} {build.fpu} -fsigned-char -ffunction-sections -fdata-sections -fmessage-length=0 -fno-builtin
29+
compiler.cpp.flags=-c {compiler.warning_flags} {compiler.optimization_flags} -g3 -fno-use-cxa-atexit -fno-rtti -fno-exceptions -MMD -nostdlib {build.defines} -MMD -std=gnu++17 -mcpu={build.mcu} {build.float-abi} {build.fpu} -fsigned-char -ffunction-sections -fdata-sections -fmessage-length=0 -fno-builtin
2630
compiler.ar.cmd={build.crossprefix}ar
2731
compiler.ar.flags=rcs
2832
compiler.ar.extra_flags=

0 commit comments

Comments
 (0)