Porting with CMAKE_CXX_FLAGS

35 views
Skip to first unread message

Daniel Luu

unread,
Nov 4, 2019, 8:04:53 PM11/4/19
to emscripten-discuss
Trying to port an application on mac and not sure how to correctly support -framework with CMAKE_CXX_FLAGS

    SET(CMAKE_CXX_FLAGS "-O3 -flto=full -ffast-math -DNDEBUG -std=c++17 -fcolor-diagnostics -nostdinc++ -I/usr/local/Cellar/llvm/9.0.0/include/c++/v1 -L/usr/local/Cellar/llvm/9.0.0/lib -L/usr/local/Cellar/freeglut/3.0.0/lib -L/usr/local/Cellar/sdl2/2.0.10/lib -L/usr/local/Cellar/sdl2_mixer/2.0.4/lib -Wl,-rpath,/usr/local/Cellar/llvm/9.0.0/lib -pipe -DASIO_STANDALONE -DGLEW_NO_GLU -DBOOST_BIMAP_DISABLE_SERIALIZATION -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo -lglut -lSDL2 -lSDL2_mixer -ldl -pthread -Wall -Wextra -Wshadow -Wpointer-arith -Wcast-align -Wstrict-prototypes -Werror-implicit-function-declaration -Wformat=2 -Wnull-dereference -Wstrict-overflow=5 -Wno-unused-private-field -Wno-unused-command-line-argument -Wno-narrowing")



Floh

unread,
Nov 7, 2019, 10:31:47 AM11/7/19
to emscripten-discuss
The concept of MacOS "frameworks" doesn't exist outside of the Mac platform.

I *think* in your case you can just remove all -framework command line options when compiling for emscripten. I think those
are dependencies required by the macOS port of SDL2, and when compiling on emscripten it should be sufficient to just link with SDL2.

Sam Clegg

unread,
Nov 8, 2019, 8:31:54 PM11/8/19
to emscripte...@googlegroups.com
You will also want to remove all the references to `/usr/local/Cellar`
since (unless I'm misunderstanding) that are headers and libraries
from the homebrew project and won't be compatible with emscripten.
You will needs to build each of your dependencies from source unless
there is an existing emscripten port (e.g. -s USE_SDL2 for SDL2).
> --
> You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/5ac9b5dc-92de-4be6-913e-abd818b81c49%40googlegroups.com.

Daniel Luu

unread,
Nov 13, 2019, 4:44:29 PM11/13/19
to emscripten-discuss
Thanks for all the help! Was wondering how I can compile a sub library that is using lz4. -s LZ4=1 doesn't seem to be enough
> To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages