Skip to content

Commit

Permalink
Introduce CMAKE_RS_SKIP_COMPILER_FLAG which remove use of CMAKE_C_COM…
Browse files Browse the repository at this point in the history
…PILER flag from cmake command

* This changes is required in order to build paho-mqtt for armv7-a using Yocto Poky compiler.
  • Loading branch information
lucasdietrich committed Sep 22, 2023
1 parent 3ddc3d5 commit eaa6cb1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ pub struct Config {
path: PathBuf,
generator: Option<OsString>,
generator_toolset: Option<OsString>,
cflags: OsString,

/// Doc
pub cflags: OsString,
cxxflags: OsString,
asmflags: OsString,
defines: Vec<(OsString, OsString)>,
Expand Down Expand Up @@ -762,7 +764,10 @@ impl Config {
// Also specify this on Windows only if we use MSVC with Ninja,
// as it's not needed for MSVC with Visual Studio generators and
// for MinGW it doesn't really vary.
if !self.defined("CMAKE_TOOLCHAIN_FILE")
let skip_compiler_flag =
env::var("CMAKE_RS_SKIP_COMPILER_FLAG").ok() == Some("1".to_string());
if !skip_compiler_flag
&& !self.defined("CMAKE_TOOLCHAIN_FILE")
&& !self.defined(&tool_var)
&& (env::consts::FAMILY != "windows" || (msvc && is_ninja))
{
Expand Down

0 comments on commit eaa6cb1

Please sign in to comment.