mirror of
https://github.com/ProgramSnail/snake_2024.git
synced 2025-12-06 06:28:43 +00:00
initial template changes, xmake integration
This commit is contained in:
parent
a1430a42aa
commit
b4a4ffc08a
7 changed files with 27 additions and 17 deletions
6
.gitignore
vendored
6
.gitignore
vendored
|
|
@ -30,3 +30,9 @@
|
||||||
*.exe
|
*.exe
|
||||||
*.out
|
*.out
|
||||||
*.app
|
*.app
|
||||||
|
|
||||||
|
build
|
||||||
|
.cache
|
||||||
|
.xmake
|
||||||
|
|
||||||
|
compile_commands.json
|
||||||
|
|
|
||||||
|
|
@ -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)
|
|
||||||
14
README.md
14
README.md
|
|
@ -1,10 +1,10 @@
|
||||||
# Game Template (Linux)
|
# Game (Linux)
|
||||||
|
|
||||||
A simple framework for prototyping games. \
|
Game, based on https://github.com/imp5imp5/game_template_linux.
|
||||||
The framework provides a video buffer and simple keyboard and mouse input.
|
|
||||||
|
|
||||||
### Build
|
### Build
|
||||||
``sudo apt install g++ cmake libx11-dev`` \
|
``sudo apt install g++ cmake libx11-dev xmake`` \
|
||||||
``mkdir build && cd build`` \
|
``xmake``
|
||||||
``cmake -DCMAKE_BUILD_TYPE=Release ..`` \
|
|
||||||
``make``
|
### Run
|
||||||
|
``xmake run``
|
||||||
|
|
|
||||||
14
xmake.lua
Normal file
14
xmake.lua
Normal 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)")
|
||||||
Loading…
Add table
Add a link
Reference in a new issue