From e020a6d17120513129a651d8a354f1085941b8e2 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Tue, 12 Nov 2002 15:24:31 -0500 Subject: ENH: add .def file support --- Modules/Platform/Windows-bcc32.cmake | 4 ++-- Modules/Platform/Windows-cl.cmake | 4 ++-- Source/cmLocalUnixMakefileGenerator.cxx | 14 +++++++++++++- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/Modules/Platform/Windows-bcc32.cmake b/Modules/Platform/Windows-bcc32.cmake index 53123c5..f45c0aa 100644 --- a/Modules/Platform/Windows-bcc32.cmake +++ b/Modules/Platform/Windows-bcc32.cmake @@ -3,7 +3,7 @@ SET(CMAKE_LINK_LIBRARY_FLAG "") # create a shared C++ library SET(CMAKE_CXX_CREATE_SHARED_LIBRARY - " @&&|\n-e -tWD \n|" + " @&&|\n-e -tWD \n|" "implib @&&|\n-w .lib .dll\n|" ) @@ -11,7 +11,7 @@ SET(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY}) # create a C shared library SET(CMAKE_C_CREATE_SHARED_LIBRARY - " @&&|\n-e -tWD \n|" + " @&&|\n-e -tWD \n|" "implib @&&|\n-w .lib .dll\n|" ) diff --git a/Modules/Platform/Windows-cl.cmake b/Modules/Platform/Windows-cl.cmake index 278b20f..83fa2e7 100644 --- a/Modules/Platform/Windows-cl.cmake +++ b/Modules/Platform/Windows-cl.cmake @@ -3,7 +3,7 @@ SET(CMAKE_LINK_LIBRARY_FLAG "") # create a shared C++ library SET(CMAKE_CXX_CREATE_SHARED_LIBRARY - "link @<<\n /out: /dll \n<<") + "link @<<\n /out: /dll \n<<") SET(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY}) @@ -58,7 +58,7 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM NAMES nmake ) # executable linker flags - +SET (CMAKE_LINK_DEF_FILE_FLAG "/DEF:") SET (CMAKE_EXE_LINKER_FLAGS_INIT "/nologo /STACK:10000000 /machine:I386 /INCREMENTAL:YES") SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug /pdbtype:sept") SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug /pdbtype:sept") diff --git a/Source/cmLocalUnixMakefileGenerator.cxx b/Source/cmLocalUnixMakefileGenerator.cxx index 215e7bf..ea6b6c5 100644 --- a/Source/cmLocalUnixMakefileGenerator.cxx +++ b/Source/cmLocalUnixMakefileGenerator.cxx @@ -834,7 +834,19 @@ void cmLocalUnixMakefileGenerator::OutputSharedLibraryRule(std::ostream& fout, linkFlags += this->GetSafeDefinition(build.c_str()); linkFlags += " "; } - +#ifdef _WIN32 + const std::vector& sources = t.GetSourceFiles(); + for(std::vector::const_iterator i = sources.begin(); + i != sources.end(); ++i) + { + if((*i)->GetSourceExtension() == "def") + { + linkFlags += this->GetSafeDefinition("CMAKE_LINK_DEF_FILE_FLAG"); + linkFlags += (*i)->GetFullPath(); + linkFlags += " "; + } + } +#endif this->OutputLibraryRule(fout, name, t, this->GetSafeDefinition("CMAKE_SHARED_LIBRARY_PREFIX"), this->GetSafeDefinition("CMAKE_SHARED_LIBRARY_SUFFIX"), -- cgit v0.12