From 7b6668fe1aa5119a6831e68e1ddfbc0599cbc33e Mon Sep 17 00:00:00 2001 From: "Anthony J. Bentley" Date: Thu, 3 Aug 2017 01:40:21 -0600 Subject: [PATCH] Make sure to add SDL's library directory before building SDL things. --- a2play/CMakeLists.txt | 2 ++ src/CMakeLists.txt | 1 + test/CMakeLists.txt | 25 +++++++++++++------------ 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/a2play/CMakeLists.txt b/a2play/CMakeLists.txt index 30999f5..ac0b4db 100644 --- a/a2play/CMakeLists.txt +++ b/a2play/CMakeLists.txt @@ -6,6 +6,8 @@ include_directories(${AUDIALITY2_BINARY_DIR}/include) include_directories(${AUDIALITY2_SOURCE_DIR}/include) link_directories(${AUDIALITY2_BINARY_DIR}) +pkg_search_module(SDL2 sdl2) +link_directories(${SDL2_LIBDIR}) set(AUDIALITY2_LIBRARY audiality2) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 683d327..9ae55d8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -65,6 +65,7 @@ if(SDL_FOUND) elseif(SDL2_FOUND) add_definitions(-DA2_HAVE_SDL) include_directories(${SDL2_INCLUDE_DIRS}) + link_directories(${SDL2_LIBDIR}) endif(SDL_FOUND) if(USE_JACK) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 4fb6cd9..4a295c4 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -18,18 +18,6 @@ function(a2_add_test testname) endif(FORCE_32BIT) endfunction(a2_add_test) -a2_add_test(waveupload) -a2_add_test(rtsubstate) -a2_add_test(renderwave) -a2_add_test(renderwave2) -a2_add_test(streamupload) -a2_add_test(wavestress) -a2_add_test(wavestress2) -a2_add_test(voicestress) -a2_add_test(streamtest) -a2_add_test(streamstress) -a2_add_test(timingtest) - if(SDL_FOUND) include_directories(${SDL_INCLUDE_DIR}) a2_add_test(a2test gui.c) @@ -38,10 +26,23 @@ if(SDL_FOUND) target_link_libraries(apistress SDLmain) elseif(SDL2_FOUND) include_directories(${SDL2_INCLUDE_DIRS}) + link_directories(${SDL2_LIBDIR}) a2_add_test(a2test gui.c) a2_add_test(apistress) endif(SDL_FOUND) +a2_add_test(waveupload) +a2_add_test(rtsubstate) +a2_add_test(renderwave) +a2_add_test(renderwave2) +a2_add_test(streamupload) +a2_add_test(wavestress) +a2_add_test(wavestress2) +a2_add_test(voicestress) +a2_add_test(streamtest) +a2_add_test(streamstress) +a2_add_test(timingtest) + # Release build: full optimization, no debug features, no debug info set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG")