CMake generated projects should generate debug info

Having problems with building or using the JCEF Java binding? Ask your questions here.

CMake generated projects should generate debug info

Postby Phylanx » Thu Jun 09, 2022 9:25 am

Hi!

I'm trying to build JCEF binaries and have questions regarding the CMAKE statement...

I'm building on a Windows 10 64 bit and want to build 32bit binaries.
Also I want to create PDB files for additional debugging informations.

On version 4147 I used the following CMAKE statement:
Code: Select all
cmake -G "Visual Studio 15" ..


On new version I currently use the following statement:
Code: Select all
cmake -G "Visual Studio 16" -A Win32 ..


Visual Studio creates the Release binaries, but the PDB files are missing.
I checked the project files and as expected: Setting jcef/jcef_helper -> Properties -> Linker -> Debugging -> Generate Debug Info is set to false.
In 4147 this setting is set to "/DEBUG".

I know I can change it manually but I create an automatic build script and want CMAKE to generate the projects with that setting automatically.

Is there a CMAKE Parameter for this?
If not where can I change code to generate that automatically?
Phylanx
Expert
 
Posts: 201
Joined: Thu Aug 11, 2016 8:17 am

Re: CMake generated projects should generate debug info

Postby Phylanx » Fri Jun 10, 2022 3:53 am

I found a solution!

The problem is the new CMake version and its "Release" configuration type.

My usecase:

I start CMAKE and generate the jcef solution and project files.
Afterwards I start the compile with a "msbuild jcef.sln" call on the command line.

Working solution
I had to make the following adaptions to generate PDB files:

Start CMake as described in documentation.
Create a file called "MSBuildOverrides.props" in jcef_build folder with following contents:
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ImportGroup Label="PropertySheets" />
  <PropertyGroup Label="UserMacros" />
  <PropertyGroup />
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <Link>
        <GenerateDebugInformation>true</GenerateDebugInformation>
        <OptimizeReferences>true</OptimizeReferences>
     </Link>
  </ItemDefinitionGroup>
  <ItemGroup />
</Project>

Start the msbuild command with the additional following parameter:
Code: Select all
-p:ForceImportBeforeCppTargets=%path_to_jcef_build%\MSBuildOverrides.props

For Example:
Code: Select all
msbuild jcef.sln /nologo /ds /t:Build /p:Configuration=Release /p:Platform=Win32 -p:ForceImportBeforeCppTargets=c:\dev\cefbuild\jcef_native\target\src\jcef_build\MSBuildOverrides.props


This solution created the PDB files like before!

Solution that did not work (or was too complicated for me):
Use the CMAKE configuration type "RelWithDebInfos".
The Solution/Project files have been created correctly and the PDB files would be generated, but the afterbuild copy scripts didn't work because they wanted to use the "RelWithDebInfos" target of the downloaded CEF binaries.
Phylanx
Expert
 
Posts: 201
Joined: Thu Aug 11, 2016 8:17 am


Return to JCEF Forum

Who is online

Users browsing this forum: No registered users and 18 guests