Author Topic: Escape sequences for build commands  (Read 2201 times)

cilly.bole

  • Community Member
  • Posts: 11
  • Hero Points: 0
Escape sequences for build commands
« on: October 05, 2018, 04:13:28 AM »
Hi,
The default build command looks something like this:
Code: [Select]
msbuild "%w" /t:"%sf" /p:Configuration="%bn" /p:Platform="%bpms" And for [*|Win32] the "%bpms" is resolving to x86 instead of Win32. This leads to an msbuild error. Where are these escape sequences ultimately defined? I'm thinking they may come from the original VisualStudio projects I've imported, but I'm not sure. I know I can modify that msbuild command line to simply be /p:Configuration=Win32 for the Win32 configurations, but I'd rather fix it correctly and have something that applies to the whole workspace since I have multiple projects that have this issue. Thank you.

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Re: Escape sequences for build commands
« Reply #1 on: October 08, 2018, 02:57:01 PM »
I do see an issue when Platform is Any CPU, but I am not 100% sure this is same issue as what you are seeing.  What type of project is this?  And what version of Visual Studio are you using?  Could you post the Visual Studio project/solution? 

cilly.bole

  • Community Member
  • Posts: 11
  • Hero Points: 0
Re: Escape sequences for build commands
« Reply #2 on: October 09, 2018, 02:15:58 AM »
It's Visual Studio 2017, Active Configuration Debug|Win32. Slickedit version 23.0 pro beta 4. I've reduced my solution down to a single project that shows the failure. Like I said, it could be something in my solution / project (they've gone through many versions of Visual Studio over the years, being upgraded each time). I've stripped down what I think is the minimum solution / project with the Visual Studio solutions / project and the Slickedit workspace / project.

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Re: Escape sequences for build commands
« Reply #3 on: October 09, 2018, 03:11:39 PM »
Thanks for the sample, I am able to reproduce the issue.  For this example, the correct command-line should use the platform option "/p:Platform="%bp", which just passes the platform part of the active configuration string "Config|Platform". 

"/p:Platform="%bpms" was added because there are several samples of vcxproj where msbuild requires the platform setting to be "x86" instead of "Win32", %bpms strips out the platform side of the active configuration and translated Win32 to x86 if needed. 

I need to research this and find out why there is a difference and fix the templates or try to fix the command-line on the fly as needed.

cilly.bole

  • Community Member
  • Posts: 11
  • Hero Points: 0
Re: Escape sequences for build commands
« Reply #4 on: October 10, 2018, 01:19:28 AM »
Cool, thanks. %bp was not in the list of "Escape Sequences for Build Commands," maybe that can be updated as well?

Another question, where can I modify that build command line without going in to each project individually? I don't really have too many projects, but it would be easier if there was a workspace wide setting.

Thanks again.

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Re: Escape sequences for build commands
« Reply #5 on: October 10, 2018, 01:11:12 PM »
To edit the template, you can go to main menu File > New..., select the Project tab, and use Customize....  The template for this project would be "Microsoft Visual Studio 2017 C++", and use Edit.
You'll be presented with Project Properties form, and you can edit the command-lines there.  Configuration Platform option probably should be one of macros built onto the project macros menu, I'll look into that.

Still very curious why this project behaves different than the other samples I have.  Was this Project/Solution created directly in Visual Studio or was it a generated project via something like CMake?