build BUGFIX link compat as objects
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e3e4454..9d5a6b1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -195,7 +195,7 @@
 use_compat()
 
 # netconf2 target
-add_library(netconf2 SHARED ${libsrc} ${headers} compat)
+add_library(netconf2 SHARED ${libsrc} ${headers} $<TARGET_OBJECTS:compat>)
 set_target_properties(netconf2 PROPERTIES VERSION ${LIBNETCONF2_VERSION} SOVERSION ${LIBNETCONF2_SOVERSION_FULL})
 
 if((CMAKE_BUILD_TYPE STREQUAL Debug) OR (CMAKE_BUILD_TYPE STREQUAL Package))