From 473f5252b1e7400e7f6114126e67db2b1f92ac9c Mon Sep 17 00:00:00 2001 From: LiamDevine Date: Wed, 14 Jul 2010 23:06:23 +0100 Subject: added local keyword to functions not called outside of the file scope. --- src/actions/vstudio/vs2010_vcxproxj.lua | 76 ++++++++++++++++----------------- todo.txt | 4 -- 2 files changed, 38 insertions(+), 42 deletions(-) diff --git a/src/actions/vstudio/vs2010_vcxproxj.lua b/src/actions/vstudio/vs2010_vcxproxj.lua index 67bbc47..19ab2d9 100644 --- a/src/actions/vstudio/vs2010_vcxproxj.lua +++ b/src/actions/vstudio/vs2010_vcxproxj.lua @@ -1,6 +1,6 @@ -premake.vstudio.vcxproj = { } ---local vcproj = premake.vstudio.vcxproj +premake.vstudio.vs10_helpers = { } +local vs10_helpers = premake.vstudio.vs10_helpers function remove_relative_path(file) @@ -84,7 +84,7 @@ premake.vstudio.vcxproj = { } _p(1,'') end - function config_type(config) + local function config_type(config) local t = { SharedLib = "DynamicLibrary", @@ -94,11 +94,11 @@ premake.vstudio.vcxproj = { } return t[config.kind] end - function if_config_and_platform() + local function if_config_and_platform() return 'Condition="\'$(Configuration)|$(Platform)' end - function config_type_block(prj) + local function config_type_block(prj) for _, cfginfo in ipairs(prj.solution.vstudio_configs) do local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform) _p(1,'' @@ -123,7 +123,7 @@ premake.vstudio.vcxproj = { } end - function import_props(prj) + local function import_props(prj) for _, cfginfo in ipairs(prj.solution.vstudio_configs) do local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform) _p(1,'' @@ -133,7 +133,7 @@ premake.vstudio.vcxproj = { } end end - function incremental_link(cfg,cfginfo) + local function incremental_link(cfg,cfginfo) if cfg.kind ~= "StaticLib" then ShoudLinkIncrementally = 'false' if optimisation(cfg) == "Disabled" then @@ -146,7 +146,7 @@ premake.vstudio.vcxproj = { } end - function ignore_import_lib(cfg,cfginfo) + local function ignore_import_lib(cfg,cfginfo) if cfg.kind == "SharedLib" then local shouldIgnore = "false" if cfg.flags.NoImportLib then shouldIgnore = "true" end @@ -156,7 +156,7 @@ premake.vstudio.vcxproj = { } end - function intermediate_and_out_dirs(prj) + local function intermediate_and_out_dirs(prj) _p(1,'') _p(2,'<_ProjectFileVersion>10.0.30319.1') @@ -180,7 +180,7 @@ premake.vstudio.vcxproj = { } _p(1,'') end - function optimisation(cfg) + --[[local--]] function optimisation(cfg) local result = "Disabled" for _, value in ipairs(cfg.flags) do if (value == "Optimize") then @@ -194,7 +194,7 @@ premake.vstudio.vcxproj = { } return result end - function runtime(cfg) + local function runtime(cfg) local runtime if cfg.flags.StaticRuntime then runtime = iif(cfg.flags.Symbols,"MultiThreadedDebug","MultiThreaded") @@ -204,7 +204,7 @@ premake.vstudio.vcxproj = { } return runtime end - function precompiled_header(cfg) + local function precompiled_header(cfg) if not cfg.flags.NoPCH and cfg.pchheader then _p(3,'Use') _p(3,'%s', path.getname(cfg.pchheader)) @@ -231,7 +231,7 @@ premake.vstudio.vcxproj = { } -- end --end -- - function preprocessor(indent,cfg) + local function preprocessor(indent,cfg) if #cfg.defines > 0 then _p(indent,'%s;%%(PreprocessorDefinitions)' ,premake.esc(table.concat(cfg.defines, ";"))) @@ -240,14 +240,14 @@ premake.vstudio.vcxproj = { } end end - function include_dirs(indent,cfg) + local function include_dirs(indent,cfg) if #cfg.includedirs > 0 then _p(indent,'%s;%%(AdditionalIncludeDirectories)' ,premake.esc(path.translate(table.concat(cfg.includedirs, ";"), '\\'))) end end - function resource_compile(cfg) + local function resource_compile(cfg) _p(2,'') preprocessor(3,cfg) include_dirs(3,cfg) @@ -255,7 +255,7 @@ premake.vstudio.vcxproj = { } end - function exceptions(cfg) + local function exceptions(cfg) if cfg.flags.NoExceptions then _p(2,'false') elseif cfg.flags.SEH then @@ -263,13 +263,13 @@ premake.vstudio.vcxproj = { } end end - function rtti(cfg) + local function rtti(cfg) if cfg.flags.NoRTTI then _p(3,'false') end end - function wchar_t_buildin(cfg) + local function wchar_t_buildin(cfg) if cfg.flags.NativeWChar then _p(3,'true') elseif cfg.flags.NoNativeWChar then @@ -277,7 +277,7 @@ premake.vstudio.vcxproj = { } end end - function sse(cfg) + local function sse(cfg) if cfg.flags.EnableSSE then _p(3,'StreamingSIMDExtensions') elseif cfg.flags.EnableSSE2 then @@ -285,7 +285,7 @@ premake.vstudio.vcxproj = { } end end - function floating_point(cfg) + local function floating_point(cfg) if cfg.flags.FloatFast then _p(3,'Fast') elseif cfg.flags.FloatStrict then @@ -293,7 +293,7 @@ premake.vstudio.vcxproj = { } end end - function debug_info(cfg) + local function debug_info(cfg) -- -- EditAndContinue /ZI -- ProgramDatabase /Zi @@ -306,7 +306,7 @@ premake.vstudio.vcxproj = { } end end - function minimal_build(cfg) + local function minimal_build(cfg) if cfg.flags.Symbols and not cfg.flags.NoMinimalRebuild then _p(3,'true') elseif cfg.flags.Symbols then @@ -314,13 +314,13 @@ premake.vstudio.vcxproj = { } end end - function compile_language(cfg) + local function compile_language(cfg) if cfg.language == "C" then _p(3,'CompileAsC') end end - function vs10_clcompile(cfg) + local function vs10_clcompile(cfg) _p(2,'') if #cfg.buildoptions > 0 then @@ -377,7 +377,7 @@ premake.vstudio.vcxproj = { } end - function event_hooks(cfg) + local function event_hooks(cfg) if #cfg.postbuildcommands> 0 then _p(2,'') _p(3,'%s',premake.esc(table.implode(cfg.postbuildcommands, "", "", "\r\n"))) @@ -397,7 +397,7 @@ premake.vstudio.vcxproj = { } end end - function item_def_lib(cfg) + local function item_def_lib(cfg) if cfg.kind == 'StaticLib' then _p(1,'') _p(2,'$(OutDir)%s',cfg.buildtarget.name) @@ -405,7 +405,7 @@ premake.vstudio.vcxproj = { } end end - function link_target_machine(cfg) + local function link_target_machine(cfg) local target if cfg.platform == nil or cfg.platform == "x32" then target ="MachineX86" elseif cfg.platform == "x64" then target ="MachineX64" @@ -414,7 +414,7 @@ premake.vstudio.vcxproj = { } _p(3,'%s', target) end - function import_lib(cfg) + local function import_lib(cfg) --Prevent the generation of an import library for a Windows DLL. if cfg.kind == "SharedLib" then local implibname = cfg.linktarget.fullpath @@ -423,7 +423,7 @@ premake.vstudio.vcxproj = { } end - function common_link_section(cfg) + local function common_link_section(cfg) _p(3,'%s',iif(cfg.kind == "ConsoleApp","Console", "Windows")) if cfg.flags.Symbols then @@ -442,7 +442,7 @@ premake.vstudio.vcxproj = { } end - function item_link(cfg) + local function item_link(cfg) _p(2,'') if cfg.kind ~= 'StaticLib' then @@ -473,7 +473,7 @@ premake.vstudio.vcxproj = { } _p(2,'') end - function item_definitions(prj) + local function item_definitions(prj) for _, cfginfo in ipairs(prj.solution.vstudio_configs) do local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform) _p(1,'' @@ -490,7 +490,7 @@ premake.vstudio.vcxproj = { } end - function get_file_extension(file) + --[[local--]] function get_file_extension(file) local ext_start,ext_end = string.find(file,"%.[%w_%-]+$") if ext_start then return string.sub(file,ext_start+1,ext_end) @@ -500,7 +500,7 @@ premake.vstudio.vcxproj = { } --also translates file paths from '/' to '\\' - function sort_input_files(files,sorted_container) + --[[local--]] function sort_input_files(files,sorted_container) local types = { h = "ClInclude", @@ -533,7 +533,7 @@ premake.vstudio.vcxproj = { } -- -- - function write_file_type_block(files,group_type) + local function write_file_type_block(files,group_type) if #files > 0 then _p(1,'') for _, current_file in ipairs(files) do @@ -543,7 +543,7 @@ premake.vstudio.vcxproj = { } end end - function vcxproj_files(prj) + local function vcxproj_files(prj) local sorted = { ClCompile ={}, @@ -559,7 +559,7 @@ premake.vstudio.vcxproj = { } end - function write_filter_includes(sorted_table) + local function write_filter_includes(sorted_table) local directories = table_of_file_filters(sorted_table) --I am going to take a punt here that the ItemGroup is missing if no files!!!! --there is a test for this see @@ -575,7 +575,7 @@ premake.vstudio.vcxproj = { } end end - function write_file_filter_block(files,group_type) + local function write_file_filter_block(files,group_type) if #files > 0 then _p(1,'') for _, current_file in ipairs(files) do @@ -592,7 +592,7 @@ premake.vstudio.vcxproj = { } end end - function vcxproj_filter_files(prj) + local function vcxproj_filter_files(prj) local sorted = { ClCompile ={}, diff --git a/todo.txt b/todo.txt index 246e98d..afdde20 100644 --- a/todo.txt +++ b/todo.txt @@ -1,12 +1,8 @@ add support for flags: Managed, Unsafe -support C support Managed C++ support C# - - - MFC support added which sets Dynamic Should the project define DEBUG and NDEBUG depending on if debugging info is on?? -- cgit v1.2.3 From 69996eaec81866d4412f2635f40feaa791dcc61e Mon Sep 17 00:00:00 2001 From: LiamDevine Date: Wed, 14 Jul 2010 23:31:31 +0100 Subject: Moved remaining functions from global and added them to the table premake.vstudio.vs10_helpers --- src/actions/vstudio/vs2010_vcxproxj.lua | 98 ++++++++++++++------------- tests/actions/vstudio/test_vs2010_filters.lua | 76 ++++++++++----------- tests/actions/vstudio/test_vs2010_vcxproj.lua | 15 ++-- 3 files changed, 97 insertions(+), 92 deletions(-) diff --git a/src/actions/vstudio/vs2010_vcxproxj.lua b/src/actions/vstudio/vs2010_vcxproxj.lua index 19ab2d9..9ea4bf9 100644 --- a/src/actions/vstudio/vs2010_vcxproxj.lua +++ b/src/actions/vstudio/vs2010_vcxproxj.lua @@ -3,14 +3,14 @@ premake.vstudio.vs10_helpers = { } local vs10_helpers = premake.vstudio.vs10_helpers - function remove_relative_path(file) + function vs10_helpers.remove_relative_path(file) file = file:gsub("%.%.\\",'') file = file:gsub("%.\\",'') return file end - function file_path(file) - file = remove_relative_path(file) + function vs10_helpers.file_path(file) + file = vs10_helpers.remove_relative_path(file) local path = string.find(file,'\\[%w%.%_%-]+$') if path then return string.sub(file,1,path-1) @@ -19,7 +19,7 @@ local vs10_helpers = premake.vstudio.vs10_helpers end end - function list_of_directories_in_path(path) + function vs10_helpers.list_of_directories_in_path(path) local list={} if path then for dir in string.gmatch(path,"[%w%-%_%.]+\\")do @@ -33,11 +33,11 @@ local vs10_helpers = premake.vstudio.vs10_helpers return list end - function table_of_filters(t) + function vs10_helpers.table_of_filters(t) local filters ={} for key, value in pairs(t) do - local result = list_of_directories_in_path(value) + local result = vs10_helpers.list_of_directories_in_path(value) for __,dir in ipairs(result) do if table.contains(filters,dir) ~= true then filters[#filters +1] = dir @@ -48,12 +48,12 @@ local vs10_helpers = premake.vstudio.vs10_helpers return filters end - function table_of_file_filters(files) + function vs10_helpers.table_of_file_filters(files) local filters ={} for key, valueTable in pairs(files) do for _, entry in ipairs(valueTable) do - local result = list_of_directories_in_path(entry) + local result = vs10_helpers.list_of_directories_in_path(entry) for __,dir in ipairs(result) do if table.contains(filters,dir) ~= true then filters[#filters +1] = dir @@ -64,7 +64,45 @@ local vs10_helpers = premake.vstudio.vs10_helpers return filters end - + + function vs10_helpers.get_file_extension(file) + local ext_start,ext_end = string.find(file,"%.[%w_%-]+$") + if ext_start then + return string.sub(file,ext_start+1,ext_end) + end + end + + + + --also translates file paths from '/' to '\\' + function vs10_helpers.sort_input_files(files,sorted_container) + local types = + { + h = "ClInclude", + hpp = "ClInclude", + hxx = "ClInclude", + c = "ClCompile", + cpp = "ClCompile", + cxx = "ClCompile", + cc = "ClCompile" + } + + for _, current_file in ipairs(files) do + local translated_path = path.translate(current_file, '\\') + local ext = vs10_helpers.get_file_extension(translated_path) + if ext then + local type = types[ext] + if type then + table.insert(sorted_container[type],translated_path) + else + table.insert(sorted_container.None,translated_path) + end + end + end + end + + + local function vs2010_config(prj) _p(1,'') for _, cfginfo in ipairs(prj.solution.vstudio_configs) do @@ -490,41 +528,7 @@ local vs10_helpers = premake.vstudio.vs10_helpers end - --[[local--]] function get_file_extension(file) - local ext_start,ext_end = string.find(file,"%.[%w_%-]+$") - if ext_start then - return string.sub(file,ext_start+1,ext_end) - end - end - - - - --also translates file paths from '/' to '\\' - --[[local--]] function sort_input_files(files,sorted_container) - local types = - { - h = "ClInclude", - hpp = "ClInclude", - hxx = "ClInclude", - c = "ClCompile", - cpp = "ClCompile", - cxx = "ClCompile", - cc = "ClCompile" - } - for _, current_file in ipairs(files) do - local translated_path = path.translate(current_file, '\\') - local ext = get_file_extension(translated_path) - if ext then - local type = types[ext] - if type then - table.insert(sorted_container[type],translated_path) - else - table.insert(sorted_container.None,translated_path) - end - end - end - end -- -- -- @@ -552,7 +556,7 @@ local vs10_helpers = premake.vstudio.vs10_helpers } cfg = premake.getconfig(prj) - sort_input_files(cfg.files,sorted) + vs10_helpers.sort_input_files(cfg.files,sorted) write_file_type_block(sorted.ClInclude,"ClInclude") write_file_type_block(sorted.ClCompile,'ClCompile') write_file_type_block(sorted.None,'None') @@ -560,7 +564,7 @@ local vs10_helpers = premake.vstudio.vs10_helpers end local function write_filter_includes(sorted_table) - local directories = table_of_file_filters(sorted_table) + local directories = vs10_helpers.table_of_file_filters(sorted_table) --I am going to take a punt here that the ItemGroup is missing if no files!!!! --there is a test for this see --vs10_filters.noInputFiles_bufferDoesNotContainTagItemGroup @@ -579,7 +583,7 @@ local vs10_helpers = premake.vstudio.vs10_helpers if #files > 0 then _p(1,'') for _, current_file in ipairs(files) do - local path_to_file = file_path(current_file) + local path_to_file = vs10_helpers.file_path(current_file) if path_to_file then _p(2,'<%s Include=\"%s\">', group_type,path.translate(current_file, "\\")) _p(3,'%s',path_to_file) @@ -601,7 +605,7 @@ local vs10_helpers = premake.vstudio.vs10_helpers } cfg = premake.getconfig(prj) - sort_input_files(cfg.files,sorted) + vs10_helpers.sort_input_files(cfg.files,sorted) io.eol = "\r\n" _p('') diff --git a/tests/actions/vstudio/test_vs2010_filters.lua b/tests/actions/vstudio/test_vs2010_filters.lua index d4621ca..fc62d6b 100644 --- a/tests/actions/vstudio/test_vs2010_filters.lua +++ b/tests/actions/vstudio/test_vs2010_filters.lua @@ -1,6 +1,6 @@ T.vs2010_filters = { } local vs10_filters = T.vs2010_filters - + local vs10_helpers = premake.vstudio.vs10_helpers local sln, prj @@ -25,104 +25,104 @@ end function vs10_filters.path_noPath_returnsNil() - local result = file_path("foo.h") + local result = vs10_helpers.file_path("foo.h") test.isequal(nil,result) end function vs10_filters.path_hasOneDirectoryPath_returnsIsFoo() local path = "foo" - local result = file_path(path .."\\foo.h") + local result = vs10_helpers.file_path(path .."\\foo.h") test.isequal(path,result) end function vs10_filters.path_hasTwoDirectoryPath_returnsIsFooSlashBar() local path = "foo\\bar" - local result = file_path(path .."\\foo.h") + local result = vs10_helpers.file_path(path .."\\foo.h") test.isequal(path,result) end function vs10_filters.path_hasTwoDirectoryPath_returnsIsFooSlashBar_Baz() local path = "foo\\bar_baz" - local result = file_path(path .."\\foo.h") + local result = vs10_helpers.file_path(path .."\\foo.h") test.isequal(path,result) end function vs10_filters.path_extensionWithHyphen_returnsIsFoo() local path = "foo" - local result = file_path(path .."\\foo-bar.h") + local result = vs10_helpers.file_path(path .."\\foo-bar.h") test.isequal(path,result) end function vs10_filters.path_extensionWithNumber_returnsIs2Foo() local path = "foo" - local result = file_path(path .."\\2foo.h") + local result = vs10_helpers.file_path(path .."\\2foo.h") test.isequal(path,result) end function vs10_filters.path_hasThreeDirectoryPath_returnsIsFooSlashBarSlashBaz() local path = "foo\\bar\\baz" - local result = file_path(path .."\\foo.h") + local result = vs10_helpers.file_path(path .."\\foo.h") test.isequal(path,result) end function vs10_filters.path_hasDotDotSlashDirectoryPath_returnsNil() local path = ".." - local result = file_path(path .."\\foo.h") + local result = vs10_helpers.file_path(path .."\\foo.h") test.isequal(nil,result) end function vs10_filters.removeRelativePath_noRelativePath_returnsInput() local path = "foo.h" - local result = remove_relative_path(path) + local result = vs10_helpers.remove_relative_path(path) test.isequal("foo.h",result) end function vs10_filters.removeRelativePath_dotDotSlashFoo_returnsFoo() local path = "..\\foo" - local result = remove_relative_path(path) + local result = vs10_helpers.remove_relative_path(path) test.isequal("foo",result) end function vs10_filters.removeRelativePath_dotDotSlashDotDotSlashFoo_returnsFoo() local path = "..\\..\\foo" - local result = remove_relative_path(path) + local result = vs10_helpers.remove_relative_path(path) test.isequal("foo",result) end function vs10_filters.removeRelativePath_DotSlashFoo_returnsFoo() local path = ".\\foo" - local result = remove_relative_path(path) + local result = vs10_helpers.remove_relative_path(path) test.isequal("foo",result) end function vs10_filters.listOfDirectories_passedNil_returnsIsEmpty() - local result = list_of_directories_in_path(nil) + local result = vs10_helpers.list_of_directories_in_path(nil) test.isequal(0,#result) end function vs10_filters.listOfDirectories_oneDirectory_returnsSizeIsOne() - local result = list_of_directories_in_path("foo\\bar.h") + local result = vs10_helpers.list_of_directories_in_path("foo\\bar.h") test.isequal(1,#result) end function vs10_filters.listOfDirectories_oneDirectory_returnsContainsFoo() - local result = list_of_directories_in_path("foo\\bar.h") + local result = vs10_helpers.list_of_directories_in_path("foo\\bar.h") test.contains(result,"foo") end function vs10_filters.listOfDirectories_twoDirectories_returnsSizeIsTwo() - local result = list_of_directories_in_path("foo\\bar\\bar.h") + local result = vs10_helpers.list_of_directories_in_path("foo\\bar\\bar.h") test.isequal(2,#result) end function vs10_filters.listOfDirectories_twoDirectories_secondEntryIsFooSlashBar() - local result = list_of_directories_in_path("foo\\bar\\bar.h") + local result = vs10_helpers.list_of_directories_in_path("foo\\bar\\bar.h") test.isequal("foo\\bar",result[2]) end function vs10_filters.tableOfFilters_emptyTable_returnsEmptyTable() t = {} - local result = table_of_filters(t) + local result = vs10_helpers.table_of_filters(t) test.isequal(0,#result) end @@ -131,7 +131,7 @@ { 'foo.h' } - local result = table_of_filters(t) + local result = vs10_helpers.table_of_filters(t) test.isequal(0,#result) end @@ -140,7 +140,7 @@ { 'bar\\foo.h' } - local result = table_of_filters(t) + local result = vs10_helpers.table_of_filters(t) test.isequal(1,#result) end function vs10_filters.tableOfFilters_tableHasTwoDirectories_returnSizeIsOne() @@ -149,7 +149,7 @@ 'bar\\foo.h', 'baz\\foo.h' } - local result = table_of_filters(t) + local result = vs10_helpers.table_of_filters(t) test.isequal(2,#result) end function vs10_filters.tableOfFilters_tableHasTwoDirectories_firstEntryIsBar() @@ -158,7 +158,7 @@ 'bar\\foo.h', 'baz\\foo.h' } - local result = table_of_filters(t) + local result = vs10_helpers.table_of_filters(t) test.isequal("bar",result[1]) end function vs10_filters.tableOfFilters_tableHasTwoDirectories_secondEntryIsBaz() @@ -167,7 +167,7 @@ 'bar\\foo.h', 'baz\\foo.h' } - local result = table_of_filters(t) + local result = vs10_helpers.table_of_filters(t) test.isequal("baz",result[2]) end @@ -177,7 +177,7 @@ 'bar\\foo.h', 'bar\\baz.h' } - local result = table_of_filters(t) + local result = vs10_helpers.table_of_filters(t) test.isequal(1,#result) end @@ -186,7 +186,7 @@ { 'bar\\baz\\foo.h' } - local result = table_of_filters(t) + local result = vs10_helpers.table_of_filters(t) test.isequal(2,#result) end @@ -195,7 +195,7 @@ { 'bar\\baz\\foo.h' } - local result = table_of_filters(t) + local result = vs10_helpers.table_of_filters(t) test.isequal('bar',result[1]) end @@ -204,7 +204,7 @@ { 'bar\\baz\\foo.h' } - local result = table_of_filters(t) + local result = vs10_helpers.table_of_filters(t) test.isequal('bar\\baz',result[2]) end @@ -215,7 +215,7 @@ 'bar\\baz\\foo.h', 'baz\\foo.h' } - local result = table_of_filters(t) + local result = vs10_helpers.table_of_filters(t) test.isequal(3,#result) end @@ -226,7 +226,7 @@ bar = {'foo\\bar.h'}, baz = {'baz\\bar.h'} } - local result = table_of_file_filters(t) + local result = vs10_helpers.table_of_file_filters(t) test.isequal(2,#result) end @@ -237,7 +237,7 @@ bar = {'foo\\bar.h'}, baz = {'baz\\bar.h'} } - local result = table_of_file_filters(t) + local result = vs10_helpers.table_of_file_filters(t) --order is not defined test.contains(result,'foo') end @@ -249,7 +249,7 @@ bar = {'foo\\bar.h'}, baz = {'baz\\bar.h'} } - local result = table_of_file_filters(t) + local result = vs10_helpers.table_of_file_filters(t) --order is not defined test.contains(result,'baz') end @@ -262,7 +262,7 @@ baz = {'bar\\bar.h'}, bazz = {'bar\\foo\\bar.h'} } - local result = table_of_file_filters(t) + local result = vs10_helpers.table_of_file_filters(t) --order is not defined test.isequal(4,#result) end @@ -272,7 +272,7 @@ { foo = {'foo\\bar.h','foo\\bar\\bar.h'} } - local result = table_of_file_filters(t) + local result = vs10_helpers.table_of_file_filters(t) --order is not defined test.isequal(2,#result) end @@ -366,7 +366,7 @@ { 'bar\\baz\\foo.bar.h' } - local result = table_of_filters(t) + local result = vs10_helpers.table_of_filters(t) test.isequal(2,#result) end function vs10_filters.tableOfFileFilters_filterContainsDots_resultsLengthIsThree() @@ -374,7 +374,7 @@ { foo = {'src\\host\\lua-5.1.4\\foo.h'} } - local result = table_of_file_filters(t) + local result = vs10_helpers.table_of_file_filters(t) test.isequal(3,#result) end @@ -383,11 +383,11 @@ { foo = {'src\\host\\lua-5.1.4\\foo.h'} } - local result = table_of_file_filters(t) + local result = vs10_helpers.table_of_file_filters(t) test.contains(result,'src\\host\\lua-5.1.4') end function vs10_filters.listOfDirectories_filterContainsDots_resultContainsTheEntry() - local result = list_of_directories_in_path('src\\host\\lua.4\\foo.h') + local result = vs10_helpers.list_of_directories_in_path('src\\host\\lua.4\\foo.h') test.contains(result,'src\\host\\lua.4') end diff --git a/tests/actions/vstudio/test_vs2010_vcxproj.lua b/tests/actions/vstudio/test_vs2010_vcxproj.lua index 3ba584a..fff203f 100644 --- a/tests/actions/vstudio/test_vs2010_vcxproj.lua +++ b/tests/actions/vstudio/test_vs2010_vcxproj.lua @@ -3,6 +3,7 @@ local include_directory = "bar/foo" local include_directory2 = "baz/foo" local debug_define = "I_AM_ALIVE_NUMBER_FIVE" + local vs10_helpers = premake.vstudio.vs10_helpers local sln, prj function vs10_vcxproj.setup() @@ -192,32 +193,32 @@ end function vs10_vcxproj.fileExtension_extEqualH() - local ext = get_file_extension('foo.h') + local ext = vs10_helpers.get_file_extension('foo.h') test.isequal('h', ext) end function vs10_vcxproj.fileExtension_containsTwoDots_extEqualH() - local ext = get_file_extension('foo.bar.h') + local ext = vs10_helpers.get_file_extension('foo.bar.h') test.isequal('h', ext) end function vs10_vcxproj.fileExtension_alphaNumeric_extEqualOneH() - local ext = get_file_extension('foo.1h') + local ext = vs10_helpers.get_file_extension('foo.1h') test.isequal('1h', ext) end function vs10_vcxproj.fileExtension_alphaNumericWithUnderscore_extEqualOne_H() - local ext = get_file_extension('foo.1_h') + local ext = vs10_helpers.get_file_extension('foo.1_h') test.isequal('1_h', ext) end function vs10_vcxproj.fileExtension_containsHyphen_extEqualHHyphenH() - local ext = get_file_extension('foo.h-h') + local ext = vs10_helpers.get_file_extension('foo.h-h') test.isequal('h-h', ext) end function vs10_vcxproj.fileExtension_containsMoreThanOneDot_extEqualOneH() - local ext = get_file_extension('foo.bar.h') + local ext = vs10_helpers.get_file_extension('foo.bar.h') test.isequal('h', ext) end @@ -228,7 +229,7 @@ ClCompile ={}, None ={} } - sort_input_files(input,sorted) + vs10_helpers.sort_input_files(input,sorted) return sorted end function vs10_vcxproj.sortFile_headerFile_SortedClIncludeEqualToFile() -- cgit v1.2.3 From 23fb37e802b9c5111805204ddbddc780437d38c1 Mon Sep 17 00:00:00 2001 From: LiamDevine Date: Wed, 14 Jul 2010 23:40:51 +0100 Subject: moved function optimisation to before first use in vs2010_vcxproj.lua and added the local keyword --- src/actions/vstudio/vs2010_vcxproxj.lua | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/actions/vstudio/vs2010_vcxproxj.lua b/src/actions/vstudio/vs2010_vcxproxj.lua index 9ea4bf9..b53e48f 100644 --- a/src/actions/vstudio/vs2010_vcxproxj.lua +++ b/src/actions/vstudio/vs2010_vcxproxj.lua @@ -135,6 +135,20 @@ local vs10_helpers = premake.vstudio.vs10_helpers local function if_config_and_platform() return 'Condition="\'$(Configuration)|$(Platform)' end + + local function optimisation(cfg) + local result = "Disabled" + for _, value in ipairs(cfg.flags) do + if (value == "Optimize") then + result = "Full" + elseif (value == "OptimizeSize") then + result = "MinSpace" + elseif (value == "OptimizeSpeed") then + result = "MaxSpeed" + end + end + return result + end local function config_type_block(prj) for _, cfginfo in ipairs(prj.solution.vstudio_configs) do @@ -218,19 +232,7 @@ local vs10_helpers = premake.vstudio.vs10_helpers _p(1,'') end - --[[local--]] function optimisation(cfg) - local result = "Disabled" - for _, value in ipairs(cfg.flags) do - if (value == "Optimize") then - result = "Full" - elseif (value == "OptimizeSize") then - result = "MinSpace" - elseif (value == "OptimizeSpeed") then - result = "MaxSpeed" - end - end - return result - end + local function runtime(cfg) local runtime -- cgit v1.2.3 From b728191168e7d77194da14129364f4cd99cb7afa Mon Sep 17 00:00:00 2001 From: LiamDevine Date: Thu, 15 Jul 2010 00:22:53 +0100 Subject: Moved clean funcitons to _vstudio.lua from vs2010_vcxproj.lua also removed temp stdio writes in _clean.lua --- src/actions/clean/_clean.lua | 20 -------------- src/actions/vstudio/_vstudio.lua | 46 +++++++++++++++++++++++++++++++++ src/actions/vstudio/vs2010_vcxproxj.lua | 46 +-------------------------------- 3 files changed, 47 insertions(+), 65 deletions(-) diff --git a/src/actions/clean/_clean.lua b/src/actions/clean/_clean.lua index fc53d09..0e0ead0 100644 --- a/src/actions/clean/_clean.lua +++ b/src/actions/clean/_clean.lua @@ -59,26 +59,6 @@ onproject = function(prj) for action in premake.action.each() do - -- io.write(action.trigger ..'\n') - if action.trigger =="vs2010" then - if action.oncleanproject then - io.write('vs2010 has an on clean and we are going to call it\n') - else - io.write('vs2010 does not have an on clean\n') - end - if action.oncleansolution then - io.write('vs2010 has an oncleansolution and we are going to call it\n') - else - io.write('vs2010 does not have an oncleansolution\n') - end - if action.oncleantarget then - io.write('vs2010 has an oncleantarget and we are going to call it\n') - else - io.write('vs2010 does not have an oncleantarget\n') - end - - - end if action.oncleanproject then action.oncleanproject(prj) end diff --git a/src/actions/vstudio/_vstudio.lua b/src/actions/vstudio/_vstudio.lua index a785f8b..3215311 100644 --- a/src/actions/vstudio/_vstudio.lua +++ b/src/actions/vstudio/_vstudio.lua @@ -284,7 +284,53 @@ end end + + + function premake.vs2010_cleansolution(sln) + premake.clean.file(sln, "%%.sln") + premake.clean.file(sln, "%%.suo") + --premake.clean.file(sln, "%%.sdf") + end + function premake.vs2010_cleanproject(prj) + --io.write('vs2010 clean action') + local fname = premake.project.getfilename(prj, "%%") + local vcxname = fname .. ".vcxproj" + --io.write(vcxname) + os.remove(fname .. '.vcxproj') + os.remove(fname .. '.vcxproj.user') + os.remove(fname .. '.vcxproj.filters') + os.remove(fname .. '.sdf') + + --local userfiles = os.matchfiles(fname .. ".vcxproj.user") + --for _, fname in ipairs(userfiles) do + -- os.remove(fname) + --end + + --local filter_files = os.matchfiles(fname .. ".vcxproj.filter") + --for _, fname in ipairs(filter_files) do + -- os.remove(fname) + --end + + --local proj_files = os.matchfiles(fname .. ".vcxproj") + --for _, fname in ipairs(proj_files) do + -- os.remove(fname) + --end + + --local sdf_files = os.matchfiles(fname .. ".sdf") + --for _, fname in ipairs(sdf_files) do + -- os.remove(fname) + --end + + end + + function premake.vs2010_cleantarget(name) + os.remove(name .. ".pdb") + os.remove(name .. ".idb") + os.remove(name .. ".ilk") + --os.remove(name .. ".vshost.exe") + --os.remove(name .. ".exe.manifest") + end -- diff --git a/src/actions/vstudio/vs2010_vcxproxj.lua b/src/actions/vstudio/vs2010_vcxproxj.lua index b53e48f..e2b25bc 100644 --- a/src/actions/vstudio/vs2010_vcxproxj.lua +++ b/src/actions/vstudio/vs2010_vcxproxj.lua @@ -675,49 +675,5 @@ local vs10_helpers = premake.vstudio.vs10_helpers vcxproj_filter_files(prj) end - function premake.vs2010_cleansolution(sln) - premake.clean.file(sln, "%%.sln") - premake.clean.file(sln, "%%.suo") - --premake.clean.file(sln, "%%.sdf") - end - - function premake.vs2010_cleanproject(prj) - io.write('vs2010 clean action') - local fname = premake.project.getfilename(prj, "%%") - local vcxname = fname .. ".vcxproj" - io.write(vcxname) - os.remove(fname .. '.vcxproj') - os.remove(fname .. '.vcxproj.user') - os.remove(fname .. '.vcxproj.filters') - os.remove(fname .. '.sdf') - -- - local userfiles = os.matchfiles(fname .. ".vcxproj.user") - for _, fname in ipairs(userfiles) do - os.remove(fname) - end - - local filter_files = os.matchfiles(fname .. ".vcxproj.filter") - for _, fname in ipairs(filter_files) do - os.remove(fname) - end - - local proj_files = os.matchfiles(fname .. ".vcxproj") - for _, fname in ipairs(proj_files) do - os.remove(fname) - end - - local sdf_files = os.matchfiles(fname .. ".sdf") - for _, fname in ipairs(sdf_files) do - os.remove(fname) - end - -- - end - - function premake.vs2010_cleantarget(name) - os.remove(name .. ".pdb") - os.remove(name .. ".idb") - os.remove(name .. ".ilk") - --os.remove(name .. ".vshost.exe") - --os.remove(name .. ".exe.manifest") - end + \ No newline at end of file -- cgit v1.2.3 From a178a01eb187bd195f62129004f32e39221c133c Mon Sep 17 00:00:00 2001 From: LiamDevine Date: Thu, 15 Jul 2010 00:47:35 +0100 Subject: embeded lua source. Checked clean operation on a solution with multiple projects, yet no intergration tests added. --- src/host/scripts.c | 53 ++++++++++++++++++++++++++--------------------------- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/src/host/scripts.c b/src/host/scripts.c index 909bd1f..fb41247 100644 --- a/src/host/scripts.c +++ b/src/host/scripts.c @@ -164,12 +164,12 @@ const char* builtin_scripts[] = { "dcfg in ipairs(sln.configurations) do\nfor _, platform in ipairs(platforms) do\nlocal entry = { }\nentry.src_buildcfg = buildcfg\nentry.src_platform = platform\nif platform ~= \"PS3\" then\nentry.buildcfg = buildcfg\nentry.platform = premake.vstudio_platforms[platform]\nelse\nentry.buildcfg = platform .. \" \" .. buildcfg\nentry.platform = \"Win32\"\nend\nentry.name = entry.buildcfg .. \"|\" .. entry.platform\nentry.isreal = (platform ~= \"any\" and platform ~= \"mixed\")\ntable.insert(cfgs, entry)\nend\nend\nreturn cfgs\nend\nfunction _VS.cfgtype(cfg)\nif (cfg.kind == \"SharedLib\") then\nreturn 2\nelseif (cfg.kind == \"StaticLib\") then\nreturn 4\nelse\nreturn 1\nend\nend\nfunction premake.vstudio.cleansolution(sln)\npremake.clean.file(sln, \"%%.sln\")\npremake.clean.file(sln, \"%%.suo\")\npremake.clean.file(sln, \"%%.ncb\")\npremake.clean.file(sln, \"%%.userprefs\")\npremake.clean.file(sln, \"%%.usertasks\")\nend\nfunction premake.vstudio.cleanproject(prj)\nlocal fext = iif(premake.isdotnetproject(prj), \"." "csproj\", \".vcproj\")\nlocal fname = premake.project.getfilename(prj, \"%%\")\nos.remove(fname .. fext)\nos.remove(fname .. fext .. \".user\")\nos.remove(fname .. \".pidb\")\nlocal userfiles = os.matchfiles(fname .. \".*.user\")\nfor _, fname in ipairs(userfiles) do\nos.remove(fname)\nend\nend\nfunction premake.vstudio.cleantarget(name)\nos.remove(name .. \".pdb\")\nos.remove(name .. \".idb\")\nos.remove(name .. \".ilk\")\nos.remove(name .. \".vshost.exe\")\nos.remove(name .. \".exe.manifest\")\nend\nlocal function output(indent, value)\n_p(indent .. value)\nend\nlocal function attrib(indent, name, value)\n_p(indent .. \"\\t\" .. name .. '=\"' .. value .. '\"')\nend\nfunction _VS.files(prj, fname, state, nestlevel)\nlocal indent = string.rep(\"\\t\", nestlevel + 2)\nif (state == \"GroupStart\") then\noutput(indent, \"\")\nelseif (state == \"GroupEnd\") then\noutput(indent, \"\")\nelse\nou" "tput(indent, \"\")\nif (not prj.flags.NoPCH and prj.pchsource == fname) then\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nif cfginfo.isreal then\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\noutput(indent, \"\\t\")\noutput(indent, \"\\t\\t\")\noutput(indent, \"\\t\")\nend\nend\nend\noutput(indent, \"\")\nend\nend\nfunction _VS.optimization(cfg)\nlocal result = 0\nfor _, value in ipairs(cfg.flags) do\nif (value == \"Optimize\") then\nresult = 3\nelseif (value == \"OptimizeSize\") then\nresult = 1\nelseif (value == \"OptimizeSpeed\") then\nresult = 2\nen" - "d\nend\nreturn result\nend\nfunction _VS.projectfile(prj)\nlocal extension\nif (prj.language == \"C#\") then\nextension = \".csproj\"\nelseif (_ACTION == \"vs2010\" and prj.language == \"C++\" )then\nextension = \".vcxproj\"\nelseif (_ACTION == \"vs2010\" and prj.language == \"C\" )then\nextension = \".vcxproj\"\nelse\nextension = \".vcproj\"\nend\nlocal fname = path.join(prj.location, prj.name)\nreturn fname..extension\nend\nfunction _VS.tool(prj)\nif (prj.language == \"C#\") then\nreturn \"FAE04EC0-301F-11D3-BF4B-00C04F79EFBC\"\nelse\nreturn \"8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942\"\nend\nend\nnewaction {\ntrigger = \"vs2002\",\nshortname = \"Visual Studio 2002\",\ndescription = \"Generate Microsoft Visual Studio 2002 project files\",\nos = \"windows\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\" },\nvalid_languages = { \"C\", \"C++\", \"C#\" },\nvalid_tools = {\ncc = { \"msc\" },\ndotnet = { \"msnet\" },\n},\nonsolution = funct" - "ion(sln)\npremake.generate(sln, \"%%.sln\", premake.vs2002_solution)\nend,\nonproject = function(prj)\nif premake.isdotnetproject(prj) then\npremake.generate(prj, \"%%.csproj\", premake.vs2002_csproj)\npremake.generate(prj, \"%%.csproj.user\", premake.vs2002_csproj_user)\nelse\npremake.generate(prj, \"%%.vcproj\", premake.vs200x_vcproj)\nend\nend,\noncleansolution = premake.vstudio.cleansolution,\noncleanproject = premake.vstudio.cleanproject,\noncleantarget = premake.vstudio.cleantarget\n}\nnewaction {\ntrigger = \"vs2003\",\nshortname = \"Visual Studio 2003\",\ndescription = \"Generate Microsoft Visual Studio 2003 project files\",\nos = \"windows\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\" },\nvalid_languages = { \"C\", \"C++\", \"C#\" },\nvalid_tools = {\ncc = { \"msc\" },\ndotnet = { \"msnet\" },\n},\nonsolution = function(sln)\npremake.generate(sln, \"%%.sln\", premake.vs2003_solution)\nend,\nonproject = function(prj)\ni" - "f premake.isdotnetproject(prj) then\npremake.generate(prj, \"%%.csproj\", premake.vs2002_csproj)\npremake.generate(prj, \"%%.csproj.user\", premake.vs2002_csproj_user)\nelse\npremake.generate(prj, \"%%.vcproj\", premake.vs200x_vcproj)\nend\nend,\noncleansolution = premake.vstudio.cleansolution,\noncleanproject = premake.vstudio.cleanproject,\noncleantarget = premake.vstudio.cleantarget\n}\nnewaction {\ntrigger = \"vs2005\",\nshortname = \"Visual Studio 2005\",\ndescription = \"Generate Microsoft Visual Studio 2005 project files\",\nos = \"windows\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\" },\nvalid_languages = { \"C\", \"C++\", \"C#\" },\nvalid_tools = {\ncc = { \"msc\" },\ndotnet = { \"msnet\" },\n},\nonsolution = function(sln)\npremake.generate(sln, \"%%.sln\", premake.vs2005_solution)\nend,\nonproject = function(prj)\nif premake.isdotnetproject(prj) then\npremake.generate(prj, \"%%.csproj\", premake.vs2005_csproj)\npremak" - "e.generate(prj, \"%%.csproj.user\", premake.vs2005_csproj_user)\nelse\npremake.generate(prj, \"%%.vcproj\", premake.vs200x_vcproj)\nend\nend,\noncleansolution = premake.vstudio.cleansolution,\noncleanproject = premake.vstudio.cleanproject,\noncleantarget = premake.vstudio.cleantarget\n}\nnewaction {\ntrigger = \"vs2008\",\nshortname = \"Visual Studio 2008\",\ndescription = \"Generate Microsoft Visual Studio 2008 project files\",\nos = \"windows\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\" },\nvalid_languages = { \"C\", \"C++\", \"C#\" },\nvalid_tools = {\ncc = { \"msc\" },\ndotnet = { \"msnet\" },\n},\nonsolution = function(sln)\npremake.generate(sln, \"%%.sln\", premake.vs2005_solution)\nend,\nonproject = function(prj)\nif premake.isdotnetproject(prj) then\npremake.generate(prj, \"%%.csproj\", premake.vs2005_csproj)\npremake.generate(prj, \"%%.csproj.user\", premake.vs2005_csproj_user)\nelse\npremake.generate(prj, \"%%.vcproj" - "\", premake.vs200x_vcproj)\nend\nend,\noncleansolution = premake.vstudio.cleansolution,\noncleanproject = premake.vstudio.cleanproject,\noncleantarget = premake.vstudio.cleantarget\n}\nnewaction \n{\ntrigger = \"vs2010\",\nshortname = \"Visual Studio 2010\",\ndescription = \"Generate Microsoft Visual Studio 2010 project files\",\nos = \"windows\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\" },\nvalid_languages = { \"C++\",\"C\"},\nvalid_tools = {\ncc = { \"msc\" },\n},\nonsolution = function(sln)\npremake.generate(sln, \"%%.sln\", premake.vs_generic_solution)\nend,\nonproject = function(prj)\npremake.generate(prj, \"%%.vcxproj\", premake.vs2010_vcxproj)\npremake.generate(prj, \"%%.vcxproj.user\", premake.vs2010_vcxproj_user)\npremake.generate(prj, \"%%.vcxproj.filters\", premake.vs2010_vcxproj_filters)\nend,\noncleansolution = premake.vs2010_cleansolution,\noncleanproject = premake.vs2010_cleanproject,\noncleantarget = premak" - "e.vs2010_cleantarget\n}", + "d\nend\nreturn result\nend\nfunction _VS.projectfile(prj)\nlocal extension\nif (prj.language == \"C#\") then\nextension = \".csproj\"\nelseif (_ACTION == \"vs2010\" and prj.language == \"C++\" )then\nextension = \".vcxproj\"\nelseif (_ACTION == \"vs2010\" and prj.language == \"C\" )then\nextension = \".vcxproj\"\nelse\nextension = \".vcproj\"\nend\nlocal fname = path.join(prj.location, prj.name)\nreturn fname..extension\nend\nfunction _VS.tool(prj)\nif (prj.language == \"C#\") then\nreturn \"FAE04EC0-301F-11D3-BF4B-00C04F79EFBC\"\nelse\nreturn \"8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942\"\nend\nend\nfunction premake.vs2010_cleansolution(sln)\npremake.clean.file(sln, \"%%.sln\")\npremake.clean.file(sln, \"%%.suo\")\nend\nfunction premake.vs2010_cleanproject(prj)\nlocal fname = premake.project.getfilename(prj, \"%%\")\nlocal vcxname = fname .. \".vcxproj\"\nos.remove(fname .. '.vcxproj')\nos.remove(fname .. '.vcxproj.user')\nos.remove(fname .. '.vcxproj.filters')\nos.remove(fname .. '.sdf')\nend\nfunction premake.v" + "s2010_cleantarget(name)\nos.remove(name .. \".pdb\")\nos.remove(name .. \".idb\")\nos.remove(name .. \".ilk\")\nend\nnewaction {\ntrigger = \"vs2002\",\nshortname = \"Visual Studio 2002\",\ndescription = \"Generate Microsoft Visual Studio 2002 project files\",\nos = \"windows\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\" },\nvalid_languages = { \"C\", \"C++\", \"C#\" },\nvalid_tools = {\ncc = { \"msc\" },\ndotnet = { \"msnet\" },\n},\nonsolution = function(sln)\npremake.generate(sln, \"%%.sln\", premake.vs2002_solution)\nend,\nonproject = function(prj)\nif premake.isdotnetproject(prj) then\npremake.generate(prj, \"%%.csproj\", premake.vs2002_csproj)\npremake.generate(prj, \"%%.csproj.user\", premake.vs2002_csproj_user)\nelse\npremake.generate(prj, \"%%.vcproj\", premake.vs200x_vcproj)\nend\nend,\noncleansolution = premake.vstudio.cleansolution,\noncleanproject = premake.vstudio.cleanproject,\noncleantarget = premake.vstudio.cle" + "antarget\n}\nnewaction {\ntrigger = \"vs2003\",\nshortname = \"Visual Studio 2003\",\ndescription = \"Generate Microsoft Visual Studio 2003 project files\",\nos = \"windows\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\" },\nvalid_languages = { \"C\", \"C++\", \"C#\" },\nvalid_tools = {\ncc = { \"msc\" },\ndotnet = { \"msnet\" },\n},\nonsolution = function(sln)\npremake.generate(sln, \"%%.sln\", premake.vs2003_solution)\nend,\nonproject = function(prj)\nif premake.isdotnetproject(prj) then\npremake.generate(prj, \"%%.csproj\", premake.vs2002_csproj)\npremake.generate(prj, \"%%.csproj.user\", premake.vs2002_csproj_user)\nelse\npremake.generate(prj, \"%%.vcproj\", premake.vs200x_vcproj)\nend\nend,\noncleansolution = premake.vstudio.cleansolution,\noncleanproject = premake.vstudio.cleanproject,\noncleantarget = premake.vstudio.cleantarget\n}\nnewaction {\ntrigger = \"vs2005\",\nshortname = \"Visual Studio 2005\",\ndesc" + "ription = \"Generate Microsoft Visual Studio 2005 project files\",\nos = \"windows\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\" },\nvalid_languages = { \"C\", \"C++\", \"C#\" },\nvalid_tools = {\ncc = { \"msc\" },\ndotnet = { \"msnet\" },\n},\nonsolution = function(sln)\npremake.generate(sln, \"%%.sln\", premake.vs2005_solution)\nend,\nonproject = function(prj)\nif premake.isdotnetproject(prj) then\npremake.generate(prj, \"%%.csproj\", premake.vs2005_csproj)\npremake.generate(prj, \"%%.csproj.user\", premake.vs2005_csproj_user)\nelse\npremake.generate(prj, \"%%.vcproj\", premake.vs200x_vcproj)\nend\nend,\noncleansolution = premake.vstudio.cleansolution,\noncleanproject = premake.vstudio.cleanproject,\noncleantarget = premake.vstudio.cleantarget\n}\nnewaction {\ntrigger = \"vs2008\",\nshortname = \"Visual Studio 2008\",\ndescription = \"Generate Microsoft Visual Studio 2008 project files\",\nos = \"windows\",\n" + "valid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\" },\nvalid_languages = { \"C\", \"C++\", \"C#\" },\nvalid_tools = {\ncc = { \"msc\" },\ndotnet = { \"msnet\" },\n},\nonsolution = function(sln)\npremake.generate(sln, \"%%.sln\", premake.vs2005_solution)\nend,\nonproject = function(prj)\nif premake.isdotnetproject(prj) then\npremake.generate(prj, \"%%.csproj\", premake.vs2005_csproj)\npremake.generate(prj, \"%%.csproj.user\", premake.vs2005_csproj_user)\nelse\npremake.generate(prj, \"%%.vcproj\", premake.vs200x_vcproj)\nend\nend,\noncleansolution = premake.vstudio.cleansolution,\noncleanproject = premake.vstudio.cleanproject,\noncleantarget = premake.vstudio.cleantarget\n}\nnewaction \n{\ntrigger = \"vs2010\",\nshortname = \"Visual Studio 2010\",\ndescription = \"Generate Microsoft Visual Studio 2010 project files\",\nos = \"windows\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\" },\nvalid_languages " + "= { \"C++\",\"C\"},\nvalid_tools = {\ncc = { \"msc\" },\n},\nonsolution = function(sln)\npremake.generate(sln, \"%%.sln\", premake.vs_generic_solution)\nend,\nonproject = function(prj)\npremake.generate(prj, \"%%.vcxproj\", premake.vs2010_vcxproj)\npremake.generate(prj, \"%%.vcxproj.user\", premake.vs2010_vcxproj_user)\npremake.generate(prj, \"%%.vcxproj.filters\", premake.vs2010_vcxproj_filters)\nend,\noncleansolution = premake.vs2010_cleansolution,\noncleanproject = premake.vs2010_cleanproject,\noncleantarget = premake.vs2010_cleantarget\n}", /* actions/vstudio/vs2002_solution.lua */ "function premake.vs2002_solution(sln)\nio.eol = '\\r\\n'\nsln.vstudio_configs = premake.vstudio_buildconfigs(sln)\n_p('Microsoft Visual Studio Solution File, Format Version 7.00')\nfor prj in premake.solution.eachproject(sln) do\nlocal projpath = path.translate(path.getrelative(sln.location, _VS.projectfile(prj)))\n_p('Project(\"{%s}\") = \"%s\", \"%s\", \"{%s}\"', _VS.tool(prj), prj.name, projpath, prj.uuid)\n_p('EndProject')\nend\n_p('Global')\n_p(1,'GlobalSection(SolutionConfiguration) = preSolution')\nfor i, cfgname in ipairs(sln.configurations) do\n_p(2,'ConfigName.%d = %s', i - 1, cfgname)\nend\n_p(1,'EndGlobalSection')\n_p(1,'GlobalSection(ProjectDependencies) = postSolution')\n_p(1,'EndGlobalSection')\n_p(1,'GlobalSection(ProjectConfiguration) = postSolution')\nfor prj in premake.solution.eachproject(sln) do\nfor _, cfgname in ipairs(sln.configurations) do\n_p(2,'{%s}.%s.ActiveCfg = %s|%s', prj.uuid, cfgname, cfgname, _VS.arch(prj))\n_p(2,'{%s}.%s.Build.0 = %s|%s', prj.uuid, cfgname, cfgname, _VS.arch(" @@ -229,24 +229,24 @@ const char* builtin_scripts[] = { "= function(sln)\nio.eol = '\\r\\n'\nsln.vstudio_configs = premake.vstudio_buildconfigs(sln)\n_p('\\239\\187\\191')\nend\nfunction premake.vs_generic_solution(sln)\nvs_write_pre_version(sln)\nvs_write_version_info()\nvs_write_projects(sln)\n_p('Global')\npremake.vs2005_solution_platforms(sln)\npremake.vs2005_solution_project_platforms(sln)\npremake.vs2005_solution_properties(sln)\n_p('EndGlobal')\nend", /* actions/vstudio/vs2010_vcxproxj.lua */ - "\npremake.vstudio.vcxproj = { }\nfunction remove_relative_path(file)\nfile = file:gsub(\"%.%.\\\\\",'')\nfile = file:gsub(\"%.\\\\\",'')\nreturn file\nend\nfunction file_path(file)\nfile = remove_relative_path(file)\nlocal path = string.find(file,'\\\\[%w%.%_%-]+$')\nif path then\nreturn string.sub(file,1,path-1)\nelse\nreturn nil\nend\nend\nfunction list_of_directories_in_path(path)\nlocal list={}\nif path then\nfor dir in string.gmatch(path,\"[%w%-%_%.]+\\\\\")do\nif #list == 0 then\nlist[1] = dir:sub(1,#dir-1)\nelse\nlist[#list +1] = list[#list] ..\"\\\\\" ..dir:sub(1,#dir-1)\nend\nend\nend\nreturn list\nend\nfunction table_of_filters(t)\nlocal filters ={}\nfor key, value in pairs(t) do\nlocal result = list_of_directories_in_path(value)\nfor __,dir in ipairs(result) do\nif table.contains(filters,dir) ~= true then\nfilters[#filters +1] = dir\nend\nend\nend\nreturn filters\nend\nfunction table_of_file_filters(files)\nlocal filters ={}\nfor key, valueTable in pairs(files) do\nfor _, entry in ipairs(valueTable)" - " do\nlocal result = list_of_directories_in_path(entry)\nfor __,dir in ipairs(result) do\nif table.contains(filters,dir) ~= true then\nfilters[#filters +1] = dir\nend\nend\nend\nend\nreturn filters\nend\nlocal function vs2010_config(prj)\n_p(1,'')\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\n_p(2,'', premake.esc(cfginfo.name))\n_p(3,'%s',cfginfo.buildcfg)\n_p(3,'%s',cfginfo.platform)\n_p(2,'')\nend\n_p(1,'')\nend\nlocal function vs2010_globals(prj)\n_p(1,'')\n_p(2,'{%s}',prj.uuid)\n_p(2,'%s',prj.name)\n_p(2,'Win32Proj')\n_p(1,'')\nend\nfunction config_type(config)\nlocal t =\n{\nSharedLib = \"DynamicLibrary\",\nStaticLib = \"StaticLibrary\",\nConsoleApp = \"Application\",\n}\nreturn t[config.kind]\nend\nfunct" - "ion if_config_and_platform()\nreturn 'Condition=\"\\'$(Configuration)|$(Platform)'\nend\nfunction config_type_block(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(1,''\n, premake.esc(cfginfo.name))\n_p(2,'%s',config_type(cfg))\n_p(2,'%s',iif(cfg.flags.Unicode,\"Unicode\",\"MultiByte\"))\nif cfg.flags.MFC then\n_p(2,'Dynamic')\nend\nlocal use_debug = \"false\"\nif optimisation(cfg) == \"Disabled\" then \nuse_debug = \"true\" \nelse\n_p(2,'true')\nend\n_p(2,'%s',use_debug)\n_p(1,'')\nend\nend\nfunction import_props(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, " - "cfginfo.src_platform)\n_p(1,''\n,premake.esc(cfginfo.name))\n_p(2,'')\n_p(1,'')\nend\nend\nfunction incremental_link(cfg,cfginfo)\nif cfg.kind ~= \"StaticLib\" then\nShoudLinkIncrementally = 'false'\nif optimisation(cfg) == \"Disabled\" then\nShoudLinkIncrementally = 'true'\nend\n_p(2,'%s'\n,premake.esc(cfginfo.name),ShoudLinkIncrementally)\nend\nend\nfunction ignore_import_lib(cfg,cfginfo)\nif cfg.kind == \"SharedLib\" then\nlocal shouldIgnore = \"false\"\nif cfg.flags.NoImportLib then shouldIgnore = \"true\" end\n _p(2,'%s'\n,premake.esc(cfginfo.name),sho" - "uldIgnore)\nend\nend\nfunction intermediate_and_out_dirs(prj)\n_p(1,'')\n_p(2,'<_ProjectFileVersion>10.0.30319.1')\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(2,'%s\\\\'\n, premake.esc(cfginfo.name),premake.esc(cfg.buildtarget.directory) )\n_p(2,'%s\\\\'\n, premake.esc(cfginfo.name), premake.esc(cfg.objectsdir))\n_p(2,'%s'\n,premake.esc(cfginfo.name),path.getbasename(cfg.buildtarget.name))\nignore_import_lib(cfg,cfginfo)\nincremental_link(cfg,cfginfo)\nif cfg.flags.NoManifest then\n_p(2,'false'\n,premake.esc(cfginfo.name))\nend\nend\n_p(1,'')\nend\nfunction optimisation(cfg)\nlocal " - "result = \"Disabled\"\nfor _, value in ipairs(cfg.flags) do\nif (value == \"Optimize\") then\nresult = \"Full\"\nelseif (value == \"OptimizeSize\") then\nresult = \"MinSpace\"\nelseif (value == \"OptimizeSpeed\") then\nresult = \"MaxSpeed\"\nend\nend\nreturn result\nend\nfunction runtime(cfg)\nlocal runtime\nif cfg.flags.StaticRuntime then\nruntime = iif(cfg.flags.Symbols,\"MultiThreadedDebug\",\"MultiThreaded\")\nelse\nruntime = iif(cfg.flags.Symbols, \"MultiThreadedDebugDLL\", \"MultiThreadedDLL\")\nend\nreturn runtime\nend\nfunction precompiled_header(cfg)\n if not cfg.flags.NoPCH and cfg.pchheader then\n_p(3,'Use')\n_p(3,'%s', path.getname(cfg.pchheader))\nelse\n_p(3,'')\nend\nend\nfunction preprocessor(indent,cfg)\nif #cfg.defines > 0 then\n_p(indent,'%s;%%(PreprocessorDefinitions)'\n,premake.esc(table.concat(cfg.defines, \";\"" - ")))\nelse\n_p(indent,'')\nend\nend\nfunction include_dirs(indent,cfg)\nif #cfg.includedirs > 0 then\n_p(indent,'%s;%%(AdditionalIncludeDirectories)'\n,premake.esc(path.translate(table.concat(cfg.includedirs, \";\"), '\\\\')))\nend\nend\nfunction resource_compile(cfg)\n_p(2,'')\npreprocessor(3,cfg)\ninclude_dirs(3,cfg)\n_p(2,'')\nend\nfunction exceptions(cfg)\nif cfg.flags.NoExceptions then\n_p(2,'false')\nelseif cfg.flags.SEH then\n_p(2,'Async')\nend\nend\nfunction rtti(cfg)\nif cfg.flags.NoRTTI then\n_p(3,'false')\nend\nend\nfunction wchar_t_buildin(cfg)\nif cfg.flags.NativeWChar then\n_p(3,'true')\nelseif cfg.flags.NoNativeWChar then\n_p(3,'false')\nend\nend\nfunction sse(cfg)\nif cfg.flags.EnableSSE then\n_p(3,'StreamingSIMDExtensions')\nelseif cfg.flags.EnableSSE2 then\n_p(3,'StreamingSIMDExtensions2')\nend\nend\nfunction floating_point(cfg)\n if cfg.flags.FloatFast then\n_p(3,'Fast')\nelseif cfg.flags.FloatStrict then\n_p(3,'Strict')\nend\nend\nfunction debug_info(cfg)\nif cfg.flags.Symbols and not cfg.flags.NoEditAndContinue then\n_p(3,'EditAndContinue')\nelse\n_p(3,'')\nend\nend\nfunction minimal_build(cfg)\nif cfg.flags.Symbols and not cfg.flags.NoMinimalRebuild then\n_p(3,'true')\nelseif cfg.flags.Symbols then\n_p(3,'false')\nend\nend\nfunction compile_language(cfg)\nif cfg.lang" - "uage == \"C\" then\n_p(3,'CompileAsC')\nend\nend\nfunction vs10_clcompile(cfg)\n_p(2,'')\nif #cfg.buildoptions > 0 then\n_p(3,'%s %%(AdditionalOptions)',\ntable.concat(premake.esc(cfg.buildoptions), \" \"))\nend\n_p(3,'%s',optimisation(cfg))\ninclude_dirs(3,cfg)\npreprocessor(3,cfg)\nminimal_build(cfg)\nif optimisation(cfg) == \"Disabled\" then\n_p(3,'EnableFastChecks')\nif cfg.flags.ExtraWarnings then\n_p(3,'true')\nend\nelse\n_p(3,'true')\nend\n_p(3,'%s', runtime(cfg))\n_p(3,'true')\nprecompiled_header(cfg)\nif cfg.flags.ExtraWarnings then\n_p(3,'Level4')\nelse\n_p(3,'Level3')\nend\nif cfg.flags.FatalWarnings then\n_p(3,'true" - "')\nend\nexceptions(cfg)\nrtti(cfg)\nwchar_t_buildin(cfg)\nsse(cfg)\nfloating_point(cfg)\ndebug_info(cfg)\nif cfg.flags.NoFramePointer then\n_p(3,'true')\nend\ncompile_language(cfg)\n_p(2,'')\nend\nfunction event_hooks(cfg)\nif #cfg.postbuildcommands> 0 then\n _p(2,'')\n_p(3,'%s',premake.esc(table.implode(cfg.postbuildcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'')\nend\nif #cfg.prebuildcommands> 0 then\n _p(2,'')\n_p(3,'%s',premake.esc(table.implode(cfg.prebuildcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'')\nend\nif #cfg.prelinkcommands> 0 then\n _p(2,'')\n_p(3,'%s',premake.esc(table.implode(cfg.prelinkcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'')\nend\nend\nfunction item_def_lib(cfg)\nif cfg.kind == 'StaticLib' then\n_p(1,'')\n_p(2,'$(OutDir)%s',cfg.buildtarget.name)\n_p(1,'<" - "/Lib>')\nend\nend\nfunction link_target_machine(cfg)\nlocal target\nif cfg.platform == nil or cfg.platform == \"x32\" then target =\"MachineX86\"\nelseif cfg.platform == \"x64\" then target =\"MachineX64\"\nend\n_p(3,'%s', target)\nend\nfunction import_lib(cfg)\nif cfg.kind == \"SharedLib\" then\nlocal implibname = cfg.linktarget.fullpath\n_p(3,'%s',iif(cfg.flags.NoImportLib, cfg.objectsdir .. \"\\\\\" .. path.getname(implibname), implibname))\nend\nend\nfunction common_link_section(cfg)\n_p(3,'%s',iif(cfg.kind == \"ConsoleApp\",\"Console\", \"Windows\"))\nif cfg.flags.Symbols then \n_p(3,'true')\nelse\n_p(3,'false')\nend\nif optimisation(cfg) ~= \"Disabled\" then\n_p(3,'true')\n_p(3,'true')\nend\n_p(3,'$(OutDir)%s." - "pdb'\n, path.getbasename(cfg.buildtarget.name))\nend\nfunction item_link(cfg)\n_p(2,'')\nif cfg.kind ~= 'StaticLib' then\nif #cfg.links > 0 then\n_p(3,'%s;%%(AdditionalDependencies)',\ntable.concat(premake.getlinks(cfg, \"all\", \"fullpath\"), \";\"))\nend\n_p(3,'$(OutDir)%s', cfg.buildtarget.name)\n_p(3,'%s%s%%(AdditionalLibraryDirectories)',\ntable.concat(premake.esc(path.translate(cfg.libdirs, '\\\\')) , \";\"),\niif(cfg.libdirs and #cfg.libdirs >0,';',''))\ncommon_link_section(cfg)\nif (cfg.kind == \"ConsoleApp\" or cfg.kind == \"WindowedApp\") and not cfg.flags.WinMain then\n_p(3,'mainCRTStartup')\nend\nimport_lib(cfg)\n_p(3,'%s', iif(cfg.platform == \"x64\", \"MachineX64\", \"MachineX86\"))\nelse\ncommon_link_section(cfg)\nend\n_p(2,'')\nend\n \nfunction item_defi" - "nitions(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(1,''\n,premake.esc(cfginfo.name))\nvs10_clcompile(cfg)\nresource_compile(cfg)\nitem_def_lib(cfg)\nitem_link(cfg)\nevent_hooks(cfg)\n_p(1,'')\nend\nend\nfunction get_file_extension(file)\nlocal ext_start,ext_end = string.find(file,\"%.[%w_%-]+$\")\nif ext_start then\nreturn string.sub(file,ext_start+1,ext_end)\nend\nend\nfunction sort_input_files(files,sorted_container)\nlocal types = \n{\nh= \"ClInclude\",\nhpp= \"ClInclude\",\nhxx= \"ClInclude\",\nc= \"ClCompile\",\ncpp= \"ClCompile\",\ncxx= \"ClCompile\",\ncc= \"ClCompile\"\n}\nfor _, current_file in ipairs(files) do\nlocal translated_path = path.translate(current_file, '\\\\')\nlocal ext = get_file_extension(translated_path)\nif ext then\nlocal type = types[ext]\nif type then\ntable.insert(sorted_contai" - "ner[type],translated_path)\nelse\ntable.insert(sorted_container.None,translated_path)\nend\nend\nend\nend\n -- \n -- {8fd826f8-3739-44e6-8cc8-997122e53b8d}\n -- \n -- \nfunction write_file_type_block(files,group_type)\nif #files > 0 then\n_p(1,'')\nfor _, current_file in ipairs(files) do\n_p(2,'<%s Include=\\\"%s\\\" />', group_type,current_file)\nend\n_p(1,'')\nend\nend\nfunction vcxproj_files(prj)\nlocal sorted =\n{\nClCompile={},\nClInclude={},\nNone={}\n}\ncfg = premake.getconfig(prj)\nsort_input_files(cfg.files,sorted)\nwrite_file_type_block(sorted.ClInclude,\"ClInclude\")\nwrite_file_type_block(sorted.ClCompile,'ClCompile')\nwrite_file_type_block(sorted.None,'None')\nend\nfunction write_filter_includes(sorted_table)\nlocal directories = table_of_file_filters(sorted_table)\nif #directories >0 then\n_p(1,'')\nfor _, dir in pairs(directories) do\n_p(2,'',dir)\n_p(3,'{%s}',os.uuid())\n_p(2,'')\nend\n_p(1,'')\nend\nend\nfunction write_file_filter_block(files,group_type)\nif #files > 0 then\n_p(1,'')\nfor _, current_file in ipairs(files) do\nlocal path_to_file = file_path(current_file)\nif path_to_file then\n_p(2,'<%s Include=\\\"%s\\\">', group_type,path.translate(current_file, \"\\\\\"))\n_p(3,'%s',path_to_file)\n_p(2,'',group_type)\nelse\n_p(2,'<%s Include=\\\"%s\\\" />', group_type,path.translate(current_file, \"\\\\\"))\nend\nend\n_p(1,'')\nend\nend\nfunction vcxproj_filter_files(prj)\nlocal sorted =\n{\nClCompile={},\nClInclude={},\nNone={}\n}\ncfg = premake.getconfig(prj)\nsort_input_files(cfg.files,sorted)\nio.eol = \"\\r\\n\"\n_p('')\n_p('')\nwrite_filter_includes(sorted)\nwrite_file_filter_block(sorted" - ".ClInclude,\"ClInclude\")\nwrite_file_filter_block(sorted.ClCompile,\"ClCompile\")\nwrite_file_filter_block(sorted.None,\"None\")\n_p('')\nend\n -- \n -- \n -- \n -- Create\n -- Create\n --\n --\nfunction premake.vs2010_vcxproj(prj)\nio.eol = \"\\r\\n\"\n_p('')\n_p('')\nvs2010_config(prj)\nvs2010_globals(prj)\n_p(1,'')\nconfig_type_block(prj)\n_p(1,'')\n_p(1,'')\n_p(1,'')\nimport_props(prj)\n_p(1,'')\nintermediate_and_out_dirs(prj)\nitem_definitions(prj)\nvcxproj_files(prj)\n_p(1,'')\n_p(1,'')\n_p(1,'')\n_p('')\nend\nfunction premake.vs2010_vcxproj_user(prj)\n_p('')\n_p('')\n_p('')\nend\nfunction premake.vs2010_vcxproj_filters(prj)\nvcxproj_filter_files(prj)\nend\nfunction premake.vs2010_cleansolution(sln)\npremake.clean.file(sln, \"%%.sln\")\npremake.clean.file(sln, \"%%.suo\")\nend\nfunction premake.vs2010_cleanproject(prj)\nio.write('vs2010 clean action')\nlocal fname = premake.project.getfilename(prj, \"%%\")\nlocal vcxname = fname .. \".vcxproj\"\nio.write(vcxname)\nos.remove(fname .. '.vcxproj')\nos.remove(fname .. '.vcxproj.user')\nos" - ".remove(fname .. '.vcxproj.filters')\nos.remove(fname .. '.sdf')\nlocal userfiles = os.matchfiles(fname .. \".vcxproj.user\")\nfor _, fname in ipairs(userfiles) do\nos.remove(fname)\nend\nlocal filter_files = os.matchfiles(fname .. \".vcxproj.filter\")\nfor _, fname in ipairs(filter_files) do\nos.remove(fname)\nend\nlocal proj_files = os.matchfiles(fname .. \".vcxproj\")\nfor _, fname in ipairs(proj_files) do\nos.remove(fname)\nend\nlocal sdf_files = os.matchfiles(fname .. \".sdf\")\nfor _, fname in ipairs(sdf_files) do\nos.remove(fname)\nend\nend\nfunction premake.vs2010_cleantarget(name)\nos.remove(name .. \".pdb\")\nos.remove(name .. \".idb\")\nos.remove(name .. \".ilk\")\nend\n", + "\npremake.vstudio.vs10_helpers = { }\nlocal vs10_helpers = premake.vstudio.vs10_helpers\nfunction vs10_helpers.remove_relative_path(file)\nfile = file:gsub(\"%.%.\\\\\",'')\nfile = file:gsub(\"%.\\\\\",'')\nreturn file\nend\nfunction vs10_helpers.file_path(file)\nfile = vs10_helpers.remove_relative_path(file)\nlocal path = string.find(file,'\\\\[%w%.%_%-]+$')\nif path then\nreturn string.sub(file,1,path-1)\nelse\nreturn nil\nend\nend\nfunction vs10_helpers.list_of_directories_in_path(path)\nlocal list={}\nif path then\nfor dir in string.gmatch(path,\"[%w%-%_%.]+\\\\\")do\nif #list == 0 then\nlist[1] = dir:sub(1,#dir-1)\nelse\nlist[#list +1] = list[#list] ..\"\\\\\" ..dir:sub(1,#dir-1)\nend\nend\nend\nreturn list\nend\nfunction vs10_helpers.table_of_filters(t)\nlocal filters ={}\nfor key, value in pairs(t) do\nlocal result = vs10_helpers.list_of_directories_in_path(value)\nfor __,dir in ipairs(result) do\nif table.contains(filters,dir) ~= true then\nfilters[#filters +1] = dir\nend\nend\nend\nreturn filters\nend" + "\nfunction vs10_helpers.table_of_file_filters(files)\nlocal filters ={}\nfor key, valueTable in pairs(files) do\nfor _, entry in ipairs(valueTable) do\nlocal result = vs10_helpers.list_of_directories_in_path(entry)\nfor __,dir in ipairs(result) do\nif table.contains(filters,dir) ~= true then\nfilters[#filters +1] = dir\nend\nend\nend\nend\nreturn filters\nend\nfunction vs10_helpers.get_file_extension(file)\nlocal ext_start,ext_end = string.find(file,\"%.[%w_%-]+$\")\nif ext_start then\nreturn string.sub(file,ext_start+1,ext_end)\nend\nend\nfunction vs10_helpers.sort_input_files(files,sorted_container)\nlocal types = \n{\nh= \"ClInclude\",\nhpp= \"ClInclude\",\nhxx= \"ClInclude\",\nc= \"ClCompile\",\ncpp= \"ClCompile\",\ncxx= \"ClCompile\",\ncc= \"ClCompile\"\n}\nfor _, current_file in ipairs(files) do\nlocal translated_path = path.translate(current_file, '\\\\')\nlocal ext = vs10_helpers.get_file_extension(translated_path)\nif ext then\nlocal type = types[ext]\nif type then\ntable.insert(sorted_container[type" + "],translated_path)\nelse\ntable.insert(sorted_container.None,translated_path)\nend\nend\nend\nend\nlocal function vs2010_config(prj)\n_p(1,'')\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\n_p(2,'', premake.esc(cfginfo.name))\n_p(3,'%s',cfginfo.buildcfg)\n_p(3,'%s',cfginfo.platform)\n_p(2,'')\nend\n_p(1,'')\nend\nlocal function vs2010_globals(prj)\n_p(1,'')\n_p(2,'{%s}',prj.uuid)\n_p(2,'%s',prj.name)\n_p(2,'Win32Proj')\n_p(1,'')\nend\nlocal function config_type(config)\nlocal t =\n{\nSharedLib = \"DynamicLibrary\",\nStaticLib = \"StaticLibrary\",\nConsoleApp = \"Application\",\n}\nreturn t[config.kind]\nend\nlocal function if_config_and_platform()\nreturn 'Condition=\"\\'$(Configuration)|$(Platform)'\nend\nloc" + "al function optimisation(cfg)\nlocal result = \"Disabled\"\nfor _, value in ipairs(cfg.flags) do\nif (value == \"Optimize\") then\nresult = \"Full\"\nelseif (value == \"OptimizeSize\") then\nresult = \"MinSpace\"\nelseif (value == \"OptimizeSpeed\") then\nresult = \"MaxSpeed\"\nend\nend\nreturn result\nend\nlocal function config_type_block(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(1,''\n, premake.esc(cfginfo.name))\n_p(2,'%s',config_type(cfg))\n_p(2,'%s',iif(cfg.flags.Unicode,\"Unicode\",\"MultiByte\"))\nif cfg.flags.MFC then\n_p(2,'Dynamic')\nend\nlocal use_debug = \"false\"\nif optimisation(cfg) == \"Disabled\" then \nuse_debug = \"true\" \nelse\n_p(2,'true')\nend\n_p(2,'%s',use_debug)\n_p(1,'')\nend\nend\nlocal function import_props(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(1,''\n,premake.esc(cfginfo.name))\n_p(2,'')\n_p(1,'')\nend\nend\nlocal function incremental_link(cfg,cfginfo)\nif cfg.kind ~= \"StaticLib\" then\nShoudLinkIncrementally = 'false'\nif optimisation(cfg) == \"Disabled\" then\nShoudLinkIncrementally = 'true'\nend\n_p(2,'%s'\n,premake.esc(cfginfo.name),ShoudLinkIncrementally)\nend\nend\nlocal function ignore_import_lib(cfg,cfginfo)\nif cfg.kind ==" + " \"SharedLib\" then\nlocal shouldIgnore = \"false\"\nif cfg.flags.NoImportLib then shouldIgnore = \"true\" end\n _p(2,'%s'\n,premake.esc(cfginfo.name),shouldIgnore)\nend\nend\nlocal function intermediate_and_out_dirs(prj)\n_p(1,'')\n_p(2,'<_ProjectFileVersion>10.0.30319.1')\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(2,'%s\\\\'\n, premake.esc(cfginfo.name),premake.esc(cfg.buildtarget.directory) )\n_p(2,'%s\\\\'\n, premake.esc(cfginfo.name), premake.esc(cfg.objectsdir))\n_p(2,'%s'\n,premake.esc(cfginfo.name),path.getbasename(cfg.buildtarget.name))\nignore_import_lib(cfg,cfginfo)\nincremental_l" + "ink(cfg,cfginfo)\nif cfg.flags.NoManifest then\n_p(2,'false'\n,premake.esc(cfginfo.name))\nend\nend\n_p(1,'')\nend\nlocal function runtime(cfg)\nlocal runtime\nif cfg.flags.StaticRuntime then\nruntime = iif(cfg.flags.Symbols,\"MultiThreadedDebug\",\"MultiThreaded\")\nelse\nruntime = iif(cfg.flags.Symbols, \"MultiThreadedDebugDLL\", \"MultiThreadedDLL\")\nend\nreturn runtime\nend\nlocal function precompiled_header(cfg)\n if not cfg.flags.NoPCH and cfg.pchheader then\n_p(3,'Use')\n_p(3,'%s', path.getname(cfg.pchheader))\nelse\n_p(3,'')\nend\nend\nlocal function preprocessor(indent,cfg)\nif #cfg.defines > 0 then\n_p(indent,'%s;%%(PreprocessorDefinitions)'\n,premake.esc(table.concat(cfg.defines, \";\")))\nelse\n_p(indent,'')\nend\nend\nlocal function include_dirs(indent,cfg)\nif #cfg.includedirs > 0 then\n_p(indent,'%s;%%(AdditionalIncludeDirectories)'\n,premake.esc(path.translate(table.concat(cfg.includedirs, \";\"), '\\\\')))\nend\nend\nlocal function resource_compile(cfg)\n_p(2,'')\npreprocessor(3,cfg)\ninclude_dirs(3,cfg)\n_p(2,'')\nend\nlocal function exceptions(cfg)\nif cfg.flags.NoExceptions then\n_p(2,'false')\nelseif cfg.flags.SEH then\n_p(2,'Async')\nend\nend\nlocal function rtti(cfg)\nif cfg.flags.NoRTTI then\n_p(3,'false')\nend\nend\nlocal function wchar_t_buildin(cfg)\nif cfg.flags.NativeWChar then\n_p(3,'true')\nelseif cfg.flags.NoNativeWChar then\n_p(3,'false')\nend" + "\nend\nlocal function sse(cfg)\nif cfg.flags.EnableSSE then\n_p(3,'StreamingSIMDExtensions')\nelseif cfg.flags.EnableSSE2 then\n_p(3,'StreamingSIMDExtensions2')\nend\nend\nlocal function floating_point(cfg)\n if cfg.flags.FloatFast then\n_p(3,'Fast')\nelseif cfg.flags.FloatStrict then\n_p(3,'Strict')\nend\nend\nlocal function debug_info(cfg)\nif cfg.flags.Symbols and not cfg.flags.NoEditAndContinue then\n_p(3,'EditAndContinue')\nelse\n_p(3,'')\nend\nend\nlocal function minimal_build(cfg)\nif cfg.flags.Symbols and not cfg.flags.NoMinimalRebuild then\n_p(3,'true')\nelseif cfg.flags.Symbols then\n_p(3,'false')\nend\nend\nlocal function compile_lang" + "uage(cfg)\nif cfg.language == \"C\" then\n_p(3,'CompileAsC')\nend\nend\nlocal function vs10_clcompile(cfg)\n_p(2,'')\nif #cfg.buildoptions > 0 then\n_p(3,'%s %%(AdditionalOptions)',\ntable.concat(premake.esc(cfg.buildoptions), \" \"))\nend\n_p(3,'%s',optimisation(cfg))\ninclude_dirs(3,cfg)\npreprocessor(3,cfg)\nminimal_build(cfg)\nif optimisation(cfg) == \"Disabled\" then\n_p(3,'EnableFastChecks')\nif cfg.flags.ExtraWarnings then\n_p(3,'true')\nend\nelse\n_p(3,'true')\nend\n_p(3,'%s', runtime(cfg))\n_p(3,'true')\nprecompiled_header(cfg)\nif cfg.flags.ExtraWarnings then\n_p(3,'Level4')\nelse\n_p(3,'Level3')\nend\nif cfg.flags.FatalWarnings then\n_p(3,'true')\nend\nexceptions(cfg)\nrtti(cfg)\nwchar_t_buildin(cfg)\nsse(cfg)\nfloating_point(cfg)\ndebug_info(cfg)\nif cfg.flags.NoFramePointer then\n_p(3,'true')\nend\ncompile_language(cfg)\n_p(2,'')\nend\nlocal function event_hooks(cfg)\nif #cfg.postbuildcommands> 0 then\n _p(2,'')\n_p(3,'%s',premake.esc(table.implode(cfg.postbuildcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'')\nend\nif #cfg.prebuildcommands> 0 then\n _p(2,'')\n_p(3,'%s',premake.esc(table.implode(cfg.prebuildcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'')\nend\nif #cfg.prelinkcommands> 0 then\n _p(2,'')\n_p(3,'%s',premake.esc(table.implode(cfg.prelinkcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'')\nend\nend\nlocal function item_def_lib(cfg)\nif cfg.kind == 'StaticLib' then\n_p(1,'')\n_p(2,'$(OutDir)%s',cfg.buildtarget.name)\n_p(1,'')\nend\nend\nlocal function link_target_machine(cfg)\nlocal target\nif cfg.platform == nil or cfg.platform == \"x32\" then target =\"MachineX86\"\nelseif cfg.platform == \"x64\" then target =\"MachineX64\"\nend\n_p(3,'%s', target)\nend\nlocal function import_lib(cfg)\nif cfg.kind == \"SharedLib\" then\nlocal implibname = cfg.linktarget.fullpath\n_p(3,'%s',iif(cfg.flags.NoImportLib, cfg.objectsdir .. \"\\\\\" .. path.getname(implibname), implibname))\nend\nend\nlocal function common_link_section(cfg)\n_p(3,'%s',iif(cfg.kind == \"ConsoleApp\",\"Console\", \"Windows\"))\nif cfg.flags.Symbols then \n_p(3,'true')\nelse\n_p(3,'false')\nend\nif optimisation(cfg) ~= \"Disabled\" then\n_p(3,'true')\n_p(3,'true')\nend\n_p(3,'$(OutDir)%s.pdb'\n, path.getbasename(cfg.buildtarget.name))\nend\nlocal function item_link(cfg)\n_p(2,'')\nif cfg.kind ~= 'StaticLib' then\nif #cfg.links > 0 then\n_p(3,'%s;%%(AdditionalDependencies)',\ntable.concat(premake.getlinks(cfg, \"all\", \"fullpath\"), \";\"))\nend\n_p(3,'$(OutDir)%s', cfg.buildtarget.name)\n_p(3,'%s%s%%(AdditionalLibraryDirectories)',\ntable.concat(premake.esc(path.translate(cfg.libdirs, '\\\\')) , \";\"),\niif(cfg.libdirs and #cfg.libdirs >0,';',''))\ncommon_link_section(cfg)\nif (cfg.kind == \"ConsoleApp\" or cfg.kind == \"WindowedApp\") and not cfg.flags.WinMain then\n_p(3,'mainCRTStartup')\nend\nimport_lib(cfg)\n_p(3,'%s', iif(cfg.platform == \"x64\", \"MachineX64\", \"MachineX86\"))\nelse\ncommon_link_s" + "ection(cfg)\nend\n_p(2,'')\nend\n \nlocal function item_definitions(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(1,''\n,premake.esc(cfginfo.name))\nvs10_clcompile(cfg)\nresource_compile(cfg)\nitem_def_lib(cfg)\nitem_link(cfg)\nevent_hooks(cfg)\n_p(1,'')\nend\nend\n -- \n -- {8fd826f8-3739-44e6-8cc8-997122e53b8d}\n -- \n -- \nlocal function write_file_type_block(files,group_type)\nif #files > 0 then\n_p(1,'')\nfor _, current_file in ipairs(files) do\n_p(2,'<%s Include=\\\"%s\\\" />', group_type,current_file)\nend\n_p(1,'')\nend\nend\nlocal function vcxproj_files(prj)\nlocal sorted =\n{\nClCompile={},\nClInclude={},\nNone={}\n}\ncfg = premake.getconfig(prj)\nvs10_h" + "elpers.sort_input_files(cfg.files,sorted)\nwrite_file_type_block(sorted.ClInclude,\"ClInclude\")\nwrite_file_type_block(sorted.ClCompile,'ClCompile')\nwrite_file_type_block(sorted.None,'None')\nend\nlocal function write_filter_includes(sorted_table)\nlocal directories = vs10_helpers.table_of_file_filters(sorted_table)\nif #directories >0 then\n_p(1,'')\nfor _, dir in pairs(directories) do\n_p(2,'',dir)\n_p(3,'{%s}',os.uuid())\n_p(2,'')\nend\n_p(1,'')\nend\nend\nlocal function write_file_filter_block(files,group_type)\nif #files > 0 then\n_p(1,'')\nfor _, current_file in ipairs(files) do\nlocal path_to_file = vs10_helpers.file_path(current_file)\nif path_to_file then\n_p(2,'<%s Include=\\\"%s\\\">', group_type,path.translate(current_file, \"\\\\\"))\n_p(3,'%s',path_to_file)\n_p(2,'',group_type)\nelse\n_p(2,'<%s Include=\\\"%s\\\" />', group_type,path.translate(current_file, \"\\\\\"))\ne" + "nd\nend\n_p(1,'')\nend\nend\nlocal function vcxproj_filter_files(prj)\nlocal sorted =\n{\nClCompile={},\nClInclude={},\nNone={}\n}\ncfg = premake.getconfig(prj)\nvs10_helpers.sort_input_files(cfg.files,sorted)\nio.eol = \"\\r\\n\"\n_p('')\n_p('')\nwrite_filter_includes(sorted)\nwrite_file_filter_block(sorted.ClInclude,\"ClInclude\")\nwrite_file_filter_block(sorted.ClCompile,\"ClCompile\")\nwrite_file_filter_block(sorted.None,\"None\")\n_p('')\nend\n -- \n -- \n -- \n -- Create\n -- Create\n --\n --\nfunction premake.vs2010_vcxproj(prj)" + "\nio.eol = \"\\r\\n\"\n_p('')\n_p('')\nvs2010_config(prj)\nvs2010_globals(prj)\n_p(1,'')\nconfig_type_block(prj)\n_p(1,'')\n_p(1,'')\n_p(1,'')\nimport_props(prj)\n_p(1,'')\nintermediate_and_out_dirs(prj)\nitem_definitions(prj)\nvcxproj_files(prj)\n_p(1,'')\n_p(1,'')\n_p(1,'')\n_p('')\nend\nfunction premake.vs2010_vcxproj_user(prj)\n_p('')\n_p('')\n_p('')\nend\nfuncti" + "on premake.vs2010_vcxproj_filters(prj)\nvcxproj_filter_files(prj)\nend\n", /* actions/xcode/_xcode.lua */ "premake.xcode = { }\nnewaction \n{\ntrigger = \"xcode3\",\nshortname = \"Xcode 3\",\ndescription = \"Generate Apple Xcode 3 project files (experimental)\",\nos = \"macosx\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"SharedLib\", \"StaticLib\" },\nvalid_languages = { \"C\", \"C++\" },\nvalid_tools = {\ncc = { \"gcc\" },\n},\nvalid_platforms = { \nNative = \"Native\", \nx32 = \"Native 32-bit\", \nx64 = \"Native 64-bit\", \nUniversal32 = \"32-bit Universal\", \nUniversal64 = \"64-bit Universal\", \nUniversal = \"Universal\",\n},\ndefault_platform = \"Universal\",\nonsolution = function(sln)\npremake.xcode.preparesolution(sln)\nend,\nonproject = function(prj)\npremake.generate(prj, \"%%.xcodeproj/project.pbxproj\", premake.xcode.project)\nend,\noncleanproject = function(prj)\npremake.clean.directory(prj, \"%%.xcodeproj\")\nend,\noncheckproject = function(prj)\nlocal last\nfor cfg in premake.eachconfig(prj) do\nif last and last ~= cfg.kind then\nerror(\"Project '" @@ -280,9 +280,8 @@ const char* builtin_scripts[] = { "BXProject(tr)\nxcode.PBXReferenceProxy(tr)\nxcode.PBXResourcesBuildPhase(tr)\nxcode.PBXShellScriptBuildPhase(tr)\nxcode.PBXSourcesBuildPhase(tr)\nxcode.PBXVariantGroup(tr)\nxcode.PBXTargetDependency(tr)\nxcode.XCBuildConfiguration(tr)\nxcode.XCBuildConfigurationList(tr)\nxcode.Footer(tr)\nend\n", /* actions/clean/_clean.lua */ - "premake.clean = { }\nfunction premake.clean.directory(obj, pattern)\nlocal fname = premake.project.getfilename(obj, pattern)\nos.rmdir(fname)\nend\nfunction premake.clean.file(obj, pattern)\nlocal fname = premake.project.getfilename(obj, pattern)\nos.remove(fname)\nend\nnewaction {\ntrigger = \"clean\",\ndescription = \"Remove all binaries and generated files\",\nonsolution = function(sln)\nfor action in premake.action.each() do\nif action.oncleansolution then\naction.oncleansolution(sln)\nend\nend\nend,\nonproject = function(prj)\nfor action in premake.action.each() do\nif action.trigger ==\"vs2010\" then\nif action.oncleanproject then\nio.write('vs2010 has an on clean and we are going to call it\\n')\nelse\nio.write('vs2010 does not have an on clean\\n')\nend\nif action.oncleansolution then\nio.write('vs2010 has an oncleansolution and we are going to call it\\n')\nelse\nio.write('vs2010 does not have an oncleansolution\\n')\nend\nif action.oncleantarget then\nio.write('vs2010 has an oncleantarget and we " - "are going to call it\\n')\nelse\nio.write('vs2010 does not have an oncleantarget\\n')\nend\nend\nif action.oncleanproject then\naction.oncleanproject(prj)\nend\nend\nif (prj.objectsdir) then\npremake.clean.directory(prj, prj.objectsdir)\nend\nlocal platforms = prj.solution.platforms or { }\nif not table.contains(platforms, \"Native\") then\nplatforms = table.join(platforms, { \"Native\" })\nend\nfor _, platform in ipairs(platforms) do\nfor cfg in premake.eachconfig(prj, platform) do\npremake.clean.directory(prj, cfg.objectsdir)\npremake.clean.file(prj, premake.gettarget(cfg, \"build\", \"posix\", \"windows\", \"windows\").fullpath)\npremake.clean.file(prj, premake.gettarget(cfg, \"build\", \"posix\", \"posix\", \"linux\").fullpath)\npremake.clean.file(prj, premake.gettarget(cfg, \"build\", \"posix\", \"posix\", \"macosx\").fullpath)\npremake.clean.file(prj, premake.gettarget(cfg, \"build\", \"posix\", \"PS3\", \"windows\").fullpath)\nif cfg.kind == \"WindowedApp\" then\npremake.clean.directory(prj, premake.get" - "target(cfg, \"build\", \"posix\", \"posix\", \"linux\").fullpath .. \".app\")\nend\npremake.clean.file(prj, premake.gettarget(cfg, \"link\", \"windows\", \"windows\", \"windows\").fullpath)\npremake.clean.file(prj, premake.gettarget(cfg, \"link\", \"posix\", \"posix\", \"linux\").fullpath)\nlocal target = path.join(premake.project.getfilename(prj, cfg.buildtarget.directory), cfg.buildtarget.basename)\nfor action in premake.action.each() do\nif action.oncleantarget then\naction.oncleantarget(target)\nend\nend\nend\nend\nend\n}\n", + "premake.clean = { }\nfunction premake.clean.directory(obj, pattern)\nlocal fname = premake.project.getfilename(obj, pattern)\nos.rmdir(fname)\nend\nfunction premake.clean.file(obj, pattern)\nlocal fname = premake.project.getfilename(obj, pattern)\nos.remove(fname)\nend\nnewaction {\ntrigger = \"clean\",\ndescription = \"Remove all binaries and generated files\",\nonsolution = function(sln)\nfor action in premake.action.each() do\nif action.oncleansolution then\naction.oncleansolution(sln)\nend\nend\nend,\nonproject = function(prj)\nfor action in premake.action.each() do\nif action.oncleanproject then\naction.oncleanproject(prj)\nend\nend\nif (prj.objectsdir) then\npremake.clean.directory(prj, prj.objectsdir)\nend\nlocal platforms = prj.solution.platforms or { }\nif not table.contains(platforms, \"Native\") then\nplatforms = table.join(platforms, { \"Native\" })\nend\nfor _, platform in ipairs(platforms) do\nfor cfg in premake.eachconfig(prj, platform) do\npremake.clean.directory(prj, cfg.objectsdir)\nprema" + "ke.clean.file(prj, premake.gettarget(cfg, \"build\", \"posix\", \"windows\", \"windows\").fullpath)\npremake.clean.file(prj, premake.gettarget(cfg, \"build\", \"posix\", \"posix\", \"linux\").fullpath)\npremake.clean.file(prj, premake.gettarget(cfg, \"build\", \"posix\", \"posix\", \"macosx\").fullpath)\npremake.clean.file(prj, premake.gettarget(cfg, \"build\", \"posix\", \"PS3\", \"windows\").fullpath)\nif cfg.kind == \"WindowedApp\" then\npremake.clean.directory(prj, premake.gettarget(cfg, \"build\", \"posix\", \"posix\", \"linux\").fullpath .. \".app\")\nend\npremake.clean.file(prj, premake.gettarget(cfg, \"link\", \"windows\", \"windows\", \"windows\").fullpath)\npremake.clean.file(prj, premake.gettarget(cfg, \"link\", \"posix\", \"posix\", \"linux\").fullpath)\nlocal target = path.join(premake.project.getfilename(prj, cfg.buildtarget.directory), cfg.buildtarget.basename)\nfor action in premake.action.each() do\nif action.oncleantarget then\naction.oncleantarget(target)\nend\nend\nend\nend\nend\n}\n", /* _premake_main.lua */ "local scriptfile = \"premake4.lua\"\nlocal shorthelp = \"Type 'premake4 --help' for help\"\nlocal versionhelp = \"premake4 (Premake Build Script Generator) %s\"\nlocal function injectplatform(platform)\nif not platform then return true end\nplatform = premake.checkvalue(platform, premake.fields.platforms.allowed)\nfor sln in premake.solution.each() do\nlocal platforms = sln.platforms or { }\nif #platforms == 0 then\ntable.insert(platforms, \"Native\")\nend\nif not table.contains(platforms, \"Native\") then\nreturn false, sln.name .. \" does not target native platform\\nNative platform settings are required for the --platform feature.\"\nend\nif not table.contains(platforms, platform) then\ntable.insert(platforms, platform)\nend\nsln.platforms = platforms\nend\nreturn true\nend\nfunction _premake_main(scriptpath)\nif (scriptpath) then\nlocal scripts = dofile(scriptpath .. \"/_manifest.lua\")\nfor _,v in ipairs(scripts) do\ndofile(scriptpath .. \"/\" .. v)\nend\nend\npremake.action.set(_ACTION)\nmath.r" -- cgit v1.2.3 From 8f528386ddaec35f8d69c0340edb901297f425c7 Mon Sep 17 00:00:00 2001 From: LiamDevine Date: Thu, 15 Jul 2010 01:46:27 +0100 Subject: removing dead code --- src/actions/vstudio/_vstudio.lua | 30 ++---------------------------- 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/src/actions/vstudio/_vstudio.lua b/src/actions/vstudio/_vstudio.lua index 3215311..8da2118 100644 --- a/src/actions/vstudio/_vstudio.lua +++ b/src/actions/vstudio/_vstudio.lua @@ -289,47 +289,21 @@ function premake.vs2010_cleansolution(sln) premake.clean.file(sln, "%%.sln") premake.clean.file(sln, "%%.suo") - --premake.clean.file(sln, "%%.sdf") end - function premake.vs2010_cleanproject(prj) - --io.write('vs2010 clean action') + function premake.vs2010_cleanproject(prj) local fname = premake.project.getfilename(prj, "%%") - local vcxname = fname .. ".vcxproj" - --io.write(vcxname) + local vcxname = fname .. ".vcxproj" os.remove(fname .. '.vcxproj') os.remove(fname .. '.vcxproj.user') os.remove(fname .. '.vcxproj.filters') os.remove(fname .. '.sdf') - - --local userfiles = os.matchfiles(fname .. ".vcxproj.user") - --for _, fname in ipairs(userfiles) do - -- os.remove(fname) - --end - - --local filter_files = os.matchfiles(fname .. ".vcxproj.filter") - --for _, fname in ipairs(filter_files) do - -- os.remove(fname) - --end - - --local proj_files = os.matchfiles(fname .. ".vcxproj") - --for _, fname in ipairs(proj_files) do - -- os.remove(fname) - --end - - --local sdf_files = os.matchfiles(fname .. ".sdf") - --for _, fname in ipairs(sdf_files) do - -- os.remove(fname) - --end - end function premake.vs2010_cleantarget(name) os.remove(name .. ".pdb") os.remove(name .. ".idb") os.remove(name .. ".ilk") - --os.remove(name .. ".vshost.exe") - --os.remove(name .. ".exe.manifest") end -- cgit v1.2.3