diff options
author | Jason Perkins <starkos@industriousone.com> | 2013-02-21 19:22:40 +0400 |
---|---|---|
committer | Jason Perkins <starkos@industriousone.com> | 2013-02-21 19:22:40 +0400 |
commit | 8c123337a2682c4a681dc6124a73f53e11c74059 (patch) | |
tree | 17f67841e0d41c60d2e0b80b801a96f6d5c9ac4c | |
parent | 7fd99f37c98ae37d053f3997da7a96dea79e092d (diff) |
Fix .def file support for VS2010 (Riccardo Ghetta)
-rw-r--r-- | CHANGES.txt | 1 | ||||
-rw-r--r-- | src/actions/vstudio/vs2010_vcxproj.lua | 6 | ||||
-rw-r--r-- | tests/actions/vstudio/vc2010/test_link_settings.lua | 19 |
3 files changed, 26 insertions, 0 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 2701c36..f0e8937 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -69,6 +69,7 @@ * Allow command line override of makefile flags (Cameron Hart) * Fix linking to external libraries outside of project folder * Improve processing of ld.so.conf (Cameron Hart) +* Patch 154: Fix .def file support for VS2010 (Riccardo Ghetta) ------- diff --git a/src/actions/vstudio/vs2010_vcxproj.lua b/src/actions/vstudio/vs2010_vcxproj.lua index cf62c51..0b758d8 100644 --- a/src/actions/vstudio/vs2010_vcxproj.lua +++ b/src/actions/vstudio/vs2010_vcxproj.lua @@ -403,6 +403,12 @@ end import_lib(cfg) + + local deffile = premake.findfile(cfg, ".def") + if deffile then + _p(3,'<ModuleDefinitionFile>%s</ModuleDefinitionFile>', deffile) + end + link_target_machine(3,cfg) additional_options(3,cfg) end diff --git a/tests/actions/vstudio/vc2010/test_link_settings.lua b/tests/actions/vstudio/vc2010/test_link_settings.lua index 46f02b2..c33345b 100644 --- a/tests/actions/vstudio/vc2010/test_link_settings.lua +++ b/tests/actions/vstudio/vc2010/test_link_settings.lua @@ -208,3 +208,22 @@ </Link> ]] end + + +-- +-- Correctly handle module definition (.def) files. +-- + + function suite.recognizesModuleDefinitionFile() + files { "hello.cpp", "hello.def" } + prepare() + test.capture [[ + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>false</GenerateDebugInformation> + <OutputFile>$(OutDir)MyProject.exe</OutputFile> + <EntryPointSymbol>mainCRTStartup</EntryPointSymbol> + <ModuleDefinitionFile>hello.def</ModuleDefinitionFile> + </Link> + ]] + end |