diff --git a/CMakeLists.txt b/CMakeLists.txt index 10f47c71..a9aa16b5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 @@ -150,6 +151,9 @@ add_compile_definitions($<$:WITH_TRACING=1>) add_compile_definitions($<$:DEBUG_ARC_COMPAT>) add_compile_definitions($<$: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) diff --git a/objc/objc-config.h.in b/objc/objc-config.h.in new file mode 100644 index 00000000..907563c4 --- /dev/null +++ b/objc/objc-config.h.in @@ -0,0 +1 @@ +#cmakedefine STRICT_APPLE_COMPATIBILITY @STRICT_APPLE_COMPATIBILITY@ diff --git a/objc/runtime.h b/objc/runtime.h index ba9cf858..14cb2748 100644 --- a/objc/runtime.h +++ b/objc/runtime.h @@ -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__