Explorar o código

Merge pull request #13464 from ghalliday/issue23430

HPCC-23430 Ensure that all symbols are resolved at link time
Richard Chapman %!s(int64=5) %!d(string=hai) anos
pai
achega
01c8522819
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      cmake_modules/commonSetup.cmake

+ 6 - 0
cmake_modules/commonSetup.cmake

@@ -487,6 +487,12 @@ IF ("${COMMONSETUP_DONE}" STREQUAL "")
     endif ()
   endif ()
 
+  if (CMAKE_COMPILER_IS_GNUCXX)
+    #Ensure that missing symbols are reported as errors at link time (default for osx/windows)
+    SET (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,defs")
+    SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,defs")
+  endif()
+
   macro(HPCC_ADD_EXECUTABLE target)
     add_executable(${target} ${ARGN})
   endmacro(HPCC_ADD_EXECUTABLE target)