Skip to content

Commit 5d90aa1

Browse files
author
Nat!
committed
use new mulle-c11 macro MULLE_C_STATIC_ALWAYS_INLINE to fix _WIN32 warnings
1 parent 218d931 commit 5d90aa1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+558
-229
lines changed

.github/workflows/cmake-errors.yml

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
name: CMake Errors
2+
on: [push, pull_request]
3+
4+
jobs:
5+
ci-cmake:
6+
name: ${{ matrix.name }}
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
include:
12+
- name: Ubuntu GCC
13+
os: ubuntu-latest
14+
compiler: gcc
15+
cflags: -Werror -Wall -Wextra
16+
17+
- name: Ubuntu GCC -O3
18+
os: ubuntu-latest
19+
compiler: gcc
20+
cflags: -O3 -Werror -Wall -Wextra
21+
22+
- name: Ubuntu Clang
23+
os: ubuntu-latest
24+
compiler: clang
25+
cflags: -Werror -Wall -Wextra
26+
27+
- name: Ubuntu Clang Debug
28+
os: ubuntu-latest
29+
compiler: clang
30+
cflags: -Werror -Wall -Wextra
31+
build-config: Debug
32+
33+
- name: Windows MSVC Win32
34+
os: windows-latest
35+
compiler: cl
36+
cflags: /WX /W3
37+
cmake-args: -A Win32
38+
39+
- name: Windows MSVC Win64
40+
os: windows-latest
41+
compiler: cl
42+
cflags: /WX /W3 /wd4244 # fixes some warnings in http_parser.c which is not my code
43+
cmake-args: -A x64
44+
45+
- name: Windows GCC
46+
os: windows-latest
47+
compiler: gcc
48+
cflags: -Werror -Wall -Wextra
49+
cmake-args: -G Ninja
50+
51+
- name: macOS Clang
52+
os: macos-latest
53+
compiler: clang
54+
cflags: -Werror -Wall -Wextra
55+
56+
- name: macOS GCC
57+
os: macos-latest
58+
compiler: gcc-12
59+
cflags: -Werror -Wall -Wextra
60+
61+
steps:
62+
- name: Checkout repository
63+
uses: actions/checkout@v4
64+
65+
# Set installation directory based on OS
66+
- name: Set install directory
67+
id: set-install-dir
68+
shell: bash
69+
run: |
70+
if [ "$RUNNER_OS" == "Windows" ]
71+
then
72+
INSTALL_DIR="$GITHUB_WORKSPACE\\usr"
73+
CMAKE_INSTALL_DIR="$(sed 's/\\/\//g' <<< "$INSTALL_DIR")" # sic, cygpath no good for cmake
74+
SRC_DIR="$GITHUB_WORKSPACE\\tmp"
75+
MULLE_CORE_SRC_DIR="$SRC_DIR\\mulle-core"
76+
MULLE_ATINIT_SRC_DIR="$SRC_DIR\\mulle-atinit"
77+
MULLE_ATEXIT_SRC_DIR="$SRC_DIR\\mulle-atexit"
78+
else
79+
INSTALL_DIR="$GITHUB_WORKSPACE/usr"
80+
CMAKE_INSTALL_DIR="${INSTALL_DIR}"
81+
SRC_DIR="$GITHUB_WORKSPACE/tmp"
82+
MULLE_CORE_SRC_DIR="$SRC_DIR/mulle-core"
83+
MULLE_ATINIT_SRC_DIR="$SRC_DIR/mulle-atinit"
84+
MULLE_ATEXIT_SRC_DIR="$SRC_DIR/mulle-atexit"
85+
fi
86+
echo "INSTALL_DIR=$INSTALL_DIR" >> $GITHUB_OUTPUT
87+
echo "CMAKE_INSTALL_DIR=$CMAKE_INSTALL_DIR" >> $GITHUB_OUTPUT
88+
echo "MULLE_CORE_SRC_DIR=$MULLE_CORE_SRC_DIR" >> $GITHUB_OUTPUT
89+
echo "MULLE_ATINIT_SRC_DIR=$MULLE_ATINIT_SRC_DIR" >> $GITHUB_OUTPUT
90+
echo "MULLE_ATEXIT_SRC_DIR=$MULLE_ATEXIT_SRC_DIR" >> $GITHUB_OUTPUT
91+
mkdir -p "$SRC_DIR"
92+
mkdir -p "$INSTALL_DIR"
93+
94+
- name: Clone mulle-core repository
95+
run: |
96+
git clone https://github.com/mulle-core/mulle-core.git "${{steps.set-install-dir.outputs.MULLE_CORE_SRC_DIR}}"
97+
98+
- name: Configure, build and install mulle-core with CMake
99+
working-directory: "${{steps.set-install-dir.outputs.MULLE_CORE_SRC_DIR}}"
100+
env:
101+
CC: ${{ matrix.compiler }}
102+
CFLAGS: ${{ matrix.cflags }}
103+
run: |
104+
cmake ${{ matrix.cmake-args }} -B build -DMULLE_SDK_PATH="${{ steps.set-install-dir.outputs.CMAKE_INSTALL_DIR }}" -DCMAKE_INSTALL_PREFIX="${{ steps.set-install-dir.outputs.CMAKE_INSTALL_DIR }}" -DCMAKE_PREFIX_PATH="${{ steps.set-install-dir.outputs.CMAKE_INSTALL_DIR }}" -DCMAKE_BUILD_TYPE="${{ matrix.build-config || 'Release' }}"
105+
cmake --build build --config "${{ matrix.build-config || 'Release' }}"
106+
cmake --install build --config "${{ matrix.build-config || 'Release' }}"
107+
108+
- name: Clone mulle-atinit repository
109+
run: |
110+
git clone https://github.com/mulle-core/mulle-atinit.git "${{steps.set-install-dir.outputs.MULLE_ATINIT_SRC_DIR}}"
111+
112+
- name: Configure, build and install mulle-atinit with CMake
113+
working-directory: "${{steps.set-install-dir.outputs.MULLE_ATINIT_SRC_DIR}}"
114+
env:
115+
CC: ${{ matrix.compiler }}
116+
CFLAGS: ${{ matrix.cflags }}
117+
run: |
118+
cmake ${{ matrix.cmake-args }} -B build -DMULLE_SDK_PATH="${{ steps.set-install-dir.outputs.CMAKE_INSTALL_DIR }}" -DCMAKE_INSTALL_PREFIX="${{ steps.set-install-dir.outputs.CMAKE_INSTALL_DIR }}" -DCMAKE_PREFIX_PATH="${{ steps.set-install-dir.outputs.CMAKE_INSTALL_DIR }}" -DCMAKE_BUILD_TYPE="${{ matrix.build-config || 'Release' }}"
119+
cmake --build build --config "${{ matrix.build-config || 'Release' }}"
120+
cmake --install build --config "${{ matrix.build-config || 'Release' }}"
121+
122+
- name: Clone mulle-atexit repository
123+
run: |
124+
git clone https://github.com/mulle-core/mulle-atexit.git "${{steps.set-install-dir.outputs.MULLE_ATEXIT_SRC_DIR}}"
125+
126+
- name: Configure, build and install mulle-atexit with CMake
127+
working-directory: "${{steps.set-install-dir.outputs.MULLE_ATEXIT_SRC_DIR}}"
128+
env:
129+
CC: ${{ matrix.compiler }}
130+
CFLAGS: ${{ matrix.cflags }}
131+
run: |
132+
cmake ${{ matrix.cmake-args }} -B build -DMULLE_SDK_PATH="${{ steps.set-install-dir.outputs.CMAKE_INSTALL_DIR }}" -DCMAKE_INSTALL_PREFIX="${{ steps.set-install-dir.outputs.CMAKE_INSTALL_DIR }}" -DCMAKE_PREFIX_PATH="${{ steps.set-install-dir.outputs.CMAKE_INSTALL_DIR }}" -DCMAKE_BUILD_TYPE="${{ matrix.build-config || 'Release' }}"
133+
cmake --build build --config "${{ matrix.build-config || 'Release' }}"
134+
cmake --install build --config "${{ matrix.build-config || 'Release' }}"
135+
136+
- name: Install packages (Windows)
137+
if: runner.os == 'Windows'
138+
run: |
139+
choco install --no-progress ninja ${{ matrix.packages }}
140+
141+
- name: Generate project files
142+
env:
143+
CC: ${{ matrix.compiler }}
144+
CFLAGS: ${{ matrix.cflags }}
145+
run: |
146+
cmake ${{ matrix.cmake-args }} -B build -DMULLE_SDK_PATH="${{ steps.set-install-dir.outputs.CMAKE_INSTALL_DIR }}" -DCMAKE_INSTALL_PREFIX="${{ steps.set-install-dir.outputs.CMAKE_INSTALL_DIR }}" -DCMAKE_PREFIX_PATH="${{ steps.set-install-dir.outputs.CMAKE_INSTALL_DIR }}" -DCMAKE_BUILD_TYPE="${{ matrix.build-config || 'Release' }}"
147+
148+
- name: Compile source code
149+
shell: bash
150+
run: |
151+
cmake --build "${{ matrix.build-dir || 'build' }}" --config "${{ matrix.build-config || 'Release' }}"
152+

