From ac0247a610a5a2ffbb8419a5de02c49fac9b4265 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 27 May 2023 11:47:02 +0100 Subject: Add glad submodule and build a glad library Slightly messy regarding file paths to get files generated by the glad generator into a place where b2 will happily find them later... but it works. --- .gitmodules | 3 +++ Jamroot.jam | 6 ++++-- thirdparty/Jamfile.jam | 7 +++++++ thirdparty/gl.xml | 1 + thirdparty/glad | 1 + thirdparty/glad.jam | 20 ++++++++++++++++++++ 6 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 .gitmodules create mode 100644 thirdparty/Jamfile.jam create mode 120000 thirdparty/gl.xml create mode 160000 thirdparty/glad create mode 100644 thirdparty/glad.jam diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..0ce5431 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "thirdparty/glad"] + path = thirdparty/glad + url = https://github.com/Dav1dde/glad diff --git a/Jamroot.jam b/Jamroot.jam index 95b3135..0273fe2 100644 --- a/Jamroot.jam +++ b/Jamroot.jam @@ -58,8 +58,8 @@ always main ; run iliketrains : -- : [ sequence.insertion-sort [ glob-tree-ex res : *.* ] ] : : main ; lib ilt : - [ glob-tree *.cpp *.?s *.t?s : application bin test ] - [ lib generated : [ glob-tree *.ll *.c ] : + [ glob-tree *.cpp *.?s *.t?s : application bin test thirdparty ] + [ lib generated : [ glob-tree *.ll *.c : bin thirdparty ] : . lib static @@ -89,6 +89,8 @@ lib ilt : gcc,debug:-Wuseless-cast . lib + thirdparty//glad + thirdparty//glad sdl2 glew freetype2 diff --git a/thirdparty/Jamfile.jam b/thirdparty/Jamfile.jam new file mode 100644 index 0000000..bee3392 --- /dev/null +++ b/thirdparty/Jamfile.jam @@ -0,0 +1,7 @@ +import glad ; +lib glad : gl.xml : + static + -fPIC + off + off + ; diff --git a/thirdparty/gl.xml b/thirdparty/gl.xml new file mode 120000 index 0000000..bfea0d8 --- /dev/null +++ b/thirdparty/gl.xml @@ -0,0 +1 @@ +glad/glad/files/gl.xml \ No newline at end of file diff --git a/thirdparty/glad b/thirdparty/glad new file mode 160000 index 0000000..2348b07 --- /dev/null +++ b/thirdparty/glad @@ -0,0 +1 @@ +Subproject commit 2348b07c1ab4504d60398713781d8a57880234fa diff --git a/thirdparty/glad.jam b/thirdparty/glad.jam new file mode 100644 index 0000000..f89750c --- /dev/null +++ b/thirdparty/glad.jam @@ -0,0 +1,20 @@ +import generators : register-standard ; +import feature : feature ; +import toolset : flags ; + +generators.register-standard glad.generate.c : XML : C(%) H(glad/%) XML ; +feature glad.pythonpath : thirdparty/glad : path ; +feature glad.profile : core compatibility ; +feature glad.version : 4.6 ; +flags glad.generate.c PYTHONPATH ; +flags glad.generate.c PROFILE ; +flags glad.generate.c VERSION ; + +actions glad.generate.c +{ + rm -rf $(1:D) + PYTHONPATH=$(PYTHONPATH) python -m glad --api=$(2:B):$(PROFILE)=$(VERSION) --merge --out-path=$(1[3]:D) --reproducible --quiet c + mv $(1[3]:D)/src/$(1[1]:BS) $(1[1]) + mkdir -p $(1[2]:D) + mv $(1[3]:D)/include/glad/$(1[2]:BS) $(1[2]) +} -- cgit v1.2.3