Browse Source

enable clang modules and framework auto-linking

Andrey Filipenkov 4 years ago
parent
commit
7a50620e61
3 changed files with 9 additions and 3 deletions
  1. 6 0
      CMakeLists.txt
  2. 0 1
      client/CMakeLists.txt
  3. 3 2
      client/main_ios.m

+ 6 - 0
CMakeLists.txt

@@ -224,6 +224,12 @@ if(CMAKE_COMPILER_IS_GNUCXX OR NOT WIN32) #so far all *nix compilers support suc
 	endif()
 endif()
 
+# TODO: also enable for macOS
+if(APPLE_IOS)
+	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmodules")
+	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmodules")
+endif(APPLE_IOS)
+
 # Check if some platform-specific libraries are needed for linking
 if(NOT WIN32 AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "iOS")
 	include(CheckLibraryExists)

+ 0 - 1
client/CMakeLists.txt

@@ -177,7 +177,6 @@ if(WIN32)
 	target_compile_definitions(vcmiclient PRIVATE WINDOWS_IGNORE_PACKING_MISMATCH)
 elseif(APPLE_IOS)
 	target_link_libraries(vcmiclient PRIVATE
-    "-framework UIKit"
     "-framework QuartzCore -framework CoreGraphics -framework CoreServices -framework ImageIO" # SDL2_image
   )
 endif()

+ 3 - 2
client/main_ios.m

@@ -1,5 +1,6 @@
-#import <UIKit/UIKit.h>
-int main (int argc, char const *argv[])
+@import UIKit;
+
+int main (int argc, char *argv[])
 {
     @autoreleasepool
     {