1# Copyright (c) Huawei Technologies Co., Ltd. 2021-2021. All rights reserved. 2 3import("//build/ohos.gni") 4import("//third_party/flutter/glfw/glfw_ace_config.gni") 5 6config("glfw_inner_headers") { 7 include_dirs = [ "include" ] 8} 9 10config("glfw_config_mac") { 11 cflags = [ "-Wno-sign-compare" ] 12} 13 14ohos_shared_library("glfw") { 15 defines = [ "PREVIEW" ] 16 include_dirs = [ "src" ] 17 public = [ 18 "include/GLFW/glfw3.h", 19 "include/GLFW/glfw3native.h", 20 ] 21 22 sources = [ 23 "src/context.c", 24 "src/init.c", 25 "src/input.c", 26 "src/monitor.c", 27 "src/vulkan.c", 28 "src/window.c", 29 ] 30 31 public_configs = [ ":glfw_inner_headers" ] 32 33 if (current_os == "mingw") { 34 defines += ace_windows_defines 35 sources += [ 36 "src/egl_context.c", 37 "src/egl_context.h", 38 "src/wgl_context.c", 39 "src/wgl_context.h", 40 "src/win32_init.c", 41 "src/win32_joystick.c", 42 "src/win32_joystick.h", 43 "src/win32_monitor.c", 44 "src/win32_platform.h", 45 "src/win32_time.c", 46 "src/win32_tls.c", 47 "src/win32_window.c", 48 ] 49 50 defines += [ "_GLFW_WIN32" ] 51 52 libs = [ 53 "gdi32", 54 "opengl32", 55 ] 56 } 57 if (current_os == "mac") { 58 defines += ace_mac_defines 59 sources += [ 60 "deps/glad.c", 61 "src/cocoa_init.m", 62 "src/cocoa_joystick.h", 63 "src/cocoa_joystick.m", 64 "src/cocoa_monitor.m", 65 "src/cocoa_platform.h", 66 "src/cocoa_time.c", 67 "src/cocoa_window.m", 68 "src/nsgl_context.h", 69 "src/nsgl_context.m", 70 "src/posix_tls.c", 71 "src/posix_tls.h", 72 ] 73 include_dirs += [ "deps" ] 74 libs = [ 75 "Cocoa.framework", 76 "IOKit.framework", 77 "CoreFoundation.framework", 78 "CoreVideo.framework", 79 ] 80 cflags = [ 81 "-Wno-deprecated-declarations", 82 "-Wno-objc-multiple-method-names", 83 "-DNS_FORMAT_ARGUMENT(A)=", 84 ] 85 public_configs += [ ":glfw_config_mac" ] 86 defines += [ "_GLFW_COCOA" ] 87 } 88 if (current_os == "linux") { 89 defines += ace_linux_defines 90 sources += [ 91 "src/egl_context.c", 92 "src/egl_context.h", 93 "src/glx_context.c", 94 "src/glx_context.h", 95 "src/linux_joystick.c", 96 "src/linux_joystick.h", 97 "src/posix_time.c", 98 "src/posix_time.h", 99 "src/posix_tls.c", 100 "src/posix_tls.h", 101 "src/x11_init.c", 102 "src/x11_monitor.c", 103 "src/x11_platform.h", 104 "src/x11_window.c", 105 "src/xkb_unicode.c", 106 "src/xkb_unicode.h", 107 ] 108 cflags_c = [ 109 "-Wno-sign-compare", 110 "-Wno-missing-field-initializers", 111 ] 112 libs = [ 113 "rt", 114 "dl", 115 "X11", 116 "Xcursor", 117 "Xinerama", 118 "Xrandr", 119 ] 120 defines += [ "_GLFW_X11" ] 121 } 122 123 part_name = "graphic_standard" 124 subsystem_name = "graphic" 125} 126