Skip to content

Commit 1b55009

Browse files
chore: rename project name and executable to arena rush (#20)
1 parent c1e812f commit 1b55009

5 files changed

Lines changed: 242 additions & 237 deletions

File tree

CMakeLists.txt

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.21) # Selects the minimum version of CMake required to run this file
2-
project(GFX_LAB
2+
project(ArenaRush
33
VERSION 0.1.0
44
LANGUAGES C CXX
55
)
@@ -110,7 +110,7 @@ target_link_libraries(imgui
110110

111111

112112
# ---- Application Sources ----
113-
add_executable(GAME_APPLICATION
113+
add_executable(${PROJECT_NAME}
114114
src/main.cpp
115115
src/common/application.cpp
116116

@@ -145,14 +145,14 @@ add_executable(GAME_APPLICATION
145145
src/common/systems/forward-renderer.cpp
146146
)
147147

148-
target_include_directories(GAME_APPLICATION
148+
target_include_directories(${PROJECT_NAME}
149149
PRIVATE
150150
src/common
151151
src/game
152152
src/states
153153
)
154154

155-
target_link_libraries(GAME_APPLICATION
155+
target_link_libraries(${PROJECT_NAME}
156156
PRIVATE
157157
glad
158158
glfw
@@ -161,30 +161,32 @@ target_link_libraries(GAME_APPLICATION
161161
utils
162162
)
163163

164-
set_target_properties(GAME_APPLICATION PROPERTIES
164+
set_target_properties(${PROJECT_NAME} PROPERTIES
165165
RUNTIME_OUTPUT_DIRECTORY_DEBUG ${PROJECT_SOURCE_DIR}/bin
166166
RUNTIME_OUTPUT_DIRECTORY_RELEASE ${PROJECT_SOURCE_DIR}/bin
167167
)
168168

169-
install(TARGETS GAME_APPLICATION
169+
install(TARGETS ${PROJECT_NAME}
170170
RUNTIME DESTINATION bin
171171
)
172172

173173
install(DIRECTORY assets/
174-
DESTINATION bin/assets
174+
DESTINATION assets/
175175
)
176176

177-
177+
install(FILES config/app.jsonc
178+
DESTINATION config/
179+
)
178180

179181
if(UNIX AND NOT APPLE)
180-
target_link_libraries(GAME_APPLICATION
182+
target_link_libraries(${PROJECT_NAME}
181183
PRIVATE
182184
OpenGL::GL
183185
)
184186
endif()
185187

186188
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU")
187-
target_compile_options(GAME_APPLICATION PRIVATE -Wall)
189+
target_compile_options(${PROJECT_NAME} PRIVATE -Wall)
188190
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
189-
target_compile_options(GAME_APPLICATION PRIVATE /W4)
191+
target_compile_options(${PROJECT_NAME} PRIVATE /W4)
190192
endif()

flake.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
2-
description = "Modern OpenGL (GLAD + GLFW + GLM)";
2+
description = "Arena Rush - A simple OpenGL game built with C++ and CMake";
33

44
inputs = {
5-
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
5+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
66
flake-utils.url = "github:numtide/flake-utils";
7+
self.submodules = true;
78
};
89

910
outputs =
@@ -15,7 +16,7 @@
1516
flake-utils.lib.eachDefaultSystem (
1617
system:
1718
let
18-
packageName = "project-opengl-app";
19+
packageName = "ArenaRush";
1920
pkgs = import nixpkgs { inherit system; };
2021
buildInputs = with pkgs; [
2122
# libraries
@@ -32,42 +33,43 @@
3233
extra-cmake-modules # for wayland
3334

3435
# X11
35-
xorg.libX11
36-
xorg.libXcursor
37-
xorg.libXrandr
38-
xorg.libXi
39-
xorg.libXinerama
36+
libx11
37+
libxcursor
38+
libxrandr
39+
libxi
40+
libxinerama
4041
];
4142

4243
nativeBuildInputs = with pkgs; [
4344
cmake
4445
ninja
4546
pkg-config
4647
makeWrapper
47-
ccache
4848
];
49+
50+
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;
4951
in
5052
{
5153
devShells.default = pkgs.mkShell {
5254

53-
inherit buildInputs nativeBuildInputs;
55+
inherit buildInputs nativeBuildInputs LD_LIBRARY_PATH;
5456

5557
packages = with pkgs; [
5658
# helper
5759
just
5860
powershell
5961
glslang
6062
just-lsp
63+
ccache
64+
clang-tools
6165
];
62-
63-
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;
6466
};
6567

6668
packages = {
6769
default = self.packages.${system}.opengl_app;
6870
opengl_app = pkgs.stdenv.mkDerivation {
6971
pname = packageName;
70-
version = "1.0.0";
72+
version = "0.1.0";
7173

7274
src = self;
7375

@@ -82,8 +84,9 @@
8284

8385
installPhase = ''
8486
cmake --install . --prefix $out
85-
wrapProgram $out/bin/GAME_APPLICATION \
86-
--set LD_LIBRARY_PATH ${pkgs.libGL}/lib:${pkgs.wayland}/lib:${pkgs.libxkbcommon}/lib:$LD_LIBRARY_PATH
87+
wrapProgram $out/bin/ArenaRush \
88+
--chdir $out \
89+
--suffix LD_LIBRARY_PATH : ${LD_LIBRARY_PATH}
8790
'';
8891
};
8992
};

justfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ run config="": build
2121
elif lsmod | grep -i "amdgpu" > /dev/null 2>&1; then
2222
export DRI_PRIME=1
2323
fi
24-
./bin/GAME_APPLICATION {{ if config != "" { "-c " + config } else { "" } }}
24+
just run-int {{ config }}
2525
2626
# Run the game/application on the integrated GPU for testing/sanity checks
2727
run-int config="": build
28-
./bin/GAME_APPLICATION {{ if config != "" { "-c " + config } else { "" } }}
28+
./bin/ArenaRush {{ if config != "" { "-c " + config } else { "" } }}
2929

3030
# Package the project using Nix
3131
package:
32-
nix build ".?submodules=1"
32+
nix build .
3333

3434
# Remove build artifacts
3535
clean:

0 commit comments

Comments
 (0)