Is there a way to set the VC++ "Library Directories" path?

214 views
Skip to first unread message

MK

unread,
Aug 6, 2015, 6:46:00 PM8/6/15
to gyp-developer
I'm building with MSVS. I know how to add additional library directories but I'd like to know if there's a way to set the property below through gyp...

MSVS Properties -> Configuration Properties -> VC++ Directories -> Library Directories.

Any help would be appreciated!

Thanks.

alan

unread,
Aug 7, 2015, 10:21:40 AM8/7/15
to gyp-developer
  'msbuild_settings':{
    'Link':{
      'AdditionalLibraryDirectories':[
         'my_library_directory'
      ],
    },
  },

MK

unread,
Aug 7, 2015, 2:34:10 PM8/7/15
to gyp-developer
Thanks for the response Alan. I do know how to add 'Additional Library Directories' - what I specifically needed to do was to have the project link to VC++ libs other than the default libraries. That's done through the property I mentioned initially. I found a workaround for this by adding the property in gyp/pylib/gyp/generator/msvs.py.

Shezan Baig

unread,
Aug 7, 2015, 3:29:11 PM8/7/15
to MK, gyp-developer

The 'Additional Library Directories' takes precedence over the VC++ libs setting.


--

---
You received this message because you are subscribed to the Google Groups "gyp-developer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gyp-develope...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Munyiri Kamau

unread,
Aug 7, 2015, 3:37:19 PM8/7/15
to Shezan Baig, gyp-developer
I see. I'll try that out. Thanks Shezan.

Munyiri Kamau

unread,
Aug 7, 2015, 3:48:45 PM8/7/15
to Marcin Cieslak, gyp-developer
Got it. Thanks!!!

On Fri, Aug 7, 2015 at 12:43 PM, Marcin Cieslak <sa...@saper.info> wrote:
On Thu, 6 Aug 2015, MK wrote:

> I'm building with MSVS. I know how to add additional library directories
> but I'd like to know if there's a way to set the property below through
> gyp...
>
> MSVS Properties -> Configuration Properties -> VC++ Directories -> Library
> Directories.

1) There is a linker /LIBPATH parameter (LINK.EXE):
https://msdn.microsoft.com/en-us/library/1xhzskbe.aspx
(a.k.a "AdditionalLibraryDirectories) - this one
is generated by gyp as described.

2) There is also a /LIBPATH parameter to the compiler (CL.EXE)
- https://msdn.microsoft.com/en-us/library/kezkeayy.aspx

This is necessary only for the #using directive
to attach MSIL assemblies. You can do that by
setting "LIBPATH" environment variable before
starting gyp - it should be passed on to the compiler
and is no directly supported by gyp.

https://msdn.microsoft.com/en-us/library/ee855621.aspx
It is called "Reference Directories" here.


3) The "Library Directories" option (which is what you
mean) can be set in the environment as
the "LIB" environment variable
https://msdn.microsoft.com/en-us/library/6y6t9esh.aspx
This is used if one wants to completely replace
the list of libraries (including default ones
from VC++, SDKs etc.)

This is one I think has no corresponding LINK.EXE option
and should be set in the environment before calling gyp.
The LIB variable should be picked up in the environment
and set by gyp before invocation of the build tools.
(see https://chromium.googlesource.com/external/gyp/+/master/pylib/gyp/msvs_emulation.py#939)

~Marcin

Reply all
Reply to author
Forward
0 new messages