aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-09-29 17:49:35 +0800
committercrupest <crupest@outlook.com>2022-09-29 17:49:35 +0800
commit65f920e9b88dc89124b286d82668ece9178a665f (patch)
tree23f29b4171366e23b6ac88d5149352ca8ef597e2 /src/common
parent6b14866d4cb0e496d28142f3f42e5f2624d6dc77 (diff)
downloadcru-65f920e9b88dc89124b286d82668ece9178a665f.tar.gz
cru-65f920e9b88dc89124b286d82668ece9178a665f.tar.bz2
cru-65f920e9b88dc89124b286d82668ece9178a665f.zip
Start to work on emscripten.
Diffstat (limited to 'src/common')
-rw-r--r--src/common/CMakeLists.txt6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt
index 38af768a..119bbbee 100644
--- a/src/common/CMakeLists.txt
+++ b/src/common/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_library(CruBase SHARED
+add_library(CruBase
Base.cpp
Exception.cpp
Format.cpp
@@ -17,7 +17,7 @@ target_compile_definitions(CruBase PRIVATE CRU_BASE_EXPORT_API)
target_include_directories(CruBase PUBLIC ${CRU_INCLUDE_DIR})
target_compile_definitions(CruBase PUBLIC $<$<CONFIG:Debug>:CRU_DEBUG>)
-if (UNIX)
+if (UNIX AND NOT EMSCRIPTEN)
target_sources(CruBase PRIVATE
platform/unix/ErrnoException.cpp
platform/unix/UnixFileStream.cpp
@@ -55,6 +55,8 @@ if (WIN32)
target_compile_definitions(CruBase PUBLIC CRU_PLATFORM_WINDOWS)
elseif(APPLE)
target_compile_definitions(CruBase PUBLIC CRU_PLATFORM_OSX)
+elseif(EMSCRIPTEN)
+ target_compile_definitions(CruBase PUBLIC CRU_PLATFORM_EMSCRIPTEN)
else()
target_compile_definitions(CruBase PUBLIC CRU_PLATFORM_LINUX)
endif()