diff dep/animia/CMakeLists.txt @ 155:d2bbb5773616

dep/animia: add quartz backend for windows
author Paper <mrpapersonic@gmail.com>
date Wed, 15 Nov 2023 15:24:39 -0500
parents d43d68408d3c
children cdf79282d647
line wrap: on
line diff
--- a/dep/animia/CMakeLists.txt	Wed Nov 15 14:14:17 2023 -0500
+++ b/dep/animia/CMakeLists.txt	Wed Nov 15 15:24:39 2023 -0500
@@ -1,5 +1,5 @@
 cmake_minimum_required(VERSION 3.9)
-project(animia)
+project(animia LANGUAGES CXX)
 set(SRC_FILES
 	# any non-platform-specific files go here
 	src/animia.cc
@@ -10,6 +10,8 @@
 	src/win.cc
 )
 
+set(LIBRARIES)
+
 # FD
 if(LINUX)
 	list(APPEND SRC_FILES
@@ -34,8 +36,15 @@
 		src/win/win32.cc
 		src/util/win32.cc
 	)
-else()
-	# soon x11 and apple stuff will be here...
+elseif(APPLE)
+	enable_language(OBJCXX)
+	list(APPEND SRC_FILES
+		src/win/quartz.mm
+	)
+	find_library(FOUNDATION_LIBRARY Foundation)
+	find_library(COREGRAPHICS_LIBRARY CoreGraphics)
+	find_library(APPKIT_LIBRARY AppKit)
+	list(APPEND LIBRARIES ${FOUNDATION_LIBRARY} ${COREGRAPHICS_LIBRARY} ${APPKIT_LIBRARY})
 endif()
 
 add_library(animia SHARED ${SRC_FILES})
@@ -56,3 +65,4 @@
 endif()
 
 target_include_directories(animia PRIVATE include)
+target_link_libraries(animia PUBLIC ${LIBRARIES})