How to set "Runtime Library" in MSVC to "Multi-threaded [Debug] DLL" and some other settings?

955 views
Skip to first unread message

jgaa

unread,
Feb 6, 2012, 6:39:39 AM2/6/12
to gyp-developer
Hi,

I'm totally new to gyp.

I'm building the WebRTC project for use in another project, and need
to change some of the project settings globally. I figured it's easier
to do that in the gyp project file(s), rather than in the MSVC
project, each time I update the sources.

The most critical change is the Code Generation / Runtime Library
setting. Like most programs today, mine are using "Multi-threaded
[Debug] DLL", where Debug is used for the debug build. After spending
a few hours looking at gyp and it's wiki pages, I have not figured out
how to change this.

I also need to change the library output file for all the library
projects to "$(SolutionDir)\lib\$(ProjectName)_$
(ConfigurationName).lib" (using the Macro Expansion in Visual Studio).

And finally, I need to specify the names of the Program database Files
(they defaults to "vc80.pdb") to "$(TargetDir)$(TargetName).pdb" (also
here using the Macro Expansion in Visual Studio).

I hope someone will take the time to help me with these (probably)
very trivial questions. It will be greatly appreciated!

Best regards,

Jarle

Shaun Kime

unread,
Apr 24, 2012, 4:01:22 PM4/24/12
to gyp-de...@googlegroups.com
Jarle,
   I'm new to gyp as well and had a similar problem. The lines in question to change how all webrtc libraries use the runtime can be found in \build\common.gypi. For example, I changed the values from:

'conditions': [
        ['OS=="win" and component=="shared_library"', {
          'win_release_RuntimeLibrary%': '2', # 2 = /MT (nondebug DLL)
          'win_debug_RuntimeLibrary%': '3',   # 3 = /MTd (debug DLL)
        }, {
          # sckime edit
          'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
          'win_debug_RuntimeLibrary%': '1',   # 1 = /MTd (debug static)
        }],
      ],

to

'conditions': [
        ['OS=="win" and component=="shared_library"', {
          'win_release_RuntimeLibrary%': '2', # 2 = /MT (nondebug DLL)
          'win_debug_RuntimeLibrary%': '3',   # 3 = /MTd (debug DLL)
        }, {
          # sckime edit
          'win_release_RuntimeLibrary%': '2', # 2 = /MT (nondebug DLL)
          'win_debug_RuntimeLibrary%': '3',   # 3 = /MTd (debug DLL)
        }],
      ],

This will update the project files if you call the following batch file from the trunk:
gclient runhooks --force 
Reply all
Reply to author
Forward
0 new messages