From bc1513c649dc6e8d8c4ab161537b1a2f12d41d3c Mon Sep 17 00:00:00 2001
From: Robin Mueller <robin.mueller.m@gmail.com>
Date: Mon, 28 Dec 2020 18:06:00 +0100
Subject: [PATCH 1/2] cmake lists updates

---
 CMakeLists.txt            |  1 -
 osal/host/CMakeLists.txt  |  4 +++-
 osal/linux/CMakeLists.txt | 14 ++++++++++----
 unittest/CMakeLists.txt   |  2 ++
 4 files changed, 15 insertions(+), 6 deletions(-)
 create mode 100644 unittest/CMakeLists.txt

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 02849ca44..3cc5ffd58 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -139,5 +139,4 @@ target_include_directories(${LIB_FSFW_NAME} PRIVATE
 target_compile_options(${LIB_FSFW_NAME} PRIVATE 
 	${WARNING_FLAGS}
 	${COMPILER_FLAGS}
-	${ABI_FLAGS}
 )
diff --git a/osal/host/CMakeLists.txt b/osal/host/CMakeLists.txt
index aa32990be..367f721e0 100644
--- a/osal/host/CMakeLists.txt
+++ b/osal/host/CMakeLists.txt
@@ -13,9 +13,11 @@ target_sources(${LIB_FSFW_NAME}
 )
 
 if(UNIX)
+	find_package(Threads REQUIRED)
+	
 	target_link_libraries(${LIB_FSFW_NAME} 
 	PRIVATE
 		rt
-		pthread
+		${CMAKE_THREAD_LIBS_INIT}
 	)
 endif()
\ No newline at end of file
diff --git a/osal/linux/CMakeLists.txt b/osal/linux/CMakeLists.txt
index c0096e428..474e548bf 100644
--- a/osal/linux/CMakeLists.txt
+++ b/osal/linux/CMakeLists.txt
@@ -18,8 +18,14 @@ target_sources(${LIB_FSFW_NAME}
 		Timer.cpp
 )
 
-target_link_libraries(${LIB_FSFW_NAME} 
-	PRIVATE
-		rt
-		pthread
+find_package(Threads REQUIRED)
+
+target_link_libraries(${LIB_FSFW_NAME} PRIVATE
+	${CMAKE_THREAD_LIBS_INIT}
+	rt
 )
+
+target_link_libraries(${LIB_FSFW_NAME} INTERFACE
+	${CMAKE_THREAD_LIBS_INIT}
+)
+
diff --git a/unittest/CMakeLists.txt b/unittest/CMakeLists.txt
new file mode 100644
index 000000000..119ef243a
--- /dev/null
+++ b/unittest/CMakeLists.txt
@@ -0,0 +1,2 @@
+add_subdirectory(internal)
+add_subdirectory(tests)
\ No newline at end of file

From c8af75f9c754816dba4561baf64aa5e8753406fb Mon Sep 17 00:00:00 2001
From: Robin Mueller <robin.mueller.m@gmail.com>
Date: Mon, 28 Dec 2020 18:06:34 +0100
Subject: [PATCH 2/2] moved inlcudes

---
 defaultcfg/fsfwconfig/OBSWConfig.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/defaultcfg/fsfwconfig/OBSWConfig.h b/defaultcfg/fsfwconfig/OBSWConfig.h
index 8ad2cb675..6ed8ea2c4 100644
--- a/defaultcfg/fsfwconfig/OBSWConfig.h
+++ b/defaultcfg/fsfwconfig/OBSWConfig.h
@@ -3,11 +3,12 @@
 
 #include "OBSWVersion.h"
 
+#ifdef __cplusplus
+
 #include "objects/systemObjectList.h"
 #include "events/subsystemIdRanges.h"
 #include "returnvalues/classIds.h"
 
-#ifdef __cplusplus
 namespace config {
 #endif