0028787: Configuration, genproj - add option HAVE_RelWithDebInfo for generating VS...
authorkgv <kgv@opencascade.com>
Thu, 25 May 2017 09:25:43 +0000 (12:25 +0300)
committerbugmaster <bugmaster@opencascade.com>
Fri, 9 Jun 2017 09:59:06 +0000 (12:59 +0300)
adm/genconf.tcl
adm/genconfdeps.tcl
adm/genproj.tcl
adm/templates/template.vc10
adm/templates/template.vc10x
dox/dev_guides/building/3rdparty/images/genconf_windows.png
dox/dev_guides/building/msvc.md

index 9f3a6aa..703928e 100644 (file)
@@ -394,6 +394,8 @@ ttk::combobox .myFrame.myVsFrame.myArchCombo   -values { {32} {64} } -textvariab
 entry         .myFrame.myVcEntry     -textvariable VCVER  -width 6
 entry         .myFrame.myVcVarsEntry -textvariable VCVARS -width 70
 ttk::button   .myFrame.myVcBrowseBtn -text "Browse" -command wokdep:gui:BrowseVcVars
+ttk::label    .myFrame.myHxxChecks.myRelDebInfoLbl   -text "Release with Debug info"
+checkbutton   .myFrame.myHxxChecks.myRelDebInfoCheck -offvalue "false" -onvalue "true" -variable HAVE_RelWithDebInfo
 
 #
 ttk::combobox .myFrame.myHxxChecks.myScutsCombo   -values { {ShortCut} {Copy} {HardLink} } -textvariable SHORTCUT_HEADERS -state readonly -width 12
