diff --git a/.github/workflows/io2.yml b/.github/workflows/io2.yml new file mode 100644 index 0000000..25bd1a4 --- /dev/null +++ b/.github/workflows/io2.yml @@ -0,0 +1,62 @@ +name: IO2-Main + +on: + workflow_dispatch: + push: + branches: + - 'master' + pull_request: + branches: [ master ] + + +jobs: + Windows: + strategy: + matrix: + build_type: [Release, RelWithDebInfo, MinSizeRel, Debug] + runs-on: windows-2022 + env: + BUILD_DIR: D:/a/Lua-io2/Lua-io2/${{ matrix.build_type}}/ + + steps: + - uses: actions/checkout@v4 + + - name: Cache Boost + id: cache-LuaBoost + uses: actions/cache@v3 + with: + path: | + C:/local/boost_1_80_0/ + D:/a/Lua-io2/Lua-io2/LuaJIT/ + D:/a/Lua-io2/Lua-io2/sol2/ + key: ${{ runner.os }}-LuaBoost + + - name: Get Deps (Boost, LuaJIT) + shell: bash + if: steps.cache-LuaBoost.outputs.cache-hit != 'true' + run: CI/get_win_deps.sh + + - name: Configure + shell: bash + run: LUA_DIR=LuaJIT/ cmake . + + - name: Build + run: | + cmake --build . --config ${{ matrix.build_type }} + mv ${{ env.BUILD_DIR }}/io2.dll ${{ env.BUILD_DIR }}/io2-${{ matrix.build_type }}.dll + + - name: Upload Release + if: github.event_name != 'pull_request' + uses: softprops/action-gh-release@v1 + with: + tag_name: Stable-CI + files: ${{ env.BUILD_DIR }}/io2-${{ matrix.build_type }}.dll + body: | + CI Build for Dreamweave IO2 fork + + - name: Upload Artifact + if: github.event_name == 'pull_request' + uses: actions/upload-artifact@v3 + with: + path: ${{ env.BUILD_DIR }}/io2-${{ matrix.build_type }}.dll + name: io2-lua-${{ matrix.build_type }} diff --git a/CI/get_win_deps.sh b/CI/get_win_deps.sh new file mode 100755 index 0000000..7cdd6de --- /dev/null +++ b/CI/get_win_deps.sh @@ -0,0 +1,73 @@ +set -e + +CMAKE_OPTS="" +add_cmake_opts() { + CMAKE_OPTS="$CMAKE_OPTS $@" +} + +download() { + if [ $# -lt 3 ]; then + echo "Invalid parameters to download." + return 1 + fi + + NAME=$1 + shift + + echo "$NAME..." + + while [ $# -gt 1 ]; do + URL=$1 + FILE=$2 + shift + shift + + if ! [ -f $FILE ]; then + printf " Downloading $FILE... " + + if [ -z $VERBOSE ]; then + RET=0 + curl --silent --fail --retry 10 -Ly 5 -o $FILE $URL || RET=$? + else + RET=0 + curl --fail --retry 10 -Ly 5 -o $FILE $URL || RET=$? + fi + + if [ $RET -ne 0 ]; then + echo "Failed!" + wrappedExit $RET + else + echo "Done." + fi + else + echo " $FILE exists, skipping." + fi + done + + if [ $# -ne 0 ]; then + echo "Missing parameter." + fi +} + + + +download "LuaJIT v2.1.0-beta3-452-g7a0cf5fd" \ + "https://gitlab.com/OpenMW/openmw-deps/-/raw/main/windows/LuaJIT-v2.1.0-beta3-452-g7a0cf5fd-msvc2019-win64.7z" \ + "LuaJIT-v2.1.0-beta3-452-g7a0cf5fd-msvc2019-win64.7z" + + + +download "Boost 1.80.0" \ + "https://gitlab.com/OpenMW/openmw-deps/-/raw/main/windows/boost_1_80_0-msvc-14.3-64.exe" \ + "boost-1.80.0-msvc14.3-win64.exe" + +echo "Installing Boost . . ." +./boost-1.80.0-msvc14.3-win64.exe //DIR="${CWD_DRIVE_ROOT}" //VERYSILENT //NORESTART //SUPPRESSMSGBOXES //LOG='boost_install.log' + +echo "Extracting LuaJIT . . ." +eval 7z x -y LuaJIT-v2.1.0-beta3-452-g7a0cf5fd-msvc2019-win64.7z -o./LuaJIT + +echo "Praise the Sun!" +git submodule init && git submodule update + +ls -laR diff --git a/CMakeLists.txt b/CMakeLists.txt index cc45f56..ccd8b5d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ if (CMAKE_CXX_COMPILE_FEATURES MATCHES cxx_std_17 AND HAVE_FILESYSTEM_H) add_definitions(-DHAVE_FILESYSTEM) else() set(CMAKE_CXX_STANDARD 14) - #set(Boost_USE_STATIC_LIBS ON) + set(Boost_USE_STATIC_LIBS ON) find_package(Boost REQUIRED) find_package(Boost COMPONENTS system filesystem REQUIRED) endif() diff --git a/cmake/FindLuaJit.cmake b/cmake/FindLuaJit.cmake index 275092f..213487c 100644 --- a/cmake/FindLuaJit.cmake +++ b/cmake/FindLuaJit.cmake @@ -4,7 +4,7 @@ libfind_pkg_detect(LuaJit luajit FIND_PATH luajit.h HINTS $ENV{LUA_DIR} PATH_SUFFIXES include include/luajit-2.1 - FIND_LIBRARY luajit-5.1 luajit + FIND_LIBRARY luajit-5.1 luajit lua51 HINTS $ENV{LUA_DIR} PATH_SUFFIXES lib )