/simpletypesystem/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/simpletypesystem/trunk

« back to all changes in this revision

Viewing changes to CMakeLists.txt

  • Committer: Gustav Hartvigsson
  • Date: 2015-09-21 12:11:50 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20150921121150-whoku9vfshtwz4ed
* Made the SMutex code compile.
* Added check to CMakeLists.txt to determin if we have thread support on different pratforms.
* Added HAVE_MTHREAD to config.h.in
* Added HAVE_PTHREAD to config.h.in
* Simplefied src/external/threads.h

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 
4
4
option (DEBUG "Enable debug flags and macros in project" TRUE)
5
5
 
6
 
set(THREADS_PREFER_PTHREAD_FLAG ON)
7
6
find_package (Threads REQUIRED)
8
7
 
 
8
if (CMAKE_USE_WIN32_THREADS_INIT)
 
9
  set (HAVE_MTHREAD ON)
 
10
  set (HAVE_PTHREAD OFF)
 
11
elseif (CMAKE_USE_PTHREADS_INIT)
 
12
  set (HAVE_PTHREAD ON)
 
13
  set (HAVE_MTHREAD OFF)
 
14
else ()
 
15
  set (HAVE_PTHREAD OFF)
 
16
  set (HAVE_MTHREAD OFF)
 
17
endif ()
 
18
 
 
19
 
 
20
 
 
21
 
9
22
if (WIN32)
10
23
  if (MINGW)
11
24
    message ("Compiling on Windows is undested.")
24
37
    message ("MSVC is not supported, Yet. Patches welcome!")
25
38
  endif ()
26
39
else ()
 
40
  add_definitions(-D_POSIX_C_SOURCE=199309L -D_GNU_SOURCE)
27
41
  # We need -rdynamic to get the traceback information on *nix.
28
42
  # This may not work on all non-windows targets. FIXME.
29
43
  set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread -std=c11  -Wall -rdynamic")
50
64
 
51
65
add_library (ssts SHARED ${SSTS_SRC})
52
66
target_link_libraries (ssts ${CMAKE_THREAD_LIBS_INIT})
 
67
message (${CMAKE_THREAD_LIBS_INIT})
53
68
 
54
69
 
55
70
enable_testing()