intermediate_dir and shared_intermediate_dir

392 views
Skip to first unread message

Evan Martin

unread,
Aug 10, 2011, 3:46:57 PM8/10/11
to gyp-developer
I believe this true. Please correct me if I'm wrong:

- INTERMEDIATE_DIR is a gyp-target-specific scratch space. gyp files
*should not* make assumptions about where this directory is. There is
little point in trying to namespace out a subdirectory of
INTERMEDIATE_DIR -- like using
<(INTERMEDIATE_DIR)/my_target_name/foobar instead of just
<(INTERMEDIATE_DIR)/foobar.

- SHARED_INTERMEDIATE_DIR is a global scratch space. gyp files
*should* manually namespace any outputs they intend to write into this
directory. Writing out <(SHARED_INTERMEDIATE_DIR)/libraries.cc is
only safe if you know that no other gyp file in your project happens
to want to write out its own libraries.cc.


Codesearch for the former:
http://codesearch.google.com/codesearch#search/&exact_package=chromium&q=%5B%5E_%5Dintermediate_dir%20file:%5C.gyp&type=cs
Codesearch for the latter:
http://codesearch.google.com/codesearch#search/&exact_package=chromium&q=shared_intermediate_dir%20file:%5C.gyp&type=cs

Bradley Nelson

unread,
Aug 10, 2011, 7:08:00 PM8/10/11
to Evan Martin, gyp-developer
This matches my understanding.

-BradN

Dirk Pranke

unread,
Aug 11, 2011, 3:24:09 PM8/11/11
to Bradley Nelson, Evan Martin, gyp-developer
This matches, happily, what the docs say:

http://code.google.com/p/gyp/wiki/InputFormatReference#Predefined_Variables

-- Dirk

Evan Martin

unread,
Aug 11, 2011, 3:57:23 PM8/11/11
to Dirk Pranke, Bradley Nelson, gyp-developer
Thanks!

I guess all of these, that make assumptions about the path to the
intermediate dir, are wrong then:

http://codesearch.google.com/codesearch#search/&exact_package=chromium&q=intermediate_dir.*%5C.%5C.&type=cs
732: '<(INTERMEDIATE_DIR)/../chrome_frame',

And these ones, which write into the top-level shared dir, are likely fragile:
http://codesearch.google.com/codesearch#search/&exact_package=chromium&q=shared_intermediate_dir./%5B%5E/%5D*$%20file:%5C.gyp&type=cs
784: '<(SHARED_INTERMEDIATE_DIR)/plugin',

Reply all
Reply to author
Forward
0 new messages