]> granicus.if.org Git - libexpat/commitdiff
Fix link step on MinGW
authorxantares <xantares09@hotmail.com>
Thu, 20 Jun 2019 17:01:30 +0000 (19:01 +0200)
committerGitHub <noreply@github.com>
Thu, 20 Jun 2019 17:01:30 +0000 (19:01 +0200)
.def files are handled differently on MinGW than MSVC for the WIN32 target:

```
[ 14%] Linking C shared library libexpat.dll
/usr/lib/gcc/x86_64-w64-mingw32/9.1.0/../../../../x86_64-w64-mingw32/bin/ld: ../lib/libexpat.def:4: syntax error
/usr/lib/gcc/x86_64-w64-mingw32/9.1.0/../../../../x86_64-w64-mingw32/bin/ld:../lib/libexpat.def: file format not recognized; treating as linker script
/usr/lib/gcc/x86_64-w64-mingw32/9.1.0/../../../../x86_64-w64-mingw32/bin/ld:../lib/libexpat.def:1: syntax error
collect2: error: ld returned 1 exit status
```

expat/CMakeLists.txt

index bcd91ba679557fde5d02076db4330fd840f4da21..e8777e236e29cfc6a81d8c4dc75d2db67829378c 100644 (file)
@@ -153,9 +153,9 @@ set(expat_SRCS
 \r
 if(BUILD_shared)\r
     set(_SHARED SHARED)\r
-    if(WIN32)\r
+    if(MSVC)\r
         set(expat_SRCS ${expat_SRCS} lib/libexpat.def)\r
-    endif(WIN32)\r
+    endif(MSVC)\r
 else(BUILD_shared)\r
     set(_SHARED STATIC)\r
     if(WIN32)\r