 -        set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--gc-sections")
 +        set (CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -Wl,-elf2flt -msoft-float")
 +        set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}  -Wl,-elf2flt -msoft-float")
+     else()
+         add_definitions(-Wno-gnu-statement-expression)
      endif()
  	if(NOT WIN32)
 -	    add_definitions(-fstack-protector -fPIC -fvisibility=hidden)

 add_library(open62541-objects OBJECT ${lib_sources}) # static version that exports all symbols
-add_library(open62541 SHARED $<TARGET_OBJECTS:open62541-objects>)
-target_compile_definitions(open62541 INTERFACE
-  $<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:open62541_EXPORTS> # the UA_EXPORT macro is different when building the lib or using the lib
-)
+add_library(open62541 $<TARGET_OBJECTS:open62541-objects>)
+#target_compile_definitions(open62541 INTERFACE
+#  $<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:open62541_EXPORTS> # the UA_EXPORT macro is different when building the lib or using the lib
+#)
 
 ## logging

index 87489b3..76c4aa0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -41,18 +41,16 @@ set(lib_sources src/ua_types.c
 
 # compiler flags
 if(CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