.mulle/etc/sourcetree/config

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.vscode/tasks.json

Lines changed: 21 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CMakeLists.txt

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
1-
cmake_minimum_required( VERSION 3.14)
1+
cmake_minimum_required( VERSION 3.13...99.99)
22

33
project( mulle-objc-runtime VERSION 0.26.0 LANGUAGES C)
44

5+
# Add suppression flags based on compiler
6+
if(CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID MATCHES "GNU")
7+
# GCC and Clang suppression flags
8+
add_compile_options(
9+
-Wno-unknown-pragmas
10+
)
11+
elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC")
12+
# MSVC suppression flags
13+
add_compile_options(
14+
/wd4068 # Unknown pragma warning
15+
)
16+
# MSVC secure function warnings suppression
17+
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
18+
endif()
19+
520
### mulle-sde environment
621

722
# add cmake module paths to search path

README.md

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -190,30 +190,45 @@ target_link_libraries( ${PROJECT_NAME} PUBLIC mulle-core)
190190

191191
## Install
192192

193-
### Install with mulle-sde
194-
195193
Use [mulle-sde](//github.com/mulle-sde) to build and install mulle-objc-runtime and all dependencies:
196194

197195
``` sh
198196
mulle-sde install --prefix /usr/local \
199197
https://github.com/mulle-objc/mulle-objc-runtime/archive/latest.tar.gz
200198
```
201199

202-
### Manual Installation
200+
### Legacy Installation
201+
202+
203+
#### Requirements
204+
205+
Install all requirements
206+
207+
| Requirements | Description
208+
|----------------------------------------------|-----------------------
209+
| [mulle-core](https://github.com/mulle-core/mulle-core) | 🌋 Almagamated library of mulle-core and mulle-c
210+
| [mulle-atinit](https://github.com/mulle-core/mulle-atinit) | 🤱🏼 Compatibility library for deterministic initializers
211+
| [mulle-atexit](https://github.com/mulle-core/mulle-atexit) | 👼 Compatibility library to fix atexit
203212

204-
Install the [Requirements](#Requirements) and then
205-
install **mulle-objc-runtime** with [cmake](https://cmake.org):
213+
#### Download & Install
214+
215+
216+
Download the latest [tar](https://github.com/mulle-objc/mulle-objc-runtime/archive/refs/tags/latest.tar.gz) or [zip](https://github.com/mulle-objc/mulle-objc-runtime/archive/refs/tags/latest.zip) archive and unpack it.
217+
218+
Install **mulle-objc-runtime** into `/usr/local` with [cmake](https://cmake.org):
206219

207220
``` sh
221+
export MULLE_SDK_PATH="/usr/local" # important!
208222
cmake -B build \
209-
-DCMAKE_INSTALL_PREFIX=/usr/local \
210-
-DCMAKE_PREFIX_PATH=/usr/local \
223+
-DCMAKE_INSTALL_PREFIX="${MULLE_SDK_PATH}" \
224+
-DCMAKE_PREFIX_PATH="${MULLE_SDK_PATH}" \
211225
-DCMAKE_BUILD_TYPE=Release &&
212226
cmake --build build --config Release &&
213227
cmake --install build --config Release
214228
```
215229

216230

231+
217232
## Author
218233

219234
[Nat!](https://mulle-kybernetik.com/weblog) for Mulle kybernetiK

RELEASENOTES.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
## 0.26.0
2+
3+
4+
* **BREAKING** removed allocate from `mulle_objc_classpair_free` arguments
5+
6+
* added convenience function `mulle_objc_class_lookup_implementation_noforward`
7+
8+
* `mulle_objc_sprintf_functionpointer` is now `mulle_buffer_sprintf_functionpointer` and quite different
9+
* scribble pattern is now 0xdeaddead and not 0xad as before
10+
* `MULLE_OBJC_INFRACLASS_IS_PROTOCOLCLASS` is now `MULLE_OBJC_CLASS_IS_PROTOCOLCLASS` and set on both classes
11+
* this enables the new helper function `_mulle_objc_class_is_protocolclass`
12+
* `MULLE_OBJC_CLASS_DONE_INHERIT_PROTOCOL_META` is no longer the default, functionally this should make little difference due to the fix of a bug in method searching
13+
* in method searches the wraparound now definitely also applies to the protocolclass
14+
* if a method is preloadable or not is now always routed through the universe, this when enabled the following new option
15+
* in debug modus we now optionally but by default preload the whole cache to ease debugging with C debuggers
16+
* the impcache will no longer assert for a size of power of 2, but round up on its own
17+
* `_mulle_objc_infraclass_is_protocolclass` renamed to `_mulle_objc_infraclass_conforms_to_protocolclass`
18+
* new trace options `MULLE_OBJC_TRACE_PRELOAD`
19+
* `MULLE_OBJC_TRACE_SKIP_BORING_METHOD_CALL` renamed and inverted to `MULLE_OBJC_TRACE_BORING_METHOD_CALL`
20+
21+
122
## 0.25.0
223

324
* `MULLE_OBJC_UNIVERSE_CALL_BORING_TRACE_BIT` used to be called `MULLE_OBJC_UNIVERSE_CALL_SKIP_BORING_TRACE_BIT` and had inverted semantics

cmake/reflect/_Dependencies.cmake

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmake/share/CMakeTweaksC.cmake

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)