mirror of
https://github.com/love2d/love.git
synced 2026-08-21 21:15:09 +02:00
Make LÖVE buildable (barely) with Megasource on Mac.
This commit is contained in:
@@ -30,6 +30,8 @@ project(love)
|
|||||||
set(LOVE_EXE_NAME love)
|
set(LOVE_EXE_NAME love)
|
||||||
set(LOVE_LIB_NAME liblove)
|
set(LOVE_LIB_NAME liblove)
|
||||||
|
|
||||||
|
set (CMAKE_CXX_STANDARD 11)
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
set(LOVE_CONSOLE_EXE_NAME lovec)
|
set(LOVE_CONSOLE_EXE_NAME lovec)
|
||||||
endif()
|
endif()
|
||||||
@@ -46,6 +48,9 @@ option(LOVE_JIT "Use LuaJIT" TRUE)
|
|||||||
option(LOVE_MPG123 "Use mpg123" TRUE)
|
option(LOVE_MPG123 "Use mpg123" TRUE)
|
||||||
|
|
||||||
if(LOVE_JIT)
|
if(LOVE_JIT)
|
||||||
|
if(APPLE)
|
||||||
|
message(FATAL_ERROR "JIT not supported yet on Mac. Please use -DLOVE_JIT=0.")
|
||||||
|
endif()
|
||||||
message(STATUS "LuaJIT: Enabled")
|
message(STATUS "LuaJIT: Enabled")
|
||||||
else()
|
else()
|
||||||
message(STATUS "LuaJIT: Disabled")
|
message(STATUS "LuaJIT: Disabled")
|
||||||
@@ -69,6 +74,12 @@ if(MEGA)
|
|||||||
# are CMake targets, causing include paths to be added automatically.
|
# are CMake targets, causing include paths to be added automatically.
|
||||||
set(LOVE_INCLUDE_DIRS)
|
set(LOVE_INCLUDE_DIRS)
|
||||||
|
|
||||||
|
if(APPLE)
|
||||||
|
# Some files do #include <SDL2/SDL.h>, but building with megasource
|
||||||
|
# requires #include <SDL.h>.
|
||||||
|
add_definitions(-DLOVE_MACOSX_SDL_DIRECT_INCLUDE)
|
||||||
|
endif ()
|
||||||
|
|
||||||
# SDL2 links with some DirectX libraries, and we apparently also
|
# SDL2 links with some DirectX libraries, and we apparently also
|
||||||
# pull those libraries in for linkage because we link with SDL2.
|
# pull those libraries in for linkage because we link with SDL2.
|
||||||
set(LOVE_LINK_DIRS ${SDL_LINK_DIR})
|
set(LOVE_LINK_DIRS ${SDL_LINK_DIR})
|
||||||
@@ -207,6 +218,12 @@ set(LOVE_SRC_COMMON
|
|||||||
src/common/wrap_Data.h
|
src/common/wrap_Data.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (APPLE)
|
||||||
|
set(LOVE_SRC_COMMON ${LOVE_SRC_COMMON}
|
||||||
|
src/common/macosx.mm
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
source_group("common" FILES ${LOVE_SRC_COMMON})
|
source_group("common" FILES ${LOVE_SRC_COMMON})
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -1194,6 +1211,12 @@ if(MSVC)
|
|||||||
src/libraries/luasocket/libluasocket/wsocket.c
|
src/libraries/luasocket/libluasocket/wsocket.c
|
||||||
src/libraries/luasocket/libluasocket/wsocket.h
|
src/libraries/luasocket/libluasocket/wsocket.h
|
||||||
)
|
)
|
||||||
|
else()
|
||||||
|
set(LOVE_SRC_3P_LUASOCKET_LIBLUASOCKET
|
||||||
|
${LOVE_SRC_3P_LUASOCKET_LIBLUASOCKET}
|
||||||
|
src/libraries/luasocket/libluasocket/usocket.c
|
||||||
|
src/libraries/luasocket/libluasocket/usocket.h
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(LOVE_SRC_3P_LUASOCKET
|
set(LOVE_SRC_3P_LUASOCKET
|
||||||
@@ -1401,6 +1424,9 @@ if(LOVE_MOVE_DLLS)
|
|||||||
endforeach()
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (NOT MSVC)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
###################################
|
###################################
|
||||||
# Version
|
# Version
|
||||||
|
|||||||
@@ -25,7 +25,11 @@
|
|||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|
||||||
|
#ifdef LOVE_MACOSX_SDL_DIRECT_INCLUDE
|
||||||
|
# include <SDL.h>
|
||||||
|
#else
|
||||||
# include <SDL2/SDL.h>
|
# include <SDL2/SDL.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace love
|
namespace love
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user