tgfrerer / island

🌋🐎 Project Island is an experimental, hot-reloading Vulkan Renderer for Linux and Windows, written in C/C++.
MIT License
1.04k stars 42 forks source link

Compiling with Ninja on Windows #52

Closed therealnv6 closed 1 year ago

therealnv6 commented 1 year ago

Is there a way to compile using Ninja on Windows? Ninja seems to have several compiling problems whereas building with MSVC seems to work. Using the same build commands for both MSVC and Ninja seems to cause the same issues.

cmake ../ -G Ninja
cmake --build ./ # also tried using `ninja`
cmake ../ # msvc
cmake --build ./
tgfrerer commented 1 year ago

hey @therealnv6 - thanks for your interest in Island :)

i'm on Linux today and will only get to return to windows next week, but in the meantime - could it be that the ninja build issues are somehow related to ninja not having access to the same context as msvc.

I think i faintly remember that i managed to run a ninja build on windows in the past by calling ninja from inside a 64 bit developer command prompt...

The hints in this the windows readme should explain a bit better what i mean: https://github.com/tgfrerer/island/blob/wip/README_WINDOWS.md

therealnv6 commented 1 year ago

Hey! Thanks for the quick reply.

Apologies if I caused any confusion, I'm trying to use Ninja instead of MSVC, primarily for it to generate a compile_commands.json, I'm not actually using Visual Studio.

could it be that the ninja build issues are somehow related to ninja not having access to the same context as msvc.

I'm not entirely sure, ninja can usually compile my other vulkan projects just fine, where vulkan is just set using the normal VULKAN_SDK path variable.

I think i faintly remember that i managed to run a ninja build on windows in the past by calling ninja from inside a 64 bit developer command prompt...

Hmm, I tried doing this but still seem to be facing an issue compiling with Ninja. Could there be something I'm doing wrong? I'm just following the commands I provided above.

Again, thanks a lot for the quick reply! This looks like a very interesting project!

tgfrerer commented 1 year ago

from the printouts on pastebin i wonder if it could be that you might be using the x86 developer command prompt and not the x64 one ... windows can be super finnicky ... x64 Native Tools Command Prompt for VS 2019 should be the correct one. the VS2022 should work, too

therealnv6 commented 1 year ago

Perfect! Can confirm VS2022 does work. Not sure why it took the x86 developer command prompt. Thanks a lot!

tgfrerer commented 1 year ago

awesome :)