Simplify dethread build
authorPyry Haulos <phaulos@google.com>
Thu, 2 Feb 2017 19:21:28 +0000 (11:21 -0800)
committerPyry Haulos <phaulos@google.com>
Thu, 2 Feb 2017 22:33:58 +0000 (14:33 -0800)
dethread can be now built with simply adding all source files into the
project. This reduces complexity in build scripts.

Components: Framework

Change-Id: I18a342b9b42eb8d79145306ef7fd7c5897a2f92f

framework/delibs/dethread/CMakeLists.txt
framework/delibs/dethread/unix/deMutexUnix.c

index 6d8ac86..227bb71 100644 (file)
@@ -15,6 +15,15 @@ set(DETHREAD_SRCS
        deThreadLocal.h
        deThreadTest.c
        deThreadTest.h
+       win32/deMutexWin32.c
+       win32/deSemaphoreWin32.c
+       win32/deThreadWin32.c
+       win32/deThreadLocalWin32.c
+       unix/deMutexUnix.c
+       unix/deNamedSemaphoreUnix.c
+       unix/deSemaphoreUnix.c
+       unix/deThreadUnix.c
+       unix/deThreadLocalUnix.c
        )
 
 set(DETHREAD_LIBS
@@ -28,44 +37,13 @@ include_directories(
        ${CMAKE_CURRENT_SOURCE_DIR}
        )
 
-if (DE_OS_IS_WIN32 OR DE_OS_IS_WINCE)
-       set(DETHREAD_SRCS
-               ${DETHREAD_SRCS}
-               win32/deMutexWin32.c
-               win32/deSemaphoreWin32.c
-               win32/deThreadWin32.c
-               win32/deThreadLocalWin32.c
-               )
-
-elseif (DE_OS_IS_UNIX OR DE_OS_IS_ANDROID OR DE_OS_IS_QNX)
-       if (DE_OS_IS_UNIX)
-               add_definitions(-D_GNU_SOURCE)
-               set(DETHREAD_LIBS ${DETHREAD_LIBS} pthread)
-       else ()
-               add_definitions(-D_XOPEN_SOURCE=600)
-       endif ()
-
-       set(DETHREAD_SRCS
-               ${DETHREAD_SRCS}
-               unix/deMutexUnix.c
-               unix/deSemaphoreUnix.c
-               unix/deThreadUnix.c
-               unix/deThreadLocalUnix.c
-               )
+if (DE_OS_IS_UNIX)
+       add_definitions(-D_GNU_SOURCE)
+       set(DETHREAD_LIBS ${DETHREAD_LIBS} pthread)
+endif ()
 
-elseif (DE_OS_IS_OSX OR DE_OS_IS_IOS)
+if (DE_OS_IS_ANDROID OR DE_OS_IS_OSX OR DE_OS_IS_IOS OR DE_OS_IS_QNX)
        add_definitions(-D_XOPEN_SOURCE=600)
-       # \note OS X doesn't support unnamed semaphores.
-       set(DETHREAD_SRCS
-               ${DETHREAD_SRCS}
-               unix/deMutexUnix.c
-               unix/deNamedSemaphoreUnix.c
-               unix/deThreadUnix.c
-               unix/deThreadLocalUnix.c
-               )
-
-else ()
-       message(FATAL_ERROR "Unsupported os for dethread")
 endif ()
 
 add_library(dethread STATIC ${DETHREAD_SRCS})
index bda4fdb..59ae945 100644 (file)
@@ -23,7 +23,7 @@
 
 #include "deMutex.h"
 
-#if (DE_OS == DE_OS_UNIX || DE_OS == DE_OS_OSX || DE_OS == DE_OS_ANDROID || DE_OS == DE_OS_SYMBIAN || DE_OS == DE_OS_IOS || DE_OS == DE_OS_QNX)
+#if (DE_OS == DE_OS_UNIX || DE_OS == DE_OS_ANDROID || DE_OS == DE_OS_SYMBIAN || DE_OS == DE_OS_QNX)
 
 #include "deMemory.h"