@@ -31,8 +31,14 @@ package("pangolin")
3131
3232 add_configs (" tools" , {description = " Build tools" , default = false , type = " boolean" })
3333
34+ add_links (
35+ " pango_plot" , " pango_tools" , " pango_display" , " pango_scene" , " pango_geometry" , " pango_glgeometry" ,
36+ " pango_windowing" , " pango_vars" , " pango_opengl" , " pango_image" , " pango_video" , " pango_packetstream" , " pango_core" ,
37+ " tinyobj"
38+ )
39+
3440 if is_plat (" linux" , " bsd" ) then
35- add_syslinks (" pthread" , " rt" )
41+ add_syslinks (" EGL " , " pthread" , " rt" )
3642 elseif is_plat (" windows" , " mingw" ) then
3743 add_syslinks (" shlwapi" , " gdi32" , " user32" , " shell32" )
3844 elseif is_plat (" macosx" ) then
@@ -111,6 +117,14 @@ package("pangolin")
111117 -- fix gcc15
112118 io .replace (" components/pango_core/include/pangolin/factory/factory.h" , " #include <map>" , " #include <map>\n #include <cstdint>" , {plain = true })
113119
120+ local glew = package :dep (" glew" )
121+ if glew and not glew :config (" shared" ) then
122+ -- Only failed on mingw
123+ io .replace (" components/pango_opengl/CMakeLists.txt" ,
124+ " target_link_libraries(${COMPONENT} PUBLIC ${GLEW_LIBRARY})" ,
125+ " target_link_libraries(${COMPONENT} PRIVATE ${GLEW_LIBRARY})" , {plain = true })
126+ end
127+
114128 local configs = {" -DBUILD_EXAMPLES=OFF" , " -DBUILD_PANGOLIN_PYTHON=OFF" }
115129 table.insert (configs , " -DCMAKE_BUILD_TYPE=" .. (package :is_debug () and " Debug" or " Release" ))
116130 table.insert (configs , " -DBUILD_SHARED_LIBS=" .. (package :config (" shared" ) and " ON" or " OFF" ))
@@ -128,7 +142,6 @@ package("pangolin")
128142 table.insert (configs , " -DBUILD_TOOLS=" .. (package :config (" tools" ) and " ON" or " OFF" ))
129143
130144 local opt = {}
131- local glew = package :dep (" glew" )
132145 if glew and not glew :config (" shared" ) and package :is_plat (" windows" , " mingw" ) then
133146 opt .cxflags = " -DGLEW_STATIC"
134147 end
0 commit comments