Skip to content

Commit

Permalink
Merge pull request #962 from Halmoni100/external-absl-2
Browse files Browse the repository at this point in the history
Additional external absl fixes
  • Loading branch information
taku910 authored Jan 18, 2024
2 parents 4ce471c + 0ea22c0 commit 7b9ee4c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
18 changes: 11 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -163,16 +163,20 @@ elseif (SPM_ABSL_PROVIDER STREQUAL "module")
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp
GIT_PROGRESS TRUE)
add_subdirectory(third_party/abseil-cpp)
file(RENAME ${CMAKE_CURRENT_SOURCE_DIR}/third_party/absl ${CMAKE_CURRENT_SOURCE_DIR}/third_party/absl.org)
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp/absl
${CMAKE_CURRENT_SOURCE_DIR}/third_party/absl)
if (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/absl.org)
file(RENAME ${CMAKE_CURRENT_SOURCE_DIR}/third_party/absl ${CMAKE_CURRENT_SOURCE_DIR}/third_party/absl.org)
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp/absl
${CMAKE_CURRENT_SOURCE_DIR}/third_party/absl)
endif()
elseif (SPM_ABSL_PROVIDER STREQUAL "package")
find_package(absl REQUIRED)
get_target_property(ABSL_INCLUDE_DIRS absl::base INTERFACE_INCLUDE_DIRECTORIES)
file(RENAME ${CMAKE_CURRENT_SOURCE_DIR}/third_party/absl ${CMAKE_CURRENT_SOURCE_DIR}/third_party/absl.org)
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
${ABSL_INCLUDE_DIRS}/absl ${CMAKE_CURRENT_SOURCE_DIR}/third_party/absl)
if (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/absl.org)
file(RENAME ${CMAKE_CURRENT_SOURCE_DIR}/third_party/absl ${CMAKE_CURRENT_SOURCE_DIR}/third_party/absl.org)
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
${ABSL_INCLUDE_DIRS}/absl ${CMAKE_CURRENT_SOURCE_DIR}/third_party/absl)
endif()
include_directories(${ABSL_INCLUDE_DIRS})
endif()

Expand Down
2 changes: 2 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ if (SPM_ABSL_PROVIDER STREQUAL "module" OR SPM_ABSL_PROVIDER STREQUAL "package")
list(APPEND SPM_LIBS absl::strings)
list(APPEND SPM_LIBS absl::flags)
list(APPEND SPM_LIBS absl::flags_parse)
list(APPEND SPM_LIBS absl::log)
list(APPEND SPM_LIBS absl::check)
if (MSVC)
add_definitions("/D_USE_EXTERNAL_ABSL")
else()
Expand Down

0 comments on commit 7b9ee4c

Please sign in to comment.