forked from redo/BlockLua
...
This commit is contained in:
@@ -5,13 +5,13 @@ project(BlockLua CXX)
|
|||||||
# Export compile_commands.json for VSCode IntelliSense
|
# Export compile_commands.json for VSCode IntelliSense
|
||||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
|
|
||||||
# Output directories to mirror compile.bat's build folder
|
# Output directories to mirror build.bat's build folder
|
||||||
set(OUTPUT_DIR ${CMAKE_SOURCE_DIR}/build)
|
set(OUTPUT_DIR ${CMAKE_SOURCE_DIR}/build)
|
||||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_DIR})
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_DIR})
|
||||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_DIR})
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_DIR})
|
||||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_DIR})
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_DIR})
|
||||||
|
|
||||||
# Global compile options to mirror compile.bat
|
# Global build options to mirror build.bat
|
||||||
add_compile_options(
|
add_compile_options(
|
||||||
-Wall
|
-Wall
|
||||||
-Werror
|
-Werror
|
||||||
@@ -27,14 +27,14 @@ include_directories(
|
|||||||
${CMAKE_SOURCE_DIR}/inc/lua
|
${CMAKE_SOURCE_DIR}/inc/lua
|
||||||
)
|
)
|
||||||
|
|
||||||
# Link directories (for -L.) and libraries from compile.bat
|
# Link directories (for -L.) and libraries from build.bat
|
||||||
link_directories(
|
link_directories(
|
||||||
${CMAKE_SOURCE_DIR}
|
${CMAKE_SOURCE_DIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
# Safe DLL
|
# Safe DLL
|
||||||
add_library(BlockLua SHARED src/bllua4.cpp)
|
add_library(BlockLua SHARED src/bllua4.cpp)
|
||||||
# Ensure output name matches compile.bat
|
# Ensure output name matches build.bat
|
||||||
set_target_properties(BlockLua PROPERTIES OUTPUT_NAME "BlockLua")
|
set_target_properties(BlockLua PROPERTIES OUTPUT_NAME "BlockLua")
|
||||||
# Linker flags and libraries
|
# Linker flags and libraries
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
@echo off
|
@echo off
|
||||||
cd /d %~dp0
|
cd /d %~dp0
|
||||||
|
|
||||||
REM Ensure MinGW32 toolchain is first in PATH (matches compile.bat)
|
REM Ensure MinGW32 toolchain is first in PATH
|
||||||
set "PATH=C:\msys64\mingw32\bin;%PATH%"
|
set "PATH=C:\msys64\mingw32\bin;%PATH%"
|
||||||
|
|
||||||
REM Configure CMake (generate into build/)
|
REM Configure CMake (generate into build/)
|
||||||
13
compile.bat
13
compile.bat
@@ -1,13 +0,0 @@
|
|||||||
@echo off
|
|
||||||
cd /d %~dp0
|
|
||||||
|
|
||||||
set "PATH=C:\msys64\mingw32\bin;%PATH%"
|
|
||||||
|
|
||||||
if not exist build mkdir build
|
|
||||||
|
|
||||||
set buildargs=-Wall -Werror -m32 -shared -Isrc -Iinc/tsfuncs -Iinc/lua -lpsapi -L. -llua5.1 -static-libgcc -static-libstdc++
|
|
||||||
|
|
||||||
echo on
|
|
||||||
g++ src/bllua4.cpp %buildargs% -o build\BlockLua.dll
|
|
||||||
g++ -DBLLUA_UNSAFE src/bllua4.cpp %buildargs% -o build\BlockLua-Unsafe.dll
|
|
||||||
@echo off
|
|
||||||
@@ -27,7 +27,7 @@ What these packages are for:
|
|||||||
- Run the script:
|
- Run the script:
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
compile.bat
|
build.bat
|
||||||
```
|
```
|
||||||
|
|
||||||
What the script does:
|
What the script does:
|
||||||
|
|||||||
Reference in New Issue
Block a user