diff --git a/.gitignore b/.gitignore index 73e536c..7545739 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ .vs/ build/ +include/ +lib/ \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json index e5c1400..7da00af 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,26 +1,46 @@ { - "version": "0.2.0", - "configurations": [ - { - "name": "Debug Engine", - "type": "cppvsdbg", - "request": "launch", - "program": "${workspaceFolder}/build/engine/Debug/engine.exe", // Path to your executable - "args": [], - "stopAtEntry": false, - "cwd": "${workspaceFolder}", - "environment": [], - "externalConsole": false, - "preLaunchTask": "build engine", // This will run the "build engine" task before launching - "miDebuggerPath": "C:/mingw-w64/bin/gdb.exe", // Specify the correct path to your debugger - "setupCommands": [ - { - "description": "Enable pretty-printing for gdb", - "text": "-enable-pretty-printing", - "ignoreFailures": true - } - ] - } - ] - } - \ No newline at end of file + "version": "0.2.0", + "configurations": [ + { + "name": "Debug Engine (Windows)", + "type": "cppvsdbg", + "request": "launch", + "program": "${workspaceFolder}/build/engine/Debug/engine.exe", + "args": [], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "environment": [], + "externalConsole": false, + "preLaunchTask": "build engine", + "miDebuggerPath": "C:/mingw-w64/bin/gdb.exe", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + }, + { + "name": "Debug Engine (Linux)", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/build/engine/engine", + "args": [], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "environment": [], + "externalConsole": true, + "MIMode": "gdb", + "miDebuggerPath": "/usr/bin/gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ], + "preLaunchTask": "build engine" + } + ] +} diff --git a/engine/CMakeLists.txt b/engine/CMakeLists.txt index f2f851b..9cdf8a7 100644 --- a/engine/CMakeLists.txt +++ b/engine/CMakeLists.txt @@ -15,17 +15,26 @@ set(SOURCES include_directories(${CMAKE_SOURCE_DIR}/include) link_directories(${CMAKE_SOURCE_DIR}/lib) -file(GLOB SDL2_LIB "${CMAKE_SOURCE_DIR}/lib/*.lib") -file(GLOB LUAJIT_LIB "${CMAKE_SOURCE_DIR}/lib/*.lib") - add_executable(engine ${SOURCES}) if(WIN32) + file(GLOB SDL2_LIB "${CMAKE_SOURCE_DIR}/lib/*.lib") + file(GLOB LUAJIT_LIB "${CMAKE_SOURCE_DIR}/lib/*.lib") + + target_link_libraries(engine + ${SDL2_LIB} + ${CMAKE_SOURCE_DIR}/lib/luajit.lib + ) elseif(UNIX) + include_directories(${SDL2_INCLUDE_DIRS} ${LUAJIT_INCLUDE_DIRS}) + link_directories(${SDL2_LIBRARY_DIRS} ${LUAJIT_LIBRARY_DIRS}) + + target_link_libraries(engine + ${SDL2_LIBRARIES} + ${LUAJIT_LIBRARIES} + luajit + dl # just in case LuaJIT needs dynamic linking + m # math lib, commonly needed + ) endif() -# Link all required libraries -target_link_libraries(engine - ${SDL2_LIB} - ${CMAKE_SOURCE_DIR}/lib/luajit.lib -) diff --git a/engine/main.cpp b/engine/main.cpp index e0d65e8..3939dd2 100644 --- a/engine/main.cpp +++ b/engine/main.cpp @@ -3,8 +3,6 @@ #include #include -#include - extern "C" { #include #include diff --git a/include/luajit.h b/include/luajit.h index b74e19a..82079b8 100644 --- a/include/luajit.h +++ b/include/luajit.h @@ -30,9 +30,9 @@ #include "lua.h" -#define LUAJIT_VERSION "LuaJIT 2.1.1745076535" +#define LUAJIT_VERSION "LuaJIT 2.1.1745036828" #define LUAJIT_VERSION_NUM 20199 /* Deprecated. */ -#define LUAJIT_VERSION_SYM luaJIT_version_2_1_1745076535 +#define LUAJIT_VERSION_SYM luaJIT_version_2_1_1745036828 #define LUAJIT_COPYRIGHT "Copyright (C) 2005-2025 Mike Pall" #define LUAJIT_URL "https://luajit.org/" diff --git a/lib/lua51.lib b/lib/lua51.lib deleted file mode 100644 index 9812b34..0000000 Binary files a/lib/lua51.lib and /dev/null differ diff --git a/lib/luajit.lib b/lib/luajit.lib deleted file mode 100644 index 9790138..0000000 Binary files a/lib/luajit.lib and /dev/null differ