c# - Premake 无法为 C# 库创建 Makefile

标签 c# .net linux makefile premake

我最近刚刚了解了 Premake 并决定检查一下。
它似乎在 C++ 项目中工作得很好,但由于某些原因,每当它遇到 C# 程序时,它就会跳出。
以这个 Premake 脚本为例:

solution "ExampleLib"
    configurations { "Debug", "Release" }
    project "ExampleLib"
        kind "SharedLib"
        language "C#"
        files { "../src/**.cs" }
        configuration "Debug"
            defines { "DEBUG" }
            flags { "Symbols" }
        configuration "Release"
            defines { "NDEBUG" }
            flags { "Optimize" }

当我使用 premake4 --os=linux gmake 生成 Makefile 时,我得到了这个输出:

Building configurations...
Running action 'gmake'...
Generating Makefile...
Generating ExampleLib.make...
[string "premake.dotnet = { }..."]:28: attempt to compare nil with string

如果我尝试运行 Makefile,我会得到:

==== Building ExampleLib (debug) ====
ExampleLib.make:12: *** missing 'endif'.  Stop.
Makefile:16: recipe for target 'ExampleLib' failed
make: *** [ExampleLib] Error 2

检查 Makefile,Premake 似乎在“ifndef CSC”部分突然退出。

如何使用 Premake 构建 C# 项目?

我在 Ubuntu 15.10 上安装了 Mono 和 MonoDevelop,如果有帮助的话。

最佳答案

对我有用的解决方案是使用 premake5--dotnet=mono 标志。

关于c# - Premake 无法为 C# 库创建 Makefile,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38342868/

相关文章:

c# - 如何将工具提示数据绑定(bind)到用户控件的一部分?

linux - 根据列 ID 合并多个文件

c# - C#中事件的内部设计

c# - File.Exists——不想创建新文件

c# - 为什么 Form 得不到焦点?

c# - 通过绑定(bind)到不同的 TreeView selectedItem 使用不同的数据模板

c# - 如何在 WPF TextBox 上强制 TextChanged 事件并保持焦点?

c# - 通过继承改变返回签名——多态

linux - 为什么一段时间后代码为真;做 ...;完成循环从未在 bash 中调用过?

c# - 如何在 Linux 上的 VSCode 中安装和使用 Winforms?