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

macOS: `sokol.m` vs `sokol.c` with `-ObjC` #5

Closed toyboot4e closed 3 years ago

toyboot4e commented 3 years ago

Hi, I tried building with sokol.c and -ObjC flag on macOS, and it compile demo without errors. But I'm not sure what I'm doing actually. So let me ask a question: which is preferred, sokol.m or -ObjC with sokol.c? Thank you.

floooh commented 3 years ago

Both should work the same, whatever you prefer is the right way ;)

Using the file extension makes it a bit easier in mixed-source libraries, because target_compile_options(...) sets the option for the entire compilation target, not just for the sokol.c file (cmake also has "set_source_files_properties" for this though). But in this specific case (just one source file in the whole library) this doesn't matter.