This is an implementation of the fix proposed in #15:
I would honestly go with option 2. We can read the PROFILE and OPT_LEVEL env variables and determine the correct paths according to the same logic the cmake-rs crate follows.
I believe this might also provide a fix for #9.
I left cmake-rs' decision logic mostly unchanged and just reworked the error handling to better fit a build.rs and then use the result to determine whether we are doing a debug/release build. I figured that would reduce the chance of messing something up compared to adapting the function to return release/debug directly.
This is an implementation of the fix proposed in #15:
I left
cmake-rs
' decision logic mostly unchanged and just reworked the error handling to better fit abuild.rs
and then use the result to determine whether we are doing a debug/release build. I figured that would reduce the chance of messing something up compared to adapting the function to return release/debug directly.I verified that this indeed also fixes #9. :)