@@ -508,6 +510,10 @@ if { "$tcl_platform(platform)" == "windows" } {
 grid .myFrame.myHxxChecks -row $aRowIter -column 0 -columnspan 10 -sticky w
 grid .myFrame.myHxxChecks.myScutsLbl     -row 0 -column 0
 grid .myFrame.myHxxChecks.myScutsCombo   -row 0 -column 1
+if { "$tcl_platform(platform)" == "windows" } {
+  grid .myFrame.myHxxChecks.myRelDebInfoCheck -row 0 -column 2
+  grid .myFrame.myHxxChecks.myRelDebInfoLbl   -row 0 -column 3
+}
 incr aRowIter
 #
 grid .myFrame.mySrchLbl       -row $aRowIter -column 0 -columnspan 10 -sticky w
index 3f3766a..ae61a6f 100644 (file)
@@ -65,7 +65,7 @@ if { [info exists ::env(SHORTCUT_HEADERS)] } {
 }
 
 # fetch environment variables (e.g. set by custom.sh or custom.bat) and set them as tcl variables with the same name
-set THE_ENV_VARIABLES {HAVE_FREEIMAGE HAVE_FFMPEG HAVE_TBB HAVE_GLES2 HAVE_D3D HAVE_VTK HAVE_GL2PS HAVE_ZLIB HAVE_LIBLZMA HAVE_OPENCL CHECK_QT4 CHECK_JDK MACOSX_USE_GLX}
+set THE_ENV_VARIABLES {HAVE_FREEIMAGE HAVE_FFMPEG HAVE_TBB HAVE_GLES2 HAVE_D3D HAVE_VTK HAVE_GL2PS HAVE_ZLIB HAVE_LIBLZMA HAVE_OPENCL CHECK_QT4 CHECK_JDK MACOSX_USE_GLX HAVE_RelWithDebInfo}
 foreach anEnvIter $THE_ENV_VARIABLES {
   set ${anEnvIter} "false"
   if { [info exists ::env(${anEnvIter})] } {
@@ -77,9 +77,10 @@ if { "$::tcl_platform(os)" == "Darwin" } {
   set HAVE_GLES2 ""
 } else {
   set MACOSX_USE_GLX ""
-  if { "$tcl_platform(platform)" != "windows" } {
-    set HAVE_D3D ""
-  }
+}
+if { "$tcl_platform(platform)" != "windows" } {
+  set HAVE_D3D ""
+  set HAVE_RelWithDebInfo ""
 }
 foreach anEnvIter {ARCH VCVER VCVARS PRODUCTS_PATH} {
   if { [info exists ::env(${anEnvIter})] } {
index cf4de4e..ef2f7e3 100644 (file)
@@ -1193,17 +1193,28 @@ proc osutils:vcproj:readtemplate {theVcVer isexec} {
     }
   }
 
+  set format_template "\[\\r\\n\\s\]*"
   foreach bitness {32 64} {
-    set format_template ""
+    set format_templateloc ""
     if {"[set aCmpl${bitness}]" == ""} {
-      set format_template "\[\\r\\n\\s\]*"
+      set format_templateloc "$format_template"
     }
-    regsub -all -- "${format_template}__VCMPL${bitness}__" $aTmpl "[set aCmpl${bitness}]" aTmpl
+    regsub -all -- "${format_templateloc}__VCMPL${bitness}__" $aTmpl "[set aCmpl${bitness}]" aTmpl
+  }
+
+  set aDebugInfo "no"
+  set aReleaseLnk ""
+  if { "$::HAVE_RelWithDebInfo" == "true" } {
+    set aDebugInfo "true"
+    set aReleaseLnk "\n      <OptimizeReferences>true</OptimizeReferences>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>"
   }
 
   regsub -all -- {__VCVER__}     $aTmpl $theVcVer aTmpl
   regsub -all -- {__VCVEREXT__}  $aTmpl $aVerExt  aTmpl
   regsub -all -- {__VCCHARSET__} $aTmpl $aCharSet aTmpl
+  regsub -all -- {__VCReleasePDB__} $aTmpl $aDebugInfo aTmpl
+  regsub -all -- "${format_template}__VCLNKREL__" $aTmpl "${aReleaseLnk}" aTmpl
+
   return $aTmpl
 }
 
index 2b007aa..1b8ee51 100644 (file)
       <OutputFile>.\..\..\..\win32\__VCVER__\bin\__TKNAM__.dll</OutputFile>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <AdditionalLibraryDirectories>..\..\..\win32\__VCVER__\lib;$(CSF_OPT_LIB32);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <GenerateDebugInformation>No</GenerateDebugInformation>
+      <GenerateDebugInformation>__VCReleasePDB__</GenerateDebugInformation>
       <ProgramDatabaseFile>.\..\..\..\win32\__VCVER__\bin\__TKNAM__.pdb</ProgramDatabaseFile>
       <SubSystem>Console</SubSystem>
       <ImportLibrary>..\..\..\win32\__VCVER__\lib\__TKNAM__.lib</ImportLibrary>
+      __VCLNKREL__
       __UWP_GENERATE_METADATA__
     </Link>
   </ItemDefinitionGroup>
       <OutputFile>.\..\..\..\win64\__VCVER__\bin\__TKNAM__.dll</OutputFile>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <AdditionalLibraryDirectories>..\..\..\win64\__VCVER__\lib;$(CSF_OPT_LIB64);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <GenerateDebugInformation>No</GenerateDebugInformation>
+      <GenerateDebugInformation>__VCReleasePDB__</GenerateDebugInformation>
       <ProgramDatabaseFile>.\..\..\..\win64\__VCVER__\bin\__TKNAM__.pdb</ProgramDatabaseFile>
       <SubSystem>Console</SubSystem>
       <ImportLibrary>..\..\..\win64\__VCVER__\lib\__TKNAM__.lib</ImportLibrary>
+      __VCLNKREL__
       __UWP_GENERATE_METADATA__
     </Link>
   </ItemDefinitionGroup>
index cdfd366..96faa80 100644 (file)
       <AdditionalDependencies>__TKDEP__;%(AdditionalDependencies)</AdditionalDependencies>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <AdditionalLibraryDirectories>..\..\..\win32\__VCVER__\lib;$(CSF_OPT_LIB32);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <GenerateDebugInformation>No</GenerateDebugInformation>
+      <GenerateDebugInformation>__VCReleasePDB__</GenerateDebugInformation>
       <ProgramDatabaseFile>.\..\..\..\win32\__VCVER__\bin\__XQTNAM__.pdb</ProgramDatabaseFile>
       <SubSystem>Console</SubSystem>
       <ImportLibrary>..\..\..\win32\__VCVER__\lib\__XQTNAM__.lib</ImportLibrary>
+      __VCLNKREL__
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
       <AdditionalDependencies>__TKDEP__;%(AdditionalDependencies)</AdditionalDependencies>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <AdditionalLibraryDirectories>..\..\..\win64\__VCVER__\lib;$(CSF_OPT_LIB64);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <GenerateDebugInformation>No</GenerateDebugInformation>
+      <GenerateDebugInformation>__VCReleasePDB__</GenerateDebugInformation>
       <ProgramDatabaseFile>.\..\..\..\win64\__VCVER__\bin\__XQTNAM__.pdb</ProgramDatabaseFile>
       <SubSystem>Console</SubSystem>
       <ImportLibrary>..\..\..\win64\__VCVER__\lib\__XQTNAM__.lib</ImportLibrary>
+      __VCLNKREL__
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
index 409dff0..df723a7 100644 (file)
Binary files a/dox/dev_guides/building/3rdparty/images/genconf_windows.png and b/dox/dev_guides/building/3rdparty/images/genconf_windows.png differ
index e54df86..ac5bde6 100644 (file)
@@ -38,11 +38,12 @@ If you have Visual Studio projects already available (pre-installed or generated
 Alternatively, you can launch **genconf**, a GUI tool allowing to configure build options interactively.
 That tool will analyze your environment and propose you to choose available options:
 
-* Version of Visual Studio to be used (from the list of installed ones, detected by presence of environment variables like *VS100COMNTOOLS*)
+* Version of Visual Studio to be used (from the list of installed ones, detected by presence of environment variables like *VS100COMNTOOLS*).
 * Method to populate folder *inc* (short-cuts by default).
 * Location of third-party libraries (usually downloaded from OCCT web site, see above).
-* Path to common directory where third-party libraries are located (optional)
+* Path to common directory where third-party libraries are located (optional).
 * Paths to headers and binaries of the third-party libraries (found automatically basing on previous options; click button "Reset" to update).
+* Generation of PDB files within Release build ("Release with Debug info", false by default).
 
 @figure{/dev_guides/building/3rdparty/images/genconf_windows.png}