[cmake] Fix try compile link issues (#466)

This commit is contained in:
ebraminio 2017-04-14 05:08:11 +04:30 committed by GitHub
parent cb021e14ab
commit 75931427aa
1 changed files with 2 additions and 0 deletions

View File

@ -302,6 +302,7 @@ file(WRITE "${PROJECT_BINARY_DIR}/try_compile_intel_atomic_primitives.c"
int atomic_add (int *i) { return __sync_fetch_and_add (i, 1); } 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); } int mutex_trylock (int *m) { return __sync_lock_test_and_set (m, 1); }
void mutex_unlock (int *m) { __sync_lock_release (m); } void mutex_unlock (int *m) { __sync_lock_release (m); }
int main () { return 0; }
") ")
try_compile(HB_HAVE_INTEL_ATOMIC_PRIMITIVES try_compile(HB_HAVE_INTEL_ATOMIC_PRIMITIVES
${PROJECT_BINARY_DIR}/try_compile_intel_atomic_primitives ${PROJECT_BINARY_DIR}/try_compile_intel_atomic_primitives
@ -317,6 +318,7 @@ file(WRITE "${PROJECT_BINARY_DIR}/try_compile_solaris_atomic_ops.c"
void memory_barrier (void) { __machine_rw_barrier (); } void memory_barrier (void) { __machine_rw_barrier (); }
int atomic_add (volatile unsigned *i) { return atomic_add_int_nv (i, 1); } int atomic_add (volatile unsigned *i) { return atomic_add_int_nv (i, 1); }
void *atomic_ptr_cmpxchg (volatile void **target, void *cmp, void *newval) { return atomic_cas_ptr (target, cmp, newval); } void *atomic_ptr_cmpxchg (volatile void **target, void *cmp, void *newval) { return atomic_cas_ptr (target, cmp, newval); }
int main () { return 0; }
") ")
try_compile(HB_HAVE_SOLARIS_ATOMIC_OPS try_compile(HB_HAVE_SOLARIS_ATOMIC_OPS
${PROJECT_BINARY_DIR}/try_compile_solaris_atomic_ops ${PROJECT_BINARY_DIR}/try_compile_solaris_atomic_ops