File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff 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
218242set_target_properties (gridcoinresearch PROPERTIES
219243 WIN32_EXECUTABLE TRUE
You can’t perform that action at this time.
0 commit comments