Skip to content

Debug build fails on Windows #18

@Boscop

Description

@Boscop

= note: LINK : fatal error LNK1181: cannot open input file 'mimalloc-static.lib'

But the file exists in target\debug\build\libmimalloc-sys-e3452f81d9314272\out\build\RelWithDebInfo\mimalloc-static.lib.
It's using the wrong profile: I'm building in debug, but it's using RelWithDebInfo.

According to WindowsBunny:

The build script simplifies down the four cmake targets to a boolean is_debug https://github.com/purpleprotocol/mimalloc_rust/blob/master/libmimalloc-sys/build.rs#L83-L89
So later when it finds the path to where the resulting library is, it makes invalid assumptions https://github.com/purpleprotocol/mimalloc_rust/blob/master/libmimalloc-sys/build.rs#L107-L119
I'm actually not sure why it even pushes out_dir onto dst.
All the examples of using the cmake crate show passing dst directly to cargo without any modification.
It shouldn't get out_dir based on is_debug.
Instead it should just check get_cmake_build_type() directly and do it based on that (which is robust in case in the future rust ever gains the option to enable linking against the debug CRT and the cmake crate gains support for that).


Related: #10

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions