Skip to content

Commit 1815194

Browse files
authored
[linux] Use pkg-config for libglfw (google#220)
The makes libglfw added via pkg-config calls, rather than manually, for consistency with other similar dependencies.
1 parent 867e99e commit 1815194

File tree

4 files changed

+16
-13
lines changed

4 files changed

+16
-13
lines changed

build/linux/config/BUILD.gn

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,22 @@
1414

1515
import("//third_party/chromium/build/config/linux/pkg_config.gni")
1616

17-
pkg_config("gtk3") {
18-
packages = [ "gtk+-3.0" ]
19-
}
20-
2117
pkg_config("epoxy") {
2218
packages = [ "epoxy" ]
2319
}
2420

25-
pkg_config("x11") {
26-
packages = [ "x11" ]
21+
pkg_config("glfw3") {
22+
packages = [ "glfw3" ]
23+
}
24+
25+
pkg_config("gtk3") {
26+
packages = [ "gtk+-3.0" ]
2727
}
2828

2929
pkg_config("jsoncpp") {
3030
packages = [ "jsoncpp" ]
3131
}
32+
33+
pkg_config("x11") {
34+
packages = [ "x11" ]
35+
}

example/linux/Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,13 @@ endif
8383

8484
# Build settings
8585
CXX=g++ -std=c++14
86-
CXXFLAGS=-Wall -Werror $(shell pkg-config --cflags jsoncpp)
86+
CXXFLAGS=-Wall -Werror $(shell pkg-config --cflags jsoncpp glfw3)
8787
CPPFLAGS=$(patsubst %,-I%,$(INCLUDE_DIRS))
8888
ifdef USE_GN
8989
CPPFLAGS+=-DUSE_FLATTENED_INCLUDES
9090
endif
9191
LDFLAGS=-L$(OUT_LIB_DIR) \
92-
-lglfw \
93-
$(shell pkg-config --libs jsoncpp) \
92+
$(shell pkg-config --libs jsoncpp glfw3) \
9493
-l$(FLUTTER_EMBEDDER_LIB_NAME) \
9594
-l$(FLUTTER_ENGINE_LIB_NAME) \
9695
$(patsubst %,-l$(PLUGIN_LIB_NAME_PREFIX)%,$(PLUGIN_NAMES)) \

library/BUILD.gn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ published_shared_library("flutter_embedder") {
7575

7676
if (is_linux) {
7777
libs = [
78-
"glfw",
7978
"GL",
8079
]
8180

@@ -85,6 +84,7 @@ published_shared_library("flutter_embedder") {
8584

8685
configs += [
8786
"//build/linux/config:epoxy",
87+
"//build/linux/config:glfw3",
8888
"//build/linux/config:gtk3",
8989
"//build/linux/config:jsoncpp",
9090
"//build/linux/config:x11",

library/linux/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ CXXFLAGS= -Wall -Werror -shared -fPIC -fvisibility=hidden \
2727
-I$(PROJECT_ROOT)/library/include \
2828
-I$(FLUTTER_ENGINE_HEADER_DIR) \
2929
-DFLUTTER_DESKTOP_EMBEDDING_IMPL \
30-
$(shell pkg-config --cflags gtk+-3.0 epoxy x11 jsoncpp)
30+
$(shell pkg-config --cflags gtk+-3.0 epoxy x11 jsoncpp glfw3)
3131
LDFLAGS= -L$(CURDIR) \
32-
$(shell pkg-config --libs gtk+-3.0 epoxy x11 jsoncpp) \
33-
-lglfw -lGL -l$(FLUTTER_ENGINE_LIB_NAME) \
32+
$(shell pkg-config --libs gtk+-3.0 epoxy x11 jsoncpp glfw3) \
33+
-lGL -l$(FLUTTER_ENGINE_LIB_NAME) \
3434
-Wl,-rpath=$(CURDIR)
3535

3636

0 commit comments

Comments
 (0)