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 9f3a6aa1c912bc67f901ce5fc396279a32106a7c..703928e415eee8e966d864e8ea37db1b4df95e83 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 3f3766a84d8e30e6e809be59c06656d5cd233d2e..ae61a6ffd70b1c7aa3d2a967e061884e52c8e104 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 cf4de4e5ac238f18f9fb79ea22a00e0861afc54b..ef2f7e3f22b5a6b3045beae6363b9525a9c362a0 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 2b007aa833b55e28b221ed21094cd53ae7d4b128..1b8ee51c519950816a8c04e4f4694aca92926eb4 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 cdfd3669b2c443dc53e4806e2b511edc8dfc1cff..96faa80fde6014c294fdfa5c686d74aebbec6e52 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 409dff035cfce90f0a92c9621a345a4f6918adfb..df723a75a41d5bbf58005f05c15a2d6f6cff4a5d 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 e54df86da30224e03f781a0e1091dd6e97fa239d..ac5bde63434d68bd5d5db2e770472438ae69b269 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}