Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
belle-sip
Commits
e74398bf
Commit
e74398bf
authored
Jun 22, 2016
by
Gautier Pelloux-Prayer
Browse files
tester: fix compilation on iOS
parent
276d1e31
Changes
2
Hide whitespace changes
Inline
Side-by-side
tester/CMakeLists.txt
View file @
e74398bf
...
...
@@ -20,7 +20,13 @@
#
############################################################################
set
(
TESTER_SOURCES
if
(
ENABLE_STATIC
)
set
(
PROJECT_LIBS bellesip-static
)
else
()
set
(
PROJECT_LIBS bellesip
)
endif
()
set
(
SOURCE_FILES_C
auth_helper_tester.c
belle_generic_uri_tester.c
belle_http_tester.c
...
...
@@ -39,14 +45,19 @@ set(TESTER_SOURCES
register_tester.h
)
set
(
SOURCE_FILES_OBJC
)
if
(
IOS
)
list
(
APPEND SOURCE_FILES_OBJC belle_sip_tester_ios.m
)
endif
()
string
(
REPLACE
";"
" "
LINK_FLAGS_STR
"
${
LINK_FLAGS
}
"
)
apply_compile_flags
(
TESTER_SOURCES
"CPP"
"C"
)
apply_compile_flags
(
SOURCE_FILES_C
"CPP"
"C"
)
apply_compile_flags
(
SOURCE_FILES_OBJC
"CPP"
"OBJC"
)
if
(
CMAKE_SYSTEM_NAME STREQUAL
"WindowsStore"
)
add_library
(
belle_sip_tester_static STATIC
${
TESTER_SOURCES
}
)
add_library
(
belle_sip_tester_static STATIC
${
SOURCE_FILES_C
}
)
target_include_directories
(
belle_sip_tester_static PUBLIC
${
BCTOOLBOX_TESTER_INCLUDE_DIRS
}
)
target_link_libraries
(
belle_sip_tester_static
${
BCTOOLBOX_TESTER_LIBRARIES
}
bellesip
)
target_link_libraries
(
belle_sip_tester_static
${
BCTOOLBOX_TESTER_LIBRARIES
}
${
PROJECT_LIBS
}
)
set
(
RUNTIME_COMPONENT_SOURCES
belle_sip_tester_windows.cpp
...
...
@@ -71,35 +82,38 @@ if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
endif
()
else
()
set
(
USE_BUNDLE
)
if
(
IOS
)
set
(
USE_BUNDLE MACOSX_BUNDLE
)
endif
()
add_executable
(
belle_sip_tester
${
USE_BUNDLE
}
${
SOURCE_FILES_C
}
${
SOURCE_FILES_OBJC
}
)
add_executable
(
belle_sip_tester
${
TESTER_SOURCES
}
)
if
(
NOT
"
${
LINK_FLAGS_STR
}
"
STREQUAL
""
)
set_target_properties
(
belle_sip_tester PROPERTIES LINK_FLAGS
"
${
LINK_FLAGS_STR
}
"
)
endif
()
target_include_directories
(
belle_sip_tester PUBLIC
${
BCTOOLBOX_TESTER_INCLUDE_DIRS
}
)
target_link_libraries
(
belle_sip_tester
${
BCTOOLBOX_TESTER_LIBRARIES
}
bellesip
)
target_link_libraries
(
belle_sip_tester
${
BCTOOLBOX_TESTER_LIBRARIES
}
${
PROJECT_LIBS
}
)
add_test
(
NAME belle_sip_tester COMMAND belle_sip_tester --verbose
)
set
(
OBJECT_DESCRIBE_SOURCES describe.c
)
apply_compile_flags
(
OBJECT_DESCRIBE_SOURCES
"CPP"
"C"
)
add_executable
(
belle_sip_object_describe
${
OBJECT_DESCRIBE_SOURCES
}
)
add_executable
(
belle_sip_object_describe
${
USE_BUNDLE
}
${
OBJECT_DESCRIBE_SOURCES
}
)
if
(
NOT
"
${
LINK_FLAGS_STR
}
"
STREQUAL
""
)
set_target_properties
(
belle_sip_object_describe PROPERTIES LINK_FLAGS
"
${
LINK_FLAGS_STR
}
"
)
endif
()
target_link_libraries
(
belle_sip_object_describe
bellesip
)
target_link_libraries
(
belle_sip_object_describe
${
PROJECT_LIBS
}
)
set
(
PARSE_SOURCES parse.c
)
apply_compile_flags
(
PARSE_SOURCES
"CPP"
"C"
)
add_executable
(
belle_sip_parse
${
PARSE_SOURCES
}
)
add_executable
(
belle_sip_parse
${
USE_BUNDLE
}
${
PARSE_SOURCES
}
)
if
(
NOT
"
${
LINK_FLAGS_STR
}
"
STREQUAL
""
)
set_target_properties
(
belle_sip_parse PROPERTIES LINK_FLAGS
"
${
LINK_FLAGS_STR
}
"
)
endif
()
target_link_libraries
(
belle_sip_parse
bellesip
)
target_link_libraries
(
belle_sip_parse
${
PROJECT_LIBS
}
)
endif
()
tester/belle_sip_tester_ios.m
0 → 100644
View file @
e74398bf
/*
linphone library - modular sound and video processing and streaming
Copyright (C) 2006-2014 Belledonne Communications, Grenoble
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#if TARGET_OS_IPHONE
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#include <CoreFoundation/CFRunLoop.h>
#include "belle_sip_tester.h"
int
g_argc
;
char
**
g_argv
;
void
stop_handler
(
int
sig
)
{
return
;
}
static
void
*
_apple_main
(
void
*
data
)
{
NSString
*
bundlePath
=
[[[
NSBundle
mainBundle
]
bundlePath
]
retain
];
NSArray
*
paths
=
NSSearchPathForDirectoriesInDomains
(
NSDocumentDirectory
,
NSUserDomainMask
,
YES
);
NSString
*
documentPath
=
[[
paths
objectAtIndex
:
0
]
retain
];
NSLog
(
@"Bundle path: %@"
,
bundlePath
);
NSLog
(
@"Document path: %@"
,
documentPath
);
bc_tester_set_resource_dir_prefix
(
bundlePath
.
UTF8String
);
bc_tester_set_writable_dir_prefix
(
documentPath
.
UTF8String
);
belle_sip_tester_init
(
NULL
);
bc_tester_start
(
NULL
);
belle_sip_tester_uninit
();
[
bundlePath
release
];
[
documentPath
release
];
return
NULL
;
}
int
main
(
int
argc
,
char
*
argv
[])
{
pthread_t
main_thread
;
g_argc
=
argc
;
g_argv
=
argv
;
pthread_create
(
&
main_thread
,
NULL
,
_apple_main
,
NULL
);
NSAutoreleasePool
*
pool
=
[[
NSAutoreleasePool
alloc
]
init
];
int
value
=
UIApplicationMain
(
0
,
nil
,
nil
,
nil
);
[
pool
release
];
return
value
;
pthread_join
(
main_thread
,
NULL
);
return
0
;
}
#endif // target IPHONE
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment