[CMake] Mingw target can not process .DEF files

Dongsheng Song dongsheng.song at gmail.com
Thu Jan 27 03:55:02 EST 2011


Hi,

After I declared the following DLL target:

ADD_LIBRARY(freetds-db SHARED freetds-db.def freetds-db.rc
        bcp.c
        dblib.c
        dbopen.c
        dbutil.c
        rpc.c
        xact.c)

CMake use the following link command:

C:\gcc-4.5-windows\bin\gcc.exe -s -static -shared -o libfreetds-db.dll
-Wl,--out-implib,libfreetds-db.dll.a
-Wl,--major-image-version,0,--minor-image-version,0 -Wl,--whole-archive
CMakeFiles\freetds-db.dir/objects.a -Wl,--no-whole-archive ..\tds\libtds.a
..\replacements\libreplacements.a -lws2_32 -lssp -lkernel32 -luser32 -lgdi32
-lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32

Completely ignored freetds-db.def file, I expected freetds-db.def file in
the link file list, e.g.

C:\gcc-4.5-windows\bin\gcc.exe -s -static -shared -o libfreetds-db.dll
-Wl,--out-implib,libfreetds-db.dll.a
-Wl,--major-image-version,0,--minor-image-version,0 -Wl,--whole-archive
CMakeFiles\freetds-db.dir/objects.a -Wl,--no-whole-archive freetds-db.def
..\tds\libtds.a ..\replacements\libreplacements.a -lws2_32 -lssp -lkernel32
-luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32
-ladvapi32

I do not want gcc export ALL symbols instead of specified in .DEF file.

Thanks for some help.

--
Dongsheng
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110127/7c27a6a7/attachment.htm>


More information about the CMake mailing list