Skip to content

Commit

Permalink
Forward python path to cmake
Browse files Browse the repository at this point in the history
Change `COMPONENTS` env var, for passing enabled components to cmake, to `ESP_IDF_COMPONENTS` to prevent name collision.
  • Loading branch information
N3xed committed Aug 2, 2022
1 parent 235e507 commit 7e1fc91
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion build/common.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use std::collections::HashSet;
use std::ffi::OsStr;
use std::fmt::Display;
use std::path::{Path, PathBuf};
use std::str::FromStr;
Expand Down
5 changes: 3 additions & 2 deletions build/native/cargo_driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ pub fn build() -> Result<EspIdfBuildOutput> {
.no_build_target(true)
.define("CMAKE_TOOLCHAIN_FILE", &cmake_toolchain_file)
.define("CMAKE_BUILD_TYPE", "")
.define("PYTHON", to_cmake_path_list([&idf.venv_python])?)
.always_configure(true)
.pic(false)
.asmflag(asm_flags)
Expand All @@ -318,9 +319,9 @@ pub fn build() -> Result<EspIdfBuildOutput> {
cmake_config.env("IDF_TOOLS_PATH", install_dir);
}

// specify the components that should be built
// Specify the components that should be built.
if let Some(components) = &config.native.esp_idf_components {
cmake_config.env("COMPONENTS", components.join(";"));
cmake_config.env("ESP_IDF_COMPONENTS", components.join(";"));
}

// Build the esp-idf.
Expand Down
4 changes: 2 additions & 2 deletions resources/cmake_project/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ foreach(component_dir IN ITEMS $ENV{EXTRA_COMPONENT_DIRS})
idf_build_component(${component_dir})
endforeach()

if(DEFINED ENV{COMPONENTS})
idf_build_process($ENV{IDF_TARGET} SDKCONFIG $ENV{SDKCONFIG} SDKCONFIG_DEFAULTS $ENV{SDKCONFIG_DEFAULTS} COMPONENTS $ENV{COMPONENTS})
if(DEFINED ENV{ESP_IDF_COMPONENTS})
idf_build_process($ENV{IDF_TARGET} SDKCONFIG $ENV{SDKCONFIG} SDKCONFIG_DEFAULTS $ENV{SDKCONFIG_DEFAULTS} COMPONENTS $ENV{ESP_IDF_COMPONENTS})
else()
idf_build_process($ENV{IDF_TARGET} SDKCONFIG $ENV{SDKCONFIG} SDKCONFIG_DEFAULTS $ENV{SDKCONFIG_DEFAULTS})
endif()
Expand Down

0 comments on commit 7e1fc91

Please sign in to comment.