mirror of
https://github.com/fallout2-ce/fallout2-ce.git
synced 2026-07-27 16:47:11 -07:00
- Set correct checks for msvc or win
- change SDL2 cmake for mingw to link correctly
This commit is contained in:
@@ -330,14 +330,33 @@ if(WIN32)
|
||||
)
|
||||
endif()
|
||||
|
||||
if(MINGW)
|
||||
target_compile_definitions(${EXECUTABLE_NAME} PUBLIC
|
||||
_USE_MATH_DEFINES
|
||||
)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries(${EXECUTABLE_NAME}
|
||||
winmm
|
||||
)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
target_link_libraries(${EXECUTABLE_NAME}
|
||||
debug libcpmtd
|
||||
optimized libcpmt
|
||||
)
|
||||
endif()
|
||||
|
||||
if(MINGW)
|
||||
target_link_options(${EXECUTABLE_NAME} PRIVATE
|
||||
-static
|
||||
-static-libgcc
|
||||
-static-libstdc++
|
||||
)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
target_sources(${EXECUTABLE_NAME} PUBLIC
|
||||
"os/windows/fallout2-ce.ico"
|
||||
@@ -452,6 +471,7 @@ target_link_libraries(${EXECUTABLE_NAME} ${ZLIB_LIBRARIES})
|
||||
target_include_directories(${EXECUTABLE_NAME} PRIVATE ${ZLIB_INCLUDE_DIRS})
|
||||
|
||||
target_link_libraries(${EXECUTABLE_NAME} ${SDL2_LIBRARIES})
|
||||
target_link_libraries(${EXECUTABLE_NAME} ${SDL2_MAIN_LIBRARIES})
|
||||
target_include_directories(${EXECUTABLE_NAME} PRIVATE ${SDL2_INCLUDE_DIRS})
|
||||
|
||||
if((NOT ANDROID) AND (NOT IOS) AND (NOT CMAKE_SYSTEM_NAME MATCHES "Emscripten"))
|
||||
@@ -478,6 +498,13 @@ if((NOT ANDROID) AND (NOT IOS) AND (NOT CMAKE_SYSTEM_NAME MATCHES "Emscripten"))
|
||||
if(WIN32)
|
||||
target_link_libraries(ce-dat-tool winmm)
|
||||
endif()
|
||||
if(MINGW)
|
||||
target_link_options(ce-dat-tool PRIVATE
|
||||
-static
|
||||
-static-libgcc
|
||||
-static-libstdc++
|
||||
)
|
||||
endif()
|
||||
target_include_directories(ce-dat-tool PRIVATE "src")
|
||||
target_include_directories(ce-dat-tool PRIVATE ${ZLIB_INCLUDE_DIRS})
|
||||
target_include_directories(ce-dat-tool PRIVATE ${SDL2_INCLUDE_DIRS})
|
||||
@@ -501,6 +528,13 @@ if((NOT ANDROID) AND (NOT IOS) AND (NOT CMAKE_SYSTEM_NAME MATCHES "Emscripten"))
|
||||
target_include_directories(ce-frm2png PRIVATE ${ZLIB_INCLUDE_DIRS})
|
||||
target_link_libraries(ce-frm2png ${SDL2_LIBRARIES})
|
||||
target_link_libraries(ce-frm2png ${ZLIB_LIBRARIES})
|
||||
if(MINGW)
|
||||
target_link_options(ce-frm2png PRIVATE
|
||||
-static
|
||||
-static-libgcc
|
||||
-static-libstdc++
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
|
||||
+1
-1
@@ -90,7 +90,7 @@ bool fileFindNext(DirectoryFileFindData* findData)
|
||||
// 0x4E63CC
|
||||
bool findFindClose(DirectoryFileFindData* findData)
|
||||
{
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(_WIN32)
|
||||
FindClose(findData->hFind);
|
||||
#else
|
||||
if (findData->dir != nullptr) {
|
||||
|
||||
+1
-1
@@ -278,7 +278,7 @@ static void programPrintError(const char* format, va_list args)
|
||||
if (gInterpreterCurrentProgram) {
|
||||
longjmp(gInterpreterCurrentProgram->env, 1);
|
||||
}
|
||||
#ifdef _WIN32
|
||||
#ifdef _MSC_VER
|
||||
__assume(0);
|
||||
#else
|
||||
__builtin_unreachable();
|
||||
|
||||
Vendored
+2
-1
@@ -22,4 +22,5 @@ FetchContent_Declare(sdl2
|
||||
FetchContent_MakeAvailable(sdl2)
|
||||
|
||||
set(SDL2_INCLUDE_DIRS ${sdl2_SOURCE_DIR} ${sdl2_BINARY_DIR} PARENT_SCOPE)
|
||||
set(SDL2_LIBRARIES SDL2-static SDL2::SDL2main PARENT_SCOPE)
|
||||
set(SDL2_LIBRARIES SDL2-static PARENT_SCOPE)
|
||||
set(SDL2_MAIN_LIBRARIES SDL2::SDL2main PARENT_SCOPE)
|
||||
|
||||
Reference in New Issue
Block a user