Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/windirstat.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.hgignore2
-rw-r--r--3rdparty/lua/premake4.lua23
-rw-r--r--premake4.lua77
-rw-r--r--public_release.cmd9
4 files changed, 73 insertions, 38 deletions
diff --git a/.hgignore b/.hgignore
index 4d64380..ca9afcc 100644
--- a/.hgignore
+++ b/.hgignore
@@ -17,3 +17,5 @@ web/*.html
web/software/cushionstarlets.php
src/*
Visual Lint/*
+common/hgtip.h
+common/buildnumber.h
diff --git a/3rdparty/lua/premake4.lua b/3rdparty/lua/premake4.lua
index 327aec6..597c6cc 100644
--- a/3rdparty/lua/premake4.lua
+++ b/3rdparty/lua/premake4.lua
@@ -1,7 +1,13 @@
-- The below is used to insert the .vs(2005|2008|2010|2012|2013) into the file names for projects and solutions
local standalone = false
local action = _ACTION or ""
-if premake.CurrentContainer == nil then
+local pfx = ""
+if premake.CurrentContainer ~= nil then
+ pfx = _OPTIONS["release"]
+ if not pfx then
+ pfx = ""
+ end
+else
-- Name the project files after their VS version
local orig_getbasename = premake.project.getbasename
premake.project.getbasename = function(prjname, pattern)
@@ -33,12 +39,10 @@ if premake.CurrentContainer == nil then
end
orig_generate(obj, filename, callback)
end
-end
-do
-- Override the project creation to suppress unnecessary configurations
-- these get invoked by sln2005.generate per project ...
-- ... they depend on the values in the sln.vstudio_configs table
- local mprj = {["minilua"] = {["Release|Win32"] = 0}, ["buildvm"] = {["Release|Win32"] = 0, ["Release|x64"] = 0}, ["luajit2"] = {["Release|Win32"] = 0, ["Release|x64"] = 0}, ["lua"] = {["Release|Win32"] = 0, ["Release|x64"] = 0}}
+ local mprj = {[pfx.."minilua"] = {["Release|Win32"] = 0}, [pfx.."buildvm"] = {["Release|Win32"] = 0, ["Release|x64"] = 0}, [pfx.."luajit2"] = {["Release|Win32"] = 0, ["Release|x64"] = 0}, [pfx.."lua"] = {["Release|Win32"] = 0, ["Release|x64"] = 0}}
local function prjgen_override_factory(orig_prjgen)
return function(prj)
local function prjmap()
@@ -72,10 +76,10 @@ do
-- no matter what the global solution project is.
local orig_project_platforms_sln2prj_mapping = premake.vstudio.sln2005.project_platforms_sln2prj_mapping
premake.vstudio.sln2005.project_platforms_sln2prj_mapping = function(sln, prj, cfg, mapped)
- if prj.name:find('minilua') then
+ if prj.name:find(pfx..'minilua') then
_p('\t\t{%s}.%s.ActiveCfg = Release|Win32', prj.uuid, cfg.name)
_p('\t\t{%s}.%s.Build.0 = Release|Win32', prj.uuid, cfg.name)
- elseif prj.name:find('buildvm') or prj.name:find('luajit2') or prj.name:find('lua') then
+ elseif prj.name:find(pfx..'buildvm') or prj.name:find(pfx..'luajit2') or prj.name:find(pfx..'lua') then
_p('\t\t{%s}.%s.ActiveCfg = Release|%s', prj.uuid, cfg.name, mapped)
_p('\t\t{%s}.%s.Build.0 = Release|%s', prj.uuid, cfg.name, mapped)
else
@@ -102,8 +106,7 @@ local function fmt(msg, ...)
return string.format(msg, unpack(arg))
end
-function create_luajit_projects(basedir, pfx)
- local pfx = iif(pfx, pfx, "")
+function create_luajit_projects(basedir)
local bd = ""
local offs = "" -- relative path, calculated based on slashes and backslashes in bd (basedir after normalization)
if basedir ~= nil then
@@ -111,8 +114,8 @@ function create_luajit_projects(basedir, pfx)
offs = bd:gsub("[^\\/]+", ""):gsub(".", "..\\")
end
local oldcurr = premake.CurrentContainer
- local int_dir = fmt("intermediate\\%s_$(%s)_$(%s)\\$(ProjectName)", action, transformMN("Platform"), transformMN("Configuration"))
- local inc_dir = fmt("intermediate\\%s_$(%s)", action, transformMN("Platform"))
+ local int_dir = fmt(pfx.."intermediate\\%s_$(%s)_$(%s)\\$(ProjectName)", action, transformMN("Platform"), transformMN("Configuration"))
+ local inc_dir = fmt(pfx.."intermediate\\%s_$(%s)", action, transformMN("Platform"))
-- Single minilua for all configurations and platforms
project (pfx.."minilua") -- required to build LuaJIT
uuid ("531911BC-0023-4EC6-A2CE-6C3F5C182647")
diff --git a/premake4.lua b/premake4.lua
index 90527de..9483a80 100644
--- a/premake4.lua
+++ b/premake4.lua
@@ -1,5 +1,20 @@
-- The below is used to insert the .vs(2005|2008|2010|2012|2013) into the file names for projects and solutions
local action = _ACTION or ""
+local release = false
+local slnname = ""
+local pfx = ""
+if _OPTIONS["resources"] then
+ print "INFO: Creating projects for resource DLLs."
+end
+if _OPTIONS["release"] then
+ print "INFO: Creating release build solution."
+ _OPTIONS["resources"] = ""
+ _OPTIONS["sdk71"] = ""
+ release = true
+ slnname = "wds_release"
+ pfx = slnname .. "_"
+ _OPTIONS["release"] = pfx
+end
do
-- Name the project files after their VS version
local orig_getbasename = premake.project.getbasename
@@ -34,7 +49,7 @@ do
-- Make sure we do not incremental linking for the resource DLLs
local orig_config_isincrementallink = premake.config.isincrementallink
premake.config.isincrementallink = function(cfg)
- if cfg.project.name:find('wdsr') and cfg.flags.NoIncrementalLink then
+ if cfg.project.name:find(pfx..'wdsr') and cfg.flags.NoIncrementalLink then
return false
end
return orig_config_isincrementallink(cfg)
@@ -42,7 +57,7 @@ do
-- Override the project creation to suppress unnecessary configurations
-- these get invoked by sln2005.generate per project ...
-- ... they depend on the values in the sln.vstudio_configs table
- local mprj = {["wdsr%x*"] = {["Release|Win32"] = 0}}
+ local mprj = {[pfx.."wdsr%x*"] = {["Release|Win32"] = 0}, [pfx.."minilua"] = {["Release|Win32"] = 0}, [pfx.."buildvm"] = {["Release|Win32"] = 0, ["Release|x64"] = 0}, [pfx.."luajit2"] = {["Release|Win32"] = 0, ["Release|x64"] = 0}, [pfx.."lua"] = {["Release|Win32"] = 0, ["Release|x64"] = 0}}
local function prjgen_override_factory(orig_prjgen)
return function(prj)
local function prjmap()
@@ -76,9 +91,19 @@ do
-- no matter what the global solution project is.
local orig_project_platforms_sln2prj_mapping = premake.vstudio.sln2005.project_platforms_sln2prj_mapping
premake.vstudio.sln2005.project_platforms_sln2prj_mapping = function(sln, prj, cfg, mapped)
- if prj.name:find('wdsr') then
+ if prj.name:find(pfx..'wdsr') then
+ _p('\t\t{%s}.%s.ActiveCfg = Release|Win32', prj.uuid, cfg.name)
+ if release and mapped == "Win32" and cfg.name == "Release|Win32" then
+ _p('\t\t{%s}.%s.Build.0 = Release|Win32', prj.uuid, cfg.name)
+ end
+ elseif prj.name:find(pfx..'minilua') then
_p('\t\t{%s}.%s.ActiveCfg = Release|Win32', prj.uuid, cfg.name)
- _p('\t\t{%s}.%s.Build.0 = Release|Win32', prj.uuid, cfg.name)
+ if not release then
+ _p('\t\t{%s}.%s.Build.0 = Release|Win32', prj.uuid, cfg.name)
+ end
+ elseif prj.name:find(pfx..'buildvm') or prj.name:find(pfx..'luajit2') or prj.name:find(pfx..'lua') then
+ _p('\t\t{%s}.%s.ActiveCfg = Release|%s', prj.uuid, cfg.name, mapped)
+ _p('\t\t{%s}.%s.Build.0 = Release|%s', prj.uuid, cfg.name, mapped)
else
_p('\t\t{%s}.%s.ActiveCfg = %s|%s', prj.uuid, cfg.name, cfg.buildcfg, mapped)
if mapped == cfg.platform or cfg.platform == "Mixed Platforms" then
@@ -99,24 +124,13 @@ local function transformMN(input) -- transform the macro names for older Visual
end
return input
end
-newoption { trigger = "resources", description = "Also create projects for the resource DLLs." }
-newoption { trigger = "sdk71", description = "Applies to VS 2005 and 2008. If you have the Windows 7 SP1\n SDK, use this to create projects for a feature-complete\n WinDirStat." }
-newoption { trigger = "release", description = "Creates a solution suitable for a release build." }
-if _OPTIONS["resources"] then
- print "INFO: Creating projects for resource DLLs."
-end
-local release = false
-local slnname = "wds_release"
-if _OPTIONS["release"] then
- print "INFO: Creating release build solution."
- _OPTIONS["resources"] = ""
- _OPTIONS["sdk71"] = ""
- release = true
-end
local function inc(inc_dir)
include(inc_dir)
- create_luajit_projects(inc_dir, iif(release, slnname .. "_", ""))
+ create_luajit_projects(inc_dir)
end
+newoption { trigger = "resources", description = "Also create projects for the resource DLLs." }
+newoption { trigger = "sdk71", description = "Applies to VS 2005 and 2008. If you have the Windows 7 SP1\n SDK, use this to create projects for a feature-complete\n WinDirStat." }
+newoption { trigger = "release", description = "Creates a solution suitable for a release build." }
solution (iif(release, slnname, "windirstat"))
configurations (iif(release, {"Release"}, {"Debug", "Release"}))
@@ -128,26 +142,30 @@ solution (iif(release, slnname, "windirstat"))
-- Main WinDirStat project
project (iif(release, slnname, "windirstat"))
- local int_dir = "intermediate/" .. action .. "_$(" .. transformMN("Platform") .. ")_$(" .. transformMN("Configuration") .. ")\\$(ProjectName)"
+ local int_dir = pfx.."intermediate/" .. action .. "_$(" .. transformMN("Platform") .. ")_$(" .. transformMN("Configuration") .. ")\\$(ProjectName)"
uuid ("BD11B94C-6594-4477-9FDF-2E24447D1F14")
language ("C++")
kind ("WindowedApp")
location ("windirstat")
targetname ("wds")
flags {"StaticRuntime", "Unicode", "MFC", "NativeWChar", "ExtraWarnings", "NoRTTI", "WinMain", "NoMinimalRebuild", "NoIncrementalLink", "NoEditAndContinue"} -- "No64BitChecks", "NoManifest", "NoExceptions" ???
- targetdir ("build")
+ targetdir (iif(release, slnname, "build"))
includedirs {".", "windirstat", "common", "windirstat/Controls", "windirstat/Dialogs", "3rdparty/lua/src"}
objdir (int_dir)
libdirs {"$(IntDir)"}
- links {"htmlhelp", "psapi", "delayimp", iif(release, slnname .. "_luajit2", "luajit2")}
+ links {"htmlhelp", "psapi", "delayimp", pfx.."luajit2"}
resoptions {"/nologo", "/l409"}
resincludedirs {".", "$(IntDir)"}
linkoptions {"/delayload:psapi.dll", "/pdbaltpath:%_PDB%"}
+ prebuildcommands("if not exist \"$(SolutionDir)common\\buildnumber.h\" \"$(SolutionDir)common\\buildinc.cmd\" \"$(SolutionDir)common\"")
if release then
postbuildcommands
{
"signtool.exe sign /v /a /ph /d \"WinDirStat\" /du \"http://windirstat.info\" /tr http://www.startssl.com/timestamp \"$(TargetPath)\""
}
+ if os.isfile("common/hgtip.h") then
+ defines ("HAVE_HGTIP")
+ end
end
files
{
@@ -248,19 +266,28 @@ solution (iif(release, slnname, "windirstat"))
}
for nm,guid in pairs(resource_dlls) do
premake.CurrentContainer = oldcurr
- prj = project(iif(release, slnname .. "_" .. nm, nm))
- local int_dir = "intermediate/" .. action .. "_$(ProjectName)_" .. nm
+ prj = project(pfx..nm)
+ local int_dir = pfx.."intermediate/" .. action .. "_$(ProjectName)_" .. nm
uuid (guid)
language ("C++")
kind ("SharedLib")
location (nm)
flags {"NoImportLib", "Unicode", "NoManifest", "NoExceptions", "NoPCH", "NoIncrementalLink"}
objdir (int_dir)
- targetdir ("build")
+ targetdir (iif(release, slnname, "build"))
targetextension (".wdslng")
resoptions {"/nologo", "/l409"}
resincludedirs {".", nm, "$(IntDir)"} -- ATTENTION: FAULTY IN premake-stable ... needs to be addressed
linkoptions {"/noentry"}
+ if release then
+ postbuildcommands
+ {
+ "signtool.exe sign /v /a /ph /d \"WinDirStat resource DLL\" /du \"http://windirstat.info\" /tr http://www.startssl.com/timestamp \"$(TargetPath)\""
+ }
+ if os.isfile("common/hgtip.h") then
+ defines ("HAVE_HGTIP")
+ end
+ end
files
{
nm .. "/*.txt", nm .. "/*.rst",
diff --git a/public_release.cmd b/public_release.cmd
index 9c09c36..db11902 100644
--- a/public_release.cmd
+++ b/public_release.cmd
@@ -1,10 +1,13 @@
@echo off
setlocal ENABLEEXTENSIONS & pushd .
+set HGTIPFILE="%~dp0common\hgtip.h"
+for /f %%i in ('hg id -i -r tip') do @echo #define HG_TIP_ID "%%i" > %HGTIPFILE%
+if exist %HGTIPFILE% type %HGTIPFILE%
"%~dp0common\premake4.exe" --release vs2005
call %~dp0common\setvcvars.cmd 2005
call %~dp0common\buildinc.cmd "%~dp0common"
echo %VCVER_FRIENDLY%
+::popd & endlocal & goto :EOF
vcbuild.exe /time /rebuild /showenv /M1 /nologo ^
- "/htmllog:$(SolutionDir)build\buildlog.html" "%~dp0\wds_release.vs8.sln" "$ALL"
-popd & endlocal
-goto :EOF
+ "/htmllog:$(SolutionDir)wds_release\buildlog.html" "%~dp0\wds_release.vs8.sln" "$ALL"
+popd & endlocal & goto :EOF