Compile all dependencies from git submodules, convert to cmake
This commit is contained in:
24
.gitmodules
vendored
Normal file
24
.gitmodules
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
[submodule "deps/SDL"]
|
||||
path = deps/SDL
|
||||
url = git@github.com:libsdl-org/SDL.git
|
||||
[submodule "deps/SDL_image"]
|
||||
path = deps/SDL_image
|
||||
url = git@github.com:libsdl-org/SDL_image.git
|
||||
[submodule "deps/SDL_mixer"]
|
||||
path = deps/SDL_mixer
|
||||
url = git@github.com:libsdl-org/SDL_mixer.git
|
||||
[submodule "deps/SDL_ttf"]
|
||||
path = deps/SDL_ttf
|
||||
url = git@github.com:libsdl-org/SDL_ttf.git
|
||||
[submodule "deps/libakgl"]
|
||||
path = deps/libakgl
|
||||
url = https://source.home.aklabs.net/andrew/libakgl.git
|
||||
[submodule "deps/libsdlerror"]
|
||||
path = deps/libakerror
|
||||
url = https://source.home.aklabs.net/andrew/libsdlerror.git
|
||||
[submodule "deps/libakstdlib"]
|
||||
path = deps/libakstdlib
|
||||
url = https://source.home.aklabs.net/andrew/libakstdlib.git
|
||||
[submodule "deps/jansson"]
|
||||
path = deps/jansson
|
||||
url = git@github.com:akheron/jansson.git
|
||||
34
CMakeLists.txt
Normal file
34
CMakeLists.txt
Normal file
@@ -0,0 +1,34 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(akgltest LANGUAGES C)
|
||||
|
||||
add_subdirectory(deps/jansson EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(deps/libakerror EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(deps/libakstdlib EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(deps/SDL EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(deps/SDL_image EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(deps/SDL_mixer EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(deps/SDL_ttf EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(deps/libakgl EXCLUDE_FROM_ALL)
|
||||
|
||||
set(prefix ${CMAKE_INSTALL_PREFIX})
|
||||
set(exec_prefix "\${prefix}")
|
||||
set(libdir "\${exec_prefix}/lib")
|
||||
set(includedir "\${prefix}/include")
|
||||
|
||||
# Add include directories
|
||||
include_directories(${SDL3_INCLUDE_DIRS})
|
||||
add_executable(akgltest src/akgltest.c)
|
||||
|
||||
target_link_libraries(akgltest
|
||||
PRIVATE
|
||||
akerror::akerror
|
||||
akstdlib::akstdlib
|
||||
akgl::akgl
|
||||
SDL3::SDL3
|
||||
SDL3_image::SDL3_image
|
||||
SDL3_mixer::SDL3_mixer
|
||||
SDL3_ttf::SDL3_ttf
|
||||
jansson::jansson
|
||||
-lm
|
||||
)
|
||||
|
||||
26
Makefile
26
Makefile
@@ -1,26 +0,0 @@
|
||||
SDLFLAGS_CC:=$(shell pkg-config sdl3 --cflags) $(shell pkg-config sdl3-ttf --cflags) $(shell pkg-config sdl3-image --cflags) $(shell pkg-config akgl --cflags) $(shell pkg-config akerror --cflags)
|
||||
SDLFLAGS_LD:=$(shell pkg-config sdl3 --libs) $(shell pkg-config sdl3-ttf --libs) $(shell pkg-config sdl3-mixer --libs) $(shell pkg-config sdl3-image --libs) $(shell pkg-config akgl --libs) $(shell pkg-config akerror --libs) -lasound
|
||||
CC:=$(shell which gcc)
|
||||
LD:=$(shell which ld)
|
||||
|
||||
SRCFILES:=$(shell find src -type f -name '*.c')
|
||||
OBJFILES:=$(patsubst %.c,%.o,$(SRCFILES))
|
||||
|
||||
LDFLAGS:=-L/home/andrew/local/lib -lsdlerror -lakgl -lgcov -lbox2d -ljansson
|
||||
CFLAGS:=-I/home/andrew/local/include -g3 -gdwarf-2 -I./include/ -Wall -fstack-usage -Werror=analyzer-use-of-uninitialized-value -Werror=unused-result -Werror=multistatement-macros
|
||||
|
||||
DISTFILE:=dist/akgl-test
|
||||
|
||||
.PHONY: lib
|
||||
.PHONY: clean
|
||||
|
||||
all: $(DISTFILE)
|
||||
|
||||
clean:
|
||||
rm -fr $(OBJFILES) ${DISTFILE}
|
||||
|
||||
src/%.o: src/%.c $(LIB_HEADERS)
|
||||
$(CC) -c -o $@ $(CFLAGS) $(SDLFLAGS_CC) $<
|
||||
|
||||
$(DISTFILE): $(OBJFILES)
|
||||
$(CC) -o $@ $^ $(LDFLAGS) $(SDLFLAGS_LD) -lm -lwayland-client
|
||||
BIN
assets/C64_Pro-STYLE.ttf
Normal file
BIN
assets/C64_Pro-STYLE.ttf
Normal file
Binary file not shown.
1
deps/SDL
vendored
Submodule
1
deps/SDL
vendored
Submodule
Submodule deps/SDL added at f30ec9940a
1
deps/SDL_image
vendored
Submodule
1
deps/SDL_image
vendored
Submodule
Submodule deps/SDL_image added at fcb9d0b15f
1
deps/SDL_mixer
vendored
Submodule
1
deps/SDL_mixer
vendored
Submodule
Submodule deps/SDL_mixer added at 63bb682ef0
1
deps/SDL_ttf
vendored
Submodule
1
deps/SDL_ttf
vendored
Submodule
Submodule deps/SDL_ttf added at 2eabf8bcdf
1
deps/jansson
vendored
Submodule
1
deps/jansson
vendored
Submodule
Submodule deps/jansson added at 1eb7a81297
1
deps/libakerror
vendored
Submodule
1
deps/libakerror
vendored
Submodule
Submodule deps/libakerror added at 768a235da4
1
deps/libakgl
vendored
Submodule
1
deps/libakgl
vendored
Submodule
Submodule deps/libakgl added at 6f62e674d5
1
deps/libakstdlib
vendored
Submodule
1
deps/libakstdlib
vendored
Submodule
Submodule deps/libakstdlib added at dda645e188
Reference in New Issue
Block a user