diff options
| author | Andre Weissflog <floooh@gmail.com> | 2022-09-25 16:18:44 +0200 |
|---|---|---|
| committer | Andre Weissflog <floooh@gmail.com> | 2022-09-25 16:18:44 +0200 |
| commit | 0aa383225c2b8d9bbdf10d143773680023450ebd (patch) | |
| tree | bb083ee250dbdafa4e1b87d3fc7102b21b43eb5a /tests | |
| parent | 523c85cd08b1f3850ee6bc4809ce22744f8d75bb (diff) | |
integrate sokol_app.h Linux EGL/GLES3 support into test- and analysis-scripts
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/CMakeLists.txt | 11 | ||||
| -rwxr-xr-x | tests/analyze_linux.sh | 3 | ||||
| -rw-r--r-- | tests/test_common.sh | 10 | ||||
| -rwxr-xr-x | tests/test_linux.sh | 6 |
4 files changed, 27 insertions, 3 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index fe923218..8d3c2492 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -6,6 +6,7 @@ set(CMAKE_CXX_STANDARD 17) # needed for UWP # SOKOL_GLCORE33, SOKOL_GLES2, SOKOL_GLES3, SOKOL_D3D11, SOKOL_METAL, SOKOL_WGPU, SOKOL_DUMMY option(SOKOL_BACKEND "Select 3D backend API" SOKOL_GLCORE33) +option(SOKOL_FORCE_EGL "Force EGL with GLCORE33 backend" OFF) option(USE_ARC "Enable/disable ARC" OFF) if (CMAKE_SYSTEM_NAME STREQUAL Emscripten) @@ -27,6 +28,7 @@ else() endif() message(">> SOKOL_BACKEND: ${SOKOL_BACKEND}") +message(">> SOKOL_FORCE_EGL: ${SOKOL_FORCE_EGL}") if (OSX_IOS OR OSX_MACOS) if (USE_ARC) message(">> ObjC ARC ENABLED") @@ -83,7 +85,11 @@ elseif (ANDROID) elseif (LINUX) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) - set(system_libs ${system_libs} X11 Xi Xcursor GL asound dl m Threads::Threads) + if ((SOKOL_BACKEND STREQUAL SOKOL_GLES3) OR SOKOL_FORCE_EGL) + set(system_libs ${system_libs} X11 Xi Xcursor EGL GL asound dl m Threads::Threads) + else() + set(system_libs ${system_libs} X11 Xi Xcursor GL asound dl m Threads::Threads) + endif() elseif (OSX_MACOS) set(exe_type MACOSX_BUNDLE) if (USE_ARC) @@ -103,6 +109,9 @@ elseif (WINDOWS) endif() macro(configure_common target) + if (SOKOL_FORCE_EGL) + target_compile_definitions(${target} PRIVATE SOKOL_FORCE_EGL) + endif() target_compile_definitions(${target} PRIVATE ${SOKOL_BACKEND}) target_link_options(${target} PRIVATE ${link_flags}) target_link_libraries(${target} PRIVATE ${system_libs}) diff --git a/tests/analyze_linux.sh b/tests/analyze_linux.sh index 35b408f4..229e272a 100755 --- a/tests/analyze_linux.sh +++ b/tests/analyze_linux.sh @@ -3,4 +3,5 @@ set -e source test_common.sh prepare -analyze linux_gl_analyze SOKOL_GLCORE33 Debug
\ No newline at end of file +analyze linux_gl_analyze SOKOL_GLCORE33 Debug +analyze linux_gles3_analyze SOKOL_GLES3 Debug
\ No newline at end of file diff --git a/tests/test_common.sh b/tests/test_common.sh index 1fe5dd73..046f40e3 100644 --- a/tests/test_common.sh +++ b/tests/test_common.sh @@ -41,6 +41,16 @@ build() { cd ../.. } +build_force_egl() { + cfg=$1 + backend=$2 + mode=$3 + mkdir -p build/$cfg && cd build/$cfg + cmake -GNinja -DSOKOL_BACKEND=$backend -DSOKOL_FORCE_EGL=ON -DCMAKE_BUILD_TYPE=$mode ../.. + cmake --build . + cd ../.. +} + analyze() { cfg=$1 backend=$2 diff --git a/tests/test_linux.sh b/tests/test_linux.sh index e157ec2c..7056a244 100755 --- a/tests/test_linux.sh +++ b/tests/test_linux.sh @@ -4,5 +4,9 @@ source test_common.sh prepare build linux_gl_debug SOKOL_GLCORE33 Debug build linux_gl_release SOKOL_GLCORE33 Release -runtest linux_gl_debug +build linux_gles3_debug SOKOL_GLES3 Debug +build linux_gles3_release SOKOL_GLES3 Release +build_force_egl linux_gl_egl_debug SOKOL_GLCORE33 Debug +build_force_egl linux_gl_egl_release SOKOL_GLCORE33 Release +runtest linux_glx_debug |