Skip to content
This repository was archived by the owner on Oct 7, 2025. It is now read-only.

Commit 6c82367

Browse files
committed
add mgl library
1 parent a4d8564 commit 6c82367

File tree

8 files changed

+20
-50
lines changed

8 files changed

+20
-50
lines changed

.gitignore

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
config.mk
22
build/
33
libmgl.dylib
4-
external/glfw/src/MGLContext.h
5-
external/glfw/src/MGLRenderer.h
6-
external/OpenGL-Registry/
7-
external/SPIRV-Cross/
8-
external/SPIRV-Headers/
9-
external/SPIRV-Tools/
10-
external/ezxml/
11-
external/glslang/
124
*.DS_Store
135
/SPIRV-Headers
146
/SPIRV-Cross

.gitmodules

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[submodule "external/glslang"]
2+
path = external/glslang
3+
url = https://github.com/KhronosGroup/glslang.git
4+
[submodule "external/SPIRV-Cross"]
5+
path = external/SPIRV-Cross
6+
url = https://github.com/r58Playz/SPIRV-Cross.git

CMakeLists.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
cmake_minimum_required(VERSION 3.15)
1+
cmake_minimum_required(VERSION 3.31)
22
project(MGL LANGUAGES C CXX OBJC)
33

4-
execute_process(COMMAND "bash" "build_external.sh" WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/external" COMMAND_ECHO STDOUT)
4+
execute_process(COMMAND "python3" "update_glslang_sources.py" WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/external/glslang" COMMAND_ECHO STDOUT)
55

6+
set(CMAKE_SKIP_INSTALL_RULES TRUE) # disable installs
7+
set(CMAKE_POLICY_VERSION_MINIMUM 3.31) # override cmake minimum version for dependencies
68
set(CMAKE_C_STANDARD 17)
79
set(CMAKE_CXX_STANDARD 20)
10+
set(ENABLE_OPT ON) # use spirv-tools inside glslang
11+
12+
add_subdirectory(external/SPIRV-Cross)
13+
add_subdirectory(external/glslang)
14+
add_subdirectory(external/glfw)
815

916
include_directories(
1017
MGL/SPIRV/SPIRV-Cross
@@ -60,14 +67,7 @@ target_link_libraries(mgl PUBLIC
6067
)
6168

6269
if(MGL_BUILD_TEST)
63-
add_library(glfw-imp STATIC IMPORTED)
64-
set_target_properties(glfw-imp PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/external/glfw/build/src/libglfw3.a")
65-
66-
add_library(glfw INTERFACE)
67-
target_link_libraries(glfw INTERFACE glfw-imp mgl)
68-
target_include_directories(glfw INTERFACE "external/glfw/include")
69-
70-
add_dependencies(glfw mgl)
70+
target_link_libraries(glfw INTERFACE mgl)
7171

7272
add_library(glm INTERFACE)
7373
target_include_directories(glm INTERFACE "mgl/MGL/include")

external/SPIRV-Cross

Submodule SPIRV-Cross added at 1884e75

external/build_external.sh

Lines changed: 0 additions & 32 deletions
This file was deleted.

external/glfw/src/MGLContext.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../MGL/include/MGLContext.h

external/glfw/src/MGLRenderer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../MGL/include/MGLRenderer.h

external/glslang

Submodule glslang added at eb77189

0 commit comments

Comments
 (0)