Skip to content

Commit 0737152

Browse files
apolukhinroot-kidik
andcommitted
feat build: explicitly link with libm if it exists
Fixes: #571 Co-authored-by: root-kidik <[email protected]> Tests: протестировано CI ab30c67c71320b7258bbbe70e98470f429f0fb91
1 parent 945d27e commit 0737152

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cmake/SetupPostgresqlDeps.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ find_package(GssApi REQUIRED)
1616
find_package(Threads REQUIRED)
1717
find_package(OpenSSL REQUIRED)
1818

19+
include(CheckLibraryExists)
20+
CHECK_LIBRARY_EXISTS(m sin "" USERVER_HAS_LIB_MATH)
21+
set(USERVER_LIB_MATH)
22+
if(USERVER_HAS_LIB_MATH)
23+
set(USERVER_LIB_MATH m)
24+
endif()
25+
1926
get_target_property(PQ_EXTRA_INITIAL_LIBRARIES_LIST
2027
PostgreSQLInternal INTERFACE_LINK_LIBRARIES
2128
)
@@ -26,6 +33,7 @@ target_link_libraries(PostgreSQLInternal
2633
OpenSSL::Crypto
2734
GssApi
2835
Threads::Threads
36+
${USERVER_LIB_MATH}
2937
)
3038

3139
if(${CMAKE_SYSTEM_NAME} MATCHES "BSD")

0 commit comments

Comments
 (0)