diff options
author | crupest <crupest@outlook.com> | 2022-09-29 17:49:35 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-09-29 17:49:35 +0800 |
commit | 65f920e9b88dc89124b286d82668ece9178a665f (patch) | |
tree | 23f29b4171366e23b6ac88d5149352ca8ef597e2 /src/platform | |
parent | 6b14866d4cb0e496d28142f3f42e5f2624d6dc77 (diff) | |
download | cru-65f920e9b88dc89124b286d82668ece9178a665f.tar.gz cru-65f920e9b88dc89124b286d82668ece9178a665f.tar.bz2 cru-65f920e9b88dc89124b286d82668ece9178a665f.zip |
Start to work on emscripten.
Diffstat (limited to 'src/platform')
-rw-r--r-- | src/platform/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/platform/bootstrap/Bootstrap.cpp | 8 | ||||
-rw-r--r-- | src/platform/bootstrap/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/platform/graphics/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/platform/graphics/cairo/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/platform/graphics/direct2d/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/platform/graphics/quartz/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/platform/gui/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/platform/gui/osx/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/platform/gui/win/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/platform/osx/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/platform/win/CMakeLists.txt | 2 |
12 files changed, 20 insertions, 14 deletions
diff --git a/src/platform/CMakeLists.txt b/src/platform/CMakeLists.txt index bb9259ae..22c9faa3 100644 --- a/src/platform/CMakeLists.txt +++ b/src/platform/CMakeLists.txt @@ -1,4 +1,4 @@ -add_library(CruPlatformBase SHARED +add_library(CruPlatformBase ForDllExport.cpp Color.cpp GraphicsBase.cpp diff --git a/src/platform/bootstrap/Bootstrap.cpp b/src/platform/bootstrap/Bootstrap.cpp index 93c164d4..5c47e95c 100644 --- a/src/platform/bootstrap/Bootstrap.cpp +++ b/src/platform/bootstrap/Bootstrap.cpp @@ -6,6 +6,8 @@ #elif defined(CRU_PLATFORM_OSX) #include "cru/platform/graphics/quartz/Factory.h" #include "cru/platform/gui/osx/UiApplication.h" +#elif defined(CRU_PLATFORM_EMSCRIPTEN) +// TODO: Go fill this! #else #include "cru/platform/graphics/cairo/CairoGraphicsFactory.h" #endif @@ -14,7 +16,7 @@ namespace cru::platform::bootstrap { cru::platform::gui::IUiApplication* CreateUiApplication() { #ifdef CRU_PLATFORM_WINDOWS return new cru::platform::gui::win::WinUiApplication(); -#elif CRU_PLATFORM_OSX +#elif defined(CRU_PLATFORM_OSX) return new cru::platform::gui::osx::OsxUiApplication(); #else return nullptr; @@ -25,8 +27,10 @@ CRU_PLATFORM_BOOTSTRAP_API cru::platform::graphics::IGraphicsFactory* CreateGraphicsFactory() { #ifdef CRU_PLATFORM_WINDOWS return new cru::platform::graphics::direct2d::DirectGraphicsFactory(); -#elif CRU_PLATFORM_OSX +#elif defined(CRU_PLATFORM_OSX) return new cru::platform::graphics::quartz::QuartzGraphicsFactory(); +#elif defined(CRU_PLATFORM_EMSCRIPTEN) + return nullptr; // TODO: Change this. #else return new cru::platform::graphics::cairo::CairoGraphicsFactory(); #endif diff --git a/src/platform/bootstrap/CMakeLists.txt b/src/platform/bootstrap/CMakeLists.txt index f5d79cca..4092c677 100644 --- a/src/platform/bootstrap/CMakeLists.txt +++ b/src/platform/bootstrap/CMakeLists.txt @@ -1,4 +1,4 @@ -add_library(CruPlatformBootstrap SHARED +add_library(CruPlatformBootstrap Bootstrap.cpp ) @@ -6,6 +6,8 @@ if(WIN32) target_link_libraries(CruPlatformBootstrap PUBLIC CruPlatformGuiWin) elseif(APPLE) target_link_libraries(CruPlatformBootstrap PUBLIC CruPlatformGuiOsx) +elseif(EMSCRIPTEN) + target_link_libraries(CruPlatformBootstrap PUBLIC CruBase) # TODO: Remember to change this. else() target_link_libraries(CruPlatformBootstrap PUBLIC CruPlatformGraphicsCairo) endif() diff --git a/src/platform/graphics/CMakeLists.txt b/src/platform/graphics/CMakeLists.txt index da9bf61c..e9c6a9d1 100644 --- a/src/platform/graphics/CMakeLists.txt +++ b/src/platform/graphics/CMakeLists.txt @@ -1,4 +1,4 @@ -add_library(CruPlatformGraphics SHARED +add_library(CruPlatformGraphics ForDllExport.cpp Geometry.cpp Image.cpp diff --git a/src/platform/graphics/cairo/CMakeLists.txt b/src/platform/graphics/cairo/CMakeLists.txt index 206fa21c..5879e01c 100644 --- a/src/platform/graphics/cairo/CMakeLists.txt +++ b/src/platform/graphics/cairo/CMakeLists.txt @@ -1,4 +1,4 @@ -if (UNIX) +if (UNIX AND NOT EMSCRIPTEN) # It's so great to see emscripten is somewhat UNIX! foreach(PP IN LISTS CMAKE_SYSTEM_PREFIX_PATH) cmake_path(APPEND PP "lib" ${CMAKE_LIBRARY_ARCHITECTURE}) list(APPEND LIB_ARCH_DIR ${PP}) @@ -16,7 +16,7 @@ if (UNIX) find_library(LIB_PNG png REQUIRED) - add_library(CruPlatformGraphicsCairo SHARED + add_library(CruPlatformGraphicsCairo Base.cpp CairoBrush.cpp CairoGeometry.cpp diff --git a/src/platform/graphics/direct2d/CMakeLists.txt b/src/platform/graphics/direct2d/CMakeLists.txt index a9d5900b..4776e773 100644 --- a/src/platform/graphics/direct2d/CMakeLists.txt +++ b/src/platform/graphics/direct2d/CMakeLists.txt @@ -1,4 +1,4 @@ -add_library(CruPlatformGraphicsDirect2d SHARED +add_library(CruPlatformGraphicsDirect2d Brush.cpp Font.cpp Geometry.cpp diff --git a/src/platform/graphics/quartz/CMakeLists.txt b/src/platform/graphics/quartz/CMakeLists.txt index 1fcaff26..88050a07 100644 --- a/src/platform/graphics/quartz/CMakeLists.txt +++ b/src/platform/graphics/quartz/CMakeLists.txt @@ -1,4 +1,4 @@ -add_library(CruPlatformGraphicsQuartz SHARED +add_library(CruPlatformGraphicsQuartz Brush.cpp Convert.cpp Factory.cpp diff --git a/src/platform/gui/CMakeLists.txt b/src/platform/gui/CMakeLists.txt index eb7467cd..808caf9c 100644 --- a/src/platform/gui/CMakeLists.txt +++ b/src/platform/gui/CMakeLists.txt @@ -1,4 +1,4 @@ -add_library(CruPlatformGui SHARED +add_library(CruPlatformGui Keyboard.cpp Menu.cpp UiApplication.cpp diff --git a/src/platform/gui/osx/CMakeLists.txt b/src/platform/gui/osx/CMakeLists.txt index 5442ad15..87245cdb 100644 --- a/src/platform/gui/osx/CMakeLists.txt +++ b/src/platform/gui/osx/CMakeLists.txt @@ -1,4 +1,4 @@ -add_library(CruPlatformGuiOsx SHARED +add_library(CruPlatformGuiOsx Clipboard.mm Cursor.mm InputMethod.mm diff --git a/src/platform/gui/win/CMakeLists.txt b/src/platform/gui/win/CMakeLists.txt index 4a27ffb6..9f2263fd 100644 --- a/src/platform/gui/win/CMakeLists.txt +++ b/src/platform/gui/win/CMakeLists.txt @@ -1,4 +1,4 @@ -add_library(CruPlatformGuiWin SHARED +add_library(CruPlatformGuiWin Clipboard.cpp Cursor.cpp GodWindow.cpp diff --git a/src/platform/osx/CMakeLists.txt b/src/platform/osx/CMakeLists.txt index 9768a75c..43a0a22b 100644 --- a/src/platform/osx/CMakeLists.txt +++ b/src/platform/osx/CMakeLists.txt @@ -1,4 +1,4 @@ -add_library(CruPlatformBaseOsx SHARED +add_library(CruPlatformBaseOsx Resource.cpp ) diff --git a/src/platform/win/CMakeLists.txt b/src/platform/win/CMakeLists.txt index c561f96f..06406267 100644 --- a/src/platform/win/CMakeLists.txt +++ b/src/platform/win/CMakeLists.txt @@ -1,4 +1,4 @@ -add_library(CruWinBase SHARED +add_library(CruWinBase ForDllExport.cpp ) target_compile_definitions(CruWinBase PUBLIC UNICODE _UNICODE) # use unicode |