Skip to content

Instantly share code, notes, and snippets.

@omochi
Created February 7, 2018 07:02
Show Gist options
  • Save omochi/2a2ebe3cf99a1e5a63fbf6a38c587dc6 to your computer and use it in GitHub Desktop.
Save omochi/2a2ebe3cf99a1e5a63fbf6a38c587dc6 to your computer and use it in GitHub Desktop.
import Foundation
import PathKit
import xcproj
let repoDir = Path(FileManager.default.currentDirectoryPath).parent()
let xcodeProjPath = repoDir + "MyProject.xcodeproj"
let xcodeProj = try XcodeProj(path: xcodeProjPath)
let target: PBXTarget = xcodeProj.pbxproj.objects.getTarget(reference: "SQLite.swift::SQLiteObjc")!
let configList = xcodeProj.pbxproj.objects.configurationLists[target.buildConfigurationList!]!
for config in configList.buildConfigurations {
let buildConfig = xcodeProj.pbxproj.objects.buildConfigurations[config]!
buildConfig.buildSettings["CLANG_ENABLE_MODULES"] = "YES"
}
try xcodeProj.write(path: xcodeProjPath)
@omochi
Copy link
Author

omochi commented Feb 7, 2018

@omochi
Copy link
Author

omochi commented Feb 7, 2018

In Makefile

xcode:
	swift package generate-xcodeproj
	cd Script; \
		swift run fix-xcodeproj

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment