Skip to content

Commit

Permalink
Fix HarmonyOS Next platform crash
Browse files Browse the repository at this point in the history
  • Loading branch information
qiuguohua committed Jan 24, 2025
1 parent fd7270c commit 6a87599
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions native/cocos/renderer/gfx-gles3/GLES3Wrangler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,17 @@ bool gles3wClose() {
void *gles3wLoad(const char *proc) {
void *res = nullptr;
if (eglGetProcAddress) res = reinterpret_cast<void *>(eglGetProcAddress(proc));

#if CC_PLATFORM != CC_PLATFORM_OPENHARMONY
auto sdkVersion = cc::BasePlatform::getPlatform()->getSdkVersion();
if (sdkVersion <= 23) {
if (!res) res = dlsym(libgles, proc);
} else {
if (!res) res = dlsym(libegl, proc);
}
#else
if (!res) res = dlsym(libegl, proc);
#endif
return res;
}
#endif
Expand Down
4 changes: 2 additions & 2 deletions templates/harmonyos-next/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ set(CC_ALL_SOURCES)
option(APP_NAME "Project Name" "test-cases")
project(${APP_NAME} CXX)

set(CMAKE_CXX_FLAGS_DEBUG "-Werror=return-type")

set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g -ggdb -Werror=return-type")
set(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall")

include(${COMMON_DIR}/CMakeLists.txt)

Expand Down

0 comments on commit 6a87599

Please sign in to comment.