aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-08-19 23:27:00 +0800
committercrupest <crupest@outlook.com>2021-08-19 23:27:00 +0800
commitbcb879240f96764b8f17da2878fc0784c51b6054 (patch)
tree0a65cb55261a1d932c59ee3e66b89051940b2413
parentf5d7355579d51bc25d88f9884e0ed345b6256d23 (diff)
downloadcru-bcb879240f96764b8f17da2878fc0784c51b6054.tar.gz
cru-bcb879240f96764b8f17da2878fc0784c51b6054.tar.bz2
cru-bcb879240f96764b8f17da2878fc0784c51b6054.zip
...
-rw-r--r--include/cru/osx/Exception.hpp9
-rw-r--r--include/cru/osx/graphics/native/Factory.hpp1
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--src/osx/CMakeLists.txt11
-rw-r--r--src/osx/Exception.cpp1
-rw-r--r--src/osx/graphics/CMakeLists.txt1
-rw-r--r--src/osx/graphics/native/CMakeLists.txt11
-rw-r--r--src/osx/graphics/native/Factory.cpp1
8 files changed, 37 insertions, 0 deletions
diff --git a/include/cru/osx/Exception.hpp b/include/cru/osx/Exception.hpp
new file mode 100644
index 00000000..34c4a06c
--- /dev/null
+++ b/include/cru/osx/Exception.hpp
@@ -0,0 +1,9 @@
+#pragma once
+#include "cru/platform/Exception.hpp"
+
+namespace cru::platform::osx {
+ class OsxException : PlatformException {
+ public:
+ using PlatformException::PlatformException;
+ };
+}
diff --git a/include/cru/osx/graphics/native/Factory.hpp b/include/cru/osx/graphics/native/Factory.hpp
new file mode 100644
index 00000000..6f70f09b
--- /dev/null
+++ b/include/cru/osx/graphics/native/Factory.hpp
@@ -0,0 +1 @@
+#pragma once
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index e10aafbd..ba2fbce6 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -4,6 +4,8 @@ add_subdirectory(platform)
if(WIN32)
add_subdirectory(win)
+elseif (APPLE)
+ add_subdirectory(osx)
endif()
add_subdirectory(ui)
diff --git a/src/osx/CMakeLists.txt b/src/osx/CMakeLists.txt
new file mode 100644
index 00000000..8013a5d6
--- /dev/null
+++ b/src/osx/CMakeLists.txt
@@ -0,0 +1,11 @@
+set(CRU_OSX_BASE_INCLUDE_DIR ${CRU_INCLUDE_DIR}/cru/osx)
+
+add_library(cru_osx_base SHARED
+ Exception.cpp
+)
+
+target_sources(cru_osx_base PUBLIC
+ ${CRU_OSX_BASE_INCLUDE_DIR}/Exception.hpp
+)
+
+add_subdirectory(graphics)
diff --git a/src/osx/Exception.cpp b/src/osx/Exception.cpp
new file mode 100644
index 00000000..c7eef64b
--- /dev/null
+++ b/src/osx/Exception.cpp
@@ -0,0 +1 @@
+#include "cru/osx/Exception.hpp"
diff --git a/src/osx/graphics/CMakeLists.txt b/src/osx/graphics/CMakeLists.txt
new file mode 100644
index 00000000..91ffbfaf
--- /dev/null
+++ b/src/osx/graphics/CMakeLists.txt
@@ -0,0 +1 @@
+add_subdirectory(native)
diff --git a/src/osx/graphics/native/CMakeLists.txt b/src/osx/graphics/native/CMakeLists.txt
new file mode 100644
index 00000000..610292da
--- /dev/null
+++ b/src/osx/graphics/native/CMakeLists.txt
@@ -0,0 +1,11 @@
+set(CRU_OSX_GRAPHICS_NATIVE_INCLUDE_DIR ${CRU_INCLUDE_DIR}/cru/osx/graphics/native)
+
+add_library(cru_win_graphics_direct SHARED
+ Factory.cpp
+)
+target_sources(cru_win_graphics_direct PUBLIC
+ ${CRU_OSX_GRAPHICS_NATIVE_INCLUDE_DIR}/Factory.hpp
+)
+target_link_libraries(cru_win_graphics_direct PUBLIC cocoa)
+target_link_libraries(cru_win_graphics_direct PUBLIC cru_osx_base cru_platform_graphics)
+
diff --git a/src/osx/graphics/native/Factory.cpp b/src/osx/graphics/native/Factory.cpp
new file mode 100644
index 00000000..0025ca3e
--- /dev/null
+++ b/src/osx/graphics/native/Factory.cpp
@@ -0,0 +1 @@
+#include "cru/osx/graphics/native/Factory.hpp"