cmake-rs
cmake-rs copied to clipboard
Add option to disable adding cmake c flags
We are working with a project in which setting any cmake c flags causes cmake to end up with the incorrect set of flags. This adds an option to disable adding the c flags altogether.
Thanks for the PR! I feel like though that one of the main purposes of this crate is to automatically add the appropriate C flags. With that disabled is there much gained over just simply calling cmake yourself?
@alexcrichton well that is one way to do it. Our (couchbase) build.rs uses the cmake builder quite significantly (https://github.com/couchbaselabs/couchbase-rs/blob/master/couchbase-sys/build.rs#L9) we just found that on windows against visual studio we have to disable the cmake flags in order to get it to compile. (on linux and osx it works fine as in the source right now)
Could you gist the error you were seeing with the cmake flags? Maybe there's a way to fix this in cc?
Hello! It's interesting, but I've spotted a project (https://github.com/assimp/assimp) where adding -DCMAKE_CXX_FLAGS prevents it from compiling on Windows. I haven't investigated it yet, but in general - if this PR is going to be merged, is there any chance a similar option for cmake CXX flags can be added? Thanks!
UPD: In my case it looks like adding /EHs flag fixes the problem, but as to me, it is less clean than just to let package developers do what they wanted to do :)
Hi! Is this still depending on something to be merged?
I have the same issue blocking my workflow https://github.com/esp-rs/esp-mbedtls/pull/15 which can be fixed by disabling the automatically generated cmake c flags.
Hello, I'm also interested in this modification. I need to build paho-mqtt (which has a build dependency on cmake-rs) using a custom compiler arm-poky-linux-gnueabi (Yocto) for armv7-a, the presence of the CMAKE_C_COMPILER flag breaks the build, I need to remove it from the arguments to make it work.
I would be satisfied with something like this: https://github.com/rust-lang/cmake-rs/pull/185