AW: [CMake] CMake 2.4.7: Generator "Visual Studio 7 .NET 2003" seems
to ignore certain LINK_FLAGS properties (worked in 2.4.6)
Gerhard Grimm
ggrimm at detec.de
Tue Jul 31 10:19:44 EDT 2007
Hi Bill,
here's a minimal example, consisting of three files.
source.c:
---------------------------------------------
#include <stdio.h>
void MyExport1(void)
{
puts("MyExport1");
}
void MyExport2(void)
{
puts("MyExport2");
}
---------------------------------------------
source.def:
---------------------------------------------
EXPORTS
MyExport1
MyExport2
---------------------------------------------
CMakeLists.txt:
---------------------------------------------
project(MyProject)
add_library(MyLib SHARED source.c)
set_target_properties(MyLib PROPERTIES LINK_FLAGS "/DEF:${CMAKE_CURRENT_SOURCE_DIR}/source.def")
---------------------------------------------
When using the 2.4.7 Visual Studio .NET generator, the build will succeed, but the resulting "MyLib.dll" will not export any symbols, since the "/DEF:..." flag is missing in the project (reverting to 2.4.6 would fix this).
Using the NMake makefiles generator, the "/DEF:..." flag will be passed to the linker, and voilĂ - we have exports.
Thank you for your attention!
Best regards,
Gerhard
More information about the CMake
mailing list