Skip to content
This repository was archived by the owner on Aug 1, 2022. It is now read-only.

[draft] CMake support - #130

Draft
VirtualBrightPlayz wants to merge 4 commits into
SCP-CBN:mainfrom
VirtualBrightPlayz:cmake
Draft

VirtualBrightPlayz wants to merge 4 commits into
SCP-CBN:mainfrom
VirtualBrightPlayz:cmake

Conversation

@VirtualBrightPlayz

@VirtualBrightPlayz VirtualBrightPlayz commented May 18, 2022 •

Copy link
Copy Markdown

All the c/cpp files compile, but the shaders are an issue I spotted.
To "compile" shaders, you will need https://github.com/microsoft/DirectXShaderCompiler and https://github.com/KhronosGroup/SPIRV-Cross.
Make sure to set DXC_CMD to the dxc.exe file and SPVC_CMD to spirv-cross.exe file (assuming Windows).

Note:
Due to the way pge is designed, the compiled shaders don't work.

This also updates assimp

@VirtualBrightPlayz

Copy link
Copy Markdown
Author

Ok, the shader compiler I used (dxc and spirv-cross) are no longer required (or used), and the engine and game compile and run (Windows only for now), but you need to update the engine submodule to this commit: juanjp600/pge@655f8a0 for it to function without crashing.

This also makes assimp a submodule, and adds three new compiler directives for the engine, PGE_D3D for Direct3D support, PGE_VKR for Vulkan, and PGE_OGL for OpenGL.

I also removed the OpenVR submodule, as I didn't mean to add it.

@VirtualBrightPlayz

VirtualBrightPlayz commented May 20, 2022 •

Copy link
Copy Markdown
Author

I've been looking into supporting Linux with this (was going to make a new PR), however there is a bug in both gcc and clang that prevents PGE's String class from compiling.
I'm still looking for obvious workarounds, but I think the "workaround" is custom patches to gcc (clang doesn't support some of the c++20 features yet) or rewrite parts of the String code to work on linux. Not gonna make a new issue on PGE regarding Strings, as juanjp600/pge#56 exists, which might fix this depending on implementation.
clang/llvm issue gcc issue

macOS support with CMake is unknown as I don't own a mac.

TODO: futureproof the CMake files with removal of TARGET_RUNTIME_DLLS

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant