Remove include, lib
Update launch.json to include Linux specific debug config Update CMakeList to compile on Linux
This commit is contained in:
parent
6fc18195fc
commit
10064f31c2
7 changed files with 66 additions and 37 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,3 +1,5 @@
|
||||||
|
|
||||||
.vs/
|
.vs/
|
||||||
build/
|
build/
|
||||||
|
include/
|
||||||
|
lib/
|
70
.vscode/launch.json
vendored
70
.vscode/launch.json
vendored
|
@ -1,26 +1,46 @@
|
||||||
{
|
{
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"configurations": [
|
"configurations": [
|
||||||
{
|
{
|
||||||
"name": "Debug Engine",
|
"name": "Debug Engine (Windows)",
|
||||||
"type": "cppvsdbg",
|
"type": "cppvsdbg",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"program": "${workspaceFolder}/build/engine/Debug/engine.exe", // Path to your executable
|
"program": "${workspaceFolder}/build/engine/Debug/engine.exe",
|
||||||
"args": [],
|
"args": [],
|
||||||
"stopAtEntry": false,
|
"stopAtEntry": false,
|
||||||
"cwd": "${workspaceFolder}",
|
"cwd": "${workspaceFolder}",
|
||||||
"environment": [],
|
"environment": [],
|
||||||
"externalConsole": false,
|
"externalConsole": false,
|
||||||
"preLaunchTask": "build engine", // This will run the "build engine" task before launching
|
"preLaunchTask": "build engine",
|
||||||
"miDebuggerPath": "C:/mingw-w64/bin/gdb.exe", // Specify the correct path to your debugger
|
"miDebuggerPath": "C:/mingw-w64/bin/gdb.exe",
|
||||||
"setupCommands": [
|
"setupCommands": [
|
||||||
{
|
{
|
||||||
"description": "Enable pretty-printing for gdb",
|
"description": "Enable pretty-printing for gdb",
|
||||||
"text": "-enable-pretty-printing",
|
"text": "-enable-pretty-printing",
|
||||||
"ignoreFailures": true
|
"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"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
|
@ -15,17 +15,26 @@ set(SOURCES
|
||||||
include_directories(${CMAKE_SOURCE_DIR}/include)
|
include_directories(${CMAKE_SOURCE_DIR}/include)
|
||||||
link_directories(${CMAKE_SOURCE_DIR}/lib)
|
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})
|
add_executable(engine ${SOURCES})
|
||||||
|
|
||||||
if(WIN32)
|
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)
|
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()
|
endif()
|
||||||
|
|
||||||
# Link all required libraries
|
|
||||||
target_link_libraries(engine
|
|
||||||
${SDL2_LIB}
|
|
||||||
${CMAKE_SOURCE_DIR}/lib/luajit.lib
|
|
||||||
)
|
|
||||||
|
|
|
@ -3,8 +3,6 @@
|
||||||
#include <glad/glad.h>
|
#include <glad/glad.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#include <filesystem>
|
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include <lua.h>
|
#include <lua.h>
|
||||||
#include <lualib.h>
|
#include <lualib.h>
|
||||||
|
|
|
@ -30,9 +30,9 @@
|
||||||
|
|
||||||
#include "lua.h"
|
#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_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_COPYRIGHT "Copyright (C) 2005-2025 Mike Pall"
|
||||||
#define LUAJIT_URL "https://luajit.org/"
|
#define LUAJIT_URL "https://luajit.org/"
|
||||||
|
|
||||||
|
|
BIN
lib/lua51.lib
BIN
lib/lua51.lib
Binary file not shown.
BIN
lib/luajit.lib
BIN
lib/luajit.lib
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue