Skip to content

Commit

Permalink
Get rid of Lua modding (CleverRaven#28572)
Browse files Browse the repository at this point in the history
* Get rid of Lua modding
  • Loading branch information
ZhilkinSerg authored and kevingranade committed Mar 14, 2019
1 parent 46e2ec7 commit cf9dee9
Show file tree
Hide file tree
Showing 98 changed files with 208 additions and 7,931 deletions.
6 changes: 1 addition & 5 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ cache:
- 'c:\tools\vcpkg\installed'
install:
# Install dependency packages
- cmd: vcpkg --triplet %PLATFORM%-windows-static install sdl2 sdl2-image sdl2-mixer sdl2-ttf gettext lua
# Add LUA binary folder to PATH
- cmd: set PATH=c:\tools\vcpkg\installed\%PLATFORM%-windows-static\tools\lua;%PATH%
# Report LUA binary version
- cmd: lua.exe -v
- cmd: vcpkg --triplet %PLATFORM%-windows-static install sdl2 sdl2-image sdl2-mixer sdl2-ttf gettext
build:
parallel: true
project: /msvc-full-features/Cataclysm-vcpkg-static.sln
Expand Down
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
*.cpp text
*.h text
*.json text
*.lua text
*.md text
*.py text
*.rc text
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
/obj/
/objwin/
/save/
/src/lua/catabindings.cpp
/src/version.h
/sound/
/templates/
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
sources: [*apt_sources, llvm-toolchain-trusty-6.0]

# macOS Tiles
- env: CLANG=clang++ NATIVE=osx OSX_MIN=10.13 TILES=1 SOUND=1 LUA=1
- env: CLANG=clang++ NATIVE=osx OSX_MIN=10.13 TILES=1 SOUND=1
os: osx
osx_image: xcode10.1
compiler: clang
Expand Down
29 changes: 2 additions & 27 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ SET(CMAKE_MODULE_PATH
)

# Build options
option(LUA "Lua support (required for some mods)." "OFF")
option(TILES "Build graphical tileset version." "OFF")
option(CURSES "Build curses version." "ON" )
option(SOUND "Support for in-game sounds & music." "OFF")
Expand All @@ -18,9 +17,8 @@ option(USE_HOME_DIR "Use user's home directory for save files." "ON" )
option(LOCALIZE "Support for language localizations. Also enable UTF support." "ON" )
option(LANGUAGES "Compile localization files for specified languages." "" )
option(DYNAMIC_LINKING "Use dynamic linking. Or use static to remove MinGW dependency instead." "ON")
option(LUA_BINARY "Lua binary name or path. You can try to use luajit for extra speed." "")
option(GIT_BINARY "Git binary name or path." "")
OPTION(PREFIX "Location of Data,GFX, & Lua directories" "")
OPTION(PREFIX "Location of Data & GFX directories" "")

include(CTest)

Expand Down Expand Up @@ -140,10 +138,6 @@ ENDIF (${CMAKE_SYSTEM_NAME} MATCHES Windows)
MESSAGE(STATUS "${PROJECT_NAME} build options --\n")

# Preset variables
IF (NOT LUA_BINARY)
SET (LUA_BINARY "lua")
ENDIF (NOT LUA_BINARY)

IF(NOT LANGUAGES)
SET (LANGUAGES de es_AR es_ES fr it_IT ja ko pt_BR ru zh_CN zh_TW)
ENDIF(NOT LANGUAGES)
Expand Down Expand Up @@ -192,16 +186,12 @@ ELSE (CMAKE_BUILD_TYPE STREQUAL Debug)
MESSAGE(STATUS "PIXMAPS_UNITY_ENTRY_PATH : ${PIXMAPS_UNITY_ENTRY_PATH}")
MESSAGE(STATUS "MANPAGE_ENTRY_PATH : ${MANPAGE_ENTRY_PATH}\n")
ADD_DEFINITIONS(-DRELEASE)
# Use PREFIX as storage of data,gfx,lua etc.. Usefull only on *nix OS.
# Use PREFIX as storage of data,gfx, etc.. Usefull only on *nix OS.
IF (PREFIX AND NOT WIN32)
ADD_DEFINITIONS(-DDATA_DIR_PREFIX)
ENDIF (PREFIX AND NOT WIN32)
ENDIF (CMAKE_BUILD_TYPE STREQUAL Debug)

MESSAGE(STATUS "LUA : ${LUA}")
IF (LUA)
MESSAGE(STATUS "LUA_BINARY : ${LUA_BINARY}")
ENDIF (LUA)
MESSAGE(STATUS "GIT_BINARY : ${GIT_EXECUTABLE}")
MESSAGE(STATUS "DYNAMIC_LINKING : ${DYNAMIC_LINKING}")
MESSAGE(STATUS "TILES : ${TILES}")
Expand Down Expand Up @@ -309,16 +299,6 @@ IF(SOUND)
ENDIF(NOT SDL2_MIXER_FOUND)
ENDIF(SOUND)

IF(LUA)
FIND_PACKAGE(Lua)
IF(NOT LUA_FOUND)
MESSAGE(FATAL_ERROR
"You need the Lua development library to be able to compile with Lua support.\nSee INSTALL file for details and more info\n"
)
ENDIF(NOT LUA_FOUND)
ADD_DEFINITIONS(-DLUA)
ENDIF(LUA)

IF(BACKTRACE)
ADD_DEFINITIONS(-DBACKTRACE)
ENDIF(BACKTRACE)
Expand Down Expand Up @@ -347,11 +327,6 @@ IF(USE_HOME_DIR)
ADD_DEFINITIONS(-DUSE_HOME_DIR)
ENDIF(USE_HOME_DIR)

IF(LUA)
add_subdirectory(lua)
add_subdirectory(src/lua)
ENDIF(LUA)

add_subdirectory(src)
add_subdirectory(data)
if (NOT MSVC)
Expand Down
117 changes: 0 additions & 117 deletions CMakeModules/FindLua.cmake

This file was deleted.

23 changes: 3 additions & 20 deletions COMPILING-CMAKE.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ order to build CataclysmDDA:
* `zlib`
* `bzip2`
* Optional
* `lua51`
* `gettext`
* Curses
* `ncurses`
Expand Down Expand Up @@ -68,7 +67,6 @@ Obtain packages specified above with your system package manager.
pacman -S mingw-w64-i686-toolchain msys/git \
mingw-w64-i686-cmake \
mingw-w64-i686-SDL2_{image,mixer,ttf} \
mingw-w64-i686-lua51 \
ncurses-devel \
gettext-devel
```
Expand All @@ -82,7 +80,6 @@ Obtain packages specified above with your system package manager.
pacman -S mingw-w64-x86_64-toolchain msys/git \
mingw-w64-x86_64-cmake \
mingw-w64-x86_64-SDL2_{image,mixer,ttf} \
mingw-w64-x86_64-lua51 \
ncurses-devel \
gettext-devel
```
Expand Down Expand Up @@ -178,9 +175,6 @@ The above example creates a build directory inside the source directory, but tha
* `libintl-8.dll`
* `libiconv-2.dll`

* LUA deps:
* `lua51.dll`

* TILES deps:
* `SDL2.dll`
* `SDL2_ttf.dll`
Expand Down Expand Up @@ -216,7 +210,7 @@ The above example creates a build directory inside the source directory, but tha
CMake can generate `.sln` and `.vcxproj` files used either by Visual Studio itself or by MSBuild command line compiler (if you don't want
a full fledged IDE) and have more "native" binaries than what MSYS/Cygwin can provide.

At the moment only a limited combination of options is supported (tiles only, no lua, no localizations, no backtrace).
At the moment only a limited combination of options is supported (tiles only, no localizations, no backtrace).

Get the tools:
* CMake from the official site - https://cmake.org/download/.
Expand All @@ -229,7 +223,6 @@ Get the required libraries:
* `SDL2_image` - https://www.libsdl.org/projects/SDL_image/
* `SDL2_mixer` (optional, for sound support) - https://www.libsdl.org/projects/SDL_mixer/
* Unsupported (and unused in the following instructions) optional libs:
* `Lua` - http://luabinaries.sourceforge.net/
* `gettext`/`libintl` - http://gnuwin32.sourceforge.net/packages/gettext.htm
* `ncurses` - ???

Expand Down Expand Up @@ -315,11 +308,6 @@ Run the game. Should work.
Support for in-game sounds & music.


* LUA=`<boolean>`

This enables Lua support. Needed only for full-fledged mods.


* USE_HOME_DIR=`<boolean>`

Use user's home directory for save files.
Expand All @@ -342,16 +330,11 @@ Run the game. Should work.
-DLANGUAGES="cs;de;el;es_AR;es_ES"
```

* LUA_BINARY=`<str>`

Override default Lua binary name or path. You can try to use `luajit` for extra speed.


* GIT_BINARY=`<str>`

Override default Git binary name or path.

So a CMake command for building Cataclysm-DDA in release mode with tiles, sound and lua support will look as follows, provided it is run in build directory located in the project.
So a CMake command for building Cataclysm-DDA in release mode with tiles and sound support will look as follows, provided it is run in build directory located in the project.
```
cmake ../ -DCMAKE_BUILD_TYPE=Release -DTILES=ON -DSOUND=ON -DLUA=ON
cmake ../ -DCMAKE_BUILD_TYPE=Release -DTILES=ON -DSOUND=ON
```
6 changes: 3 additions & 3 deletions COMPILING-MSYS.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pacman -Su
4. Install packages required for compilation with:

```bash
pacman -S git git-extras-git make mingw-w64-x86_64-{astyle,ccache,gcc,libmad,libwebp,lua,ncurses,pkg-config,SDL2} mingw-w64-x86_64-SDL2_{image,mixer,ttf}
pacman -S git git-extras-git make mingw-w64-x86_64-{astyle,ccache,gcc,libmad,libwebp,ncurses,pkg-config,SDL2} mingw-w64-x86_64-SDL2_{image,mixer,ttf}
```

5. Update paths in system-wide profile file (e.g. `C:\msys64\etc\profile`) as following:
Expand Down Expand Up @@ -88,10 +88,10 @@ cd Cataclysm-DDA
2. Compile with following command line:

```bash
make CCACHE=1 RELEASE=1 MSYS2=1 DYNAMIC_LINKING=1 LUA=1 SDL=1 TILES=1 SOUND=1 LOCALIZE=1 LANGUAGES=all LINTJSON=0 ASTYLE=0 RUNTESTS=0
make CCACHE=1 RELEASE=1 MSYS2=1 DYNAMIC_LINKING=1 SDL=1 TILES=1 SOUND=1 LOCALIZE=1 LANGUAGES=all LINTJSON=0 ASTYLE=0 RUNTESTS=0
```

**Note**: This will compile release version with Lua, Sound and Tiles support and all localization languages, skipping checks and tests and using ccache for faster build. You can use other switches, but `MSYS2=1`, `DYNAMIC_LINKING=1` and probably `RELEASE=1` are required to compile without issues.
**Note**: This will compile release version with Sound and Tiles support and all localization languages, skipping checks and tests and using ccache for faster build. You can use other switches, but `MSYS2=1`, `DYNAMIC_LINKING=1` and probably `RELEASE=1` are required to compile without issues.

## Running:

Expand Down
10 changes: 5 additions & 5 deletions COMPILING-VS-VCPKG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,26 +34,26 @@ vcpkg integrate install
#### install 64 bit dependencies:

```cmd
vcpkg --triplet x64-windows install sdl2 sdl2-image sdl2-mixer sdl2-ttf gettext lua
vcpkg --triplet x64-windows install sdl2 sdl2-image sdl2-mixer sdl2-ttf gettext
```

or (if you want to build statically linked executable)

```cmd
vcpkg --triplet x64-windows-static install sdl2 sdl2-image sdl2-mixer sdl2-ttf gettext lua
vcpkg --triplet x64-windows-static install sdl2 sdl2-image sdl2-mixer sdl2-ttf gettext
```


#### install32 bit dependencies:

```cmd
vcpkg --triplet x86-windows install sdl2 sdl2-image sdl2-mixer sdl2-ttf gettext lua
vcpkg --triplet x86-windows install sdl2 sdl2-image sdl2-mixer sdl2-ttf gettext
```

or (if you want to build statically linked executable)

```cmd
vcpkg --triplet x86-windows-static install sdl2 sdl2-image sdl2-mixer sdl2-ttf gettext lua
vcpkg --triplet x86-windows-static install sdl2 sdl2-image sdl2-mixer sdl2-ttf gettext
```

#### upgrade all dependencies:
Expand All @@ -75,4 +75,4 @@ cd Cataclysm-DDA

2. Open one of provided solutions (`msvc-full-features\Cataclysm-vcpkg.sln` for dynamically linked executable or `msvc-full-features\Cataclysm-vcpkg-static.sln` for statically linked executable) in `Visual Studio`, select configuration (`Release` or `Debug`) an platform (`x64` or `x86`) and build it.

**Note**: This will compile release version with Lua, Sound, Tiles and Localization support (language files won't be automatically compiled).
**Note**: This will compile release version with Sound, Tiles and Localization support (language files won't be automatically compiled).
Loading

0 comments on commit cf9dee9

Please sign in to comment.