Commits

Jason Perkins committed ea6b557

Fix module definition file (.def) handling in VC'10

  • Participants
  • Parent commits c070f61

Comments (0)

Files changed (3)

 * 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)
 
 
 -------

File src/actions/vstudio/vs2010_vcxproj.lua

 		vc2010.additionalLibraryDirectories(cfg)
 		vc2010.importLibrary(cfg)
 		vc2010.entryPointSymbol(cfg)
+		vc2010.moduleDefinitionFile(cfg)
 		vc2010.additionalLinkOptions(cfg)
 	end
 
 	end
 
 
+	function vc2010.moduleDefinitionFile(cfg)
+		local df = config.findfile(cfg, ".def")
+		if df then
+			_p(3,'<ModuleDefinitionFile>%s</ModuleDefinitionFile>', df)
+		end
+	end
+
+
 	function vc2010.multiProcessorCompilation(cfg)
 		if cfg.flags.MultiProcessorCompile then
 			_p(3,'<MultiProcessorCompilation>true</MultiProcessorCompilation>')

File tests/actions/vstudio/vc2010/test_link.lua

 			<AdditionalDependencies>-lfs_stub;-lnet_stub;%(AdditionalDependencies)</AdditionalDependencies>
 		]]
 	end
+
+
+--
+-- Correctly handle module definition (.def) files.
+--
+
+	function suite.recognizesModuleDefinitionFile()
+		files { "hello.cpp", "hello.def" }
+		prepare()
+		test.capture [[
+		<Link>
+			<SubSystem>Windows</SubSystem>
+			<GenerateDebugInformation>false</GenerateDebugInformation>
+			<ImportLibrary>MyProject.lib</ImportLibrary>
+			<ModuleDefinitionFile>hello.def</ModuleDefinitionFile>
+		</Link>
+		]]
+	end