Skip to content

Commit

Permalink
Export of internal Abseil changes.
Browse files Browse the repository at this point in the history
--
4501f16edb0939be6165df74c70a421d3a959aa5 by Jon Cohen <[email protected]>:

Remove use of list(FILTER as it's only available in cmake 3.6.  We currently have to support cmake 3.5 at least because of Ubuntu 14.04.  Also make sure to exclude .inc files when checking if the library is header only.

Fixes #263

PiperOrigin-RevId: 235725207

--
68ceb6a674a6cbb74472c64915e9e76d2de2fb8d by Abseil Team <[email protected]>:

Fix comment in FixedArrayTest.SmallObjects.

PiperOrigin-RevId: 235671337
GitOrigin-RevId: 4501f16edb0939be6165df74c70a421d3a959aa5
Change-Id: I7c2759ad9d1d086cc7c213e7964279366113fccb
  • Loading branch information
Abseil Team authored and Jon Cohen committed Feb 26, 2019
1 parent 308ce31 commit b312c3c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion CMake/AbseilHelpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,15 @@ function(absl_cc_library)
endif()

# Check if this is a header-only library
# Note that as of February 2019, many popular OS's (for example, Ubuntu
# 16.04 LTS) only come with cmake 3.5 by default. For this reason, we can't
# use list(FILTER...)
set(ABSL_CC_SRCS "${ABSL_CC_LIB_SRCS}")
list(FILTER ABSL_CC_SRCS EXCLUDE REGEX ".*\\.h")
foreach(src_file IN LISTS ABSL_CC_SRCS)
if(${src_file} MATCHES ".*\\.(h|inc)")
list(REMOVE_ITEM ABSL_CC_SRCS "${src_file}")
endif()
endforeach()
if ("${ABSL_CC_SRCS}" STREQUAL "")
set(ABSL_CC_LIB_IS_INTERFACE 1)
else()
Expand Down
2 changes: 1 addition & 1 deletion absl/container/fixed_array_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ TEST(FixedArrayTest, SmallObjects) {
}

{
// Arrays of > default size should be on the stack
// Arrays of > default size should be on the heap
absl::FixedArray<int, 100> array(101);
EXPECT_FALSE(IsOnStack(array));
}
Expand Down

0 comments on commit b312c3c

Please sign in to comment.