mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
Add support for MinGW
This commit is contained in:
+23
-14
@@ -41,7 +41,7 @@ if(APPLE)
|
||||
message(WARNING "Use the prebuilt .app or the xcode project in platform/xcode/ instead.")
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
if(MSVC OR MINGW)
|
||||
set(LOVE_CONSOLE_EXE_NAME lovec)
|
||||
endif()
|
||||
|
||||
@@ -179,7 +179,7 @@ if(MEGA)
|
||||
else()
|
||||
if(MSVC)
|
||||
message(FATAL_ERROR "
|
||||
It is currently only possible to build with megasource on Windows.
|
||||
It is currently only possible to build with megasource or (experimental) mingw on Windows.
|
||||
Please see https://github.com/love2d/megasource
|
||||
")
|
||||
endif()
|
||||
@@ -188,7 +188,7 @@ Please see https://github.com/love2d/megasource
|
||||
find_package(ModPlug REQUIRED)
|
||||
find_package(OpenAL REQUIRED)
|
||||
find_package(OpenGL REQUIRED)
|
||||
find_package(SDL2 REQUIRED)
|
||||
find_package(SDL2 REQUIRED CONFIG COMPONENTS SDL2main)
|
||||
find_package(Theora REQUIRED)
|
||||
find_package(Vorbis REQUIRED)
|
||||
find_package(ZLIB REQUIRED)
|
||||
@@ -198,7 +198,7 @@ Please see https://github.com/love2d/megasource
|
||||
add_definitions(-D HAS_SOCKLEN_T)
|
||||
|
||||
set(LOVE_INCLUDE_DIRS
|
||||
${SDL2_INCLUDE_DIR}
|
||||
${SDL2_INCLUDE_DIRS}
|
||||
${FREETYPE_INCLUDE_DIRS}
|
||||
${VORBIS_INCLUDE_DIR}
|
||||
${OPENAL_INCLUDE_DIR}
|
||||
@@ -210,7 +210,7 @@ Please see https://github.com/love2d/megasource
|
||||
|
||||
set(LOVE_LINK_LIBRARIES
|
||||
${OPENGL_gl_LIBRARY}
|
||||
${SDL2_LIBRARY}
|
||||
${SDL2_LIBRARIES}
|
||||
${FREETYPE_LIBRARY}
|
||||
${OPENAL_LIBRARY}
|
||||
${MODPLUG_LIBRARY}
|
||||
@@ -1316,6 +1316,9 @@ set(LOVE_SRC_3P_ENET
|
||||
add_library(love_3p_enet ${LOVE_SRC_3P_ENET})
|
||||
target_link_libraries(love_3p_enet ${LOVE_LUA_LIBRARY})
|
||||
target_include_directories(love_3p_enet PUBLIC src/libraries/enet/libenet/include)
|
||||
if(MINGW)
|
||||
target_link_libraries(love_3p_enet winmm.a)
|
||||
endif()
|
||||
|
||||
#
|
||||
# GLAD
|
||||
@@ -1411,7 +1414,7 @@ set(LOVE_SRC_3P_GLSLANG_GLSLANG_OSDEPENDENT
|
||||
src/libraries/glslang/glslang/OSDependent/osinclude.h
|
||||
)
|
||||
|
||||
if(MSVC)
|
||||
if(MSVC OR MINGW)
|
||||
set(LOVE_SRC_3P_GLSLANG_GLSLANG_OSDEPENDENT
|
||||
${LOVE_SRC_3P_GLSLANG_GLSLANG_OSDEPENDENT}
|
||||
src/libraries/glslang/glslang/OSDependent/Windows/main.cpp
|
||||
@@ -1511,7 +1514,13 @@ set(LOVE_SRC_3P_LUASOCKET_LIBLUASOCKET
|
||||
|
||||
set(LOVE_LINK_L3P_LUASOCKET_LIBLUASOCKET)
|
||||
|
||||
if(MSVC)
|
||||
if(MINGW)
|
||||
set(WIN32_LIB_EXT .a)
|
||||
else()
|
||||
set(WIN32_LIB_EXT .lib)
|
||||
endif()
|
||||
|
||||
if(MSVC OR MINGW)
|
||||
set(LOVE_SRC_3P_LUASOCKET_LIBLUASOCKET
|
||||
${LOVE_SRC_3P_LUASOCKET_LIBLUASOCKET}
|
||||
src/libraries/luasocket/libluasocket/wsocket.c
|
||||
@@ -1520,7 +1529,7 @@ if(MSVC)
|
||||
|
||||
set(LOVE_LINK_L3P_LUASOCKET_LIBLUASOCKET
|
||||
${LOVE_LINK_L3P_LUASOCKET_LIBLUASOCKET}
|
||||
ws2_32.lib
|
||||
ws2_32${WIN32_LIB_EXT}
|
||||
)
|
||||
else()
|
||||
set(LOVE_SRC_3P_LUASOCKET_LIBLUASOCKET
|
||||
@@ -1757,11 +1766,11 @@ link_directories(${LOVE_LINK_DIRS})
|
||||
|
||||
set(LOVE_RC)
|
||||
|
||||
if(MSVC)
|
||||
if(MSVC OR MINGW)
|
||||
set(LOVE_LINK_LIBRARIES ${LOVE_LINK_LIBRARIES}
|
||||
ws2_32.lib
|
||||
winmm.lib
|
||||
dwmapi.lib
|
||||
ws2_32${WIN32_LIB_EXT}
|
||||
winmm${WIN32_LIB_EXT}
|
||||
dwmapi${WIN32_LIB_EXT}
|
||||
)
|
||||
|
||||
set(LOVE_RC
|
||||
@@ -1790,7 +1799,7 @@ add_executable(${LOVE_EXE_NAME} WIN32 src/love.cpp ${LOVE_RC})
|
||||
target_link_libraries(${LOVE_EXE_NAME} ${LOVE_LIB_NAME})
|
||||
set_target_properties(${LOVE_EXE_NAME} PROPERTIES C_VISIBILITY_PRESET hidden CXX_VISIBILITY_PRESET hidden VISIBILITY_INLINES_HIDDEN ON)
|
||||
|
||||
if(MSVC)
|
||||
if(MSVC OR MINGW)
|
||||
add_executable(${LOVE_CONSOLE_EXE_NAME} src/love.cpp ${LOVE_RC})
|
||||
target_link_libraries(${LOVE_CONSOLE_EXE_NAME} ${LOVE_LIB_NAME})
|
||||
endif()
|
||||
@@ -1818,7 +1827,7 @@ if(LOVE_MOVE_DLLS)
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if (NOT MSVC)
|
||||
if (NOT MSVC OR MINGW)
|
||||
return()
|
||||
endif()
|
||||
|
||||
|
||||
Binary file not shown.
+3
-1
@@ -104,7 +104,7 @@
|
||||
#endif
|
||||
|
||||
// DLL-stuff.
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
# define LOVE_EXPORT __declspec(dllexport)
|
||||
#elif defined(__GNUC__) || defined(__clang__)
|
||||
# define LOVE_EXPORT __attribute__((visibility("default")))
|
||||
@@ -116,8 +116,10 @@
|
||||
#ifndef LOVE_WINDOWS_UWP
|
||||
# define LOVE_LEGENDARY_CONSOLE_IO_HACK
|
||||
#endif // LOVE_WINDOWS_UWP
|
||||
#ifndef __MINGW32__
|
||||
# define NOMINMAX
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(LOVE_MACOSX) || defined(LOVE_IOS)
|
||||
# define LOVE_LEGENDARY_APP_ARGV_HACK
|
||||
|
||||
Reference in New Issue
Block a user