Skip to content

kosmik641/gm_turbostroi

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Русская версия этого файла

Turbostroi V2 with cross-compile support

  • Backwards compatibility
    • With small sv_turbostroi_v2.lua fix for FFI load
  • Linux compile
  • Use Source Engine think instead of our thread
  • Linux stable work not guaranteed
    • Need testing
  • Lock-free queue and spsc_queue use
    • Mutex is slow
  • Optimization
  • Code refactoring

Install fix

Replace original sv_turbostroi_v2.lua from this repository. if you don't do this, it will crash on Linux.

  1. Create new folder in garrysmod/addons
  2. Place lua file to lua/metrostroi in your new folder (you need to create subdirectories)

Manual for Windows MSVC compile:

  1. Install Visual Studio 2015 or newer
  2. Get premake5.exe for Windows
  3. Place and run premake5.exe in this folder:
premake5.exe vs2022
  • vs2015 for Visual Studio 2015
  • vs2017 for Visual Studio 2017
  • vs2019 for Visual Studio 2019
  • vs2022 for Visual Studio 2022
  1. Open x86 Native Tools Command Prompt for VS command prompt
  2. Go to external\luajit\src folder
  3. Run command:
msvcbuild.bat static
  1. Copy lua51.lib to external\luajit\x86
  2. Open projects\windows\vs2022\turbostroi.sln
  3. Compile with Release/Win32 configuration
  4. Copy projects\windows\vs2022\x86\Release\gmsv_turbostroi_win32.dll to GarrysModDS\garrysmod\lua\bin (create bin folder if it doesn't exist)

Manual for Linux GCC compile:

  1. Install gcc-multilib
apt install gcc-multilib
  1. Get premake5.exe for Linux
  2. Place and run premake5 in this folder:
chmod +x ./premake5
./premake5 gmake
  1. In external/luajit/src/Makefile find
CC= $(DEFAULT_CC)

and add -m32 parameter:

CC= $(DEFAULT_CC) -m32
  1. Run make in external/luajit directory
  2. Copy external/luajit/src/libluajit.a to external/luajit/linux32
  3. Open terminal in projects/linux/gmake
  4. Run compilation
make config=release_x86
  1. Copy projects/linux/gmake/x86/Release/gmsv_turbostroi_linux.dll to GarrysModDS\garrysmod\lua\bin (create bin folder if it doesn't exist)

About

Cross-compile version

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Lua 51.2%
  • C++ 48.8%