bkaradzic / GENie

GENie - Project generator tool
Other
898 stars 166 forks source link

Building a C# project yields a "attempt to index a nil value (field 'cs2005')"? #427

Open eddieparker opened 5 years ago

eddieparker commented 5 years ago

This could be a misconfiguration on my part, but the lua callstack isn't giving me much to go on.

I've built a project as follows:

project "enginesharp"
    language "C#"
    kind "StaticLib"
    objdir (path.join(SOLUTION_DIR, "_build/obj/" .. project()['name']))
    location "src/enginesharp"

    files { "**.*" }

The master genie file looks like this in case it matters:

SOLUTION_DIR = path.getabsolute("./")
TARGET_DIR=path.join(SOLUTION_DIR, "_build/bin")

function fix_path_slashes(path)
    return path:gsub("/", "\\")
end

solution "tinkerengine"
    configurations {
        "Debug",
        "Release",
    }

    platforms {
        "x64",
        "x32",
    }

    language "C++"
    targetdir(TARGET_DIR)

-- Too slow for iterating, so I'm disabling this for now
-- No real good place to put this, so put this at the root
--all_genie_files = os.matchfiles(path.join(SOLUTION_DIR, "**_genie.lua"))
--
---- Rebuild sln from genie if out of date.
--custombuildtask {
--  {
--      path.join(SOLUTION_DIR, "genie.lua"), -- input
--      path.join(SOLUTION_DIR, "file_that_dont_exist.sln"), -- output
--      all_genie_files, -- dependencies
--      { -- command:
--          "@echo Building visual studio solutions.",
--          (path.join(SOLUTION_DIR, "genie.bat") .. " vs2017")
--      }
--  },
--}

-- 3rdparty scripts
for index, match in pairs(os.matchfiles("3rdparty/genie_scripts/*.lua")) do
    dofile(match)
end

-- Our genie files
for index, match in pairs(os.matchfiles("src/**.lua")) do
    dofile(match)
end

Anyhow, running genie with vs2017 as the action, either release or built from github yields:

Building configurations...
Running action 'vs2017'...
[string "premake.vstudio.vc2017 = {}..."]:21: attempt to index a nil value (field 'cs2005')
stack traceback:
        [string "premake.vstudio.vc2017 = {}..."]:21: in field 'onproject'
        [string "premake.action = { }..."]:23: in field 'call'
        [string "_WORKING_DIR        = os.getcwd()..."]:74: in function '_premake_main'

It's not clear what I'm doing wrong here, or what's misconfigured on my system. I can build C# apps that I build with VS2017 normally; so I'm not sure what's going on with genie.

bkaradzic commented 5 years ago

C# code path in GENie wasn't maintained well. I'm going to look at it.

Mvivant commented 4 years ago

Hi, I have same issue to make a C# project. Did you fix it ?

ScienceGeekxx commented 1 year ago

Hi, I have same issue to make a C# project. Did you fix it ?