mirror of
https://github.com/OpenRCT2/OpenRCT2.git
synced 2025-01-24 11:22:02 -05:00
Fix mingw build
This commit is contained in:
parent
aefc49440a
commit
62d15e44db
3 changed files with 21 additions and 6 deletions
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
|
@ -71,7 +71,7 @@ jobs:
|
|||
run: |
|
||||
sudo su
|
||||
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
|
||||
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
|
||||
macos:
|
||||
name: macOS
|
||||
|
|
|
@ -100,9 +100,22 @@ if (NOT DISABLE_GOOGLE_BENCHMARK)
|
|||
endif ()
|
||||
endif ()
|
||||
|
||||
if (ENABLE_SCRIPTING)
|
||||
if (MSVC)
|
||||
find_package(duktape REQUIRED)
|
||||
else ()
|
||||
PKG_CHECK_MODULES(DUKTAPE REQUIRED duktape)
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE ${DUKTAPE_INCLUDE_DIRS})
|
||||
if (STATIC)
|
||||
target_link_libraries(${PROJECT_NAME} ${DUKTAPE_STATIC_LIBRARIES})
|
||||
else ()
|
||||
target_link_libraries(${PROJECT_NAME} ${DUKTAPE_LIBRARIES})
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
# Third party libraries
|
||||
if (MSVC)
|
||||
find_package(duktape REQUIRED)
|
||||
find_package(jansson CONFIG REQUIRED)
|
||||
set(JANSSON_LIBRARIES "jansson::jansson")
|
||||
find_package(png 1.6 REQUIRED)
|
||||
|
@ -111,7 +124,6 @@ if (MSVC)
|
|||
find_path(LIBZIP_INCLUDE_DIRS zip.h)
|
||||
find_library(LIBZIP_LIBRARIES zip)
|
||||
else ()
|
||||
PKG_CHECK_MODULES(DUKTAPE REQUIRED duktape)
|
||||
PKG_CHECK_MODULES(JANSSON REQUIRED jansson>=2.5)
|
||||
PKG_CHECK_MODULES(LIBZIP REQUIRED libzip>=1.0)
|
||||
PKG_CHECK_MODULES(ZLIB REQUIRED zlib)
|
||||
|
@ -130,13 +142,11 @@ endif ()
|
|||
|
||||
if (STATIC)
|
||||
target_link_libraries(${PROJECT_NAME} ${JANSSON_STATIC_LIBRARIES}
|
||||
${DUKTAPE_STATIC_LIBRARIES}
|
||||
${PNG_STATIC_LIBRARIES}
|
||||
${ZLIB_STATIC_LIBRARIES}
|
||||
${LIBZIP_STATIC_LIBRARIES})
|
||||
else ()
|
||||
target_link_libraries(${PROJECT_NAME} ${JANSSON_LIBRARIES}
|
||||
${DUKTAPE_LIBRARIES}
|
||||
${PNG_LIBRARIES}
|
||||
${ZLIB_LIBRARIES}
|
||||
${LIBZIP_LIBRARIES})
|
||||
|
@ -200,7 +210,6 @@ endif()
|
|||
target_include_directories(${PROJECT_NAME} PRIVATE ${LIBZIP_INCLUDE_DIRS})
|
||||
target_include_directories(${PROJECT_NAME} PUBLIC ${JANSSON_INCLUDE_DIRS})
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE ${PNG_INCLUDE_DIRS}
|
||||
${DUKTAPE_INCLUDE_DIRS}
|
||||
${ZLIB_INCLUDE_DIRS})
|
||||
include_directories(${PROJECT_NAME} SYSTEM ${CMAKE_CURRENT_LIST_DIR}/../thirdparty)
|
||||
|
||||
|
|
|
@ -109,7 +109,13 @@ FileWatcher::FileWatcher(const std::string& directoryPath)
|
|||
FileWatcher::~FileWatcher()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
# ifdef __MINGW32__
|
||||
// TODO CancelIo is documented as not working across a different thread but
|
||||
// CancelIoEx is not available.
|
||||
CancelIo(_directoryHandle);
|
||||
# else
|
||||
CancelIoEx(_directoryHandle, nullptr);
|
||||
# endif
|
||||
CloseHandle(_directoryHandle);
|
||||
#else
|
||||
_finished = true;
|
||||
|
|
Loading…
Add table
Reference in a new issue