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/Test/CMakeLists.txt b/Test/CMakeLists.txt index f2161e22..3e37fb79 100644 --- a/Test/CMakeLists.txt +++ b/Test/CMakeLists.txt @@ -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 ) @@ -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 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__