{"action":"created","issue":{"url":"https://api.github.com/repos/paroj/ogre/issues/128","labels_url":"https://api.github.com/repos/paroj/ogre/issues/128/labels{/name}","comments_url":"https://api.github.com/repos/paroj/ogre/issues/128/comments","events_url":"https://api.github.com/repos/paroj/ogre/issues/128/events","html_url":"https://github.com/paroj/ogre/issues/128","id":119376251,"number":128,"title":"[OGRE-460] Forcing i686 architecture on MinGW","user":{"login":"paroj","id":4941802,"avatar_url":"https://avatars.githubusercontent.com/u/4941802?v=3","gravatar_id":"","url":"https://api.github.com/users/paroj","html_url":"https://github.com/paroj","followers_url":"https://api.github.com/users/paroj/followers","following_url":"https://api.github.com/users/paroj/following{/other_user}","gists_url":"https://api.github.com/users/paroj/gists{/gist_id}","starred_url":"https://api.github.com/users/paroj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paroj/subscriptions","organizations_url":"https://api.github.com/users/paroj/orgs","repos_url":"https://api.github.com/users/paroj/repos","events_url":"https://api.github.com/users/paroj/events{/privacy}","received_events_url":"https://api.github.com/users/paroj/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/paroj/ogre/labels/Build%20/%20Compilation","name":"Build / Compilation","color":"5c3f53"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-11-29T18:35:05Z","updated_at":"2015-11-29T18:35:27Z","closed_at":null,"body":"<b>[reporter=\"Mako_energy\", created=\"Mon, 24 Nov 2014 03:29:25 +0100\"]</b>\n<p>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.  </p>\n\n<p>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:</p>\n<div class=\"code panel\" style=\"border-width: 1px;\"><div class=\"codeContent panelContent\">\n<div class=\"error\"><span class=\"error\">Unable to find source-code formatter for language: before.</span> Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml</div><pre>\n  set(CMAKE_CXX_FLAGS <span class=\"code-quote\">\"${CMAKE_CXX_FLAGS} -march=i686\"</span>)\n</pre>\n</div></div>\n<p>with...</p>\n<div class=\"code panel\" style=\"border-width: 1px;\"><div class=\"codeContent panelContent\">\n<div class=\"error\"><span class=\"error\">Unable to find source-code formatter for language: after.</span> Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml</div><pre>\n  <span class=\"code-keyword\">if</span>( CMAKE_SIZEOF_VOID_P EQUAL 8 )\n    set(CMAKE_CXX_FLAGS <span class=\"code-quote\">\"${CMAKE_CXX_FLAGS} -march=athlon64\"</span>)\n  <span class=\"code-keyword\">else</span>( CMAKE_SIZEOF_VOID_P EQUAL 8 )\n    set(CMAKE_CXX_FLAGS <span class=\"code-quote\">\"${CMAKE_CXX_FLAGS} -march=i686\"</span>)\n  endif( CMAKE_SIZEOF_VOID_P EQUAL 8 )\n</pre>\n</div></div>\n\n<p>This should preserve the previous bugfix while enable compilation on 64-bit MinGW builds.</p>"},"comment":{"url":"https://api.github.com/repos/paroj/ogre/issues/comments/160445456","html_url":"https://github.com/paroj/ogre/issues/128#issuecomment-160445456","issue_url":"https://api.github.com/repos/paroj/ogre/issues/128","id":160445456,"user":{"login":"paroj","id":4941802,"avatar_url":"https://avatars.githubusercontent.com/u/4941802?v=3","gravatar_id":"","url":"https://api.github.com/users/paroj","html_url":"https://github.com/paroj","followers_url":"https://api.github.com/users/paroj/followers","following_url":"https://api.github.com/users/paroj/following{/other_user}","gists_url":"https://api.github.com/users/paroj/gists{/gist_id}","starred_url":"https://api.github.com/users/paroj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paroj/subscriptions","organizations_url":"https://api.github.com/users/paroj/orgs","repos_url":"https://api.github.com/users/paroj/repos","events_url":"https://api.github.com/users/paroj/events{/privacy}","received_events_url":"https://api.github.com/users/paroj/received_events","type":"User","site_admin":false},"created_at":"2015-11-29T18:35:27Z","updated_at":"2015-11-29T18:35:27Z","body":"<b><i>[author=\"mako_energy\", created=\"Mon, 1 Dec 2014 21:15:26 +0100\"]</i></b>\n<p>@Philip Allgaier  At first I had no idea what you meant by saying that having a solution that would work if 64 bit builds were selected in the CMake generator list.  I now realize that among the vast sea of Visual Studio generators that you can do that.  This design does not apply to any other group of generators however, and all of the CMake modifications I have proposed thus far are for CMake logic that is inside a check for MinGW(which is already in the file, encasing the offending code I quoted earlier).  So this will have zero chance at contaminating builds for other compilers.  Whether or not it'll work with the selected generator in the CMake pulldown doesn't apply.</p>"}}