Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
03fe1cb7
Commit
03fe1cb7
authored
Aug 01, 2019
by
Hugo Lindström
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support building shared libraries on WINCE.
parent
4dadf17b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
10 deletions
+31
-10
dllmain.cpp.in
cmake/templates/dllmain.cpp.in
+8
-2
glob.cpp
modules/core/src/glob.cpp
+2
-2
datafile.cpp
modules/core/src/utils/datafile.cpp
+11
-4
arm-wince-headless-overrides.cmake
platforms/wince/arm-wince-headless-overrides.cmake
+2
-2
readme.md
platforms/wince/readme.md
+8
-0
No files found.
cmake/templates/dllmain.cpp.in
View file @
03fe1cb7
...
...
@@ -18,11 +18,17 @@ namespace cv {
extern __declspec(dllimport) bool __termination; // Details: #12750
}
#ifdef _WIN32_WCE
#define DLL_MAIN_ARG0 HANDLE
#else
#define DLL_MAIN_ARG0 HINSTANCE
#endif
extern "C"
BOOL WINAPI DllMain(
HINSTANCE
, DWORD fdwReason, LPVOID lpReserved);
BOOL WINAPI DllMain(
DLL_MAIN_ARG0
, DWORD fdwReason, LPVOID lpReserved);
extern "C"
BOOL WINAPI DllMain(
HINSTANCE
, DWORD fdwReason, LPVOID lpReserved)
BOOL WINAPI DllMain(
DLL_MAIN_ARG0
, DWORD fdwReason, LPVOID lpReserved)
{
if (fdwReason == DLL_THREAD_DETACH || fdwReason == DLL_PROCESS_DETACH)
{
...
...
modules/core/src/glob.cpp
View file @
03fe1cb7
...
...
@@ -139,7 +139,7 @@ const char dir_separators[] = "/";
static
bool
isDir
(
const
cv
::
String
&
path
,
DIR
*
dir
)
{
#if defined _WIN32 || defined
WIN
CE
#if defined _WIN32 || defined
_WIN32_W
CE
DWORD
attributes
;
BOOL
status
=
TRUE
;
if
(
dir
)
...
...
@@ -147,7 +147,7 @@ static bool isDir(const cv::String& path, DIR* dir)
else
{
WIN32_FILE_ATTRIBUTE_DATA
all_attrs
;
#if
def WINRT
#if
defined WINRT || defined _WIN32_WCE
wchar_t
wpath
[
MAX_PATH
];
size_t
copied
=
mbstowcs
(
wpath
,
path
.
c_str
(),
MAX_PATH
);
CV_Assert
((
copied
!=
MAX_PATH
)
&&
(
copied
!=
(
size_t
)
-
1
));
...
...
modules/core/src/utils/datafile.cpp
View file @
03fe1cb7
...
...
@@ -115,13 +115,20 @@ static cv::String getModuleLocation(const void* addr)
#endif
if
(
m
)
{
char
path
[
MAX_PATH
];
const
size_t
path_size
=
sizeof
(
path
)
/
sizeof
(
*
path
);
size_t
sz
=
GetModuleFileName
A
(
m
,
path
,
path_size
);
// no unicode support
TCHAR
path
[
MAX_PATH
];
const
size_t
path_size
=
sizeof
(
path
)
/
sizeof
(
*
path
);
size_t
sz
=
GetModuleFileName
(
m
,
path
,
path_size
);
if
(
sz
>
0
&&
sz
<
path_size
)
{
path
[
sz
]
=
'\0'
;
path
[
sz
]
=
TCHAR
(
'\0'
);
#ifdef _UNICODE
char
char_path
[
MAX_PATH
];
size_t
copied
=
wcstombs
(
char_path
,
path
,
MAX_PATH
);
CV_Assert
((
copied
!=
MAX_PATH
)
&&
(
copied
!=
(
size_t
)
-
1
));
return
cv
::
String
(
char_path
);
#else
return
cv
::
String
(
path
);
#endif
}
}
#elif defined(__linux__)
...
...
platforms/wince/arm-wince-headless-overrides.cmake
View file @
03fe1cb7
...
...
@@ -3,10 +3,10 @@ if(WINCE)
# Try_Compile succeed and therefore also C/C++ ABI Detetection work
# https://gitlab.kitware.com/cmake/cmake/blob/master/Modules/Platform/Windows-
# MSVC.cmake
set
(
CMAKE_C_STANDARD_LIBRARIES_INIT
"coredll.lib"
)
set
(
CMAKE_C_STANDARD_LIBRARIES_INIT
"coredll.lib
oldnames.lib
"
)
set
(
CMAKE_CXX_STANDARD_LIBRARIES_INIT
${
CMAKE_C_STANDARD_LIBRARIES_INIT
}
)
foreach
(
ID EXE SHARED MODULE
)
string
(
APPEND CMAKE_
${
ID
}
_LINKER_FLAGS_INIT
" /NODEFAULTLIB:libc.lib
/NODEFAULTLIB:oldnames.lib
"
)
" /NODEFAULTLIB:libc.lib"
)
endforeach
()
endif
()
platforms/wince/readme.md
View file @
03fe1cb7
...
...
@@ -57,6 +57,14 @@ For headless WEC2013, this configuration may not be limited to but is known to w
-DWITH_TIFF=OFF `
```
## Configuring to build as shared
Building OpenCV as shared libraries is as easy as appending
```
-DBUILD_SHARED_LIBS=ON `
-DBUILD_ZLIB=ON
```
to the build configuration.
## Building
You are required to build using Unicode:
`cmake --build . -- /p:CharacterSet=Unicode`
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