Skip to content

Commit

Permalink
cmake change for ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Crylia committed Mar 26, 2024
1 parent 8a5ec5d commit 30e2fc7
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,22 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(QT NAMES Qt6 REQUIRED COMPONENTS Widgets Qml Svg Core)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets Qml Svg Core)

find_package(SDL2 REQUIRED)
find_library(SDL2_MIXER_LIBRARY SDL2_mixer)
find_package(SDL2 QUIET)

if(NOT SDL2_FOUND)
message(STATUS "SDL2 not found. Fallback to SDL3.")

# Find SDL3 package
find_package(SDL3 REQUIRED)
set(SDL_INCLUDE_DIRS ${SDL3_INCLUDE_DIRS})
set(SDL_LIBRARIES ${SDL3_LIBRARIES})
else()
message(STATUS "SDL2 found.")
set(SDL_INCLUDE_DIRS ${SDL2_INCLUDE_DIRS})
set(SDL_LIBRARIES ${SDL2_LIBRARIES})
endif()

find_library(SDL_MIXER_LIBRARY NAMES SDL2_mixer SDL3_mixer)
include_directories(${SDL2_INCLUDE_DIRS})

find_package(PkgConfig REQUIRED)
Expand Down Expand Up @@ -42,8 +56,8 @@ target_link_libraries(CryliaPlayer PRIVATE
Qt${QT_VERSION_MAJOR}::Qml
Qt${QT_VERSION_MAJOR}::Svg
Qt${QT_VERSION_MAJOR}::Core
${SDL2_LIBRARIES}
${SDL2_MIXER_LIBRARY}
${SDL_LIBRARIES}
${SDL_MIXER_LIBRARY}
PkgConfig::LIBAV
)

Expand Down

0 comments on commit 30e2fc7

Please sign in to comment.