While I am working on the WebKit project there is a need to port harfbuzz library (https://github.com/harfbuzz/harfbuzz)
This library is using meson to compile and what I did so far is create a meson cross-compile file that is used during the compilation. Unfortunately, when I try to compile it there is always -pthreads added automatically and I cannot find a way to remove it. You see meson finds that pthreads are available and adds it no matter what.
Unfortunately, this flag breaks the compilation because it is not recognised by our gcc.
My question is if anyone has worked on porting harfbuzz to OS4 in the past.
Does anyone have any experience with meson and have already ported stuff with it so can share some knowledge?
Thank you in advance for your help.
hafbuzz seems part in AmigaOS4.1FinalEditionUpdate1 archive, so if have access OS4 repository you can take a peek and see how its build.
github.com/harfbuzz/harfbuzz/blob/main/CMakeLists.txt:
...
if (NOT MSVC)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads)
if (CMAKE_USE_PTHREADS_INIT)
add_definitions("-DHAVE_PTHREAD")
list(APPEND THIRD_PARTY_LIBS Threads::Threads)
list(APPEND PC_LIBS_PRIV -pthread)
endif ()
endif ()
...
maybe you can tweak to skip or just "remove" -pthreads switch (or chnage to -lpthread)
or in https://github.com/harfbuzz/harfbuzz/blob/main/meson.build:
...
# threads
thread_dep = null_dep
if host_machine.system() != 'windows'
thread_dep = dependency('threads', required: false)
if thread_dep.found()
conf.set('HAVE_PTHREAD', 1)
endif
endif
...
PS: and as you can imagine/see I don't know nothing about how mason and/or CMakeLists "works".
AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P
@jabirulo
Thank you so much for your reply and pointing those parts in the code.
I am thinking to set it to skip for OS4 and then manually add the -lpthreads but I am afraid it will skip also parts of the code.
I need to dig further I am afraid.