File tree 6 files changed +49
-6
lines changed
6 files changed +49
-6
lines changed Original file line number Diff line number Diff line change 24
24
# add jsoncpp
25
25
patch -N " src/BUILD.gn" < " $COMMAND_DIR /patches/add_jsoncpp.patch"
26
26
27
+ # add objc library to use videotoolbox
28
+ patch -N " src/sdk/BUILD.gn" < " $COMMAND_DIR /patches/add_objc_mac.patch"
29
+
27
30
mkdir -p " $ARTIFACTS_DIR /lib"
28
31
29
32
# generate ninja files for release
Original file line number Diff line number Diff line change
1
+ --- src/sdk/BUILD.gn 2020-08-31 17:02:50.000000000 +0900
2
+ +++ src/sdk/BUILD.gn.edited 2020-08-31 17:15:53.000000000 +0900
3
+ @@ -24,6 +24,16 @@ group("sdk") {
4
+ if (is_ios) {
5
+ public_deps += [ ":framework_objc" ]
6
+ }
7
+ + if(is_mac) {
8
+ + public_deps += [
9
+ + ":base_objc",
10
+ + ":default_codec_factory_objc",
11
+ + ":native_api",
12
+ + ":native_video",
13
+ + ":videocodec_objc",
14
+ + ":videotoolbox_objc"
15
+ + ]
16
+ + }
17
+ }
18
+ }
19
+
Original file line number Diff line number Diff line change @@ -38,12 +38,11 @@ if(MSVC)
38
38
elseif (APPLE )
39
39
file (GLOB append_source
40
40
../libcxx/debug.cpp
41
+ *.mm
41
42
GraphicsDevice/Metal/*.h
42
43
GraphicsDevice/Metal/*.mm
43
44
Codec/SoftwareCodec/*.h
44
45
Codec/SoftwareCodec/*.cpp
45
- #Codec/VideoToolbox/VTEncoderMetal.mm
46
- #Codec/VideoToolbox/VTEncoderMetal.h
47
46
)
48
47
list (APPEND sources ${append_source} )
49
48
elseif (UNIX )
@@ -165,7 +164,15 @@ elseif(APPLE)
165
164
PROPERTIES LIBRARY_OUTPUT_DIRECTORY_RELEASE
166
165
${PROJECT_BINARY_DIR}
167
166
)
167
+ target_include_directories (webrtc
168
+ PRIVATE
169
+ ${WEBRTC_OBJC_INCLUDE_DIR}
170
+ )
168
171
172
+ set_target_properties ( webrtc
173
+ PROPERTIES LINK_FLAGS
174
+ "-ObjC"
175
+ )
169
176
elseif (UNIX )
170
177
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-lto -fno-rtti -stdlib=libc++" )
171
178
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ if(MSVC)
41
41
elseif (APPLE )
42
42
file (GLOB append_source
43
43
../libcxx/debug.cpp
44
+ ../WebRTCPlugin/*.mm
44
45
../WebRTCPlugin/GraphicsDevice/Metal/*.h
45
46
../WebRTCPlugin/GraphicsDevice/Metal/*.mm
46
47
../WebRTCPlugin/Codec/SoftwareCodec/*.h
@@ -132,6 +133,11 @@ if(MSVC)
132
133
elseif (APPLE )
133
134
set (CMAKE_C_FLAGS "-x objective-c" )
134
135
set (CMAKE_CXX_FLAGS "-x objective-c++" )
136
+
137
+ set_target_properties ( WebRTCPluginTest
138
+ PROPERTIES LINK_FLAGS
139
+ "-ObjC"
140
+ )
135
141
136
142
target_compile_definitions (WebRTCPluginTest
137
143
PRIVATE
@@ -151,6 +157,7 @@ elseif(APPLE)
151
157
target_include_directories (WebRTCPluginTest
152
158
PRIVATE
153
159
..
160
+ ${WEBRTC_OBJC_INCLUDE_DIR}
154
161
)
155
162
elseif (UNIX )
156
163
find_package (OpenGL REQUIRED)
Original file line number Diff line number Diff line change 1
1
2
2
find_library (CORE_FOUNDATION Foundation)
3
+ find_library (AV_FOUNDATION AVFoundation)
3
4
find_library (APPLICATION_SERVICES ApplicationServices)
4
5
find_library (CORE_SERVICES CoreServices)
5
6
find_library (CORE_AUDIO CoreAudio)
@@ -11,6 +12,7 @@ find_library(METAL Metal)
11
12
12
13
set (FRAMEWORK_LIBS
13
14
${CORE_FOUNDATION}
15
+ ${AV_FOUNDATION}
14
16
${APPLICATION_SERVICES}
15
17
${CORE_SERVICES}
16
18
${CORE_AUDIO}
Original file line number Diff line number Diff line change 3
3
set (WEBRTC_DIR "${CMAKE_SOURCE_DIR} /webrtc" )
4
4
5
5
set (WEBRTC_INCLUDE_DIR
6
- ${WEBRTC_DIR} /include
7
- ${WEBRTC_DIR} /include /third_party/abseil-cpp
8
- ${WEBRTC_DIR} /include /third_party/jsoncpp/source /include
9
- ${WEBRTC_DIR} /include /third_party/jsoncpp/generated
6
+ ${WEBRTC_DIR} /include
7
+ ${WEBRTC_DIR} /include /third_party/abseil-cpp
8
+ ${WEBRTC_DIR} /include /third_party/jsoncpp/source /include
9
+ ${WEBRTC_DIR} /include /third_party/jsoncpp/generated
10
+ )
11
+
12
+ set (WEBRTC_OBJC_INCLUDE_DIR
13
+ ${WEBRTC_DIR} /include /sdk/objc
14
+ ${WEBRTC_DIR} /include /sdk/objc/base
10
15
)
11
16
12
17
set (WEBRTC_LIBRARY_DIR
You can’t perform that action at this time.
0 commit comments