浏览代码

Support datachannel-tests and datachannel-benchmark in UWP.

Hanseul Jun 4 年之前
父节点
当前提交
433d5fbe7f

+ 28 - 10
CMakeLists.txt

@@ -128,14 +128,22 @@ set(TESTS_SOURCES
 )
 
 set(TESTS_UWP_RESOURCES
-	${CMAKE_CURRENT_SOURCE_DIR}/test/uwp/Logo.png
-	${CMAKE_CURRENT_SOURCE_DIR}/test/uwp/package.appxManifest
-	${CMAKE_CURRENT_SOURCE_DIR}/test/uwp/SmallLogo.png
-	${CMAKE_CURRENT_SOURCE_DIR}/test/uwp/SmallLogo44x44.png
-	${CMAKE_CURRENT_SOURCE_DIR}/test/uwp/SplashScreen.png
-	${CMAKE_CURRENT_SOURCE_DIR}/test/uwp/StoreLogo.png
-	${CMAKE_CURRENT_SOURCE_DIR}/test/uwp/Windows_TemporaryKey.pfx
-)
+	${CMAKE_CURRENT_SOURCE_DIR}/test/uwp-tests/Logo.png
+	${CMAKE_CURRENT_SOURCE_DIR}/test/uwp-tests/package.appxManifest
+	${CMAKE_CURRENT_SOURCE_DIR}/test/uwp-tests/SmallLogo.png
+	${CMAKE_CURRENT_SOURCE_DIR}/test/uwp-tests/SmallLogo44x44.png
+	${CMAKE_CURRENT_SOURCE_DIR}/test/uwp-tests/SplashScreen.png
+	${CMAKE_CURRENT_SOURCE_DIR}/test/uwp-tests/StoreLogo.png
+	${CMAKE_CURRENT_SOURCE_DIR}/test/uwp-tests/Windows_TemporaryKey.pfx)
+
+set(BENCHMARK_UWP_RESOURCES
+	${CMAKE_CURRENT_SOURCE_DIR}/test/uwp-benchmark/Logo.png
+	${CMAKE_CURRENT_SOURCE_DIR}/test/uwp-benchmark/package.appxManifest
+	${CMAKE_CURRENT_SOURCE_DIR}/test/uwp-benchmark/SmallLogo.png
+	${CMAKE_CURRENT_SOURCE_DIR}/test/uwp-benchmark/SmallLogo44x44.png
+	${CMAKE_CURRENT_SOURCE_DIR}/test/uwp-benchmark/SplashScreen.png
+	${CMAKE_CURRENT_SOURCE_DIR}/test/uwp-benchmark/StoreLogo.png
+	${CMAKE_CURRENT_SOURCE_DIR}/test/uwp-benchmark/Windows_TemporaryKey.pfx)
 
 set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
 set(THREADS_PREFER_PTHREAD_FLAG TRUE)
@@ -294,7 +302,12 @@ endif()
 
 # Tests
 if(NOT NO_TESTS)
-	add_executable(datachannel-tests ${TESTS_SOURCES} ${TESTS_UWP_RESOURCES})
+	if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
+		# Add resource files needed for UWP apps.
+		add_executable(datachannel-tests ${TESTS_SOURCES} ${TESTS_UWP_RESOURCES})
+	else()
+		add_executable(datachannel-tests ${TESTS_SOURCES})
+	endif()
 	set_target_properties(datachannel-tests PROPERTIES
 		VERSION ${PROJECT_VERSION}
 		CXX_STANDARD 17)
@@ -305,7 +318,12 @@ if(NOT NO_TESTS)
 	target_link_libraries(datachannel-tests datachannel)
 
 	# Benchmark
-	add_executable(datachannel-benchmark test/benchmark.cpp)
+	if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
+		# Add resource files needed for UWP apps.
+		add_executable(datachannel-benchmark test/benchmark.cpp ${BENCHMARK_UWP_RESOURCES})
+	else()
+		add_executable(datachannel-benchmark test/benchmark.cpp)
+	endif()
 	set_target_properties(datachannel-benchmark PROPERTIES
 		VERSION ${PROJECT_VERSION}
 		CXX_STANDARD 17)

+ 0 - 0
test/uwp/Logo.png → test/uwp-benchmark/Logo.png


+ 0 - 0
test/uwp/SmallLogo.png → test/uwp-benchmark/SmallLogo.png


+ 0 - 0
test/uwp/SmallLogo44x44.png → test/uwp-benchmark/SmallLogo44x44.png


+ 0 - 0
test/uwp/SplashScreen.png → test/uwp-benchmark/SplashScreen.png


+ 0 - 0
test/uwp/StoreLogo.png → test/uwp-benchmark/StoreLogo.png


+ 0 - 0
test/uwp/Windows_TemporaryKey.pfx → test/uwp-benchmark/Windows_TemporaryKey.pfx


+ 42 - 0
test/uwp-benchmark/package.appxManifest

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Package
+	xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
+	xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
+	xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
+	xmlns:desktop4="http://schemas.microsoft.com/appx/manifest/desktop/windows10/4"
+	xmlns:iot2="http://schemas.microsoft.com/appx/manifest/iot/windows10/2"
+	IgnorableNamespaces="uap mp">
+
+	<Identity Name="EF284012-D73C-360F-A800-2D2910675E38" Publisher="CN=CMake" Version="1.0.0.0" />
+	<mp:PhoneIdentity PhoneProductId="EF284012-D73C-360F-A800-2D2910675E38" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
+	<Properties>
+		<DisplayName>datachannel-benchmark</DisplayName>
+		<PublisherDisplayName>CMake</PublisherDisplayName>
+		<Logo>StoreLogo.png</Logo>
+	</Properties>
+	<Dependencies>
+		<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
+	</Dependencies>
+	<Resources>
+		<Resource Language="x-generate" />
+	</Resources>
+	<Applications>
+		<Application
+			Id="App"
+			Executable="datachannel-benchmark.exe"
+			EntryPoint="datachannel-benchmark.App"
+			desktop4:Subsystem="console"
+			desktop4:SupportsMultipleInstances="true"
+			iot2:Subsystem="console"
+			iot2:SupportsMultipleInstances="true">
+			<uap:VisualElements
+				DisplayName="datachannel-benchmark"
+				Description="datachannel-benchmark"
+				BackgroundColor="#336699"
+				Square150x150Logo="Logo.png"
+				Square44x44Logo="SmallLogo44x44.png">
+				<uap:SplashScreen Image="SplashScreen.png" />
+			</uap:VisualElements>
+		</Application>
+	</Applications>
+</Package>

二进制
test/uwp-tests/Logo.png


二进制
test/uwp-tests/SmallLogo.png


二进制
test/uwp-tests/SmallLogo44x44.png


二进制
test/uwp-tests/SplashScreen.png


二进制
test/uwp-tests/StoreLogo.png


二进制
test/uwp-tests/Windows_TemporaryKey.pfx


+ 0 - 0
test/uwp/package.appxManifest → test/uwp-tests/package.appxManifest