Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
8856337b
Unverified
Commit
8856337b
authored
Aug 24, 2018
by
Edward Thomson
Committed by
GitHub
Aug 24, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4777 from pks-t/pks/cmake-iconv-via-libc
cmake: detect and use libc-provided iconv
parents
9a193102
2e2d8c64
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
cmake/Modules/FindIconv.cmake
+11
-6
No files found.
cmake/Modules/FindIconv.cmake
View file @
8856337b
...
...
@@ -12,14 +12,19 @@ IF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
ENDIF
()
FIND_PATH
(
ICONV_INCLUDE_DIR iconv.h
)
CHECK_FUNCTION_EXISTS
(
iconv_open libc_has_iconv
)
FIND_LIBRARY
(
iconv_lib NAMES iconv libiconv libiconv-2 c
)
IF
(
ICONV_INCLUDE_DIR AND iconv_lib
)
SET
(
ICONV_FOUND TRUE
)
ENDIF
()
IF
(
ICONV_FOUND
)
# split iconv into -L and -l linker options, so we can set them for pkg-config
IF
(
ICONV_INCLUDE_DIR AND libc_has_iconv
)
SET
(
ICONV_FOUND TRUE
)
SET
(
ICONV_LIBRARIES
""
)
IF
(
NOT ICONV_FIND_QUIETLY
)
MESSAGE
(
STATUS
"Found Iconv: provided by libc"
)
ENDIF
(
NOT ICONV_FIND_QUIETLY
)
ELSEIF
(
ICONV_INCLUDE_DIR AND iconv_lib
)
SET
(
ICONV_FOUND TRUE
)
# split iconv into -L and -l linker options, so we can
# set them for pkg-config
GET_FILENAME_COMPONENT
(
iconv_path
${
iconv_lib
}
PATH
)
GET_FILENAME_COMPONENT
(
iconv_name
${
iconv_lib
}
NAME_WE
)
STRING
(
REGEX REPLACE
"^lib"
""
iconv_name
${
iconv_name
}
)
...
...
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