Skip to content

Commit

Permalink
Prefer system-provided robin-map (#248)
Browse files Browse the repository at this point in the history
* Prefer system-provided robin-map

* Use find_package

* Use submodule

* PR feedback

* Include FetchContent
  • Loading branch information
qmfrederik authored Dec 30, 2023
1 parent 8e18060 commit 32c09c0
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 36 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

10 changes: 0 additions & 10 deletions ANNOUNCE
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
18 changes: 11 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ endif()
enable_language(OBJC OBJCXX)

INCLUDE (CheckCXXSourceCompiles)
INCLUDE (FetchContent)

set(libobjc_VERSION 4.6)

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
9 changes: 0 additions & 9 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion arc.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion selector_table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion third_party/robin-map
Submodule robin-map deleted from d37a41

0 comments on commit 32c09c0

Please sign in to comment.