check why <MinimalRebuild>true</MinimalRebuild> is missing in a debug static lib and shared lib build
--------Requires symbols to be set in flags shared lib missing <DebugInformationFormat>EditAndContinue</DebugInformationFormat> in ClCompile section --------Requires symbols to be set in flags shared lib incorrectly <GenerateDebugInformation>true</GenerateDebugInformation> to false in link section --------Requires symbols to be set in flags shared lib LinkIncremental set to incorrect value of false ---Fixed and tests wrote check all configs %(AdditionalIncludeDirectories) missing before AdditionalIncludeDirectories end tag in ClCompile ---Fixed if no include Directories supplied, this tag is not present
This commit is contained in:
parent
e1ca7109f1
commit
5c4d3cd478
@ -50,13 +50,29 @@ premake.vstudio.vcxproj = { }
|
||||
_p(1,'</ImportGroup>')
|
||||
end
|
||||
end
|
||||
function incremental_link(cfg)
|
||||
if optimisation(cfg) ~= "Disabled" then
|
||||
return 'true'
|
||||
else
|
||||
return 'false'
|
||||
--NOTE: check this is correct
|
||||
function incremental_link(cfg,cfginfo)
|
||||
if cfg.kind ~= "StaticLib" then
|
||||
ShoudLinkIncrementally = 'false'
|
||||
if optimisation(cfg) == "Disabled" then
|
||||
ShoudLinkIncrementally = 'true'
|
||||
end
|
||||
|
||||
_p(2,'<LinkIncremental Condition="\'$(Configuration)|$(Platform)\'==\'%s\'">%s</LinkIncremental>'
|
||||
,premake.esc(cfginfo.name),ShoudLinkIncrementally)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function ignore_import_lib(cfg,cfginfo)
|
||||
if cfg.kind == "SharedLib" then
|
||||
local shouldIgnore = "false"
|
||||
if cfg.flags.NoImportLib then shouldIgnore = "true" end
|
||||
_p(2,'<IgnoreImportLibrary Condition="\'$(Configuration)|$(Platform)\'==\'%s\'">%s</IgnoreImportLibrary>'
|
||||
,premake.esc(cfginfo.name),shouldIgnore)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--needs revisiting for when there are dependency projects
|
||||
function intermediate_and_out_dirs(prj)
|
||||
_p(1,'<PropertyGroup>')
|
||||
@ -66,9 +82,9 @@ premake.vstudio.vcxproj = { }
|
||||
local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)
|
||||
_p(2,'<OutDir Condition="\'$(Configuration)|$(Platform)\'==\'%s\'">%s</OutDir>', premake.esc(cfginfo.name),premake.esc(cfg.buildtarget.directory) )
|
||||
_p(2,'<IntDir Condition="\'$(Configuration)|$(Platform)\'==\'%s\'">%s</IntDir>', premake.esc(cfginfo.name), premake.esc(cfg.objectsdir))
|
||||
|
||||
_p(2,'<LinkIncremental Condition="\'$(Configuration)|$(Platform)\'==\'%s\'">%s</LinkIncremental>',premake.esc(cfginfo.name),incremental_link(cfg))
|
||||
|
||||
ignore_import_lib(cfg,cfginfo)
|
||||
--_p(2,'<LinkIncremental Condition="\'$(Configuration)|$(Platform)\'==\'%s\'">%s</LinkIncremental>',premake.esc(cfginfo.name),incremental_link(cfg))
|
||||
incremental_link(cfg,cfginfo)
|
||||
if cfg.flags.NoManifest then
|
||||
_p(2,'<GenerateManifest Condition="\'$(Configuration)|$(Platform)\'==\'%s\'">false</GenerateManifest>',premake.esc(cfginfo.name))
|
||||
end
|
||||
@ -138,9 +154,8 @@ premake.vstudio.vcxproj = { }
|
||||
|
||||
function include_dirs(indent,cfg)
|
||||
if #cfg.includedirs > 0 then
|
||||
_p(indent,'<AdditionalIncludeDirectories>%s;%%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>',premake.esc(path.translate(table.concat(cfg.includedirs, ";"), '\\')))
|
||||
else
|
||||
_p(indent,'<AdditionalIncludeDirectories></AdditionalIncludeDirectories>')
|
||||
_p(indent,'<AdditionalIncludeDirectories>%s;%%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>'
|
||||
,premake.esc(path.translate(table.concat(cfg.includedirs, ";"), '\\')))
|
||||
end
|
||||
end
|
||||
|
||||
@ -309,6 +324,17 @@ premake.vstudio.vcxproj = { }
|
||||
_p(3,'<TargetMachine>%s</TargetMachine>', target)
|
||||
end
|
||||
|
||||
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
|
||||
--_p(3,'ImportLibrary="%s"', iif(cfg.flags.NoImportLib, cfg.objectsdir .. "\\" .. path.getname(implibname), implibname))
|
||||
_p(3,'<ImportLibrary> nothing to see here</ImportLibrary>')
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
function item_link(cfg)
|
||||
if cfg.kind ~= 'StaticLib' then
|
||||
_p(2,'<Link>')
|
||||
@ -338,7 +364,9 @@ premake.vstudio.vcxproj = { }
|
||||
if (cfg.kind == "ConsoleApp" or cfg.kind == "WindowedApp") and not cfg.flags.WinMain then
|
||||
_p(3,'<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>')
|
||||
end
|
||||
|
||||
|
||||
import_lib(cfg)
|
||||
|
||||
_p(3,'<TargetMachine>%s</TargetMachine>', iif(cfg.platform == "x64", "MachineX64", "MachineX86"))
|
||||
|
||||
_p(2,'</Link>')
|
||||
@ -367,6 +395,8 @@ premake.vstudio.vcxproj = { }
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
--also translates file paths from '/' to '\\'
|
||||
function sort_input_files(files,sorted_container)
|
||||
local types =
|
||||
@ -442,6 +472,7 @@ premake.vstudio.vcxproj = { }
|
||||
_p(1,'</ItemGroup>')
|
||||
end
|
||||
end
|
||||
|
||||
function write_file_filter_block(files,group_type)
|
||||
if #files > 0 then
|
||||
_p(1,'<ItemGroup>')
|
||||
@ -458,6 +489,7 @@ premake.vstudio.vcxproj = { }
|
||||
_p(1,'</ItemGroup>')
|
||||
end
|
||||
end
|
||||
|
||||
function vcxproj_filter_files(prj)
|
||||
local sorted =
|
||||
{
|
||||
|
@ -84,19 +84,7 @@
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<GenerateDebugInformation>true</GenerateDebugInformation>')
|
||||
end
|
||||
--[[
|
||||
StaticLib does not have this section
|
||||
function vs10_links.subSystem_consoleApp_valueInTagsIsConsole()
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<SubSystem>Console</SubSystem>')
|
||||
end
|
||||
|
||||
function vs10_links.subSystem_StaticLib_valueInTagsIsWindows()
|
||||
kind "StaticLib"
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<SubSystem>Windows</SubSystem>')
|
||||
end
|
||||
--]]
|
||||
|
||||
|
||||
function vs10_links.noOptimiseFlag_optimizeReferences_isNotInBuffer()
|
||||
local buffer = get_buffer()
|
||||
|
@ -38,11 +38,109 @@
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<Lib>*.*<OutputFile>*.*MyProject.lib*.*</OutputFile>*.*</Lib>')
|
||||
end
|
||||
|
||||
--[[
|
||||
function vs10_project_kinds.sharedLib_fail_asIDoNotKnowWhatItShouldLookLike_printsTheBufferSoICanCompare()
|
||||
kind "SharedLib"
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'youWillNotFindThis')
|
||||
end
|
||||
--]]
|
||||
|
||||
|
||||
--[[
|
||||
check OutDir in debug it is showing "."
|
||||
shared lib missing <ImportLibrary>???</ImportLibrary> in link section when noInportLib not used
|
||||
--]]
|
||||
--check why <MinimalRebuild>true</MinimalRebuild> is missing in a debug static lib and shared lib build
|
||||
function vs10_project_kinds.staticLib_valueInMinimalRebuildIsTrue()
|
||||
kind "StaticLib"
|
||||
flags {"Symbols"}
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<ClCompile>*.*<MinimalRebuild>true</MinimalRebuild>*.*</ClCompile>')
|
||||
end
|
||||
function vs10_project_kinds.sharedLib_valueInMinimalRebuildIsTrue()
|
||||
kind "SharedLib"
|
||||
flags {"Symbols"}
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<ClCompile>*.*<MinimalRebuild>true</MinimalRebuild>*.*</ClCompile>')
|
||||
end
|
||||
--shared lib missing <DebugInformationFormat>EditAndContinue</DebugInformationFormat> in ClCompile section
|
||||
function vs10_project_kinds.sharedLib_valueDebugInformationFormatIsEditAndContinue()
|
||||
kind "SharedLib"
|
||||
flags {"Symbols"}
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<ClCompile>*.*<DebugInformationFormat>EditAndContinue</DebugInformationFormat>*.*</ClCompile>')
|
||||
end
|
||||
function vs10_project_kinds.sharedLib_valueGenerateDebugInformationIsTrue()
|
||||
kind "SharedLib"
|
||||
flags {"Symbols"}
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<Link>*.*<GenerateDebugInformation>true</GenerateDebugInformation>*.*</Link>')
|
||||
end
|
||||
function vs10_project_kinds.sharedLib_linkSectionContainsImportLibrary()
|
||||
kind "SharedLib"
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<Link>*.*<ImportLibrary>*.*</ImportLibrary>*.*</Link>')
|
||||
end
|
||||
--should this go in vs2010_flags???
|
||||
|
||||
function vs10_project_kinds.sharedLib_withNoImportLibraryFlag_linkSectionContainsImportLibrary()
|
||||
kind "SharedLib"
|
||||
flags{"NoImportLib"}
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<Link>*.*<ImportLibrary>*.*</ImportLibrary>*.*</Link>')
|
||||
end
|
||||
|
||||
function vs10_project_kinds.sharedLib_withOutNoImportLibraryFlag_propertyGroupSectionContainsIgnoreImportLibrary()
|
||||
kind "SharedLib"
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<PropertyGroup>*.*<IgnoreImportLibrary*.*</IgnoreImportLibrary>*.*</PropertyGroup>')
|
||||
end
|
||||
|
||||
function vs10_project_kinds.sharedLib_withNoImportLibraryFlag_propertyGroupSectionContainsIgnoreImportLibrary()
|
||||
kind "SharedLib"
|
||||
flags{"NoImportLib"}
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<PropertyGroup>*.*<IgnoreImportLibrary*.*</IgnoreImportLibrary>*.*</PropertyGroup>')
|
||||
end
|
||||
|
||||
function vs10_project_kinds.sharedLib_withOutNoImportLibraryFlag_ignoreImportLibraryValueIsFalse()
|
||||
kind "SharedLib"
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<PropertyGroup>*.*<IgnoreImportLibrary*.*false</IgnoreImportLibrary>*.*</PropertyGroup>')
|
||||
end
|
||||
|
||||
function vs10_project_kinds.sharedLib_withNoImportLibraryFlag_ignoreImportLibraryValueIsTrue()
|
||||
kind "SharedLib"
|
||||
flags{"NoImportLib"}
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<PropertyGroup>*.*<IgnoreImportLibrary*.*true</IgnoreImportLibrary>*.*</PropertyGroup>')
|
||||
end
|
||||
|
||||
--shared lib LinkIncremental set to incorrect value of false
|
||||
function vs10_project_kinds.staticLib_doesNotContainLinkIncremental()
|
||||
kind "StaticLib"
|
||||
flags {"Symbols"}
|
||||
local buffer = get_buffer()
|
||||
test.string_does_not_contain(buffer,'<LinkIncremental*.*</LinkIncremental>')
|
||||
end
|
||||
|
||||
function vs10_project_kinds.sharedLib_withoutOptimisation_linkIncrementalValueIsTrue()
|
||||
kind "SharedLib"
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<LinkIncremental*.*true</LinkIncremental>')
|
||||
end
|
||||
|
||||
function vs10_project_kinds.sharedLib_withOptimisation_linkIncrementalValueIsFalse()
|
||||
kind "SharedLib"
|
||||
flags{"Optimize"}
|
||||
local buffer = get_buffer()
|
||||
test.string_contains(buffer,'<LinkIncremental*.*false</LinkIncremental>')
|
||||
end
|
||||
|
||||
--check all configs %(AdditionalIncludeDirectories) missing before AdditionalIncludeDirectories end tag in ClCompile
|
||||
function vs10_project_kinds.kindDoesNotMatter_noAdditionalDirectoriesSpecified_bufferDoesNotContainAdditionalIncludeDirectories()
|
||||
kind "SharedLib"
|
||||
local buffer = get_buffer()
|
||||
test.string_does_not_contain(buffer,'<ClCompile>*.*<AdditionalIncludeDirectories>*.*</ClCompile>')
|
||||
end
|
||||
|
26
todo.txt
26
todo.txt
@ -1,15 +1,9 @@
|
||||
find why MFC in flags causes an error
|
||||
|
||||
add support for flags: Managed, MFC, NoImportLib, Unsafe
|
||||
add support for flags: Managed, MFC, Unsafe
|
||||
|
||||
NoImportLib
|
||||
Prevent the generation of an import library for a Windows DLL.
|
||||
if cfg.kind == "SharedLib" then
|
||||
local implibname = cfg.linktarget.fullpath
|
||||
_p(4,'ImportLibrary="%s"', iif(cfg.flags.NoImportLib, cfg.objectsdir .. "\\" .. path.getname(implibname), implibname))
|
||||
end
|
||||
|
||||
add LinkIncremental support if no optimization and and exe?if cfg.kind ~= "StaticLib" then
|
||||
|
||||
add ImportGroup section - which section?????
|
||||
|
||||
fix ProgramDataBaseFileName tag currently at line 285 see note which states
|
||||
@ -18,14 +12,22 @@ fix ProgramDataBaseFileName tag currently at line 285 see note which states
|
||||
what is the correct thing to do.
|
||||
|
||||
check why <MinimalRebuild>true</MinimalRebuild> is missing in a debug static lib and shared lib build
|
||||
check OutDir in debug it is showing "."
|
||||
--------Requires symbols to be set in flags
|
||||
shared lib missing <DebugInformationFormat>EditAndContinue</DebugInformationFormat> in ClCompile section
|
||||
--------Requires symbols to be set in flags
|
||||
shared lib incorrectly <GenerateDebugInformation>true</GenerateDebugInformation> to false in link section
|
||||
shared lib missing <ImportLibrary>???</ImportLibrary> in link section when noInportLib not used
|
||||
shared lib LinkIncremental set to incorrect value of false
|
||||
--------Requires symbols to be set in flags
|
||||
|
||||
|
||||
shared lib LinkIncremental set to incorrect value of false
|
||||
---Fixed and tests wrote
|
||||
|
||||
check all configs %(AdditionalIncludeDirectories) missing before AdditionalIncludeDirectories end tag in ClCompile
|
||||
---Fixed if no include Directories supplied, this tag is not present
|
||||
|
||||
|
||||
check OutDir in debug it is showing "." --is this because no obj directory is supplied???
|
||||
shared lib missing <ImportLibrary>???</ImportLibrary> in link section when a static lib
|
||||
---I am confused at what the value should be
|
||||
|
||||
support C
|
||||
support Managed C++
|
||||
|
Loading…
Reference in New Issue
Block a user