-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
242908f
commit 5ee1c99
Showing
2 changed files
with
90 additions
and
4 deletions.
There are no files selected for viewing
82 changes: 82 additions & 0 deletions
82
mingw-w64-libobjc2/0001-Windows-Support-building-with-strict-compatibility.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
From 18ced3b5c6b2ae5c512d18e3cfddc477a7fe7763 Mon Sep 17 00:00:00 2001 | ||
From: Frederik Carlier <[email protected]> | ||
Date: Mon, 18 Nov 2024 11:01:52 +0100 | ||
Subject: [PATCH] Windows: Support building with strict compatibility | ||
|
||
--- | ||
.github/workflows/main.yml | 7 ++++--- | ||
CMakeLists.txt | 5 +++-- | ||
2 files changed, 7 insertions(+), 5 deletions(-) | ||
|
||
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml | ||
index 4ed8230..862c914 100644 | ||
--- a/.github/workflows/main.yml | ||
+++ b/.github/workflows/main.yml | ||
@@ -199,6 +199,7 @@ jobs: | ||
os: [ windows-2019 ] | ||
msystem: [ ucrt64, mingw64, clang64 ] | ||
build-type: [ Release, Debug ] | ||
+ strict-apple-compatibility: [ ON, OFF ] | ||
include: | ||
- msystem: ucrt64 | ||
package-prefix: ucrt-x86_64 | ||
@@ -213,7 +214,7 @@ jobs: | ||
# Don't abort runners if a single one fails | ||
fail-fast: false | ||
runs-on: ${{ matrix.os }} | ||
- name: ${{ matrix.os }} ${{ matrix.msystem }} ${{ matrix.build-type}} | ||
+ name: ${{ matrix.os }} ${{ matrix.msystem }} ${{ matrix.build-type}} (Strict Apple compatibility ${{ matrix.strict-apple-compatibility }}) | ||
defaults: | ||
run: | ||
shell: msys2 {0} | ||
@@ -228,7 +229,7 @@ jobs: | ||
run: | | ||
mkdir build | ||
cd build | ||
- ${{ matrix.cmake-flags }} cmake .. -DTESTS=ON -DCMAKE_C_COMPILER="clang" -DCMAKE_CXX_COMPILER="clang++" -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} | ||
+ ${{ matrix.cmake-flags }} cmake .. -DTESTS=ON -DCMAKE_C_COMPILER="clang" -DCMAKE_CXX_COMPILER="clang++" -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DSTRICT_APPLE_COMPATIBILITY=${{ matrix.strict-apple-compatibility }} | ||
- name: Build | ||
working-directory: build | ||
run: | | ||
@@ -243,7 +244,7 @@ jobs: | ||
cmake --install . --prefix=../dist | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
- name: ${{ matrix.msystem }}-${{ matrix.build-type }} | ||
+ name: ${{ matrix.msystem }}-${{ matrix.build-type }}-compat-${{ matrix.strict-apple-compatibility }} | ||
path: dist/ | ||
|
||
# Fake check that can be used as a branch-protection rule. | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 4d7e41b..945da02 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -44,7 +44,7 @@ endif() | ||
message(STATUS "Architecture as detected by CMake: ${CMAKE_SYSTEM_PROCESSOR}") | ||
|
||
# Build configuration | ||
-add_compile_definitions(GNUSTEP __OBJC_RUNTIME_INTERNAL__=1) | ||
+add_compile_definitions(GNUSTEP __OBJC_RUNTIME_INTERNAL__=1 __OBJC_BOOL) | ||
|
||
set(CMAKE_CXX_STANDARD 17) | ||
|
||
@@ -143,7 +143,7 @@ option(DEBUG_ARC_COMPAT | ||
"Log warnings for classes that don't hit ARC fast paths" OFF) | ||
option(ENABLE_OBJCXX "Enable support for Objective-C++" ON) | ||
option(TESTS "Enable building the tests") | ||
- | ||
+option(STRICT_APPLE_COMPATIBILITY "Use strict Apple compatibility, always defining BOOL as signed char" OFF) | ||
|
||
# For release builds, we disable spamming the terminal with warnings about | ||
# selector type mismatches | ||
@@ -151,6 +151,7 @@ add_compile_definitions($<$<CONFIG:Release>:NO_SELECTOR_MISMATCH_WARNINGS>) | ||
add_compile_definitions($<$<BOOL:${TYPE_DEPENDENT_DISPATCH}>:TYPE_DEPENDENT_DISPATCH>) | ||
add_compile_definitions($<$<BOOL:${ENABLE_TRACING}>:WITH_TRACING=1>) | ||
add_compile_definitions($<$<BOOL:${DEBUG_ARC_COMPAT}>:DEBUG_ARC_COMPAT>) | ||
+add_compile_definitions($<$<BOOL:${STRICT_APPLE_COMPATIBILITY}>:STRICT_APPLE_COMPATIBILITY>) | ||
|
||
if (OLDABI_COMPAT) | ||
list(APPEND libobjc_C_SRCS legacy.c abi_version.c statics_loader.c) | ||
-- | ||
2.47.0.windows.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters