diff --git a/pgproto/src/postgres/CMakeLists.txt b/pgproto/src/postgres/CMakeLists.txt
index 50715a95720599a41dd73f23b9236a1152e17c45..7e43969db8cba4817dc009245c8a8f436e0f4436 100644
--- a/pgproto/src/postgres/CMakeLists.txt
+++ b/pgproto/src/postgres/CMakeLists.txt
@@ -8,9 +8,6 @@ set(POSTGRES_SOURCES
     startup.c
 )
 
-
-build_module(postgres "${POSTGRES_SOURCES}")
-message("MSGPUCK_LIBRARIES: ${MSGPUCK_LIBRARIES}")
-target_link_libraries(postgres PRIVATE ${MSGPUCK_LIBRARIES})
-
+add_library(postgres STATIC ${POSTGRES_SOURCES})
+set_property(TARGET postgres PROPERTY POSITION_INDEPENDENT_CODE ON)
 target_compile_options(postgres PRIVATE "-Wno-format-security")
diff --git a/pgproto/src/server/CMakeLists.txt b/pgproto/src/server/CMakeLists.txt
index 2e1b9dc957d44bbb6b798e7c41438970bddf2de8..045e31bd8b24d06c075b4e2581d3d985c3488d99 100644
--- a/pgproto/src/server/CMakeLists.txt
+++ b/pgproto/src/server/CMakeLists.txt
@@ -1,7 +1,7 @@
 set(SERVER_SOURCES
-    server.c)
+    server.c
+)
 
-build_module(tcpserver "${SERVER_SOURCES}")
-target_link_libraries(tcpserver PRIVATE
-                      tarantool postgres
-                      ${MSGPUCK_LIBRARIES})
+build_module(tcpserver ${SERVER_SOURCES})
+target_link_libraries(tcpserver
+    PRIVATE tarantool postgres ${MSGPUCK_LIB})
diff --git a/pgproto/src/tarantool/CMakeLists.txt b/pgproto/src/tarantool/CMakeLists.txt
index df2878aae391b67273a3ad6f7af4172b377b1ebb..784bf7b2cbae53c12c3dd8985050c9720644aa6e 100644
--- a/pgproto/src/tarantool/CMakeLists.txt
+++ b/pgproto/src/tarantool/CMakeLists.txt
@@ -1,5 +1,7 @@
 set(TARANTOOL_MODULE_SOURCES
     sio.c
-    evio.c)
+    evio.c
+)
 
-build_module(tarantool "${TARANTOOL_MODULE_SOURCES}")
+add_library(tarantool STATIC ${TARANTOOL_MODULE_SOURCES})
+set_property(TARGET tarantool PROPERTY POSITION_INDEPENDENT_CODE ON)