Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Persist STRICT_APPLE_COMPATIBILITY in objc-config.h #314

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ set(libobjc_HDRS
objc/objc.h
objc/runtime-deprecated.h
objc/runtime.h
objc/slot.h)
objc/slot.h
${PROJECT_BINARY_DIR}/objc/objc-config.h)

set(libobjc_CXX_SRCS
selector_table.cc
Expand Down Expand Up @@ -150,6 +151,9 @@ 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>)

configure_file(objc/objc-config.h.in objc/objc-config.h @ONLY)
include_directories("${PROJECT_BINARY_DIR}/objc/")

if (OLDABI_COMPAT)
list(APPEND libobjc_C_SRCS legacy.c abi_version.c statics_loader.c)
add_definitions(-DOLDABI_COMPAT=1)
Expand Down
6 changes: 3 additions & 3 deletions Test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,14 @@ remove_definitions(-D__OBJC_RUNTIME_INTERNAL__=1)

add_library(test_runtime_legacy OBJECT Test.m)
set_target_properties(test_runtime_legacy PROPERTIES
INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR}"
INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR};${PROJECT_BINARY_DIR}/objc/"
COMPILE_FLAGS "-Xclang -fblocks -fobjc-runtime=gnustep-1.7"
LINKER_LANGUAGE C
)

add_library(test_runtime OBJECT Test.m)
set_target_properties(test_runtime PROPERTIES
INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR}"
INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR};${PROJECT_BINARY_DIR}/objc/"
COMPILE_FLAGS "-Xclang -fblocks -fobjc-runtime=gnustep-2.0"
LINKER_LANGUAGE C
)
Expand All @@ -123,7 +123,7 @@ function(addtest_flags TEST_NAME FLAGS TEST_SOURCE)
add_test(${TEST_NAME} ${TEST_NAME})
set(ARC "")
set_target_properties(${TEST_NAME} PROPERTIES
INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR}"
INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR};${PROJECT_BINARY_DIR}/objc/"
COMPILE_FLAGS "-Xclang -fblocks -Xclang -fobjc-exceptions ${FLAGS}"
LINK_FLAGS ${INCREMENTAL}
LINKER_LANGUAGE C
Expand Down
1 change: 1 addition & 0 deletions objc/objc-config.h.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#cmakedefine STRICT_APPLE_COMPATIBILITY @STRICT_APPLE_COMPATIBILITY@
1 change: 1 addition & 0 deletions objc/runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#pragma clang system_header
#endif
#include "objc-visibility.h"
#include "objc-config.h"

#ifndef __LIBOBJC_RUNTIME_H_INCLUDED__
#define __LIBOBJC_RUNTIME_H_INCLUDED__
Expand Down
Loading