This commit is contained in:
Asuro
2025-02-06 02:09:19 +01:00
parent 3e7c0b73e0
commit 445844bb6d
6 changed files with 84 additions and 0 deletions

35
src/.gitignore vendored Normal file
View File

@@ -0,0 +1,35 @@
# Prerequisites
*.d
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Fortran module files
*.mod
*.smod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
# build dirs
cmake-build/

View File

@@ -0,0 +1,3 @@
[language-server.clangd]
command = "clangd"
args=["--compile-commands-dir=cmake-build"]

30
src/CMakeLists.txt Normal file
View File

@@ -0,0 +1,30 @@
cmake_minimum_required(VERSION 3.10)
project(PuzGameProj)
file(GLOB_RECURSE sources_engine engine/*.cpp engine/*.h)
#file(GLOB_RECURSE data resources/xyz)
add_executable(PuzGame ${sources_engine})
#target_compile_options(PuzGame PUBLIC xyz)
set_property(TARGET PuzGame PROPERTY CXX_STANDARD 17)
#file(COPY ${data} DESTINATION resources)
# BGFX
add_library(bx STATIC IMPORTED)
add_library(bimg STATIC IMPORTED)
add_library(bgfx STATIC IMPORTED)
set_target_properties(bx PROPERTIES
IMPORTED_LOCATION "${CMAKE_SOURCE_DIR}/dependency/bgfx/.build/win64_vs2022/bin/bxDebug.lib"
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR}/dependency/bx/include/"
)
set_target_properties(bimg PROPERTIES
IMPORTED_LOCATION "${CMAKE_SOURCE_DIR}/dependency/bgfx/.build/win64_vs2022/bin/bimgDebug.lib"
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR}/dependency/bimg/include/"
)
set_target_properties(bgfx PROPERTIES
IMPORTED_LOCATION "${CMAKE_SOURCE_DIR}/dependency/bgfx/.build/win64_vs2022/bin/bgfxDebug.lib"
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR}/dependency/bgfx/include/"
)
target_link_libraries(PuzGame bx bimg bgfx)
target_compile_definitions(PuzGame PUBLIC BX_CONFIG_DEBUG=1)

1
src/build.bat Normal file
View File

@@ -0,0 +1 @@
cmake --build cmake-build && start ./cmake-build/PuzGame.exe

11
src/engine/main.cpp Normal file
View File

@@ -0,0 +1,11 @@
#include <bx/bx.h>
#include <cstdio>
int main()
{
while (true)
{
printf("a\n");
}
return 1;
}

4
src/setup.bat Normal file
View File

@@ -0,0 +1,4 @@
cd dependency\bgfx
..\bx\tools\bin\windows\genie vs2022
cd ..\..
cmake -G "Ninja" -S . -B cmake-build -DCMAKE_C_COMPILER="clang.exe" -DCMAKE_CXX_COMPILER="clang++.exe" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON