Skip to content

building examples-native fails on Windows #188

@cormac-obrien

Description

@cormac-obrien

Running make examples-native from the project root:

PS C:\[...]\wgpu> make examples-native
cargo build --manifest-path wgpu-native/Cargo.toml --features "local,gfx-backend-dx12"
    Finished dev [unoptimized + debuginfo] target(s) in 0.09s
cd examples/hello_triangle_c && mkdir build && cd build && cmake .. && make
-- Building for: Visual Studio 15 2017

[...]

-- Generating done
-- Build files have been written to: C:/[...]/wgpu/examples/hello_triangle_c/build
make[1]: Entering directory 'C:/[...]/wgpu/examples/hello_triangle_c/build'
make[1]: *** No targets specified and no makefile found.  Stop.
make[1]: Leaving directory 'C:/[...]/wgpu/examples/hello_triangle_c/build'
make: *** [makefile:74: examples-native] Error 2

It looks like the Makefile expects CMake to have generated another Makefile:

examples-native: lib-native $(FFI_DIR)/wgpu.h examples/hello_triangle_c/main.c
    cd examples/hello_triangle_c && $(CREATE_BUILD_DIR) && cd build && cmake .. && make

But on Windows (or at least my system) CMake generates Visual Studio project files instead.

    Directory: C:\[...]\wgpu\examples\hello_triangle_c\build

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----        5/23/2019  10:57 PM                CMakeFiles
-a----        5/23/2019  10:57 PM          49613 ALL_BUILD.vcxproj
-a----        5/23/2019  10:57 PM            306 ALL_BUILD.vcxproj.filters
-a----        5/23/2019  10:57 PM          14042 CMakeCache.txt
-a----        5/23/2019  10:57 PM           1493 cmake_install.cmake
-a----        5/23/2019  10:57 PM           3211 hello_triangle.sln
-a----        5/23/2019  10:57 PM          59806 hello_triangle.vcxproj
-a----        5/23/2019  10:57 PM            613 hello_triangle.vcxproj.filters
-a----        5/23/2019  10:57 PM          48809 ZERO_CHECK.vcxproj
-a----        5/23/2019  10:57 PM            549 ZERO_CHECK.vcxproj.filters

I'm not terribly familiar with CMake so I'm not sure how to make it generate Makefiles instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help requiredWe need community help to make this happen.type: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions