From 1f14454d63632106cfc6942c1a7501ca690b88ea Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Fri, 4 Aug 2023 22:04:52 -0400 Subject: [PATCH] Make It Work Standalone --- CMakeLists.txt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ac8883a..fc5c8d9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ project(gles-compatibility-layer) # Build add_library(gles-compatibility-layer STATIC src/state.c src/passthrough.c src/matrix.c src/draw.c) -target_link_libraries(gles-compatibility-layer m SDL) +target_link_libraries(gles-compatibility-layer m) target_include_directories(gles-compatibility-layer PUBLIC include) # Shaders include(cmake/util.cmake) @@ -11,3 +11,12 @@ embed_resource(gles-compatibility-layer src/shaders/main.vsh) embed_resource(gles-compatibility-layer src/shaders/main.fsh) # Warnings target_compile_options(gles-compatibility-layer PRIVATE -Wall -Wextra -Werror -Wpointer-arith -Wshadow -Wnull-dereference) + +# Dependencies +set(GLES_COMPATIBILITY_LAYER_DEPENDENCY "" CACHE STRING "Compatibility Layer Dependency") +if(NOT GLES_COMPATIBILITY_LAYER_DEPENDENCY) + find_package(SDL2 REQUIRED) + target_link_libraries(gles-compatibility-layer SDL2::SDL2) +else() + target_link_libraries(gles-compatibility-layer "${GLES_COMPATIBILITY_LAYER_DEPENDENCY}") +endif()