diff --git a/scripts/embed.lua b/scripts/embed.lua index 497f2d30..01de3580 100644 --- a/scripts/embed.lua +++ b/scripts/embed.lua @@ -90,9 +90,7 @@ -- Generate an index of the script file names. Script names are stored -- relative to the directory containing the manifest, i.e. the main -- Xcode script, which is at $/modules/xcode/xcode.lua is stored as --- "xcode/xcode.lua". Core scripts currently get special treatment and --- are stored as "base/os.lua" instead of "core/base/os.lua"; I would --- like to treat core like just another module eventually. +-- "xcode/xcode.lua". table.insert(result, "const char* builtin_scripts_index[] = {") @@ -105,18 +103,12 @@ for fi = 1, #files do local filename = path.join(manifestDir, files[fi]) filename = path.getrelative(baseDir, filename) - - -- core files fix-up for backward compatibility - if filename:startswith("src/") then - filename = filename:sub(5) - end - table.insert(result, '\t"' .. filename .. '",') end end - table.insert(result, '\t"_premake_main.lua",') - table.insert(result, '\t"_manifest.lua",') + table.insert(result, '\t"src/_premake_main.lua",') + table.insert(result, '\t"src/_manifest.lua",') table.insert(result, "\tNULL") table.insert(result, "};") table.insert(result, "") diff --git a/src/_premake_main.lua b/src/_premake_main.lua index 42b98216..679b49e4 100644 --- a/src/_premake_main.lua +++ b/src/_premake_main.lua @@ -164,7 +164,7 @@ function p.main.moduleLoader(name) local shortName = name .. "/" .. name .. ".lua" local longName = "modules/" .. shortName - local chunk = loadfile(shortName) or loadfile(longName) + local chunk = loadfile(longName) or loadfile(shortName) if chunk then return chunk else diff --git a/src/host/premake.c b/src/host/premake.c index 3189f5b9..1b8c49c7 100644 --- a/src/host/premake.c +++ b/src/host/premake.c @@ -135,7 +135,7 @@ int premake_execute(lua_State* L, int argc, const char** argv) } /* load the main script */ - if (luaL_dofile(L, "_premake_main.lua") != OKAY) { + if (luaL_dofile(L, "src/_premake_main.lua") != OKAY) { printf(ERROR_MESSAGE, lua_tostring(L, -1)); return !OKAY; } @@ -312,7 +312,7 @@ int premake_load_embedded_script(lua_State* L, const char* filename) #if !defined(NDEBUG) if (!warned) { warned = 1; - printf("** warning: using embedded scripts; use /scripts argument to load from files\n"); + printf("** warning: using embedded script '%s'; use /scripts argument to load from files\n", filename); } #endif