aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt21
1 files changed, 16 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c84cd4b..086f166 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,6 +10,9 @@ include(CheckIPOSupported)
include(CheckIncludeFile)
include(CheckSymbolExists)
+# Project settings
+option(BH_PLATFORM_THREADS "Enable multithreading support" TRUE)
+
# Check for IPO/LTO
check_ipo_supported(RESULT supported)
@@ -55,6 +58,7 @@ set(BH_INCLUDE_DIRS
if(WIN32)
message(STATUS "Platform - Win32")
set(BH_PLATFORM_WIN TRUE)
+ option(BH_THREADS_WINXP "Enable threading support for Windows XP" FALSE)
# Add platform dependent files
list(APPEND BH_SOURCE
@@ -62,8 +66,11 @@ if(WIN32)
)
# Check multithreading support
- check_symbol_exists(_beginthread process.h BH_USE_WINTHREAD)
- if(BH_USE_WINTHREAD)
+ if(BH_PLATFORM_THREADS)
+ check_symbol_exists(_beginthread process.h BH_PLATFORM_THREADS)
+ endif()
+
+ if(BH_PLATFORM_THREADS)
message(STATUS "Multithreading enabled")
list(APPEND BH_SOURCE
src/thread_win.c
@@ -75,7 +82,7 @@ if(WIN32)
)
endif()
- if(BH_NO_WINXP)
+ if(NOT BH_THREADS_WINXP)
add_definitions(-D_WIN32_WINNT=_WIN32_WINNT_VISTA -DWINVER=_WIN32_WINNT_VISTA)
endif()
elseif(UNIX)
@@ -88,8 +95,11 @@ elseif(UNIX)
)
# Check multithreading support
- check_include_file(pthread.h BH_USE_PTHREAD)
- if(BH_USE_PTHREAD)
+ if(BH_PLATFORM_THREADS)
+ check_include_file(pthread.h BH_PLATFORM_THREADS)
+ endif()
+
+ if(BH_PLATFORM_THREADS)
message(STATUS "Multithreading enabled")
list(APPEND BH_SOURCE
src/thread_posix.c
@@ -111,6 +121,7 @@ endif()
# Configure library
configure_file(include/bh/config.in include/bh/config.h)
+configure_file(include/bh/internal/config.in include/bh/internal/config.h)
# Library
add_library(bhlib STATIC ${BH_SOURCE} ${BH_HEADER})