浏览代码

Workaround GCC issue producing shared lib containing undefined symbol.
Close #1519.

Yao Wei Tjong 姚伟忠 9 年之前
父节点
当前提交
ecfa732d52
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      Source/Urho3D/CMakeLists.txt

+ 4 - 0
Source/Urho3D/CMakeLists.txt

@@ -268,6 +268,10 @@ if (URHO3D_LUA)
     # This is more practical than patching its header files in many places to make them work with relative path
     list (APPEND INCLUDE_DIRS ${CMAKE_BINARY_DIR}/${DEST_INCLUDE_DIR}/ThirdParty/Lua${JIT})
 endif ()
+# Workaround for GCC 5.4 and above when building a SHARED lib type for Linux platform to fix the undefined symbol "__cpu_model" issue (see #1519)
+if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 5.3.1 AND CMAKE_SYSTEM_NAME STREQUAL Linux AND URHO3D_LIB_TYPE STREQUAL SHARED)  # 5.3.1 was the last known good version
+    list (APPEND LIBS gcc)
+endif ()
 
 # Setup library output path
 if (ANDROID)