mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-07 05:53:06 +00:00
Use correct namespaces and winmd name when building for Windows 10.
This commit is contained in:
parent
b0ea18f83c
commit
a6ae0d02d6
3 changed files with 59 additions and 45 deletions
|
|
@ -89,6 +89,8 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
|||
target_compile_options(linphone_tester_runtime PRIVATE "/wd4996")
|
||||
target_link_libraries(linphone_tester_runtime linphone_tester_static)
|
||||
set_target_properties(linphone_tester_runtime PROPERTIES VS_WINRT_COMPONENT TRUE)
|
||||
set_target_properties(linphone_tester_runtime PROPERTIES LIBRARY_OUTPUT_NAME "BelledonneCommunications.Linphone.Tester")
|
||||
set_target_properties(linphone_tester_runtime PROPERTIES LINK_FLAGS "/WINMDFILE:BelledonneCommunications.Linphone.Tester.winmd")
|
||||
|
||||
install(TARGETS linphone_tester_runtime
|
||||
RUNTIME DESTINATION bin
|
||||
|
|
@ -96,7 +98,13 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
|||
ARCHIVE DESTINATION lib
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
|
||||
)
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/linphone_tester_runtime.winmd" DESTINATION bin)
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/BelledonneCommunications.Linphone.Tester.winmd" DESTINATION lib)
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Debug/BelledonneCommunications.Linphone.Tester.pdb
|
||||
DESTINATION lib
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
|
||||
)
|
||||
endif()
|
||||
else()
|
||||
add_executable(liblinphone_tester ${SOURCE_FILES})
|
||||
set_target_properties(liblinphone_tester PROPERTIES LINKER_LANGUAGE CXX)
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include "liblinphone_tester_windows.h"
|
||||
|
||||
using namespace linphone_tester_runtime;
|
||||
using namespace BelledonneCommunications::Linphone::Tester;
|
||||
using namespace Platform;
|
||||
using namespace Windows::Foundation;
|
||||
using namespace Windows::Storage;
|
||||
|
|
@ -14,7 +14,7 @@ using namespace Windows::System::Threading;
|
|||
|
||||
static OutputTraceListener^ sTraceListener;
|
||||
|
||||
LibLinphoneTester^ LibLinphoneTester::_instance = ref new LibLinphoneTester();
|
||||
NativeTester^ NativeTester::_instance = ref new NativeTester();
|
||||
|
||||
static void nativeOutputTraceHandler(int lev, const char *fmt, va_list args)
|
||||
{
|
||||
|
|
@ -45,27 +45,27 @@ static void nativeOutputTraceHandler(int lev, const char *fmt, va_list args)
|
|||
}
|
||||
}
|
||||
|
||||
static void libLinphoneNativeOutputTraceHandler(OrtpLogLevel lev, const char *fmt, va_list args)
|
||||
static void libLinphoneNativeOutputTraceHandler(const char *domain, OrtpLogLevel lev, const char *fmt, va_list args)
|
||||
{
|
||||
nativeOutputTraceHandler((int)lev, fmt, args);
|
||||
}
|
||||
|
||||
|
||||
LibLinphoneTester::LibLinphoneTester()
|
||||
NativeTester::NativeTester()
|
||||
{
|
||||
}
|
||||
|
||||
LibLinphoneTester::~LibLinphoneTester()
|
||||
NativeTester::~NativeTester()
|
||||
{
|
||||
liblinphone_tester_uninit();
|
||||
}
|
||||
|
||||
void LibLinphoneTester::setOutputTraceListener(OutputTraceListener^ traceListener)
|
||||
void NativeTester::setOutputTraceListener(OutputTraceListener^ traceListener)
|
||||
{
|
||||
sTraceListener = traceListener;
|
||||
}
|
||||
|
||||
void LibLinphoneTester::initialize(StorageFolder^ writableDirectory, Platform::Boolean ui)
|
||||
void NativeTester::initialize(StorageFolder^ writableDirectory, Platform::Boolean ui)
|
||||
{
|
||||
if (ui) {
|
||||
liblinphone_tester_init(nativeOutputTraceHandler);
|
||||
|
|
@ -91,7 +91,7 @@ void LibLinphoneTester::initialize(StorageFolder^ writableDirectory, Platform::B
|
|||
}
|
||||
}
|
||||
|
||||
bool LibLinphoneTester::run(Platform::String^ suiteName, Platform::String^ caseName, Platform::Boolean verbose)
|
||||
bool NativeTester::run(Platform::String^ suiteName, Platform::String^ caseName, Platform::Boolean verbose)
|
||||
{
|
||||
std::wstring all(L"ALL");
|
||||
std::wstring wssuitename = suiteName->Data();
|
||||
|
|
@ -111,7 +111,7 @@ bool LibLinphoneTester::run(Platform::String^ suiteName, Platform::String^ caseN
|
|||
return bc_tester_run_tests(wssuitename == all ? 0 : csuitename, wscasename == all ? 0 : ccasename) != 0;
|
||||
}
|
||||
|
||||
void LibLinphoneTester::runAllToXml()
|
||||
void NativeTester::runAllToXml()
|
||||
{
|
||||
auto workItem = ref new WorkItemHandler([this](IAsyncAction ^workItem) {
|
||||
bc_tester_start(NULL);
|
||||
|
|
@ -120,12 +120,12 @@ void LibLinphoneTester::runAllToXml()
|
|||
_asyncAction = ThreadPool::RunAsync(workItem);
|
||||
}
|
||||
|
||||
unsigned int LibLinphoneTester::nbTestSuites()
|
||||
unsigned int NativeTester::nbTestSuites()
|
||||
{
|
||||
return bc_tester_nb_suites();
|
||||
}
|
||||
|
||||
unsigned int LibLinphoneTester::nbTests(Platform::String^ suiteName)
|
||||
unsigned int NativeTester::nbTests(Platform::String^ suiteName)
|
||||
{
|
||||
std::wstring suitename = suiteName->Data();
|
||||
char cname[MAX_SUITE_NAME_SIZE] = { 0 };
|
||||
|
|
@ -133,7 +133,7 @@ unsigned int LibLinphoneTester::nbTests(Platform::String^ suiteName)
|
|||
return bc_tester_nb_tests(cname);
|
||||
}
|
||||
|
||||
Platform::String^ LibLinphoneTester::testSuiteName(int index)
|
||||
Platform::String^ NativeTester::testSuiteName(int index)
|
||||
{
|
||||
const char *cname = bc_tester_suite_name(index);
|
||||
wchar_t wcname[MAX_SUITE_NAME_SIZE];
|
||||
|
|
@ -141,7 +141,7 @@ Platform::String^ LibLinphoneTester::testSuiteName(int index)
|
|||
return ref new String(wcname);
|
||||
}
|
||||
|
||||
Platform::String^ LibLinphoneTester::testName(Platform::String^ suiteName, int testIndex)
|
||||
Platform::String^ NativeTester::testName(Platform::String^ suiteName, int testIndex)
|
||||
{
|
||||
std::wstring suitename = suiteName->Data();
|
||||
char csuitename[MAX_SUITE_NAME_SIZE] = { 0 };
|
||||
|
|
|
|||
|
|
@ -3,39 +3,45 @@
|
|||
#include "linphonecore.h"
|
||||
#include "liblinphone_tester.h"
|
||||
|
||||
namespace linphone_tester_runtime
|
||||
namespace BelledonneCommunications
|
||||
{
|
||||
public interface class OutputTraceListener
|
||||
namespace Linphone
|
||||
{
|
||||
public:
|
||||
void outputTrace(Platform::String^ lev, Platform::String^ msg);
|
||||
};
|
||||
|
||||
public ref class LibLinphoneTester sealed
|
||||
{
|
||||
public:
|
||||
void setOutputTraceListener(OutputTraceListener^ traceListener);
|
||||
unsigned int nbTestSuites();
|
||||
unsigned int nbTests(Platform::String^ suiteName);
|
||||
Platform::String^ testSuiteName(int index);
|
||||
Platform::String^ testName(Platform::String^ suiteName, int testIndex);
|
||||
void initialize(Windows::Storage::StorageFolder^ writableDirectory, Platform::Boolean ui);
|
||||
bool run(Platform::String^ suiteName, Platform::String^ caseName, Platform::Boolean verbose);
|
||||
void runAllToXml();
|
||||
|
||||
static property LibLinphoneTester^ Instance
|
||||
namespace Tester
|
||||
{
|
||||
LibLinphoneTester^ get() { return _instance; }
|
||||
}
|
||||
property Windows::Foundation::IAsyncAction^ AsyncAction
|
||||
{
|
||||
Windows::Foundation::IAsyncAction^ get() { return _asyncAction; }
|
||||
}
|
||||
private:
|
||||
LibLinphoneTester();
|
||||
~LibLinphoneTester();
|
||||
public interface class OutputTraceListener
|
||||
{
|
||||
public:
|
||||
void outputTrace(Platform::String^ lev, Platform::String^ msg);
|
||||
};
|
||||
|
||||
static LibLinphoneTester^ _instance;
|
||||
Windows::Foundation::IAsyncAction^ _asyncAction;
|
||||
};
|
||||
public ref class NativeTester sealed
|
||||
{
|
||||
public:
|
||||
void setOutputTraceListener(OutputTraceListener^ traceListener);
|
||||
unsigned int nbTestSuites();
|
||||
unsigned int nbTests(Platform::String^ suiteName);
|
||||
Platform::String^ testSuiteName(int index);
|
||||
Platform::String^ testName(Platform::String^ suiteName, int testIndex);
|
||||
void initialize(Windows::Storage::StorageFolder^ writableDirectory, Platform::Boolean ui);
|
||||
bool run(Platform::String^ suiteName, Platform::String^ caseName, Platform::Boolean verbose);
|
||||
void runAllToXml();
|
||||
|
||||
static property NativeTester^ Instance
|
||||
{
|
||||
NativeTester^ get() { return _instance; }
|
||||
}
|
||||
property Windows::Foundation::IAsyncAction^ AsyncAction
|
||||
{
|
||||
Windows::Foundation::IAsyncAction^ get() { return _asyncAction; }
|
||||
}
|
||||
private:
|
||||
NativeTester();
|
||||
~NativeTester();
|
||||
|
||||
static NativeTester^ _instance;
|
||||
Windows::Foundation::IAsyncAction^ _asyncAction;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue