Skip to content

Commit

Permalink
Fixed bug 4144 - CMake complains about trailing spaces in sdl2.pc
Browse files Browse the repository at this point in the history
 Azamat H. Hackimov

When you try use SDL2 2.0.8 in CMake project in Linux, it complains about trailing spaces in sdl2.pc:

CMake Error at CMakeLists.txt:147 (add_executable):
  Target "TestSimpleMain" links to item "-L/usr/lib64 -lSDL2 " which has
  leading or trailing whitespace.  This is now an error according to policy
  CMP0004.
  • Loading branch information
slouken committed Apr 24, 2018
1 parent a1b8fa6 commit db94dfb
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
15 changes: 11 additions & 4 deletions configure
Expand Up @@ -15752,10 +15752,17 @@ EXTRA_LDFLAGS="$BASE_LDFLAGS"
# fi
#done
SDL_CFLAGS="$BASE_CFLAGS"
SDL_LIBS="-lSDL2 $BASE_LDFLAGS"
CPPFLAGS="$CPPFLAGS $EXTRA_CFLAGS"
CFLAGS="$CFLAGS $EXTRA_CFLAGS"
LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
SDL_LIBS="-lSDL2"
if "$BASE_LDFLAGS" != "" ; then
SDL_LIBS="$SDL_LIBS $BASE_LDFLAGS"
fi
if "$EXTRA_CFLAGS" != "" ; then
CPPFLAGS="$CPPFLAGS $EXTRA_CFLAGS"
CFLAGS="$CFLAGS $EXTRA_CFLAGS"
fi
if "$EXTRA_LDFLAGS" != "" ; then
LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
fi

base_libdir=`echo \${libdir} | sed 's/.*\/\(.*\)/\1/; q'`

Expand Down
15 changes: 11 additions & 4 deletions configure.in
Expand Up @@ -123,10 +123,17 @@ EXTRA_LDFLAGS="$BASE_LDFLAGS"
# fi
#done
SDL_CFLAGS="$BASE_CFLAGS"
SDL_LIBS="-lSDL2 $BASE_LDFLAGS"
CPPFLAGS="$CPPFLAGS $EXTRA_CFLAGS"
CFLAGS="$CFLAGS $EXTRA_CFLAGS"
LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
SDL_LIBS="-lSDL2"
if [ "$BASE_LDFLAGS" != "" ]; then
SDL_LIBS="$SDL_LIBS $BASE_LDFLAGS"
fi
if [ "$EXTRA_CFLAGS" != "" ]; then
CPPFLAGS="$CPPFLAGS $EXTRA_CFLAGS"
CFLAGS="$CFLAGS $EXTRA_CFLAGS"
fi
if [ "$EXTRA_LDFLAGS" != "" ]; then
LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
fi

dnl set this to use on systems that use lib64 instead of lib
base_libdir=`echo \${libdir} | sed 's/.*\/\(.*\)/\1/; q'`
Expand Down

0 comments on commit db94dfb

Please sign in to comment.