-
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Makefile
60 lines (47 loc) · 1.76 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
imgui_src := 3rdparty/cimgui
c_imgui_src := Sources/CImGui
swift_imgui_src := Sources/ImGui
release_dir := .build/release
autowrapper_assets := Sources/AutoWrapper/Assets
SWIFT_PACKAGE_VERSION := $(shell swift package tools-version)
# Lint fix and format code.
.PHONY: lint-fix
lint-fix:
mint run swiftlint --fix --quiet
mint run swiftformat --quiet --swiftversion ${SWIFT_PACKAGE_VERSION} .
.PHONY: setupEnv
setupEnv:
brew install luajit
.PHONY: build-release
build-release:
swift build -c release -Xcxx -Wno-modules-import-nested-redundant -Xcxx -Wno-return-type-c-linkage -Xcc -Wno-modules-import-nested-redundant -Xcc -Wno-return-type-c-linkage
.PHONY: test
test:
swift test -Xcxx -Wno-modules-import-nested-redundant -Xcxx -Wno-return-type-c-linkage -Xcc -Wno-modules-import-nested-redundant -Xcc -Wno-return-type-c-linkage
.PHONY: generateCInterface
generateCInterface:
cd $(imgui_src)/generator && luajit ./generator.lua gcc "internal" glfw glut metal sdl
.PHONY: copyLibImGui
copyLibImGui:
cp $(imgui_src)/cimgui.h $(c_imgui_src)/include
cp $(imgui_src)/cimgui.cpp $(c_imgui_src)
cp $(imgui_src)/imgui/*.h $(c_imgui_src)/imgui
cp $(imgui_src)/imgui/*.cpp $(c_imgui_src)/imgui
cp $(imgui_src)/generator/output/definitions.json $(autowrapper_assets)/definitions.json
.PHONY: buildAutoWrapper
buildAutoWrapper:
swift build -c release --product AutoWrapper
.PHONY: wrapLibImGui
wrapLibImGui: buildAutoWrapper
$(release_dir)/AutoWrapper
.PHONY: applyFixIfDefsPatch
applyFixIfDefsPatch:
git apply patch_fix_ifdefs.diff
.PHONY: resetSubmodule
resetSubmodule:
cd $(imgui_src) && git checkout -- .
.PHONY: update
update: generateCInterface copyLibImGui wrapLibImGui applyFixIfDefsPatch resetSubmodule
.PHONY: testReadme
testReadme:
markdown-link-check -p -v ./README.md