浏览代码

fix compiling storyboard without the need to edit generated xcodeproj manually

Andrey Filipenkov 3 年之前
父节点
当前提交
ba9ace46ad
共有 2 个文件被更改,包括 4 次插入6 次删除
  1. 4 0
      client/CMakeLists.txt
  2. 0 6
      configure_ios.sh

+ 4 - 0
client/CMakeLists.txt

@@ -215,6 +215,10 @@ elseif(APPLE_IOS)
 
 	target_sources(vcmiclient PRIVATE ios/LaunchScreen.storyboard)
 	set_source_files_properties(ios/LaunchScreen.storyboard PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
+	# workaround to prevent CMAKE_SKIP_PRECOMPILE_HEADERS being added as compile flag
+	if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.22.0")
+		set_source_files_properties(ios/LaunchScreen.storyboard PROPERTIES LANGUAGE CXX)
+	endif()
 
 	target_sources(vcmiclient PRIVATE ios/Images.xcassets)
 	set_source_files_properties(ios/Images.xcassets PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")

+ 0 - 6
configure_ios.sh

@@ -33,9 +33,3 @@ cmake "$srcDir" -G Xcode \
   -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY='Apple Development' \
   -DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM='4XHN44TEVG'
   # -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=NO
-
-# workaround strange cmake bug that adds compile flag to resources
-sed -i '' \
-  -e 's|\.storyboard \*/; settings = {COMPILER_FLAGS = "-DCMAKE_SKIP_PRECOMPILE_HEADERS "; };|.storyboard */;|g' \
-  -e 's|\.xcassets \*/; settings = {COMPILER_FLAGS = "-DCMAKE_SKIP_PRECOMPILE_HEADERS "; };|.xcassets */;|g' \
-  VCMI.xcodeproj/project.pbxproj