简体   繁体   中英

Premake fails to create Makefile for C# library

I've just learned about Premake recently and decided to check it out.
It seems to work fine with C++ projects, but for some reason, whenever it encounters a C# program, it flips out.
Take this example Premake script:

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" }

When I generate the Makefile with premake4 --os=linux gmake , I get this output:

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

If I try to the run the Makefile, I get this:

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

Examining the Makefile, it seems that Premake abruptly quit during the "ifndef CSC" section.

How can I get C# projects to build with Premake?

I am on Ubuntu 15.10 with Mono and MonoDevelop installed, if that helps.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM