mirror of
https://github.com/reactos/CMake.git
synced 2025-01-20 02:12:35 +00:00
BUG: Fix export/import file generation to not store link dependencies of executables or modules.
This commit is contained in:
parent
6388ebceb1
commit
437043bb04
@ -135,7 +135,22 @@ cmExportFileGenerator
|
||||
}
|
||||
|
||||
// Add the transitive link dependencies for this configuration.
|
||||
{
|
||||
if(target->GetType() == cmTarget::STATIC_LIBRARY ||
|
||||
target->GetType() == cmTarget::SHARED_LIBRARY)
|
||||
{
|
||||
this->SetImportLinkProperties(config, suffix, target, properties);
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
void
|
||||
cmExportFileGenerator
|
||||
::SetImportLinkProperties(const char* config, std::string const& suffix,
|
||||
cmTarget* target, ImportPropertyMap& properties)
|
||||
{
|
||||
// Get the makefile in which to lookup target information.
|
||||
cmMakefile* mf = target->GetMakefile();
|
||||
|
||||
// Compute which library configuration to link.
|
||||
cmTarget::LinkLibraryType linkType = cmTarget::OPTIMIZED;
|
||||
if(config && cmSystemTools::UpperCase(config) == "DEBUG")
|
||||
@ -193,7 +208,6 @@ cmExportFileGenerator
|
||||
std::string prop = "IMPORTED_LINK_LIBRARIES";
|
||||
prop += suffix;
|
||||
properties[prop] = link_libs;
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
@ -67,6 +67,9 @@ protected:
|
||||
void SetImportDetailProperties(const char* config,
|
||||
std::string const& suffix, cmTarget* target,
|
||||
ImportPropertyMap& properties);
|
||||
void SetImportLinkProperties(const char* config,
|
||||
std::string const& suffix, cmTarget* target,
|
||||
ImportPropertyMap& properties);
|
||||
|
||||
/** Each subclass knows how to generate its kind of export file. */
|
||||
virtual bool GenerateMainFile(std::ostream& os) = 0;
|
||||
|
@ -5,7 +5,9 @@ if(CMAKE_ANSI_CFLAGS)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ANSI_CFLAGS}")
|
||||
endif(CMAKE_ANSI_CFLAGS)
|
||||
|
||||
add_library(testExe1lib STATIC testExe1lib.c) # not exported
|
||||
add_executable(testExe1 testExe1.c)
|
||||
target_link_libraries(testExe1 testExe1lib)
|
||||
|
||||
add_executable(testExe2 testExe2.c)
|
||||
set_property(TARGET testExe2 PROPERTY ENABLE_EXPORTS 1)
|
||||
|
@ -1,5 +1,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
extern int testExe1lib();
|
||||
|
||||
int main(int argc, const char* argv[])
|
||||
{
|
||||
if(argc < 2)
|
||||
@ -20,5 +22,5 @@ int main(int argc, const char* argv[])
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return testExe1lib();
|
||||
}
|
||||
|
1
Tests/ExportImport/Export/testExe1lib.c
Normal file
1
Tests/ExportImport/Export/testExe1lib.c
Normal file
@ -0,0 +1 @@
|
||||
int testExe1lib() { return 0; }
|
Loading…
x
Reference in New Issue
Block a user