weixin_39595487 2020-11-30 03:02
浏览 0

[OGRE-460] Forcing i686 architecture on MinGW

[reporter="Mako_energy", created="Mon, 24 Nov 2014 03:29:25 +0100"]

At around line 150 of the root CMakeLists.txt file in the Ogre 2.0 trunk (I suspect this applies to all other versions of Ogre as well), there is a condition that checks for MinGW and if found would force the CMake architecture to i686 using "-march=i686". This is not a 64-bit architecture and thus will cause any MinGW64 compiler configured to actually build 64-bit libraries to fail.

From doing some research it seems this line for the architecture was added to resolve a linking bug on MinGW a while back. It should stay for 32-bit builds, but shouldn't exist for 64-bit builds. For example, replace:

Unable to find source-code formatter for language: before. Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=i686")

with...

Unable to find source-code formatter for language: after. Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml
  if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=athlon64")
  else( CMAKE_SIZEOF_VOID_P EQUAL 8 )
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=i686")
  endif( CMAKE_SIZEOF_VOID_P EQUAL 8 )

This should preserve the previous bugfix while enable compilation on 64-bit MinGW builds.

该提问来源于开源项目:OGRECave/ogre

  • 写回答

8条回答 默认 最新

  • weixin_39595487 2020-11-30 03:02
    关注

    [author="dark_sylinc", created="Tue, 25 Nov 2014 00:02:33 +0100"]

    MinGW is not my thing. Perhaps Philip Allgaier you can see the problem and if it applies to other branches as well (most likely)?

    评论

报告相同问题?