Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usr/local/include not included in build includes #19

Open
bferguson3 opened this issue Sep 14, 2021 · 4 comments
Open

Usr/local/include not included in build includes #19

bferguson3 opened this issue Sep 14, 2021 · 4 comments

Comments

@bferguson3
Copy link

harfbuzz installs by default to /usr/local/include/harfbuzz. I had to manually copy harfbuzz source to /usr/include/harfbuzz to get skia to build.

ben@benpi-desktop:~/deps/skia$ find / -name "hb.h" 2>/dev/null
/usr/local/include/harfbuzz/hb.h
/home/ben/Projects/aseprite/third_party/harfbuzz/src/hb.h
/home/ben/deps/skia/third_party/externals/harfbuzz/src/hb.h
/home/ben/deps/harfbuzz/src/hb.h

[1/422] compile ../../modules/skshaper/src/SkShaper_harfbuzz.cpp
FAILED: obj/modules/skshaper/src/libskshaper.SkShaper_harfbuzz.o 
g++ -MD -MF obj/modules/skshaper/src/libskshaper.SkShaper_harfbuzz.o.d -DSKSHAPER_IMPLEMENTATION=1 -DNDEBUG -DSK_GAMMA_APPLY_TO_A8 -DSK_SHAPER_HARFBUZZ_AVAILABLE -DSK_GL -DSK_SUPPORT_PDF -DSK_HAS_JPEG_LIBRARY -DSK_USE_LIBGIFCODEC -DSK_HAS_PNG_LIBRARY -DSK_CODEC_DECODES_RAW -DSK_HAS_WEBP_LIBRARY -DSK_XML -DSK_R32_SHIFT=16 -DU_USING_ICU_NAMESPACE=0 -DSK_USING_THIRD_PARTY_ICU -I../../modules/skshaper/include -I../.. -I../../third_party/externals/libgifcodec -I/usr/include/harfbuzz -fstrict-aliasing -fPIC -O3 -fdata-sections -ffunction-sections -Wno-unused-parameter -I /home/ben/deps/skia/third_party/externals/icu/source/common -I /home/ben/deps/skia/third_party/externals/icu/source/i18n -I /home/ben/deps/skia/third_party/icu -std=c++17 -fno-exceptions -fno-rtti -c ../../modules/skshaper/src/SkShaper_harfbuzz.cpp -o obj/modules/skshaper/src/libskshaper.SkShaper_harfbuzz.o
../../modules/skshaper/src/SkShaper_harfbuzz.cpp:32:10: fatal error: hb.h: No such file or directory
   32 | #include <hb.h>
      |          ^~~~~~
compilation terminated.

@ryandesign
Copy link

This happens because when the skia build uses the system version of harfbuzz, it hardcodes the location /usr/include/harfbuzz:

include_dirs = [ "/usr/include/harfbuzz" ]

Hardcoding /usr/local/include/harfbuzz would not be an improvement. This location needs to be configurable. Even better, the correct location could be determined automatically using pkg-config harfbuzz --cflags.

A similar problem exists for skia when using system freetype2:

../../src/ports/SkFontHost_FreeType_common.cpp:24:10: fatal error: 'ft2build.h' file not found
   24 | #include <ft2build.h>
      |          ^~~~~~~~~~~~
1 error generated.
../../src/ports/SkFontHost_FreeType.cpp:41:10: fatal error: 'ft2build.h' file not found
   41 | #include <ft2build.h>
      |          ^~~~~~~~~~~~
1 error generated.

for a similar reason:

include_dirs = [ "/usr/include/freetype2" ]

which could be fixed similarly by using pkg-config freetype2 --cflags.

@ryandesign
Copy link

I couldn't find an upstream issue for this so I've now filed https://issues.skia.org/issues/372508426.

@dacap
Copy link
Member

dacap commented Oct 10, 2024

@ryandesign I'd highly recommend you to avoid creating new issues on Skia if you are not testing their latest version in main branch. I'd say that if we have a compilation problem using m102, or m124, it is our problem.

@ryandesign
Copy link

Since the hardcoded /usr/include paths are still present in the latest version of the code in their main branch, I felt sufficiently confident in filing the issue with them even without attempting to build their version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants