无法在Ubuntu上使用Swift 4.1 Package Manager编译系统模块

时间:2018-05-08 11:34:00

标签: swift linux ubuntu swift-package-manager

当我尝试通过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

0 个答案:

没有答案