当我尝试通过Swift Package Manager编译libavutil时,swift build
会返回错误:
<unknown>:0: error: unexpected 'commands' value (expected map)
<unknown>:0: error: unable to load build file
Package.swift:
// swift-tools-version:4.0
import PackageDescription
let package = Package(
name: "CAVUtil",
pkgConfig: "libavutil-ffmpeg"
)
module.modulemap
module CAVUtil [system] {
header "avutil.h"
link "avutil"
export *
}
avutil.h
#ifndef _CAVUtil_H_
#define _CAVUtil_H_
#include <libavutil/avutil.h>
#endif
斯威夫特,Ubuntu:
swift --version
Swift version 4.1 (swift-4.1-RELEASE)
Target: x86_64-unknown-linux-gnu
pkg-config --version
0.29.1
Description: Ubuntu 16.04.4 LTS
Release: 16.04
Codename: xenial