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

Commit 951aca9

Browse files
committed
add mgl library
1 parent a4d8564 commit 951aca9

File tree

8 files changed

+18
-49
lines changed

8 files changed

+18
-49
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: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
cmake_minimum_required(VERSION 3.15)
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 "bash" "./update_glslang_sources.py" WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/external/glslang" COMMAND_ECHO STDOUT)
55

66
set(CMAKE_C_STANDARD 17)
77
set(CMAKE_CXX_STANDARD 20)
88

9+
set(ENABLE_OPT ON)
10+
11+
add_subdirectory(external/SPIRV-Cross)
12+
add_subdirectory(external/glslang)
13+
add_subdirectory(external/glfw)
14+
915
include_directories(
1016
MGL/SPIRV/SPIRV-Cross
1117
MGL/include
@@ -60,14 +66,7 @@ target_link_libraries(mgl PUBLIC
6066
)
6167

6268
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)
69+
target_link_libraries(glfw INTERFACE mgl)
7170

7271
add_library(glm INTERFACE)
7372
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)