initial template changes, xmake integration

This commit is contained in:
programsnail 2024-07-20 22:43:52 +03:00
parent a1430a42aa
commit b4a4ffc08a
7 changed files with 27 additions and 17 deletions

6
.gitignore vendored
View file

@ -30,3 +30,9 @@
*.exe
*.out
*.app
build
.cache
.xmake
compile_commands.json

View file

@ -1,10 +0,0 @@
# You are free to modify this file
cmake_minimum_required(VERSION 3.0)
project(game)
find_package(X11 REQUIRED)
set(CMAKE_CONFIGURATION_TYPES "Debug" "Release")
file(GLOB SRC *.cpp)
add_executable(game ${SRC})
target_link_libraries(game m X11)

View file

@ -1,10 +1,10 @@
# Game Template (Linux)
# Game (Linux)
A simple framework for prototyping games. \
The framework provides a video buffer and simple keyboard and mouse input.
Game, based on https://github.com/imp5imp5/game_template_linux.
### Build
``sudo apt install g++ cmake libx11-dev`` \
``mkdir build && cd build`` \
``cmake -DCMAKE_BUILD_TYPE=Release ..`` \
``make``
``sudo apt install g++ cmake libx11-dev xmake`` \
``xmake``
### Run
``xmake run``

14
xmake.lua Normal file
View file

@ -0,0 +1,14 @@
add_requires("libx11")
add_rules("mode.debug", "mode.release")
set_languages("c++20")
target("game")
set_kind("binary")
add_includedirs("include")
-- add_includedirs(os.dirs(path.join(os.scriptdir(), "include/**")))
add_files("src/**.cpp")
add_packages("libx11")
set_warnings("allextra")
set_rundir("$(projectdir)")