Skip to content

Commit 0bcc1bd

Browse files
authored
Add debian-12 support (#2946)
1 parent bf04921 commit 0bcc1bd

File tree

11 files changed

+55
-32
lines changed

11 files changed

+55
-32
lines changed

1k/build.profiles

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# --- region platfom:common
77

88
# The axmol shader compiler, legacy name is 'glslcc' before axmol-2.3.0
9-
axslcc=3.3.0+
9+
axslcc=3.3.1+
1010

1111
# The cmake, @gradle @axmol-cmdline
1212
# as latest as possible

3rdparty/yasio/yasio/tlx/string.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class basic_string {
8181
__compressed_pair<allocator_type, _Str_storage> _Mypair;
8282

8383
basic_string() : _Mypair(__zero_then_variadic_args_t{}) {}
84-
basic_string(nullptr_t) = delete;
84+
basic_string(::std::nullptr_t) = delete;
8585
explicit basic_string(size_type count) : _Mypair(__one_then_variadic_args_t{}, _Alloc{}) { resize(static_cast<size_type>(count)); }
8686
basic_string(size_type count, const_reference val) : _Mypair(__one_then_variadic_args_t{}, _Alloc{}) { resize(static_cast<size_type>(count), val); }
8787
template <typename _Iter, _TLX enable_if_t<_TLX is_iterator<_Iter>::value, int> = 0>

axmol/CMakeLists.txt

Lines changed: 44 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,25 @@ endif()
5050

5151
include(CMakeDependentOption)
5252

53+
# check linux system libraries
54+
if(LINUX)
55+
find_package(X11 REQUIRED)
56+
57+
# including GTK3.0 and WebKit2Gtk4.x
58+
find_package(PkgConfig REQUIRED)
59+
pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
60+
61+
set(_webkit2gtk_vers "4.1;4.0")
62+
63+
foreach(_ver ${_webkit2gtk_vers})
64+
pkg_check_modules(WEBKIT2GTK webkit2gtk-${_ver})
65+
66+
if(WEBKIT2GTK_LIBRARY_DIRS)
67+
break()
68+
endif()
69+
endforeach()
70+
endif()
71+
5372
set(AX_RENDER_API "auto" CACHE STRING "Specify axmol graphics render API")
5473
set_property(CACHE AX_RENDER_API PROPERTY STRINGS d3d11 d3d12 vk mtl gl)
5574

@@ -406,6 +425,10 @@ ax_config_pred(${_AX_CORE_LIB} AX_ENABLE_VR)
406425
ax_config_pred(${_AX_CORE_LIB} AX_CORE_PROFILE)
407426
ax_config_pred(${_AX_CORE_LIB} AX_ENABLE_WAYLAND)
408427

428+
if(LINUX AND WEBKIT2GTK_FOUND)
429+
target_compile_definitions(${_AX_CORE_LIB} PUBLIC AX_HAVE_WEBKIT2GTK=1)
430+
endif()
431+
409432
# add base macro define and compile options
410433
use_ax_compile_define(${_AX_CORE_LIB})
411434
use_ax_compile_options(${_AX_CORE_LIB})
@@ -548,29 +571,29 @@ if(ANDROID)
548571
target_link_libraries(${_AX_CORE_LIB} ${AX_LUA_ENGINE})
549572
endif()
550573
endif()
551-
endif()
552-
553-
if(LINUX)
554-
find_package(X11 REQUIRED)
574+
elseif(LINUX)
555575
target_include_directories(${_AX_CORE_LIB} PUBLIC "${X11_X11_INCLUDE_PATH}")
556576

557-
# X11 gets linked by cmake/Modules/AXLinkHelpers.cmake
558-
559-
# including GTK3.0 and WebKit2Gtk4.x
560-
find_package(PkgConfig REQUIRED)
561-
pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
562-
563-
set(_webkit2gtk_vers "4.1;4.0")
564-
565-
foreach(_ver ${_webkit2gtk_vers})
566-
pkg_check_modules(WEBKIT2GTK webkit2gtk-${_ver})
567-
568-
if(WEBKIT2GTK_LIBRARY_DIRS)
569-
break()
577+
# remove system freetype2 due to we already embed freetype
578+
set(_gtk_includes "")
579+
set(_filtered_freetype FALSE)
580+
foreach(dir IN LISTS GTK3_INCLUDE_DIRS)
581+
if(NOT dir MATCHES "freetype2")
582+
list(APPEND _gtk_includes "${dir}")
583+
else()
584+
set(_filtered_freetype TRUE)
570585
endif()
571586
endforeach()
572587

573-
target_include_directories(${_AX_CORE_LIB} PUBLIC ${GTK3_INCLUDE_DIRS} ${WEBKIT2GTK_INCLUDE_DIRS})
574-
target_link_directories(${_AX_CORE_LIB} PRIVATE ${GTK3_LIBRARY_DIRS} ${WEBKIT2GTK_LIBRARY_DIRS})
575-
target_link_libraries(${_AX_CORE_LIB} ${GTK3_LIBRARIES} ${WEBKIT2GTK_LIBRARIES})
576-
endif()
588+
if(_filtered_freetype)
589+
message(STATUS "GTK3: filtered out system freetype include directory")
590+
endif()
591+
592+
target_include_directories(${_AX_CORE_LIB} PUBLIC ${_gtk_includes})
593+
target_link_directories(${_AX_CORE_LIB} PRIVATE ${GTK3_LIBRARY_DIRS})
594+
595+
if(WEBKIT2GTK_FOUND)
596+
target_include_directories(${_AX_CORE_LIB} PUBLIC ${WEBKIT2GTK_INCLUDE_DIRS})
597+
target_link_libraries(${_AX_CORE_LIB} ${WEBKIT2GTK_LIBRARIES})
598+
endif()
599+
endif()

axmol/ui/UIWebView/UIWebView.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
# include "axmol/ui/UIWebView/UIWebViewImpl-win32.h"
3636
# include "axmol/ui/UIWebView/UIWebView-inl.h"
3737

38-
#elif (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX)
38+
#elif (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) && defined(AX_HAVE_WEBKIT2GTK)
3939

4040
# include "axmol/ui/UIWebView/UIWebViewImpl-linux.h"
4141
# include "axmol/ui/UIWebView/UIWebView-inl.h"

axmol/ui/UIWebView/UIWebView.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
#if (defined(_WIN32) && defined(AX_ENABLE_MSEDGE_WEBVIEW2)) || \
3333
(AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || AX_TARGET_PLATFORM == AX_PLATFORM_IOS || \
34-
AX_TARGET_PLATFORM == AX_PLATFORM_LINUX)
34+
(AX_TARGET_PLATFORM == AX_PLATFORM_LINUX && defined(AX_HAVE_WEBKIT2GTK)))
3535
/**
3636
* @addtogroup ui
3737
* @{

axmol/ui/UIWebView/UIWebViewImpl-linux.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
#include "axmol/ui/UIWebView/UIWebViewImpl-linux.h"
3030

31-
#if (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX)
31+
#if (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) && defined(AX_HAVE_WEBKIT2GTK)
3232

3333
# include <sys/stat.h>
3434
# include <chrono> // chrono_literals

axmol/ui/UIWebView/UIWebViewImpl-linux.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
#include "axmol/platform/PlatformMacros.h"
2828

29-
#if (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX)
29+
#if (AX_TARGET_PLATFORM == AX_PLATFORM_LINUX) && defined(AX_HAVE_WEBKIT2GTK)
3030

3131
# include <string>
3232
# include "axmol/platform/StdC.h"

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"kcp": "skywind3000/kcp.git",
1616
"lz4": "lz4/lz4.git",
1717
"sample-assets": "axmolengine/axmol-sample-assets.git",
18-
"axslcc": "axmolengine/axslcc/releases/download"
18+
"axslcc": "simdsoft/axslcc/releases/download"
1919
},
2020
"gitee":
2121
{

setup.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ else {
325325
if ($LinuxDistro -eq 'Debian') {
326326
println "It will take few minutes"
327327
$os_name = $PSVersionTable.OS
328-
$os_ver = [Regex]::Match($os_name, '(\d+\.)+(\*|\d+)(\-[a-z0-9]+)?').Value
328+
$os_ver = [Regex]::Match($os_name, '\d+(\.\d+)*(-[a-z0-9]+)?').Value
329329
if (($os_name -match 'Ubuntu' -and [VersionEx]$os_ver -ge [VersionEx]'24.04') -or
330330
($os_name -match 'Debian' -and [VersionEx]$os_ver -ge [VersionEx]'13')) {
331331
$webkit2gtk_dev = 'libwebkit2gtk-4.1-dev'

tests/cpp-tests/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ if(AX_ENABLE_MEDIA)
363363
Source/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.cpp)
364364
endif()
365365

366-
if(ANDROID OR IOS OR LINUX OR(WINDOWS AND AX_ENABLE_MSEDGE_WEBVIEW2))
366+
if(ANDROID OR IOS OR (LINUX AND WEBKIT2GTK_FOUND) OR(WINDOWS AND AX_ENABLE_MSEDGE_WEBVIEW2))
367367
list(APPEND GAME_HEADER
368368
Source/UITest/CocoStudioGUITest/UIWebViewTest/UIWebViewTest.h
369369
)

0 commit comments

Comments
 (0)