[CXX-2726] Do not override CMAKE_BUILD_TYPE for multi-config generators Created: 03/Aug/23  Updated: 28/Oct/23  Resolved: 07/Aug/23

Status: Closed
Project: C++ Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 3.8.1

Type: Bug Priority: Major - P3
Reporter: Kevin Albertson Assignee: Kevin Albertson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to CXX-2707 mongocxx kvp std::string runtime erro... Closed

 Description   

Scope

  • Do not override CMAKE_BUILD_TYPE for multi-config generators
  • Document use of --config in Windows installation instructions to choose a build configuration.

Background

Configuring on Windows without specifying CMAKE_BUILD_TYPE results in this log output from CMake:

-- No build type selected, default is Release

The log message is printed when overriding CMAKE_BUILD_TYPE. Overriding CMAKE_BUILD_TYPE is ignored for multi-configuration generators:

For multi-configuration generators like Visual Studio, Xcode, and Ninja Multi-Config, the configuration is chosen by the user at build time and CMAKE_BUILD_TYPE is ignored.

This may mislead users to think the build is Release, when it may be Debug. This may result in confusing runtime errors if mixing Debug and Release builds in an application.



 Comments   
Comment by Githook User [ 05/Oct/23 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: CXX-2726 do not override CMAKE_BUILD_TYPE for multi-config generator (#1006)

  • do not override CMAKE_BUILD_TYPE for multi-config generator
  • remove CMAKE_BUILD_TYPE from Windows install instructions

CMAKE_BUILT_TYPE is ignored for multi-config generators like Visual Studio

Comment by Githook User [ 07/Aug/23 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: CXX-2726 do not override CMAKE_BUILD_TYPE for multi-config generator (#1006)

  • do not override CMAKE_BUILD_TYPE for multi-config generator
  • remove CMAKE_BUILD_TYPE from Windows install instructions

CMAKE_BUILT_TYPE is ignored for multi-config generators like Visual Studio

Comment by Githook User [ 07/Aug/23 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: CXX-2726 do not override CMAKE_BUILD_TYPE for multi-config generator (#1006)

  • do not override CMAKE_BUILD_TYPE for multi-config generator
  • remove CMAKE_BUILD_TYPE from Windows install instructions

CMAKE_BUILT_TYPE is ignored for multi-config generators like Visual Studio

Generated at Wed Feb 07 22:06:50 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.