macosx.patch 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. diff --git a/OgreMain/src/OgrePlatformInformation.cpp b/OgreMain/src/OgrePlatformInformation.cpp
  2. --- a/OgreMain/src/OgrePlatformInformation.cpp
  3. +++ b/OgreMain/src/OgrePlatformInformation.cpp
  4. @@ -40,29 +40,18 @@ THE SOFTWARE.
  5. #elif (OGRE_COMPILER == OGRE_COMPILER_GNUC || OGRE_COMPILER == OGRE_COMPILER_CLANG) && OGRE_PLATFORM != OGRE_PLATFORM_NACL
  6. #include <signal.h>
  7. #include <setjmp.h>
  8. -#if OGRE_PLATFORM != OGRE_PLATFORM_WIN32
  9. - #if OGRE_PLATFORM == OGRE_PLATFORM_ANDROID
  10. - #include <linux/sysctl.h>
  11. - #endif
  12. #endif
  13. - #if OGRE_PLATFORM == OGRE_PLATFORM_ANDROID
  14. - #include <cpu-features.h>
  15. - #elif OGRE_CPU == OGRE_CPU_ARM
  16. - #if __MACH__
  17. - #include <mach/machine.h>
  18. - #ifndef CPU_SUBTYPE_ARM64_V8
  19. - #define CPU_SUBTYPE_ARM64_V8 ((cpu_subtype_t) 1)
  20. - #endif
  21. - #ifndef CPU_SUBTYPE_ARM_V8
  22. - #define CPU_SUBTYPE_ARM_V8 ((cpu_subtype_t) 13)
  23. - #endif
  24. - #endif
  25. - #endif
  26. +#if OGRE_PLATFORM == OGRE_PLATFORM_ANDROID
  27. + #include <linux/sysctl.h>
  28. + #include <cpu-features.h>
  29. +#endif
  30. +#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE || OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS
  31. + #include <sys/sysctl.h>
  32. + #include <mach/machine.h>
  33. #endif
  34. -
  35. #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 || OGRE_PLATFORM == OGRE_PLATFORM_WINRT
  36. - #include "windows.h"
  37. + #include <windows.h>
  38. #endif
  39. // Yes, I know, this file looks very ugly, but there aren't other ways to do it better.
  40. diff --git a/OgreMain/CMakeLists.txt b/OgreMain/CMakeLists.txt
  41. --- a/OgreMain/CMakeLists.txt
  42. +++ b/OgreMain/CMakeLists.txt
  43. @@ -419,11 +419,13 @@ else()
  44. set_target_properties(OgreMain PROPERTIES VERSION ${OGRE_SOVERSION} SOVERSION ${OGRE_SOVERSION})
  45. endif()
  46. -if(OGRE_GCC_VERSION VERSION_EQUAL 4.8 OR OGRE_GCC_VERSION VERSION_GREATER 4.8)
  47. - if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
  48. - list(APPEND LIBRARIES "-latomic_ops")
  49. - else()
  50. - list(APPEND LIBRARIES "-latomic")
  51. +if (NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  52. + if(OGRE_GCC_VERSION VERSION_EQUAL 4.8 OR OGRE_GCC_VERSION VERSION_GREATER 4.8)
  53. + if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
  54. + list(APPEND LIBRARIES "-latomic_ops")
  55. + else()
  56. + list(APPEND LIBRARIES "-latomic")
  57. + endif()
  58. endif()
  59. endif()