Skip to content

Commit d53f95b

Browse files
committed
Add basic support for external CMake arguments // Issue platformio#339
Might be useful when a user wants to modify project configuration settings: set cache entries or enable developer warnings specific to CMake
1 parent 060dc90 commit d53f95b

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

builder/frameworks/espidf.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -768,10 +768,10 @@ def find_default_component(target_configs):
768768
# Generate final linker script
769769
#
770770

771-
if not env.BoardConfig().get("build.ldscript", ""):
771+
if not board.get("build.ldscript", ""):
772772
linker_script = env.Command(
773773
join("$BUILD_DIR", "esp32_out.ld"),
774-
env.BoardConfig().get(
774+
board.get(
775775
"build.esp-idf.ldscript",
776776
join(FRAMEWORK_DIR, "components", "esp32", "ld", "esp32.ld"),
777777
),
@@ -789,7 +789,7 @@ def find_default_component(target_configs):
789789
#
790790

791791
fwpartitions_dir = join(FRAMEWORK_DIR, "components", "partition_table")
792-
partitions_csv = env.BoardConfig().get("build.partitions", "partitions_singleapp.csv")
792+
partitions_csv = board.get("build.partitions", "partitions_singleapp.csv")
793793
env.Replace(
794794
PARTITIONS_TABLE_CSV=abspath(
795795
join(fwpartitions_dir, partitions_csv)
@@ -805,7 +805,7 @@ def find_default_component(target_configs):
805805
'"$PYTHONEXE" "%s" -q --flash-size "%s" $SOURCE $TARGET'
806806
% (
807807
join(FRAMEWORK_DIR, "components", "partition_table", "gen_esp32part.py"),
808-
env.BoardConfig().get("upload.flash_size", "detect"),
808+
board.get("upload.flash_size", "detect"),
809809
),
810810
"Generating partitions $TARGET",
811811
),
@@ -853,9 +853,8 @@ def find_default_component(target_configs):
853853
project_codemodel = get_cmake_code_model(
854854
env.subst("$PROJECT_DIR"),
855855
BUILD_DIR,
856-
["-DEXTRA_COMPONENT_DIRS:PATH=" + ";".join(extra_components)]
857-
if extra_components
858-
else [],
856+
["-DEXTRA_COMPONENT_DIRS:PATH=" + ";".join(extra_components)] +
857+
click.parser.split_arg_string(board.get("build.cmake_extra_args", ""))
859858
)
860859

861860
if not project_codemodel:

0 commit comments

Comments
 (0)