{"id":2300,"date":"2019-10-27T09:15:13","date_gmt":"2019-10-27T06:15:13","guid":{"rendered":"http:\/\/demensdeum.com\/blog\/?p=2300"},"modified":"2024-12-16T22:32:33","modified_gmt":"2024-12-16T19:32:33","slug":"crosscompile-for-macos-on-ubuntu-cmake","status":"publish","type":"post","link":"https:\/\/demensdeum.com\/blog\/ru\/2019\/10\/27\/crosscompile-for-macos-on-ubuntu-cmake\/","title":{"rendered":"\u0421\u0431\u043e\u0440\u043a\u0430 macOS \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043f\u043e\u0434 Ubuntu OSXCross CMake"},"content":{"rendered":"<p>\u0412 \u044d\u0442\u043e\u0439 \u0437\u0430\u043c\u0435\u0442\u043a\u0435 \u044f \u043e\u043f\u0438\u0448\u0443 \u0441\u0431\u043e\u0440\u043a\u0443 \u043a\u0440\u043e\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u0445 C++ \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0434\u043b\u044f macOS \u043d\u0430 \u0441\u0431\u043e\u0440\u043e\u0447\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 Ubuntu \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c CMake \u0438 osxcross.<br \/>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0442\u0443\u043b\u0447\u0435\u0439\u043d osxcross:<br \/><a href=\"https:\/\/github.com\/tpoechtrager\/osxcross\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/github.com\/tpoechtrager\/osxcross<\/a><br \/>\n\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 3 \u044d\u0442\u0430\u043f\u0430, \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-unknown\" data-lang=\"unknown\"><code>cd tools\n.\/get_dependencies.sh\n<\/code><\/pre>\n<\/div>\n<p>\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 XCode.xip \u0441 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430 Apple, \u0434\u0430\u043b\u0435\u0435 \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0430 SDK \u0438\u0437 XCode:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-unknown\" data-lang=\"unknown\"><code>.\/gen_sdk_package_pbzx.sh \/media\/demensdeum\/2CE62A79E62A4404\/LinuxSupportStorage\/xcode111.xip\n<\/code><\/pre>\n<\/div>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c \u0432\u044b \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043b\u0438 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u043e\u043d\u043d\u043e\u0435 \u0441\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0435 XCode \u043d\u0430 \u043f\u0440\u043e\u0448\u043b\u043e\u043c \u0448\u0430\u0433\u0435? \u0414\u0430\u043b\u0435\u0435 \u0441\u0431\u043e\u0440\u043a\u0430 \u0442\u0443\u043b\u0447\u0435\u0439\u043d\u0430 \u0441 \u043d\u0443\u0436\u043d\u044b\u043c \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u043e\u043c:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-unknown\" data-lang=\"unknown\"><code>INSTALLPREFIX=\/home\/demensdeum\/Apps\/osxcross .\/build.sh \n<\/code><\/pre>\n<\/div>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f osxcross \u0438\u0437 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438-\u043f\u0440\u0435\u0444\u0438\u043a\u0441\u0430 \u043f\u0440\u043e\u0448\u043b\u043e\u0433\u043e \u0448\u0430\u0433\u0430. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u043c\u0430\u043a\u0440\u043e\u0441 \u0441\u0431\u043e\u0440\u043a\u0438 \u0434\u043b\u044f CMake, \u043f\u0440\u043e\u043f\u0438\u0448\u0435\u043c \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-unknown\" data-lang=\"unknown\"><code>if (OSXCROSS)\nSET(CMAKE_SYSTEM_NAME Darwin)\nSET(CMAKE_C_COMPILER o64-clang)\nSET(CMAKE_CXX_COMPILER o64-clang++)\nSET(CMAKE_C_COMPILER_AR x86_64-apple-darwin19-ar)\nSET(CMAKE_CXX_COMPILER_AR x86_64-apple-darwin19-ar)\nSET(CMAKE_LINKER x86_64-apple-darwin19-ld)\nSET(ENV{OSXCROSS_MP_INC} 1)\nendif()\n<\/code><\/pre>\n<\/div>\n<p>\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043b\u0438\u043d\u043a\u043e\u0432\u043a\u0430 \u043c\u043d\u0435 \u043d\u0435 \u0443\u0434\u0430\u043b\u0430\u0441\u044c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-unknown\" data-lang=\"unknown\"><code>if (OSXCROSS)\nadd_library(FlameSteelCore STATIC ${SOURCE_FILES})\nelse()\n<\/code><\/pre>\n<\/div>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c\u0441\u044f \u0441 \u0444\u0430\u043a\u0442\u043e\u043c \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0434\u043b\u044f osxcross, \u0441 \u044d\u0442\u0438\u043c \u044f \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u043b\u0441\u044f \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 SDL2. osxcross \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a &#8211; macports. \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 SDL2-mixer:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-unknown\" data-lang=\"unknown\"><code>osxcross-macports -v install libsdl2_mixer\n<\/code><\/pre>\n<\/div>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043a \u0441\u0431\u043e\u0440\u043a\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\/\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 cmake-make, \u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043b\u0438\u043d\u043a\u043e\u0432\u043a\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0435\u0441\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e.<\/p>\n<h3>\u0420\u0443\u0447\u043d\u0430\u044f \u0441\u0431\u043e\u0440\u043a\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a<\/h3>\n<p>\u041d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u044f \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u043b\u0441\u044f \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u043f\u0440\u0438 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043b\u0438\u043d\u043a\u043e\u0432\u043a\u0435, \u043f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435 \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0430\u044e \u043e\u0448\u0438\u0431\u043a\u0443:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-unknown\" data-lang=\"unknown\"><code>file was built for archive which is not the architecture being linked (x86_64)\n<\/code><\/pre>\n<\/div>\n<p>\u041e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 <a href=\"https:\/\/github.com\/tpoechtrager\/osxcross\/issues\/11\" rel=\"noopener\" target=\"_blank\">\u044d\u0442\u043e\u0442 \u0442\u0438\u043a\u0435\u0442<\/a>, \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c workaround \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0447\u0435\u0433\u043e \u0441\u0431\u043e\u0440\u043a\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e. \u0420\u0430\u0437\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u0443\u0435\u043c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0438 \u0441\u043e\u0431\u0435\u0440\u0435\u043c \u0435\u0435 \u043f\u043e \u043d\u043e\u0432\u043e\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0440\u0445\u0438\u0432\u0430\u0442\u043e\u0440\u0430 osxcross:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-unknown\" data-lang=\"unknown\"><code>ar x ..\/libFlameSteelCore.a\nrm ..\/libFlameSteelCore.a\nx86_64-apple-darwin19-ar rcs ..\/libFlameSteelCore.a *.o\n<\/code><\/pre>\n<\/div>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043b\u0438\u0447\u043d\u043e \u044f \u0441\u0447\u0438\u0442\u0430\u044e \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 macOS \u0441\u0440\u0430\u0437\u0443 \u043d\u0430 \u0443\u0431\u0443\u043d\u0442\u0443 (\u0445\u043e\u0442\u044f\u0431\u044b \u0441 \u0447\u0430\u0441\u0442\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430), \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 <a href=\"https:\/\/github.com\/darlinghq\/darling\" rel=\"noopener\" target=\"_blank\">darling<\/a>, \u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u043e\u043a\u0430 \u0436\u0435\u043b\u0430\u0442\u044c \u043b\u0443\u0447\u0448\u0435\u0433\u043e.<\/p>\n<h3>\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438<\/h3>\n<p><a href=\"https:\/\/github.com\/tpoechtrager\/osxcross\" rel=\"noopener\" target=\"_blank\">https:\/\/github.com\/tpoechtrager\/osxcross<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0412 \u044d\u0442\u043e\u0439 \u0437\u0430\u043c\u0435\u0442\u043a\u0435 \u044f \u043e\u043f\u0438\u0448\u0443 \u0441\u0431\u043e\u0440\u043a\u0443 \u043a\u0440\u043e\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u0445 C++ \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0434\u043b\u044f macOS \u043d\u0430 \u0441\u0431\u043e\u0440\u043e\u0447\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 Ubuntu \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c CMake \u0438 osxcross.\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0442\u0443\u043b\u0447\u0435\u0439\u043d osxcross:https:\/\/github.com\/tpoechtrager\/osxcross \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 3 \u044d\u0442\u0430\u043f\u0430, \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439: cd tools .\/get_dependencies.sh \u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 XCode.xip \u0441 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430 Apple, \u0434\u0430\u043b\u0435\u0435 \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0430 SDK \u0438\u0437 XCode: .\/gen_sdk_package_pbzx.sh \/media\/demensdeum\/2CE62A79E62A4404\/LinuxSupportStorage\/xcode111.xip \u041d\u0430\u0434\u0435\u044e\u0441\u044c \u0432\u044b \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043b\u0438 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u043e\u043d\u043d\u043e\u0435 \u0441\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0435 XCode \u043d\u0430 \u043f\u0440\u043e\u0448\u043b\u043e\u043c<a class=\"more-link\" href=\"https:\/\/demensdeum.com\/blog\/ru\/2019\/10\/27\/crosscompile-for-macos-on-ubuntu-cmake\/\">Continue reading <span class=\"screen-reader-text\">&#8220;\u0421\u0431\u043e\u0440\u043a\u0430 macOS \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043f\u043e\u0434 Ubuntu OSXCross CMake&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[61,52],"tags":[126],"class_list":["post-2300","post","type-post","status-publish","format-standard","hentry","category-techie","category-tutorials","tag-osxcross","entry"],"translation":{"provider":"WPGlobus","version":"3.0.2","language":"ru","enabled_languages":["en","ru","zh","de","fr","ja","pt","hi"],"languages":{"en":{"title":true,"content":true,"excerpt":false},"ru":{"title":true,"content":true,"excerpt":false},"zh":{"title":true,"content":true,"excerpt":false},"de":{"title":true,"content":true,"excerpt":false},"fr":{"title":true,"content":true,"excerpt":false},"ja":{"title":true,"content":true,"excerpt":false},"pt":{"title":true,"content":true,"excerpt":false},"hi":{"title":false,"content":false,"excerpt":false}}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/demensdeum.com\/blog\/ru\/wp-json\/wp\/v2\/posts\/2300","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/demensdeum.com\/blog\/ru\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/demensdeum.com\/blog\/ru\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/demensdeum.com\/blog\/ru\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/demensdeum.com\/blog\/ru\/wp-json\/wp\/v2\/comments?post=2300"}],"version-history":[{"count":20,"href":"https:\/\/demensdeum.com\/blog\/ru\/wp-json\/wp\/v2\/posts\/2300\/revisions"}],"predecessor-version":[{"id":3936,"href":"https:\/\/demensdeum.com\/blog\/ru\/wp-json\/wp\/v2\/posts\/2300\/revisions\/3936"}],"wp:attachment":[{"href":"https:\/\/demensdeum.com\/blog\/ru\/wp-json\/wp\/v2\/media?parent=2300"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/demensdeum.com\/blog\/ru\/wp-json\/wp\/v2\/categories?post=2300"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/demensdeum.com\/blog\/ru\/wp-json\/wp\/v2\/tags?post=2300"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}