floooh / cimgui-sokol-starterkit

A minimal self-contained Dear ImGui starter project for Windows, Linux and macOS.
MIT License
213 stars 19 forks source link

cannot open file '.obj' emscripten, win10, vs2022 #10

Open AleCie opened 2 years ago

AleCie commented 2 years ago

Is it some issue on my end?

C:\Development\C++\cimgui-sokol-starterkit\wasm>cmake --build .
Microsoft (R) Build Engine version 17.0.0+c9eb9dd64 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  cimgui.vcxproj -> C:\Development\C++\cimgui-sokol-starterkit\wasm\Debug\libcimgui.a
  sokol.vcxproj -> C:\Development\C++\cimgui-sokol-starterkit\wasm\Debug\libsokol.a
LINK : warning LNK4044: unrecognized option '/-default-obj-ext'; ignored [C:\Development\C++\cimgui-sokol-starterkit\wa
sm\demo.vcxproj]
LINK : warning LNK4044: unrecognized option '/-shell-file'; ignored [C:\Development\C++\cimgui-sokol-starterkit\wasm\de
mo.vcxproj]
LINK : warning LNK4044: unrecognized option '/sNO_FILESYSTEM=1'; ignored [C:\Development\C++\cimgui-sokol-starterkit\wa
sm\demo.vcxproj]
LINK : warning LNK4044: unrecognized option '/sASSERTIONS=0'; ignored [C:\Development\C++\cimgui-sokol-starterkit\wasm\
demo.vcxproj]
LINK : warning LNK4044: unrecognized option '/sMALLOC=emmalloc'; ignored [C:\Development\C++\cimgui-sokol-starterkit\wa
sm\demo.vcxproj]
LINK : warning LNK4044: unrecognized option '/-closure=1'; ignored [C:\Development\C++\cimgui-sokol-starterkit\wasm\dem
o.vcxproj]
LINK : fatal error LNK1104: cannot open file '.obj' [C:\Development\C++\cimgui-sokol-starterkit\wasm\demo.vcxproj]
floooh commented 2 years ago

The issue seems to be that cmake has generated MSVC project files (which it does by default on Windows), but with Emscripten command line options (I haven't tested Emscripten builds on Windows as I wrote in the readme).

Maybe emcmake needs to be told to explicitely generate makefiles, e.g.:

emcmake cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=MinSizeRel ..

But TBH, even if this works, it's likely that you'll run into more issues with the Emscripten SDK on Windows. Might be better to build for the Emscripten target inside WSL.