mirror of
https://github.com/asmjit/asmjit.git
synced 2025-12-17 04:24:37 +03:00
Build related improvements (additional)
This commit is contained in:
@@ -301,12 +301,22 @@ if (ASMJIT_SANITIZE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT WIN32)
|
||||
if (WIN32)
|
||||
# Dependency: nothing extra at the moment.
|
||||
elseif ("${CMAKE_SYSTEM_NAME}" STREQUAL "Android")
|
||||
# Dependency: libc is the only required library on Android as it also provides libthread.
|
||||
message("-- Dependency: adding libc (Android target detected)")
|
||||
list(APPEND ASMJIT_DEPS c)
|
||||
elseif ("${CMAKE_SYSTEM_NAME}" STREQUAL "Haiku")
|
||||
# Dependency: libroot is used by Haiku instead of libc, so link to libroot and libpthread.
|
||||
message("-- Dependency: adding libroot and libpthread (Haiku target detected)")
|
||||
list(APPEND ASMJIT_DEPS root pthread)
|
||||
else()
|
||||
# Dependency: libc is always required.
|
||||
message("-- Dependency: adding libc (Linux, BSD, or other UNIX/POSIX environment)")
|
||||
list(APPEND ASMJIT_DEPS c)
|
||||
|
||||
# Dependency: pthread (required so AsmJit can use pthread_lock).
|
||||
if (NOT "${CMAKE_SYSTEM_NAME}" MATCHES "^(Android)$")
|
||||
check_cxx_source_compiles("
|
||||
#include <pthread.h>
|
||||
int main() {
|
||||
@@ -314,14 +324,13 @@ if (NOT WIN32)
|
||||
pthread_mutex_init(&m, nullptr);
|
||||
return pthread_mutex_destroy(&m);
|
||||
}
|
||||
" ASMJIT_LIBC_HAS_PTHREAD)
|
||||
if (ASMJIT_LIBC_HAS_PTHREAD)
|
||||
message("-- Dependency: pthread provided by libc (not linking to libpthread)")
|
||||
" ASMJIT_LIBC_HAS_LIBPTHREAD)
|
||||
if (ASMJIT_LIBC_HAS_LIBPTHREAD)
|
||||
message("-- Dependency: libpthread provided by libc (not linking to libpthread)")
|
||||
else()
|
||||
message("-- Dependency: pthread not provided by libc, linking to libpthread")
|
||||
message("-- Dependency: libpthread not provided by libc, linking to libpthread")
|
||||
list(APPEND ASMJIT_DEPS pthread)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Dependency: shm_open (required so AsmJit can use shm_open on supported platforms).
|
||||
if ("${CMAKE_SYSTEM_NAME}" MATCHES "^(Linux|NetBSD)$" AND NOT ASMJIT_NO_SHM_OPEN)
|
||||
@@ -331,8 +340,8 @@ if (NOT WIN32)
|
||||
const char file_name[1] {};
|
||||
return shm_open(file_name, 0, 0);
|
||||
}
|
||||
" ASMJIT_LIBC_HAS_SHM_OPEN)
|
||||
if (ASMJIT_LIBC_HAS_SHM_OPEN)
|
||||
" ASMJIT_LIBC_HAS_LIBRT)
|
||||
if (ASMJIT_LIBC_HAS_LIBRT)
|
||||
message("-- Dependency: shm_open provided by libc (not linking to librt)")
|
||||
else()
|
||||
message("-- Dependency: shm_open not provided by libc, linking to librt")
|
||||
|
||||
Reference in New Issue
Block a user