Skip to content

Commit 16f1694

Browse files
feat: implement core application structure with basic 2d shapes
1 parent f96dade commit 16f1694

13 files changed

Lines changed: 551 additions & 336 deletions

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ build/
88
# Idea
99
.idea
1010

11-
# cmkr
11+
# cmake
1212
build*/
1313
cmake-build*/
14-
CMakerLists.txt
15-
CMakeLists.txt.user
14+

CMakeLists.txt

Lines changed: 57 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,74 @@
1-
# This file is automatically generated from cmake.toml - DO NOT EDIT
2-
# See https://github.com/build-cpp/cmkr for more information
1+
cmake_minimum_required(VERSION 3.24)
2+
project(vectorjs VERSION 0.1.0 LANGUAGES CXX)
33

4-
cmake_minimum_required(VERSION 3.15)
4+
# Require C++23 standard
5+
set(CMAKE_CXX_STANDARD 23)
6+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
7+
set(CMAKE_CXX_EXTENSIONS OFF)
58

6-
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
7-
message(FATAL_ERROR "In-tree builds are not supported. Run CMake from a separate directory: cmake -B build")
8-
endif()
9-
10-
set(CMKR_ROOT_PROJECT OFF)
11-
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
12-
set(CMKR_ROOT_PROJECT ON)
13-
14-
# Bootstrap cmkr and automatically regenerate CMakeLists.txt
15-
include(cmkr.cmake OPTIONAL RESULT_VARIABLE CMKR_INCLUDE_RESULT)
16-
if(CMKR_INCLUDE_RESULT)
17-
cmkr()
18-
endif()
9+
include(FetchContent)
1910

20-
# Enable folder support
21-
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
11+
# -----------------------------------------------------------------------------
12+
# 1. Dependencies
13+
# -----------------------------------------------------------------------------
2214

23-
# Create a configure-time dependency on cmake.toml to improve IDE support
24-
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS cmake.toml)
25-
endif()
26-
27-
project(vectorjs
28-
LANGUAGES
29-
CXX
30-
VERSION
31-
0.1.0
15+
# CLI11 (Header-only CLI parser)
16+
FetchContent_Declare(
17+
cli11
18+
GIT_REPOSITORY https://github.com/CLIUtils/CLI11.git
19+
GIT_TAG v2.6.2
3220
)
3321

34-
include(FetchContent)
22+
# raylib (Windowing, input, and graphics library)
23+
FetchContent_Declare(
24+
raylib
25+
GIT_REPOSITORY https://github.com/raysan5/raylib.git
26+
GIT_TAG 6.0
27+
)
28+
set(BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
29+
set(BUILD_GAMES OFF CACHE BOOL "" FORCE)
3530

36-
# Fix warnings about DOWNLOAD_EXTRACT_TIMESTAMP
37-
if(POLICY CMP0135)
38-
cmake_policy(SET CMP0135 NEW)
39-
endif()
40-
message(STATUS "Fetching raylib (6.0)...")
41-
FetchContent_Declare(raylib
42-
GIT_REPOSITORY
43-
"https://github.com/raysan5/raylib.git"
44-
GIT_TAG
45-
6.0
31+
# quickjs-ng (Next-generation QuickJS engine)
32+
FetchContent_Declare(
33+
quickjs-ng
34+
GIT_REPOSITORY https://github.com/quickjs-ng/quickjs.git
35+
GIT_TAG v0.15.1
4636
)
47-
FetchContent_MakeAvailable(raylib)
4837

49-
# Target: vectorjs
50-
set(vectorjs_SOURCES
51-
cmake.toml
52-
"src/engine.cpp"
53-
"src/main.cpp"
38+
# qjswrapper (C++ wrapper around QuickJS)
39+
FetchContent_Declare(
40+
qjswrapper
41+
GIT_REPOSITORY https://github.com/burdockcascade/qjswrapper.git
42+
GIT_TAG master
5443
)
5544

56-
add_executable(vectorjs)
45+
# Bring all dependencies into the build tree automatically
46+
FetchContent_MakeAvailable(cli11 raylib quickjs-ng qjswrapper)
47+
48+
# -----------------------------------------------------------------------------
49+
# 2. Executable Target
50+
# -----------------------------------------------------------------------------
5751

58-
target_sources(vectorjs PRIVATE ${vectorjs_SOURCES})
59-
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${vectorjs_SOURCES})
52+
add_executable(vectorjs ${SRC_FILES})
53+
54+
# Hide console on Windows, keep standard main() entry point
55+
if(WIN32)
56+
target_link_options(vectorjs PRIVATE "/SUBSYSTEM:WINDOWS" "/ENTRY:mainCRTStartup")
57+
endif()
6058

61-
target_compile_features(vectorjs PRIVATE
62-
cxx_std_23
59+
target_sources(vectorjs PRIVATE
60+
"src/main.cpp"
61+
"src/engine.cpp"
62+
"src/api/api_application.cpp"
63+
"src/api/api_classes.cpp"
64+
"src/api/api_enums.cpp"
6365
)
6466

67+
target_include_directories(vectorjs PRIVATE src)
68+
6569
target_link_libraries(vectorjs PRIVATE
70+
CLI11::CLI11
6671
raylib
67-
)
68-
69-
get_directory_property(CMKR_VS_STARTUP_PROJECT DIRECTORY ${PROJECT_SOURCE_DIR} DEFINITION VS_STARTUP_PROJECT)
70-
if(NOT CMKR_VS_STARTUP_PROJECT)
71-
set_property(DIRECTORY ${PROJECT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT vectorjs)
72-
endif()
72+
qjs
73+
qjswrapper
74+
)

cmake.toml

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)