diff options
-rw-r--r-- | Modules/Platform/Windows-bcc32.cmake | 4 | ||||
-rw-r--r-- | Modules/Platform/Windows-cl.cmake | 4 | ||||
-rw-r--r-- | 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 - "<CMAKE_CXX_COMPILER> @&&|\n-e<TARGET> -tWD <OBJECTS> <LINK_LIBRARIES>\n|" + "<CMAKE_CXX_COMPILER> @&&|\n-e<TARGET> -tWD <OBJECTS> <LINK_LIBRARIES> <LINK_FLAGS>\n|" "implib @&&|\n-w <TARGET_BASE>.lib <TARGET_BASE>.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 - "<CMAKE_CXX_COMPILER> @&&|\n-e<TARGET> -tWD <OBJECTS> <LINK_LIBRARIES>\n|" + "<CMAKE_CXX_COMPILER> @&&|\n-e<TARGET> -tWD <OBJECTS> <LINK_LIBRARIES> <LINK_FLAGS>\n|" "implib @&&|\n-w <TARGET_BASE>.lib <TARGET_BASE>.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:<TARGET> /dll <OBJECTS> <LINK_LIBRARIES> \n<<") + "link @<<\n /out:<TARGET> /dll <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES> \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<cmSourceFile*>& sources = t.GetSourceFiles(); + for(std::vector<cmSourceFile*>::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"), |