Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abseil-cpp
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
abseil-cpp
Commits
14abd930
Commit
14abd930
authored
Oct 21, 2022
by
H. Vetinari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add pkgconfig metadata for shared windows builds
parent
88eee8b5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
7 deletions
+50
-7
CMake/AbseilDll.cmake
+27
-0
CMake/AbseilHelpers.cmake
+23
-7
No files found.
CMake/AbseilDll.cmake
View file @
14abd930
...
...
@@ -545,6 +545,33 @@ function(absl_make_dll)
${
ABSL_DEFAULT_COPTS
}
)
foreach
(
cflag
${
ABSL_CC_LIB_COPTS
}
)
if
(
${
cflag
}
MATCHES
"^(-Wno|/wd)"
)
# These flags are needed to suppress warnings that might fire in our headers.
set
(
PC_CFLAGS
"
${
PC_CFLAGS
}
${
cflag
}
"
)
elseif
(
${
cflag
}
MATCHES
"^(-W|/w[1234eo])"
)
# Don't impose our warnings on others.
else
()
set
(
PC_CFLAGS
"
${
PC_CFLAGS
}
${
cflag
}
"
)
endif
()
endforeach
()
string
(
REPLACE
";"
" "
PC_LINKOPTS
"
${
ABSL_CC_LIB_LINKOPTS
}
"
)
FILE
(
GENERATE OUTPUT
"
${
CMAKE_BINARY_DIR
}
/lib/pkgconfig/abseil_dll.pc"
CONTENT
"\
prefix=
${
CMAKE_INSTALL_PREFIX
}
\n
\
exec_prefix=
\$
{prefix}
\n
\
libdir=
${
CMAKE_INSTALL_FULL_LIBDIR
}
\n
\
includedir=
${
CMAKE_INSTALL_FULL_INCLUDEDIR
}
\n
\
\n
\
Name: abseil_dll
\n
\
Description: Abseil DLL library
\n
\
URL: https://abseil.io/
\n
\
Version:
${
absl_VERSION
}
\n
\
Libs: -L
\$
{libdir}
${
PC_LINKOPTS
}
$<$<NOT:$<BOOL:
${
ABSL_CC_LIB_IS_INTERFACE
}
>>:-labseil_dll>
\n
\
Cflags: -I
\$
{includedir}
${
PC_CFLAGS
}
\n
"
)
INSTALL
(
FILES
"
${
CMAKE_BINARY_DIR
}
/lib/pkgconfig/abseil_dll.pc"
DESTINATION
"
${
CMAKE_INSTALL_LIBDIR
}
/pkgconfig"
)
target_compile_definitions
(
abseil_dll
PRIVATE
...
...
CMake/AbseilHelpers.cmake
View file @
14abd930
...
...
@@ -179,8 +179,7 @@ function(absl_cc_library)
endif
()
# Generate a pkg-config file for every library:
if
((
_build_type STREQUAL
"static"
OR _build_type STREQUAL
"shared"
)
AND ABSL_ENABLE_INSTALL
)
if
(
ABSL_ENABLE_INSTALL
)
if
(
NOT ABSL_CC_LIB_TESTONLY
)
if
(
absl_VERSION
)
set
(
PC_VERSION
"
${
absl_VERSION
}
"
)
...
...
@@ -189,11 +188,28 @@ function(absl_cc_library)
endif
()
foreach
(
dep
${
ABSL_CC_LIB_DEPS
}
)
if
(
${
dep
}
MATCHES
"^absl::(.*)"
)
# Join deps with commas.
if
(
PC_DEPS
)
set
(
PC_DEPS
"
${
PC_DEPS
}
,"
)
# for DLL builds many libs are not created, but add
# the pkgconfigs nevertheless, pointing to the dll.
if
(
_build_type STREQUAL
"dll"
)
# hide this MATCHES in an if-clause so it doesn't overwrite
# the CMAKE_MATCH_1 from (${dep} MATCHES "^absl::(.*)")
if
(
NOT PC_DEPS MATCHES
"abseil_dll"
)
# Join deps with commas.
if
(
PC_DEPS
)
set
(
PC_DEPS
"
${
PC_DEPS
}
,"
)
endif
()
# don't duplicate dll-dep if it exists already
set
(
PC_DEPS
"
${
PC_DEPS
}
abseil_dll =
${
PC_VERSION
}
"
)
set
(
LNK_LIB
"
${
LNK_LIB
}
-labseil_dll"
)
endif
()
else
()
# Join deps with commas.
if
(
PC_DEPS
)
set
(
PC_DEPS
"
${
PC_DEPS
}
,"
)
endif
()
set
(
PC_DEPS
"
${
PC_DEPS
}
absl_
${
CMAKE_MATCH_1
}
=
${
PC_VERSION
}
"
)
set
(
LNK_LIB
"
${
LNK_LIB
}
-labsl_
${
_NAME
}
"
)
endif
()
set
(
PC_DEPS
"
${
PC_DEPS
}
absl_
${
CMAKE_MATCH_1
}
=
${
PC_VERSION
}
"
)
endif
()
endforeach
()
foreach
(
cflag
${
ABSL_CC_LIB_COPTS
}
)
...
...
@@ -221,7 +237,7 @@ Description: Abseil ${_NAME} library\n\
URL: https://abseil.io/
\n
\
Version:
${
PC_VERSION
}
\n
\
Requires:
${
PC_DEPS
}
\n
\
Libs: -L
\$
{libdir}
${
PC_LINKOPTS
}
$<$<NOT:$<BOOL:
${
ABSL_CC_LIB_IS_INTERFACE
}
>>:
-labsl_
${
_NAME
}
>
\n
\
Libs: -L
\$
{libdir}
${
PC_LINKOPTS
}
$<$<NOT:$<BOOL:
${
ABSL_CC_LIB_IS_INTERFACE
}
>>:
${
LNK_LIB
}
>
\n
\
Cflags: -I
\$
{includedir}
${
PC_CFLAGS
}
\n
"
)
INSTALL
(
FILES
"
${
CMAKE_BINARY_DIR
}
/lib/pkgconfig/absl_
${
_NAME
}
.pc"
DESTINATION
"
${
CMAKE_INSTALL_LIBDIR
}
/pkgconfig"
)
...
...
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