From 5a82afc22c4e211fc61360a77e48ad8e321561a2 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 10 Sep 2011 18:43:21 +0200 Subject: [PATCH] Fixed: "relocation R_X86_64_32 against.." error when mixing static and shared libraries --- code/CMakeModules/nel.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/code/CMakeModules/nel.cmake b/code/CMakeModules/nel.cmake index 1524ebf46..19e0ea5c0 100644 --- a/code/CMakeModules/nel.cmake +++ b/code/CMakeModules/nel.cmake @@ -368,6 +368,11 @@ MACRO(NL_SETUP_BUILD) SET(PLATFORM_CFLAGS "-gdwarf-2 ${PLATFORM_CFLAGS}") ENDIF(APPLE) + # Fix "relocation R_X86_64_32 against.." error on x64 platforms + IF(TARGET_X64 AND WITH_STATIC AND NOT WITH_STATIC_DRIVERS) + SET(PLATFORM_CFLAGS "-fPIC ${PLATFORM_CFLAGS}") + ENDIF(TARGET_X64 AND WITH_STATIC AND NOT WITH_STATIC_DRIVERS) + SET(PLATFORM_CXXFLAGS ${PLATFORM_CFLAGS}) IF(NOT APPLE)