Skip to content

Commit

Permalink
code refine
Browse files Browse the repository at this point in the history
  • Loading branch information
K1ngst0m committed Jan 30, 2024
1 parent 289bad5 commit 7fa9909
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions cmake/AphExternal.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,12 @@ if(NOT (APH_WSI_BACKEND IN_LIST VALID_WSI_BACKENDS))
message(FATAL_ERROR "Wrong value passed for APH_WSI_BACKEND, use one of: Auto, GLFW, SDL2")
endif()

if(APH_WSI_BACKEND STREQUAL "Auto" OR APH_WSI_BACKEND STREQUAL "GLFW")
if(APH_WSI_BACKEND STREQUAL "Auto")
message("WSI backend is set to 'Auto', choose the GLFW by default")
set(APH_WSI_BACKEND "GLFW")
endif()

if(APH_WSI_BACKEND STREQUAL "GLFW")
CPMAddPackage(
NAME GLFW
GITHUB_REPOSITORY glfw/glfw
Expand All @@ -102,8 +107,8 @@ if(APH_WSI_BACKEND STREQUAL "Auto" OR APH_WSI_BACKEND STREQUAL "GLFW")
elseif(APH_WSI_BACKEND STREQUAL "SDL2")
CPMAddPackage(
NAME SDL2
VERSION 2.29.3
URL https://libsdl.org/release/SDL2-2.29.3.zip
VERSION 2.28.5
URL https://github.com/libsdl-org/SDL/releases/download/release-2.28.5/SDL2-2.28.5.tar.gz
)
if(NOT SDL2_ADDED)
message(FATAL_ERROR "SDL2 library not found!")
Expand Down
2 changes: 1 addition & 1 deletion engine/wsi/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
add_library(wsi STATIC ${APH_WSI_SRC})

if(APH_WSI_BACKEND STREQUAL "Auto" OR APH_WSI_BACKEND STREQUAL "GLFW")
if(APH_WSI_BACKEND STREQUAL "GLFW")
add_compile_definitions(WSI_USE_GLFW)
target_sources(wsi PRIVATE
${APH_ENGINE_WSI_DIR}/wsi_glfw.cpp
Expand Down

0 comments on commit 7fa9909

Please sign in to comment.