From 70d4664e72dc3b5f68dab1400cd36447be6d9464 Mon Sep 17 00:00:00 2001
From: Dmitry Ivanov <ivadmi5@gmail.com>
Date: Fri, 11 Aug 2023 19:03:54 +0300
Subject: [PATCH] fix(build): Rename incorrect references in CMake

---
 pgproto/src/postgres/CMakeLists.txt  |  7 ++-----
 pgproto/src/server/CMakeLists.txt    | 10 +++++-----
 pgproto/src/tarantool/CMakeLists.txt |  6 ++++--
 3 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/pgproto/src/postgres/CMakeLists.txt b/pgproto/src/postgres/CMakeLists.txt
index 50715a9572..7e43969db8 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 2e1b9dc957..045e31bd8b 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 df2878aae3..784bf7b2cb 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)
-- 
GitLab