feat: replaced premake5 with CMake to vendor SDL3
This commit is contained in:
parent
75455102ed
commit
98e4932a43
25
CMakeLists.txt
Normal file
25
CMakeLists.txt
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
cmake_minimum_required(VERSION 3.21)
|
||||
project(GameOfLife)
|
||||
|
||||
set(CMAKE_BINARY_DIR "${CMAKE_SOURCE_DIR}/bin")
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
|
||||
|
||||
set(CMAKE_CXX_STANDARD 23)
|
||||
set(CMAKE_C_STANDARD 23)
|
||||
|
||||
file(GLOB_RECURSE source_files . src/**.cpp src/**.c vendor/renderer/**.c)
|
||||
include_directories(vendor/)
|
||||
|
||||
add_subdirectory(vendor/SDL3/ EXCLUDE_FROM_ALL)
|
||||
set(SDLTTF_VENDORED ON)
|
||||
add_subdirectory(vendor/SDL3_ttf/ EXCLUDE_FROM_ALL)
|
||||
|
||||
add_executable(GameOfLife ${source_files})
|
||||
target_link_libraries(GameOfLife PRIVATE SDL3_ttf::SDL3_ttf SDL3::SDL3)
|
||||
|
||||
add_custom_target(copy_assets
|
||||
COMMAND ${CMAKE_COMMAND} -E
|
||||
copy_directory ${CMAKE_SOURCE_DIR}/assets/ ${CMAKE_BINARY_DIR}/assets
|
||||
)
|
||||
add_dependencies(GameOfLife copy_assets)
|
||||
6
justfile
6
justfile
|
|
@ -1,13 +1,13 @@
|
|||
build:
|
||||
# BUILDING
|
||||
bear -- make
|
||||
bear -- cmake --build build
|
||||
|
||||
run:
|
||||
bin/DiceGui
|
||||
cd bin/ && DiceGui
|
||||
|
||||
configure:
|
||||
# CONFIGURING WITH PREMAKE
|
||||
premake5 gmake
|
||||
cmake -S. -Bbuild
|
||||
|
||||
clean:
|
||||
rm -r bin/**
|
||||
|
|
|
|||
27
premake5.lua
27
premake5.lua
|
|
@ -1,27 +0,0 @@
|
|||
workspace "GameOfLife"
|
||||
configurations { "debug", "release" }
|
||||
location "."
|
||||
|
||||
project "GameOfLife"
|
||||
kind "ConsoleApp"
|
||||
language "C++"
|
||||
cppdialect "c++23"
|
||||
cdialect "c23"
|
||||
location "build/"
|
||||
files { "src/**.cpp", "src/**.c", "vendor/**.cpp", "vendor/**.c" }
|
||||
includedirs { "include/", "vendor/" }
|
||||
links { "m", "stdc++", "SDL3", "SDL3_ttf", "SDL3_image" }
|
||||
buildoptions { "-Wall" }
|
||||
targetdir "bin/"
|
||||
postbuildcommands {
|
||||
"{RMDIR} %{cfg.targetdir}/assets",
|
||||
"{COPYDIR} %{wks.location}/assets/ %{cfg.targetdir}/assets/"
|
||||
}
|
||||
filter "configurations:debug"
|
||||
defines { "DEBUG" }
|
||||
symbols "On"
|
||||
optimize "Off"
|
||||
filter "configurations:release"
|
||||
defines { "NDEBUG" }
|
||||
optimize "On"
|
||||
symbols "Off"
|
||||
Loading…
Reference in a new issue