Skip to content

Commit eaa6cb1

Browse files
committed
Introduce CMAKE_RS_SKIP_COMPILER_FLAG which remove use of CMAKE_C_COMPILER flag from cmake command
* This changes is required in order to build paho-mqtt for armv7-a using Yocto Poky compiler.
1 parent 3ddc3d5 commit eaa6cb1

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/lib.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ pub struct Config {
6060
path: PathBuf,
6161
generator: Option<OsString>,
6262
generator_toolset: Option<OsString>,
63-
cflags: OsString,
63+
64+
/// Doc
65+
pub cflags: OsString,
6466
cxxflags: OsString,
6567
asmflags: OsString,
6668
defines: Vec<(OsString, OsString)>,
@@ -762,7 +764,10 @@ impl Config {
762764
// Also specify this on Windows only if we use MSVC with Ninja,
763765
// as it's not needed for MSVC with Visual Studio generators and
764766
// for MinGW it doesn't really vary.
765-
if !self.defined("CMAKE_TOOLCHAIN_FILE")
767+
let skip_compiler_flag =
768+
env::var("CMAKE_RS_SKIP_COMPILER_FLAG").ok() == Some("1".to_string());
769+
if !skip_compiler_flag
770+
&& !self.defined("CMAKE_TOOLCHAIN_FILE")
766771
&& !self.defined(&tool_var)
767772
&& (env::consts::FAMILY != "windows" || (msvc && is_ninja))
768773
{

0 commit comments

Comments
 (0)