Skip to content

Commit 98b60e8

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 98b60e8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/lib.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,10 @@ impl Config {
762762
// Also specify this on Windows only if we use MSVC with Ninja,
763763
// as it's not needed for MSVC with Visual Studio generators and
764764
// for MinGW it doesn't really vary.
765-
if !self.defined("CMAKE_TOOLCHAIN_FILE")
765+
let skip_compiler_flag =
766+
env::var("CMAKE_RS_SKIP_COMPILER_FLAG").ok() == Some("1".to_string());
767+
if !skip_compiler_flag
768+
&& !self.defined("CMAKE_TOOLCHAIN_FILE")
766769
&& !self.defined(&tool_var)
767770
&& (env::consts::FAMILY != "windows" || (msvc && is_ninja))
768771
{

0 commit comments

Comments
 (0)