about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLoo Rong Jie <loorongjie@gmail.com>2018-10-11T09·20+0800
committerLoo Rong Jie <loorongjie@gmail.com>2018-10-11T09·20+0800
commitdadcd56b4bdab6a9cefc7528f10b20d03fa61f88 (patch)
treeb97bf5f2cf9f0da22605e6e87f422a9f8164299f
parentf59e0f1d089d647bdc441a20a2bea10963c0e5a7 (diff)
Use target_sources and remove one non-existent file
-rw-r--r--CMake/AbseilHelpers.cmake13
-rw-r--r--absl/strings/CMakeLists.txt1
2 files changed, 6 insertions, 8 deletions
diff --git a/CMake/AbseilHelpers.cmake b/CMake/AbseilHelpers.cmake
index a376721e5399..3ed58a05bcb6 100644
--- a/CMake/AbseilHelpers.cmake
+++ b/CMake/AbseilHelpers.cmake
@@ -129,16 +129,15 @@ function(absl_cc_library)
     endif()
 
     # Check if this is a header-only library
-    if (ABSL_CC_LIB_SRCS)
-      set(_SRCS ${ABSL_CC_LIB_SRCS})
-      list(FILTER _SRCS INCLUDE REGEX "\.cc$")
-      list(LENGTH _SRCS ABSL_CC_LIB_SRCS_LEN)
+    if ("${ABSL_CC_LIB_SRCS}" STREQUAL "")
+      set(ABSL_CC_LIB_IS_INTERFACE 1)
     else()
-      set(ABSL_CC_LIB_SRCS_LEN 0)
+      set(ABSL_CC_LIB_IS_INTERFACE 0)
     endif()
 
-    if(ABSL_CC_LIB_SRCS_LEN)
-      add_library(${_NAME} STATIC ${ABSL_CC_LIB_SRCS} ${ABSL_CC_LIB_HDRS})
+    if(NOT ABSL_CC_LIB_IS_INTERFACE)
+      add_library(${_NAME} STATIC "")
+      target_sources(${_NAME} PRIVATE ${ABSL_CC_LIB_SRCS} ${ABSL_CC_LIB_HDRS})
       target_include_directories(${_NAME}
         PUBLIC ${ABSL_COMMON_INCLUDE_DIRS})
       # TODO(rongjiecomputer): Revisit ABSL_COMPILE_CXXFLAGS when fixing GH#123
diff --git a/absl/strings/CMakeLists.txt b/absl/strings/CMakeLists.txt
index 9ee3fc2a5b11..4df3bac38fc3 100644
--- a/absl/strings/CMakeLists.txt
+++ b/absl/strings/CMakeLists.txt
@@ -32,7 +32,6 @@ list(APPEND STRINGS_PUBLIC_HEADERS
 
 
 list(APPEND STRINGS_INTERNAL_HEADERS
-  "internal/bits.h"
   "internal/char_map.h"
   "internal/charconv_bigint.h"
   "internal/charconv_parse.h"