[JIRA] (JENKINS-58351) buildType is used incorrectly for windows builds

5 views
Skip to first unread message

dennis.cappendijk@siemens.com (JIRA)

unread,
Jul 4, 2019, 12:11:03 PM7/4/19
to jenkinsc...@googlegroups.com
Dennis Cappendijk created an issue
 
Jenkins / Bug JENKINS-58351
buildType is used incorrectly for windows builds
Issue Type: Bug Bug
Assignee: Martin Weber
Components: cmakebuilder-plugin
Created: 2019-07-04 16:10
Environment: Windows + visual studio 2015 / Linux + unix makefiles
Jenkins ver. 2.176.1
cmake builder plugin Version 2.6.2
Priority: Minor Minor
Reporter: Dennis Cappendijk

I have created a Jenkins pipeline that covers both windows and linux.

However it appears that cmakeBuild does not use buildType correctly for windows.

For Linux is correctly adds -DCMAKE_BUILD_TYPE=Debug or Release in the configure step

However for windows the CMAKE_BUILD_TYPE variable is ignored:

17:47:24    Manually-specified variables were not used by the project:
17:47:24  
17:47:24      CMAKE_BUILD_TYPE

And subsequently in the --build step, the --config is unused. Resulting in a Debug-by-default build on windows.

-config Debug or -config Release (depending on buildType should be added to the --build phase for windows (and CMAKE_BUILD_TYPE should not be used for windows)

 

The current workaround to this is adding --config Debug/Release explicitly in the steps:

steps: [[args: '--config Debug', withCmake: true]]

Which of course is less than ideal if the buildType property is available.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

fifteenknots505@gmail.com (JIRA)

unread,
Jul 4, 2019, 4:07:02 PM7/4/19
to jenkinsc...@googlegroups.com
Martin Weber commented on Bug JENKINS-58351
 
Re: buildType is used incorrectly for windows builds

Cmake's evaluation of the CMAKE_BUILD_TYPE variable is not specific to the OS, it is specific to the buildscript generator.

For the VS generator, apparently even the cmake guys could not find a way to generate build scripts for the VS build tool that pass the CMAKE_BUILD_TYPE-corresponding compiler/linker options to the compiler/linker. So users must take care to pass the

'--config Debug'

to the VS build tool themselve.

As a workaround, you might want to try the nmake or nmake-jom generators.

dennis.cappendijk@siemens.com (JIRA)

unread,
Jul 5, 2019, 4:26:01 AM7/5/19
to jenkinsc...@googlegroups.com

Would this be possible to add this as an improvement to the plugin? Ie, when a visual studio generator is set to the generator property use config instead of CMAKE_BUILD_TYPE or would this be too custom?

dennis.cappendijk@siemens.com (JIRA)

unread,
Jul 5, 2019, 4:27:02 AM7/5/19
to jenkinsc...@googlegroups.com
Dennis Cappendijk edited a comment on Bug JENKINS-58351
Would this it be possible to add this as an improvement to the plugin? Ie, when a visual studio generator is set to the generator property use config instead of CMAKE_BUILD_TYPE or would this be too custom?

 
Reply all
Reply to author
Forward
0 new messages