Skip to content

Make user-specified cflags take precedence over cc-rs flags #232

New issue

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

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

Already on GitHub? # to your account

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

Conversation

madsmtm
Copy link
Contributor

@madsmtm madsmtm commented Jan 27, 2025

When the user uses .cflag/.cxxflag/.asmflag, we want those flags to take precedence over the default flags that cc-rs adds.

@madsmtm madsmtm force-pushed the user-specified-takes-precedence branch from 056a6ea to 4e9ce56 Compare January 27, 2025 01:25
@madsmtm
Copy link
Contributor Author

madsmtm commented Jan 27, 2025

The nightly error is rust-lang/rust#136086, will be fixed by rust-lang/rust#136098.

@jyn514
Copy link
Member

jyn514 commented Jan 27, 2025

for posterity, the full error was

   Compiling test-crate v0.1.0 (/Users/runner/work/cmake-rs/cmake-rs/test-crate)
error: linker stderr: ld: search path '/Users/runner/work/cmake-rs/cmake-rs/test-crate/target/debug/build/libz-sys-ae8c893dbe111c55/out/lib64' not found
       ld: object file (/Users/runner/work/cmake-rs/cmake-rs/test-crate/target/debug/deps/liblibz_sys-297f35bb33641431.rlib[31](zutil.c.o)) was built for newer 'macOS' version (14.5) than being linked (11.0)
  |
  = note: `-D linker-messages` implied by `-D warnings`
  = help: to override `-D warnings` add `#[allow(linker_messages)]`

(CI logs go away after about 3 months)

@jyn514
Copy link
Member

jyn514 commented Jan 27, 2025

note that i do not plan to silence the "search path" not found error, so that will eventually come back unless someone makes a convincing case why it shouldn't.

@madsmtm madsmtm force-pushed the user-specified-takes-precedence branch from 4e9ce56 to 836acf7 Compare February 10, 2025 09:26
@madsmtm
Copy link
Contributor Author

madsmtm commented Feb 10, 2025

Rebased, and filed rust-lang/libz-sys#235 to avoid the libz-sys linker warning happening in the future.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants