diff mbox

[FFmpeg-devel] configure: use check_lib2 for cuda and cuvid

Message ID 20161112004458.4156-1-h.leppkes@gmail.com
State Accepted
Commit 0539ff0e1b2f4e388bf4de16d00846ed5cebe811
Headers show

Commit Message

Hendrik Leppkes Nov. 12, 2016, 12:44 a.m. UTC
Fixes building on Windows with MSVC using the link libraries distributed with the CUDA SDK.

check_lib2 is required here because it includes the header to get the full signature of the
function, including the stdcall calling convention and all of its arguments, which enabled
the linker to determine the fully qualified object name and resolve it through the import
library, since the CUDA SDK libraries do not include un-qualified aliases.
---
 configure | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Hendrik Leppkes Nov. 12, 2016, 10:21 a.m. UTC | #1
On Sat, Nov 12, 2016 at 1:44 AM, Hendrik Leppkes <h.leppkes@gmail.com> wrote:
> Fixes building on Windows with MSVC using the link libraries distributed with the CUDA SDK.
>
> check_lib2 is required here because it includes the header to get the full signature of the
> function, including the stdcall calling convention and all of its arguments, which enabled
> the linker to determine the fully qualified object name and resolve it through the import
> library, since the CUDA SDK libraries do not include un-qualified aliases.

Something the  message didn't say, this only applies to x86 where
stdcall is used, x64 uses only one calling convention for everything,
and this problem does not occur.

- Hendrik
Timo Rothenpieler Nov. 13, 2016, 12:31 a.m. UTC | #2
Seems like I never tested on any 32bit platform.

lgtm
Hendrik Leppkes Nov. 13, 2016, 11:20 a.m. UTC | #3
On Sun, Nov 13, 2016 at 1:31 AM, Timo Rothenpieler
<timo@rothenpieler.org> wrote:
> Seems like I never tested on any 32bit platform.
>

Applied, thanks.
diff mbox

Patch

diff --git a/configure b/configure
index be7e925..c00c591 100755
--- a/configure
+++ b/configure
@@ -5659,10 +5659,10 @@  fi
 enabled avfoundation_indev && { check_header_objcc AVFoundation/AVFoundation.h || disable avfoundation_indev; }
 enabled avfoundation_indev && { check_lib2 CoreGraphics/CoreGraphics.h CGGetActiveDisplayList -framework CoreGraphics ||
                                 check_lib2 ApplicationServices/ApplicationServices.h CGGetActiveDisplayList -framework ApplicationServices; }
-enabled cuda              && { check_lib cuda.h cuInit -lcuda ||
+enabled cuda              && { check_lib2 cuda.h cuInit -lcuda ||
                                die "ERROR: CUDA not found"; }
 enabled cuvid             && { add_cflags -I$source_path;
-                               check_lib "compat/cuda/cuviddec.h" cuvidCreateDecoder -lnvcuvid ||
+                               check_lib2 "compat/cuda/cuviddec.h" cuvidCreateDecoder -lnvcuvid ||
                                die "ERROR: CUVID not found"; } &&
                              { enabled cuda ||
                                die "ERROR: CUVID requires CUDA"; }