mirror of
https://github.com/google/sentencepiece.git
synced 2024-09-11 10:55:42 +03:00
Merge pull request #962 from Halmoni100/external-absl-2
Additional external absl fixes
This commit is contained in:
commit
7b9ee4c93e
@ -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()
|
||||
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user