Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
win: Add NoImportLibrary flag for ninja generator
This adds a flag that tells ninja not to expect an import library to be generated. This is only needed very rarely in the case of DLLs that have no exported symbols. There is no corresponding functionality in the msvs generator, so the test and functionality are ninja generator-only. R=grt@chromium.org BUG=gyp:397, chromium:451499 Review URL: https://codereview.chromium.org/890773004 git-svn-id: http://gyp.googlecode.com/svn/trunk@2030 78cadc50-ecff-11dd-a971-7dbc132099af
- Loading branch information
Showing
5 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env python | ||
|
||
# Copyright (c) 2015 Google Inc. All rights reserved. | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
""" | ||
Make sure that the (custom) NoImportLibrary flag is handled correctly. | ||
""" | ||
|
||
import TestGyp | ||
|
||
import os | ||
import sys | ||
|
||
if sys.platform == 'win32': | ||
test = TestGyp.TestGyp(formats=['ninja']) | ||
|
||
CHDIR = 'importlib' | ||
test.run_gyp('noimplib.gyp', chdir=CHDIR) | ||
test.build('noimplib.gyp', test.ALL, chdir=CHDIR) | ||
|
||
# The target has an entry point, but no exports. Ordinarily, ninja expects | ||
# all DLLs to export some symbols (with the exception of /NOENTRY resource- | ||
# only DLLs). When the NoImportLibrary flag is set, this is suppressed. If | ||
# this is not working correctly, the expected .lib will never be generated | ||
# but will be expected, so the build will not be up to date. | ||
test.up_to_date('noimplib.gyp', test.ALL, chdir=CHDIR) | ||
|
||
test.pass_test() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Copyright (c) 2015 Google Inc. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include <windows.h> | ||
|
||
BOOL APIENTRY DllMain(HMODULE module, DWORD reason, LPVOID reserved) { | ||
return TRUE; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright (c) 2015 Google Inc. All rights reserved. | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
{ | ||
'targets': [ | ||
{ | ||
'target_name': 'no_import_library', | ||
'type': 'loadable_module', | ||
'msvs_settings': { | ||
'NoImportLibrary': 'true', | ||
}, | ||
'sources': ['dll_no_exports.cc'], | ||
}, | ||
] | ||
} |