Skip to content

Commit

Permalink
move absl to pkg, fix macos x-compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
felixguendling committed Nov 22, 2023
1 parent 6b0db39 commit 690e03b
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 15 deletions.
4 changes: 0 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
path = third_party/googletest
url = https://github.com/google/googletest.git
ignore = dirty
[submodule "third_party/abseil-cpp"]
path = third_party/abseil-cpp
url = https://github.com/abseil/abseil-cpp.git
branch = lts_2023_08_02
[submodule "third_party/jsoncpp"]
path = third_party/jsoncpp
url = https://github.com/open-source-parsers/jsoncpp.git
6 changes: 5 additions & 1 deletion .pkg
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
[zlib]
[email protected]:motis-project/zlib.git
branch=master
commit=fe8e13ffca867612951bc6baf114e5ac8b00f305
commit=fe8e13ffca867612951bc6baf114e5ac8b00f305
[abseil-cpp]
[email protected]:motis-project/abseil-cpp.git
branch=master
commit=f2b3825f36e37fddd47c5c395096e9b1e99eca12
3 changes: 3 additions & 0 deletions cmake/libprotobuf.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,8 @@ set_target_properties(libprotobuf PROPERTIES
VISIBILITY_INLINES_HIDDEN ON
)
add_library(protobuf::libprotobuf ALIAS libprotobuf)
if (CMAKE_OSX_ARCHITECTURES)
set_target_properties(libprotobuf PROPERTIES OSX_ARCHITECTURES "x86_64;arm64")
endif()

target_link_libraries(libprotobuf PRIVATE utf8_validity)
3 changes: 3 additions & 0 deletions cmake/libprotoc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ set_target_properties(libprotoc PROPERTIES
VISIBILITY_INLINES_HIDDEN ON
)
add_library(protobuf::libprotoc ALIAS libprotoc)
if (CMAKE_OSX_ARCHITECTURES)
set_target_properties(libprotoc PROPERTIES OSX_ARCHITECTURES "x86_64;arm64")
endif()
1 change: 0 additions & 1 deletion third_party/abseil-cpp
Submodule abseil-cpp deleted from fb3621
15 changes: 6 additions & 9 deletions third_party/utf8_range/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,19 @@ add_library (utf8_range STATIC
range2-neon.c
range2-sse.c
)
if (CMAKE_OSX_ARCHITECTURES)
set_target_properties(utf8_range PROPERTIES OSX_ARCHITECTURES "x86_64;arm64")
endif()

##
# A heavier-weight C++ wrapper that supports Abseil.
add_library (utf8_validity STATIC utf8_validity.cc)

# Load Abseil dependency.
if (NOT TARGET absl::strings)
if (NOT ABSL_ROOT_DIR)
find_package(absl REQUIRED CONFIG)
else ()
set(ABSL_ENABLE_INSTALL ${utf8_range_ENABLE_INSTALL})
set(ABSL_PROPAGATE_CXX_STD ON)
add_subdirectory(${ABSL_ROOT_DIR} third_party/abseil-cpp)
endif ()
endif ()
target_link_libraries(utf8_validity PUBLIC absl::strings)
if (CMAKE_OSX_ARCHITECTURES)
set_target_properties(utf8_validity PROPERTIES OSX_ARCHITECTURES "x86_64;arm64")
endif()

# Configure tests.
if (utf8_range_ENABLE_TESTS)
Expand Down

0 comments on commit 690e03b

Please sign in to comment.