Skip to content

Commit 8524cf1

Browse files
committed
Even more adjustments (WIP)
1 parent 6d25cc0 commit 8524cf1

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/qt/CMakeLists.txt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,30 @@ target_link_libraries(gridcoinresearch PRIVATE
214214
gridcoin_util
215215
gridcoinqt
216216
)
217+
if(UNIX AND NOT APPLE)
218+
# 1. The "Imposter" Math Target (This solves the -lm linker error where the linker looks for the math lib in the wrong place.)
219+
add_library(m SHARED IMPORTED GLOBAL)
220+
set_target_properties(m PROPERTIES IMPORTED_LOCATION "/lib64/libm.so.6")
221+
222+
target_link_libraries(gridcoinresearch PRIVATE m)
223+
224+
# 2. THE AUTOMATED MANUAL FIX
225+
# Define the libraries as a simple list first
226+
set(MY_LIBS_LIST
227+
"${DEP_LIB}/libfreetype.a"
228+
"${DEP_LIB}/libfontconfig.a"
229+
"${DEP_LIB}/libexpat.a"
230+
"${DEP_LIB}/libxcb-util.a"
231+
)
232+
233+
# Flatten the list into a space-separated string explicitly
234+
string(REPLACE ";" " " MANUAL_STATIC_FIX "${MY_LIBS_LIST}")
235+
236+
# Override the linker rule
237+
set(CMAKE_CXX_LINK_EXECUTABLE
238+
"<CMAKE_CXX_COMPILER> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES> ${MANUAL_STATIC_FIX}"
239+
)
240+
endif()
217241

218242
set_target_properties(gridcoinresearch PROPERTIES
219243
WIN32_EXECUTABLE TRUE

0 commit comments

Comments
 (0)