kripken / BananaBread

BananaBread is a C++ 3D game engine that runs on the web using JavaScript+WebGL+HTML
1.38k stars 346 forks source link

Give useful error when EMSCRIPTEN is not set #82

Closed sbc100 closed 4 years ago

sbc100 commented 4 years ago

I'm still seing a link failure: emcc: error: emcc: cannot find library "SDL_image"

How did that work previously?

kripken commented 4 years ago

I think we may need to remove -lSDL_image in the makefile here. But maybe we should fix emcc to ignore that?

kripken commented 4 years ago

(it worked on fastcomp somehow in the past, but I think we made -lX stricter at some point)

sbc100 commented 4 years ago

I see.. I had no idea that emmake did that. I guess this change is not needed after all.

Instead perhaps lets give a error saying "please run with emmake" if EMSCRIPTEN is not found?

However emmake is designed to override CC and CXX etc... its designed for makefiles that are not necarrily aware of emscripten at all right? At keast it seens like setting CXX = emcc is redundant when using emmake.

I can't see any change what would have allowed -lSDL_image with fastcomp. I agree we should accept it if we used to.. we should look into how that ever works,

kripken commented 4 years ago

However emmake is designed to override CC and CXX etc... its designed for makefiles that are not necarrily aware of emscripten at all right?

Correct, yeah. But it also sets EMSCRIPTEN which can be useful too, even if not the main intended goal.

kripken commented 4 years ago

Overall though, I don't have a clear idea in my head of the "right" way to do this. Maybe using EMSCRIPTEN is wrong. I trust your views on this type of thing more than my own.

sbc100 commented 4 years ago

OK.. I think this is better PTAL.

sbc100 commented 4 years ago

Can you land? I don't have write access here.