Open JaimeIvanCervantes opened 4 years ago
Thanks for the information. The native window/visual/... implementation is indeed missing and that is the cause of the segfault you see. The tests only test non-GUI code, so that explains what you notice there. If you inspect the Travis yml file, you will see I build libc++ with filesystem support and use that. You should be able to run the libc++ build script on your Mac as well. Xcode releases unfortunately lag quite a bit behind with these c++17 features relative to upstream LLVM releases. The native window/visual layer will probably best be implemented in Objective-C++, and help is definitely welcome. Basically what is needed is:
Note the full functionality of all this code is pretty limited and I am currently sidetracked on CSS parsing for UI styling and torn between writing an parser expression grammar library to use for that or keep fighting Boost Spirit X3.
Help is always welcome :).
I didn't have time to delve into the code, and I made the assumption that there was already a window platform/native implementation for MacOS :P. Things have been a bit hectic lately, but I'll see if I can make some time to help. Perhaps it will useful to look at the imgui
example for Apple: https://github.com/ocornut/imgui/blob/master/examples/example_apple_opengl2/main.mm#L158
With respect to the CSS parser, this is exactly what brought me to your project; I have been exploring the idea of using Spirit X3 to parse SVG (and CSS indirectly). I also thought about writing my own parser, but tbh, Spirit X3 is the 3rd generation of the Spirit parsers (~10 yrs of development), and to me it seems mature enough to be used in production. Also, the Spirit team is doing a great job answering questions on SO ;). Maybe it would be helpful to look at this CSS parser using the older Spirit: https://github.com/emweb/wt/blob/master/src/Wt/Render/CssParser.C
The older Spirit is not an option as X3 supposedly has superior performance (both compile time as runtime). It's either that or I get somewhere with my parsing library. My spare time is limited, and this really is currently my hobby project. I'm very curious where it all will end :)
I know that MacOS 10.13.* is a TODO, but I tried to build on my MacOS 10.13.6 anyways. I was finally able to build with the following:
path.h++
, replaced<experimental/filesystem>
withghc::filesystem
from https://github.com/gulrak/filesystemSET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.14")
to the rootCMakeLists.txt
-lc++fs
fromcore/CMakeLists.txt
, because it was causing a linker error.But now that I am trying to run
widget_gallery
I am getting a segfault, specifically on the lineskui::gui::window window{{0,0}, {200, 200}}
. Interestingly, all the tests are passing.Here's the backtrace: