[SERVER-4304] Add Visual Studio pre-build steps so we can eliminate mongo_vstudio.cpp Created: 17/Nov/11  Updated: 11/Jul/16  Resolved: 20/Nov/11

Status: Closed
Project: Core Server
Component/s: Build
Affects Version/s: None
Fix Version/s: 2.1.0

Type: Improvement Priority: Trivial - P5
Reporter: Tad Marshall Assignee: Tad Marshall
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Used by Windows Visual Studio, but affects the SCons build and commands like "git status" on all platforms


Participants:

 Description   

SConstruct has code to create .cpp code based on JavaScript source files, but the Visual Studio build projects don't have a matching feature. The workaround of having SConstruct create a mongo_vstudio.cpp file is kind of clumsy. We can simplify things a little by adding a pre-build step to the Visual Studio solution/project files to do what the jsToH routine in Sconstruct does and then drop mongo_vstudio.cpp from the repository.



 Comments   
Comment by Tad Marshall [ 20/Nov/11 ]

Fixed by commit c67b01be01ee3c7ef84f57834380f287d83ebf61.

Comment by auto [ 20/Nov/11 ]

Author:

{u'login': u'', u'name': u'Tad Marshall', u'email': u'tad@10gen.com'}

Message: SERVER-4304 – Generate .CPP files from JavaScript in Visual Studio

We no longer need mongo_vstudio.cpp and it is removed from the Git
repository with this commit. Visual Studio 2010 will now generate its
own copies of shell/mongo.cpp and shell/mongo-server.cpp. The code
that creates these files closely mimics the jsToH function in SConstruct
such that the resulting files are identical (quirks and all).
SConstruct no longer creates shell/mongo_vstudio.cpp and Visual Studio
creates and uses the same filename as SCons (shell/mongo.cpp). All
projects that were using mongo_vstudio.cpp will now instead generate
shell/mongo.cpp as a "Pre-Build" step.
Branch: master
https://github.com/mongodb/mongo/commit/c67b01be01ee3c7ef84f57834380f287d83ebf61

Comment by Tad Marshall [ 19/Nov/11 ]

The other problem with the way we've been doing this is that there are two generated .CPP files (shell/mongo.cpp and shell/mongo-server.cpp) but only one of them (mongo.cpp -> mongo_vstudio.cpp) is stored in Git. This means that Visual Studio builders can't build mongo.exe without running SCons at least once, because the file mongo-server.cpp doesn't exist until SCons creates it. This also means that if shell/servers.js is updated, the Visual Studio builder has to run SCons again to update mongo-server.cpp, otherwise the old version will be used and the update will not show up in the Visual Studio build.

Generated at Thu Feb 08 03:05:35 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.