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
fcc476cc
Commit
fcc476cc
authored
Aug 22, 2018
by
Loo Rong Jie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement header-only target as INTERFACE lib
parent
ac533e18
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
26 deletions
+18
-26
CMake/AbseilHelpers.cmake
+18
-26
No files found.
CMake/AbseilHelpers.cmake
View file @
fcc476cc
...
@@ -136,35 +136,27 @@ function(absl_cc_library)
...
@@ -136,35 +136,27 @@ function(absl_cc_library)
if
(
ABSL_CC_LIB_SRCS_LEN
)
if
(
ABSL_CC_LIB_SRCS_LEN
)
add_library
(
${
_NAME
}
STATIC
${
ABSL_CC_LIB_SRCS
}
${
ABSL_CC_LIB_HDRS
}
)
add_library
(
${
_NAME
}
STATIC
${
ABSL_CC_LIB_SRCS
}
${
ABSL_CC_LIB_HDRS
}
)
target_include_directories
(
${
_NAME
}
PUBLIC
${
ABSL_COMMON_INCLUDE_DIRS
}
)
target_compile_options
(
${
_NAME
}
PRIVATE
${
ABSL_COMPILE_CXXFLAGS
}
${
ABSL_CC_LIB_COPTS
}
)
target_link_libraries
(
${
_NAME
}
PUBLIC
${
ABSL_CC_LIB_DEPS
}
PRIVATE
${
ABSL_CC_LIB_LINKOPTS
}
)
target_compile_definitions
(
${
_NAME
}
PUBLIC
${
ABSL_CC_LIB_DEFINES
}
)
# Add all Abseil targets to a a folder in the IDE for organization.
set_property
(
TARGET
${
_NAME
}
PROPERTY FOLDER
${
ABSL_IDE_FOLDER
}
)
else
()
else
()
set
(
__dummy_header_only_lib_file
"
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
_NAME
}
_header_only_dummy.cc"
)
add_library
(
${
_NAME
}
INTERFACE
)
target_include_directories
(
${
_NAME
}
INTERFACE
${
ABSL_COMMON_INCLUDE_DIRS
}
)
if
(
NOT EXISTS
${
__dummy_header_only_lib_file
}
)
target_link_libraries
(
${
_NAME
}
file
(
WRITE
${
__dummy_header_only_lib_file
}
INTERFACE
${
ABSL_CC_LIB_DEPS
}
${
ABSL_CC_LIB_LINKOPTS
}
"/* generated file for header-only cmake target */
)
target_compile_definitions
(
${
_NAME
}
INTERFACE
${
ABSL_CC_LIB_DEFINES
}
)
namespace absl {
// single meaningless symbol
void
${
_NAME
}
__header_fakesym() {}
} // namespace absl"
)
endif
()
add_library
(
${
_NAME
}
${
__dummy_header_only_lib_file
}
${
ABSL_CC_LIB_HDRS
}
)
endif
()
endif
()
target_compile_options
(
${
_NAME
}
PRIVATE
${
ABSL_COMPILE_CXXFLAGS
}
${
ABSL_CC_LIB_COPTS
}
)
target_link_libraries
(
${
_NAME
}
PUBLIC
${
ABSL_CC_LIB_DEPS
}
PRIVATE
${
ABSL_CC_LIB_LINKOPTS
}
)
target_compile_definitions
(
${
_NAME
}
PUBLIC
${
ABSL_CC_LIB_DEFINES
}
)
target_include_directories
(
${
_NAME
}
PUBLIC
${
ABSL_COMMON_INCLUDE_DIRS
}
)
# Add all Abseil targets to a a folder in the IDE for organization.
set_property
(
TARGET
${
_NAME
}
PROPERTY FOLDER
${
ABSL_IDE_FOLDER
}
)
if
(
ABSL_CC_LIB_VISIBILITY_PUBLIC
)
if
(
ABSL_CC_LIB_VISIBILITY_PUBLIC
)
add_library
(
absl::
${
ABSL_CC_LIB_NAME
}
ALIAS
${
_NAME
}
)
add_library
(
absl::
${
ABSL_CC_LIB_NAME
}
ALIAS
${
_NAME
}
)
endif
()
endif
()
...
...
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