Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CMake build on macOS #2069

Merged
merged 2 commits into from
May 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 71 additions & 26 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -305,13 +305,27 @@ target_link_libraries(love_common PUBLIC

if (APPLE)
target_sources(love_common PRIVATE
src/common/macos.mm
src/common/apple.mm
)
target_link_libraries(love_common PUBLIC
objc
"-framework CoreFoundation"
"-framework AppKit"
)
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
target_sources(love_common PRIVATE
src/common/macos.mm
)
target_link_libraries(love_common PUBLIC
"-framework AppKit"
)
else()
target_sources(love_common PRIVATE
src/common/ios.mm
)
target_link_libraries(love_common PUBLIC
"-framework UIKit"
)
endif()
endif()

#
Expand Down Expand Up @@ -641,36 +655,67 @@ target_link_libraries(love_graphics_opengl PUBLIC
lovedep::SDL
)

add_library(love_graphics_vulkan STATIC
src/modules/graphics/vulkan/Graphics.h
src/modules/graphics/vulkan/Graphics.cpp
src/modules/graphics/vulkan/GraphicsReadback.h
src/modules/graphics/vulkan/GraphicsReadback.cpp
src/modules/graphics/vulkan/Shader.h
src/modules/graphics/vulkan/Shader.cpp
src/modules/graphics/vulkan/ShaderStage.h
src/modules/graphics/vulkan/ShaderStage.cpp
src/modules/graphics/vulkan/StreamBuffer.h
src/modules/graphics/vulkan/StreamBuffer.cpp
src/modules/graphics/vulkan/Buffer.h
src/modules/graphics/vulkan/Buffer.cpp
src/modules/graphics/vulkan/Texture.h
src/modules/graphics/vulkan/Texture.cpp
src/modules/graphics/vulkan/Vulkan.h
src/modules/graphics/vulkan/Vulkan.cpp
src/modules/graphics/vulkan/VulkanWrapper.h
)
target_link_libraries(love_graphics_vulkan PUBLIC
lovedep::SDL
)

add_library(love_graphics INTERFACE)
target_link_libraries(love_graphics INTERFACE
love_graphics_root
love_graphics_opengl
love_graphics_vulkan
)

if(APPLE)
add_library(love_graphics_metal STATIC
src/modules/graphics/metal/Buffer.h
src/modules/graphics/metal/Buffer.mm
src/modules/graphics/metal/Graphics.h
src/modules/graphics/metal/Graphics.mm
src/modules/graphics/metal/GraphicsReadback.h
src/modules/graphics/metal/GraphicsReadback.mm
src/modules/graphics/metal/Metal.h
src/modules/graphics/metal/Metal.mm
src/modules/graphics/metal/Shader.h
src/modules/graphics/metal/Shader.mm
src/modules/graphics/metal/ShaderStage.h
src/modules/graphics/metal/ShaderStage.mm
src/modules/graphics/metal/StreamBuffer.h
src/modules/graphics/metal/StreamBuffer.mm
src/modules/graphics/metal/Texture.h
src/modules/graphics/metal/Texture.mm
)
target_link_libraries(love_graphics_metal PUBLIC
objc
"-framework Metal"
"-framework QuartzCore"
)
target_link_libraries(love_graphics INTERFACE
love_graphics_metal
)
else()
add_library(love_graphics_vulkan STATIC
src/modules/graphics/vulkan/Graphics.h
src/modules/graphics/vulkan/Graphics.cpp
src/modules/graphics/vulkan/GraphicsReadback.h
src/modules/graphics/vulkan/GraphicsReadback.cpp
src/modules/graphics/vulkan/Shader.h
src/modules/graphics/vulkan/Shader.cpp
src/modules/graphics/vulkan/ShaderStage.h
src/modules/graphics/vulkan/ShaderStage.cpp
src/modules/graphics/vulkan/StreamBuffer.h
src/modules/graphics/vulkan/StreamBuffer.cpp
src/modules/graphics/vulkan/Buffer.h
src/modules/graphics/vulkan/Buffer.cpp
src/modules/graphics/vulkan/Texture.h
src/modules/graphics/vulkan/Texture.cpp
src/modules/graphics/vulkan/Vulkan.h
src/modules/graphics/vulkan/Vulkan.cpp
src/modules/graphics/vulkan/VulkanWrapper.h
)
target_link_libraries(love_graphics_vulkan PUBLIC
lovedep::SDL
)
target_link_libraries(love_graphics INTERFACE
love_graphics_vulkan
)
endif()

#
# love.image
#
Expand Down