mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-20 21:43:06 +01:00
Merge pull request #12792 from janisozaur/mingw_scripting
Enable scripting for MinGW CI job
This commit is contained in:
22
.github/workflows/ci.yml
vendored
22
.github/workflows/ci.yml
vendored
@@ -91,6 +91,26 @@ jobs:
|
||||
mkdir bin && cd bin
|
||||
cmake .. -G Ninja -DCMAKE_TOOLCHAIN_FILE=../CMakeLists_mingw.txt -DCMAKE_BUILD_TYPE=MinSizeRel -DDISABLE_IPO=on -DFORCE32=on -DBUILD_SHARED_LIBS=ON -DENABLE_SCRIPTING=OFF
|
||||
ninja -k0
|
||||
windows-mingw-nt51:
|
||||
name: Windows (win32, WinNT5.1) using mingw
|
||||
runs-on: ubuntu-latest
|
||||
needs: [check-code-formatting]
|
||||
container:
|
||||
image: openrct2/openrct2-build:0.3.0-mingw
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Build OpenRCT2
|
||||
run: |
|
||||
sudo su
|
||||
mkdir bin && cd bin
|
||||
cmake .. -G Ninja -DCMAKE_TOOLCHAIN_FILE=../CMakeLists_mingw.txt -DCMAKE_BUILD_TYPE=MinSizeRel -DDISABLE_IPO=on -DDISABLE_HTTP=Off -DFORCE32=on -DENABLE_SCRIPTING=ON -DCMAKE_CXX_FLAGS="-Wno-error=cast-function-type -Wno-error=unused-function" -DSTATIC=on -DMINGW_TARGET_NT5_1=ON
|
||||
ninja -k0
|
||||
- name: Upload artifacts (CI)
|
||||
uses: actions/upload-artifact@v2-preview
|
||||
with:
|
||||
name: "OpenRCT2-NT5.1"
|
||||
path: bin/openrct2.exe
|
||||
macos:
|
||||
name: macOS
|
||||
runs-on: macos-latest
|
||||
@@ -264,7 +284,7 @@ jobs:
|
||||
uses: actions/checkout@v1
|
||||
- name: Build OpenRCT2
|
||||
shell: bash
|
||||
run: . scripts/setenv && build -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Debug -DDISABLE_NETWORK=ON -DDISABLE_HTTP_TWITCH=ON -DDISABLE_OPENGL=ON
|
||||
run: . scripts/setenv && build -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Debug -DDISABLE_NETWORK=ON -DDISABLE_HTTP=ON -DDISABLE_OPENGL=ON
|
||||
android:
|
||||
name: Android
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@@ -67,6 +67,9 @@ option(DISABLE_NETWORK "Disable multiplayer functionality. Mainly for testing.")
|
||||
option(DISABLE_TTF "Disable support for TTF provided by freetype2.")
|
||||
option(ENABLE_LIGHTFX "Enable lighting effects." ON)
|
||||
option(ENABLE_SCRIPTING "Enable script / plugin support." ON)
|
||||
if (MINGW)
|
||||
option(MINGW_TARGET_NT5_1 "Use only NT5.1 APIs and libraries." OFF)
|
||||
endif ()
|
||||
|
||||
option(DISABLE_GUI "Don't build GUI. (Headless only.)")
|
||||
|
||||
@@ -76,6 +79,13 @@ if (FORCE32)
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${TARGET_M}")
|
||||
endif ()
|
||||
|
||||
if (MINGW_TARGET_NT5_1)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_WIN32_WINNT=0x501")
|
||||
if (STATIC)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCURL_STATICLIB=1 -DZIP_STATIC=1 -static")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (PORTABLE OR WIN32)
|
||||
set(CMAKE_INSTALL_LIBDIR "${CMAKE_INSTALL_BINDIR}")
|
||||
set(CMAKE_INSTALL_RPATH "$ORIGIN")
|
||||
@@ -279,6 +289,10 @@ if (CXX_WARN_SUGGEST_FINAL_METHODS)
|
||||
add_definitions(-D__WARN_SUGGEST_FINAL_METHODS__)
|
||||
endif ()
|
||||
|
||||
if (MINGW)
|
||||
add_definitions(-fstack-protector-strong)
|
||||
endif ()
|
||||
|
||||
# Include sub-projects
|
||||
include("${ROOT_DIR}/src/openrct2/CMakeLists.txt" NO_POLICY_SCOPE)
|
||||
include("${ROOT_DIR}/src/openrct2-cli/CMakeLists.txt" NO_POLICY_SCOPE)
|
||||
|
||||
@@ -11,8 +11,7 @@
|
||||
# DUKTAPE_DEFINITIONS - Compiler switches required for using Duktape
|
||||
#
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_DUK QUIET duktape libduktape)
|
||||
PKG_CHECK_MODULES(PC_DUK QUIET duktape libduktape)
|
||||
|
||||
find_path(DUKTAPE_INCLUDE_DIR duktape.h
|
||||
HINTS ${PC_DUK_INCLUDEDIR} ${PC_DUK_INCLUDE_DIRS}
|
||||
|
||||
@@ -30,7 +30,7 @@ if (NOT MINGW AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" AND NOT ${CMAKE_SYS
|
||||
endif()
|
||||
|
||||
if (NOT DISABLE_NETWORK OR NOT DISABLE_HTTP)
|
||||
if (WIN32)
|
||||
if (WIN32 AND NOT MINGW_TARGET_NT5_1)
|
||||
target_link_libraries(${PROJECT_NAME} bcrypt)
|
||||
else ()
|
||||
if (APPLE)
|
||||
@@ -55,7 +55,7 @@ if (NOT DISABLE_NETWORK AND WIN32)
|
||||
endif ()
|
||||
|
||||
if (NOT DISABLE_HTTP)
|
||||
if (WIN32)
|
||||
if (WIN32 AND NOT MINGW_TARGET_NT5_1)
|
||||
target_link_libraries(${PROJECT_NAME} winhttp)
|
||||
else ()
|
||||
PKG_CHECK_MODULES(LIBCURL REQUIRED libcurl)
|
||||
@@ -146,8 +146,10 @@ else ()
|
||||
endif ()
|
||||
|
||||
if (MINGW)
|
||||
# Hardcode libraries used by libzip on mingw
|
||||
target_link_libraries(${PROJECT_NAME} crypto ws2_32)
|
||||
# Hardcode libraries used on mingw
|
||||
target_link_libraries(${PROJECT_NAME} crypto ws2_32 tasn1 unistring iconv p11-kit hogweed gmp nettle)
|
||||
# Link in libssp
|
||||
target_link_libraries(${PROJECT_NAME} -fstack-protector-strong)
|
||||
endif()
|
||||
|
||||
if (UNIX AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "BSD")
|
||||
|
||||
Reference in New Issue
Block a user