blob: 6f33441d6591775c3d780050394ce32f866f9cd0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
add_library(CruBase
Base.cpp
Buffer.cpp
Exception.cpp
Format.cpp
PropertyTree.cpp
String.cpp
StringToNumberConverter.cpp
StringUtil.cpp
SubProcess.cpp
io/AutoReadStream.cpp
io/BufferStream.cpp
io/CFileStream.cpp
io/Stream.cpp
io/ProxyStream.cpp
io/Resource.cpp
io/MemoryStream.cpp
log/Logger.cpp
log/StdioLogTarget.cpp
)
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 AND NOT EMSCRIPTEN)
target_sources(CruBase PRIVATE
platform/unix/PosixSpawnSubProcess.cpp
platform/unix/UnixFileStream.cpp
platform/unix/UnixPipe.cpp
)
if (NOT APPLE)
target_link_libraries(CruBase PUBLIC pthread)
endif()
endif()
if (APPLE)
target_sources(CruBase PRIVATE Osx.cpp)
find_library(CORE_FOUNDATION CoreFoundation REQUIRED)
target_link_libraries(CruBase PUBLIC ${CORE_FOUNDATION})
endif()
if (EMSCRIPTEN)
target_compile_options(CruBase PUBLIC "-fwasm-exceptions")
target_link_options(CruBase PUBLIC "-fwasm-exceptions")
target_sources(CruBase PRIVATE
platform/web/WebException.cpp
)
endif()
if (WIN32)
target_sources(CruBase PRIVATE
platform/win/BridgeComStream.cpp
platform/win/ComAutoInit.cpp
platform/win/DebugLogTarget.cpp
platform/win/Exception.cpp
platform/win/StreamConvert.cpp
platform/win/Win32FileStream.cpp
)
target_link_libraries(CruBase PUBLIC Shlwapi.lib)
endif()
if (MSVC)
target_compile_options(CruBase PUBLIC /wd4250 /wd4251)
endif()
if (WIN32)
target_compile_definitions(CruBase PUBLIC
CRU_PLATFORM_WINDOWS
_CRT_SECURE_NO_WARNINGS
)
elseif(APPLE)
target_compile_definitions(CruBase PUBLIC
CRU_PLATFORM_OSX
CRU_PLATFORM_UNIX
)
elseif(EMSCRIPTEN)
target_compile_definitions(CruBase PUBLIC CRU_PLATFORM_EMSCRIPTEN)
else()
target_compile_definitions(CruBase PUBLIC
CRU_PLATFORM_LINUX
CRU_PLATFORM_UNIX
)
endif()
target_link_libraries(CruBase PUBLIC double-conversion)
|