{"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\/ja\/2019\/10\/27\/crosscompile-for-macos-on-ubuntu-cmake\/","title":{"rendered":"Ubuntu OSXCros CMake \u7528\u306e macOS \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u69cb\u7bc9"},"content":{"rendered":"<p>\u3053\u306e\u6295\u7a3f\u3067\u306f\u3001CMake \u3068 osxcross \u3092\u4f7f\u7528\u3057\u3066\u3001Ubuntu \u30d3\u30eb\u30c9 \u30de\u30b7\u30f3\u4e0a\u3067 macOS \u7528\u306e\u30af\u30ed\u30b9\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0 C++ \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u69cb\u7bc9\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002<br \/>\u307e\u305a\u3001osxcross \u30c4\u30fc\u30eb\u30c1\u30a7\u30fc\u30f3\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<br \/><a href=\"https:\/\/github.com\/tpoechtrager\/osxcross\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/github.com\/tpoechtrager\/osxcross<\/a><br \/>\n\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f 3 \u6bb5\u968e\u3067\u884c\u308f\u308c\u3001\u4f9d\u5b58\u95a2\u4fc2\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u307e\u3059\u3002<\/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>Apple \u516c\u5f0f Web \u30b5\u30a4\u30c8\u304b\u3089 XCode.xip \u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3001XCode \u304b\u3089 SDK \u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u307e\u3059\u3002<\/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>\u6700\u5f8c\u306e\u30b9\u30c6\u30c3\u30d7\u3067 XCode \u4f7f\u7528\u8a31\u8afe\u5951\u7d04\u3092\u8aad\u3093\u3067\u3044\u305f\u3060\u3051\u308c\u3070\u5e78\u3044\u3067\u3059\u3002\u6b21\u306b\u3001\u5fc5\u8981\u306a\u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9\u3092\u4f7f\u7528\u3057\u3066\u30c4\u30fc\u30eb\u30c1\u30a7\u30fc\u30f3\u3092\u69cb\u7bc9\u3057\u307e\u3059\u3002<\/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>\u3053\u308c\u3067\u3001\u524d\u306e\u624b\u9806\u306e\u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9 \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u304b\u3089 osxcross \u3092\u4f7f\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002 CMake \u306e\u65b0\u3057\u3044\u30d3\u30eb\u30c9 \u30de\u30af\u30ed\u3092\u8ffd\u52a0\u3057\u3066\u3001\u5fc5\u8981\u306a\u3082\u306e\u3092\u3059\u3079\u3066\u8a18\u8ff0\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/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>\u52d5\u7684\u30ea\u30f3\u30af\u304c\u6210\u529f\u3057\u306a\u304b\u3063\u305f\u305f\u3081\u3001\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u9759\u7684\u306b\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u3057\u307e\u3059\u3002<\/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>\u6b21\u306b\u3001osxcross \u306b\u5fc5\u8981\u306a\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u306a\u3044\u3068\u3044\u3046\u4e8b\u5b9f\u306b\u76f4\u9762\u3059\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\u79c1\u306f SDL2 \u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u3068\u304d\u306b\u3053\u308c\u306b\u906d\u9047\u3057\u307e\u3057\u305f\u3002 osxcross \u306f\u65e2\u88fd\u306e\u30e9\u30a4\u30d6\u30e9\u30ea \u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u307e\u3059 &#8211;\u30de\u30c3\u30af\u30dd\u30fc\u30c8\u3002\u305f\u3068\u3048\u3070\u3001SDL2-mixer \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u5834\u5408\u306f\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/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>\u3053\u306e\u5f8c\u3001cmake-make \u30ea\u30f3\u30af\u3067\u901a\u5e38\u3069\u304a\u308a\u30e9\u30a4\u30d6\u30e9\u30ea\/\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u69cb\u7bc9\u3092\u958b\u59cb\u3067\u304d\u307e\u3059\u3002\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u9759\u7684\u30ea\u30f3\u30af\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3092\u5fd8\u308c\u306a\u3044\u3067\u304f\u3060\u3055\u3044\u3002<\/p>\n<h3>\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u624b\u52d5\u30a2\u30bb\u30f3\u30d6\u30ea<\/h3>\n<p>\u73fe\u5728\u3001\u6700\u7d42\u7684\u306a\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u69cb\u7bc9\u3059\u308b\u3068\u304d\u306b\u3001\u9759\u7684\u30ea\u30f3\u30af\u4e2d\u306b\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u6b63\u3057\u304f\u30a2\u30fc\u30ab\u30a4\u30d6\u3055\u308c\u306a\u3044\u3068\u3044\u3046\u554f\u984c\u304c\u767a\u751f\u3057\u3001\u6b21\u306e\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3059\u3002<\/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><a href=\"https:\/\/github.com\/tpoechtrager\/osxcross\/issues\/11\" rel=\"noopener\" target=\"_blank\">\u3053\u306e\u30c1\u30b1\u30c3\u30c8<\/a>\u3068\u975e\u5e38\u306b\u3088\u304f\u4f3c\u305f\u3001\u56de\u907f\u7b56\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u30a2\u30bb\u30f3\u30d6\u30ea\u304c\u6b63\u3057\u304f\u5b8c\u4e86\u3057\u307e\u3059\u3002\u9759\u7684\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u89e3\u51cd\u3057\u3001osxcross \u30a2\u30fc\u30ab\u30a4\u30d0\u3092\u4f7f\u7528\u3057\u3066\u65b0\u305f\u306b\u30d3\u30eb\u30c9\u3057\u307e\u3057\u3087\u3046\u3002<\/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>\u79c1\u306f\u500b\u4eba\u7684\u306b\u3001macOS \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092 Ubuntu \u4e0a\u3067\u76f4\u63a5\u5b9f\u884c\u3059\u308b\u6a5f\u80fd (\u5c11\u306a\u304f\u3068\u3082\u4e00\u90e8\u306e\u6a5f\u80fd) \u304c\u6b20\u5982\u3057\u3066\u3044\u308b\u3053\u3068\u3082\u554f\u984c\u306e 1 \u3064\u3067\u3042\u308b\u3068\u8003\u3048\u3066\u3044\u307e\u3059\u3002\u3082\u3061\u308d\u3093\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u304c\u3042\u308a\u307e\u3059 <a href=\"https:\/\/github.com \/darlinghq\/darling\" rel=\"noopener\" target=\"_blank\">\u30c0\u30fc\u30ea\u30f3<\/a>\u3067\u3059\u304c\u3001\u30b5\u30dd\u30fc\u30c8\u306b\u306f\u307e\u3060\u6539\u5584\u306e\u4f59\u5730\u304c\u305f\u304f\u3055\u3093\u3042\u308a\u307e\u3059\u3002<\/p>\n<h3>\u30bd\u30fc\u30b9<\/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>\u3053\u306e\u6295\u7a3f\u3067\u306f\u3001CMake \u3068 osxcross \u3092\u4f7f\u7528\u3057\u3066\u3001Ubuntu \u30d3\u30eb\u30c9 \u30de\u30b7\u30f3\u4e0a\u3067 macOS \u7528\u306e\u30af\u30ed\u30b9\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0 C++ \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u69cb\u7bc9\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002\u307e\u305a\u3001osxcross \u30c4\u30fc\u30eb\u30c1\u30a7\u30fc\u30f3\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002https:\/\/github.com\/tpoechtrager\/osxcross \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f 3 \u6bb5\u968e\u3067\u884c\u308f\u308c\u3001\u4f9d\u5b58\u95a2\u4fc2\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u307e\u3059\u3002 cd tools .\/get_dependencies.sh Apple \u516c\u5f0f Web \u30b5\u30a4\u30c8\u304b\u3089 XCode.xip \u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3001XCode \u304b\u3089 SDK \u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u307e\u3059\u3002 .\/gen_sdk_package_pbzx.sh \/media\/demensdeum\/2CE62A79E62A4404\/LinuxSupportStorage\/xcode111.xip \u6700\u5f8c\u306e\u30b9\u30c6\u30c3\u30d7\u3067 XCode \u4f7f\u7528\u8a31\u8afe\u5951\u7d04\u3092\u8aad\u3093\u3067\u3044\u305f\u3060\u3051\u308c\u3070\u5e78\u3044\u3067\u3059\u3002\u6b21\u306b\u3001\u5fc5\u8981\u306a\u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9\u3092\u4f7f\u7528\u3057\u3066\u30c4\u30fc\u30eb\u30c1\u30a7\u30fc\u30f3\u3092\u69cb\u7bc9\u3057\u307e\u3059\u3002 INSTALLPREFIX=\/home\/demensdeum\/Apps\/osxcross .\/build.sh \u3053\u308c\u3067\u3001\u524d\u306e\u624b\u9806\u306e\u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9 \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u304b\u3089 osxcross \u3092\u4f7f\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002 CMake \u306e\u65b0\u3057\u3044\u30d3\u30eb\u30c9 \u30de\u30af\u30ed\u3092\u8ffd\u52a0\u3057\u3066\u3001\u5fc5\u8981\u306a\u3082\u306e\u3092\u3059\u3079\u3066\u8a18\u8ff0\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002 if (OSXCROSS) SET(CMAKE_SYSTEM_NAME Darwin) SET(CMAKE_C_COMPILER o64-clang) SET(CMAKE_CXX_COMPILER o64-clang++) SET(CMAKE_C_COMPILER_AR x86_64-apple-darwin19-ar) SET(CMAKE_CXX_COMPILER_AR x86_64-apple-darwin19-ar) SET(CMAKE_LINKER x86_64-apple-darwin19-ld) SET(ENV{OSXCROSS_MP_INC}<a class=\"more-link\" href=\"https:\/\/demensdeum.com\/blog\/ja\/2019\/10\/27\/crosscompile-for-macos-on-ubuntu-cmake\/\">Continue reading <span class=\"screen-reader-text\">&#8220;Ubuntu OSXCros CMake \u7528\u306e macOS \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u69cb\u7bc9&#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":"ja","enabled_languages":["en","ru","zh","de","fr","ja","pt"],"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}}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/posts\/2300","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/comments?post=2300"}],"version-history":[{"count":20,"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/posts\/2300\/revisions"}],"predecessor-version":[{"id":3936,"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/posts\/2300\/revisions\/3936"}],"wp:attachment":[{"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/media?parent=2300"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/categories?post=2300"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/tags?post=2300"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}