Add support for multithread harfbuzz with gcc

This commit is contained in:
David Capello 2017-03-13 18:35:29 -03:00
parent 1729e0e658
commit 2e7dee0787

View File

@ -19,6 +19,20 @@ if(USE_ICU)
../harfbuzz/src/hb-icu.cc)
endif()
if(UNIX AND NOT APPLE)
include(CheckCSourceCompiles)
check_cxx_source_compiles("
void memory_barrier (void) { __sync_synchronize (); }
int atomic_add (int *i) { return __sync_fetch_and_add (i, 1); }
int mutex_trylock (int *m) { return __sync_lock_test_and_set (m, 1); }
void mutex_unlock (int *m) { __sync_lock_release (m); }
int main() { ; return 0; }"
HAVE_INTEL_ATOMIC_PRIMITIVES)
if(HAVE_INTEL_ATOMIC_PRIMITIVES)
add_definitions(-DHAVE_INTEL_ATOMIC_PRIMITIVES)
endif()
endif()
add_library(harfbuzz
../harfbuzz/src/hb-blob.cc
../harfbuzz/src/hb-buffer-serialize.cc