Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to disable adding cmake c flags #102

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chvck
Copy link

@chvck chvck commented Jul 14, 2020

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.

@alexcrichton
Copy link
Member

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?

@daschl
Copy link

daschl commented Jul 15, 2020

@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)

@alexcrichton
Copy link
Member

Could you gist the error you were seeing with the cmake flags? Maybe there's a way to fix this in cc?

@curldivergence
Copy link

curldivergence commented Sep 19, 2020

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 :)

@AnthonyGrondin
Copy link

Hi! Is this still depending on something to be merged?

I have the same issue blocking my workflow esp-rs/esp-mbedtls#15 which can be fixed by disabling the automatically generated cmake c flags.

@lucasdietrich
Copy link

lucasdietrich commented Sep 22, 2023

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: #185

@tgross35 tgross35 added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants