Prefer system-provided robin-map (#248)

* Prefer system-provided robin-map

* Use find_package

* Use submodule

* PR feedback

* Include FetchContent
main
Frederik Carlier 2 years ago committed by GitHub
parent 8e18060c1d
commit 32c09c0029
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -44,8 +44,6 @@ jobs:
name: ${{ matrix.os }} ${{ matrix.build-type }} LLVM-${{ matrix.llvm-version }} ${{ matrix.cxxlib }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install dependencies
run: |
sudo apt install ninja-build
@ -92,8 +90,6 @@ jobs:
name: Cross-build for ${{ matrix.arch.triple }} LLVM-${{ matrix.llvm-version}} ${{ matrix.build-type }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install cross-compile toolchain and QEMU
run: |
sudo apt update

3
.gitmodules vendored

@ -1,3 +0,0 @@
[submodule "third_party/robin-map"]
path = third_party/robin-map
url = https://github.com/Tessil/robin-map

@ -37,16 +37,6 @@ Alternatively, a tarball is available from:
https://github.com/gnustep/libobjc2/archive/v2.2.zip
https://github.com/gnustep/libobjc2/archive/v2.2.tar.gz
The submodule is available from:
https://github.com/Tessil/robin-map/archive/d37a410.zip
https://github.com/Tessil/robin-map/archive/d37a410.tar.gz
This will extract as robin-map-d37a41003bfbc7e12e34601f93c18ca2ff6d7c07.
You must move the contents of that directory into third_party/robin_map in the
libobjc2 tree.
The runtime library is responsible for implementing the core features of the
object model, as well as exposing introspection features to the user. The
GNUstep runtime implements a superset of Apple's Objective-C Runtime APIs.

@ -21,6 +21,7 @@ endif()
enable_language(OBJC OBJCXX)
INCLUDE (CheckCXXSourceCompiles)
INCLUDE (FetchContent)
set(libobjc_VERSION 4.6)
@ -120,14 +121,16 @@ else ()
list(APPEND libobjc_C_SRCS eh_personality.c)
endif (WIN32)
if (NOT EXISTS "${CMAKE_SOURCE_DIR}/third_party/robin-map/include/tsl/robin_map.h")
message(FATAL_ERROR "Git submodules not present, please run:\n\n"
" $ git submodule init && git submodule update\n\n"
"If you did not checkout via git, you will need to"
"fetch the submodule's contents from"
"https://github.com/Tessil/robin-map/")
endif ()
find_package(tsl-robin-map)
if (NOT tls-robin-map_FOUND)
FetchContent_Declare(
robinmap
GIT_REPOSITORY https://github.com/Tessil/robin-map/
GIT_TAG v1.2.1)
FetchContent_MakeAvailable(robinmap)
endif()
if (WIN32)
set(OLD_ABI_COMPAT_DEFAULT false)
@ -235,6 +238,7 @@ if (WIN32)
target_link_libraries(objc ntdll.dll)
endif()
target_link_libraries(objc tsl::robin_map)
set_target_properties(objc PROPERTIES
LINKER_LANGUAGE C

@ -14,15 +14,6 @@ things that can be used by other programs that actually perform the building.
I recommend that you use Ninja for building if you are compiling regularly, but
these instructions will use Make to avoid the need for an extra dependency.
When checking out the code make sure you check out git submodules as well
either by using
$ git checkout --recursive <URL>
or by getting submodules after checkout using
$ git submodule update --init
After checking out the code, build as follows:
$ mkdir Build

@ -7,7 +7,7 @@
#include <stdlib.h>
#include <assert.h>
#include <vector>
#include "third_party/robin-map/include/tsl/robin_map.h"
#include <tsl/robin_map.h>
#import "lock.h"
#import "objc/runtime.h"
#import "objc/blocks_runtime.h"

@ -11,7 +11,7 @@
#include <vector>
#include <mutex>
#include <forward_list>
#include "third_party/robin-map/include/tsl/robin_set.h"
#include <tsl/robin_set.h>
#include "class.h"
#include "lock.h"
#include "method.h"

@ -1 +0,0 @@
Subproject commit d37a41003bfbc7e12e34601f93c18ca2ff6d7c07
Loading…
Cancel
Save