Commit 67a1dd4 1 parent 4108db0 commit 67a1dd4 Copy full SHA for 67a1dd4
File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -25,11 +25,17 @@ static EGL_LIBRARY: LazyLock<EGLLibraryWrapper> = LazyLock::new(|| unsafe {
25
25
EGLLibraryWrapper ( module)
26
26
} ) ;
27
27
28
+ #[ cfg( target_env = "ohos" ) ]
29
+ static EGL_POTENTIAL_SO_NAMES : [ & CStr ; 1 ] = [ c"libEGL.so" ] ;
30
+
31
+ #[ cfg( not( any( target_os = "windows" , target_os = "macos" , target_env = "ohos" ) ) ) ]
32
+ static EGL_POTENTIAL_SO_NAMES : [ & CStr ; 2 ] = [ c"libEGL.so.1" , c"libEGL.so" ] ;
33
+
28
34
#[ cfg( not( any( target_os = "windows" , target_os = "macos" ) ) ) ]
29
35
static EGL_LIBRARY : LazyLock < EGLLibraryWrapper > = LazyLock :: new ( || {
30
- for soname in [ c"libEGL.so.1" . as_ptr ( ) , c"libEGL.so" . as_ptr ( ) ] {
36
+ for soname in EGL_POTENTIAL_SO_NAMES {
31
37
unsafe {
32
- let handle = dlopen ( soname as * const _ , RTLD_LAZY ) ;
38
+ let handle = dlopen ( soname. as_ptr ( ) , RTLD_LAZY ) ;
33
39
if !handle. is_null ( ) {
34
40
return EGLLibraryWrapper ( handle) ;
35
41
}
You can’t perform that action at this time.
0 commit comments