{"id":166571,"date":"2020-09-29T16:52:53","date_gmt":"2020-09-29T08:52:53","guid":{"rendered":"http:\/\/4563.org\/?p=166571"},"modified":"2020-09-29T16:52:53","modified_gmt":"2020-09-29T08:52:53","slug":"%e7%94%a8-cmake-%e4%ba%a4%e5%8f%89%e7%bc%96%e8%af%91%e6%97%b6%e5%a6%82%e4%bd%95%e5%a4%84%e7%90%86%e7%ac%ac%e4%b8%89%e6%96%b9%e5%ba%93%e6%96%87%e4%bb%b6%e9%87%8c%e7%9a%84%e7%bb%9d%e5%af%b9%e8%b7%af","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=166571","title":{"rendered":"\u7528 CMake \u4ea4\u53c9\u7f16\u8bd1\u65f6\u5982\u4f55\u5904\u7406\u7b2c\u4e09\u65b9\u5e93\u6587\u4ef6\u91cc\u7684\u7edd\u5bf9\u8def\u5f84\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u7528 CMake \u4ea4\u53c9\u7f16\u8bd1\u65f6\u5982\u4f55\u5904\u7406\u7b2c\u4e09\u65b9\u5e93\u6587\u4ef6\u91cc\u7684\u7edd\u5bf9\u8def\u5f84\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : dangyuluo <\/span>  <span><i><\/i> 5<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u6bd4\u5982\u6211\u4eec\u51c6\u5907\u4e86\u4e00\u4e2a<code>aarch64<\/code>\u7684\u6839\u76ee\u5f55 SYSROOT\uff0c\u653e\u5728<code>\/var\/systoor<\/code>\u91cc\u3002\u7136\u540e\u5176\u4e2d\u6709\u4e00\u4e2a\u7b2c\u4e09\u65b9\u5e93\u63d0\u4f9b\u4e86\u4e2a CMake \u6587\u4ef6\uff0c<code>\/var\/sysroot\/usr\/lib\/cmake\/xxx\/xxxConfig.cmake<\/code>\u3002\u7136\u800c\u5728\u8fd9\u4e2a CMake \u6587\u4ef6\u91cc\uff0c\u4f5c\u8005\u5199\u6b7b\u4e86\u4e00\u4e2a library \u8def\u5f84\uff1a<\/p>\n<pre><code>SET(FreeType_LIB \/usr\/lib\/aarch64-linux-gnu\/libfreetype.so) <\/code><\/pre>\n<p>\u4f46\u5f88\u663e\u7136\u8fd9\u4e2a\u8def\u5f84\u662f\u76f8\u5bf9\u4e8e SYSROOT \u4e0b\u7684\u800c\u4e0d\u662f\u672c\u673a\u6839\u76ee\u5f55\u4e0b\u7684\uff0c\u4f46 CMake \u53c8\u4e0d\u80fd\u610f\u8bc6\u5230\u8fd9\u70b9\uff0c\u50bb\u4e4e\u4e4e\u7684\u5728\u672c\u673a\u5bfb\u627e\u8fd9\u4e2a\u6587\u4ef6\uff0c\u5f53\u7136\u4f1a\u62a5\u9519\u8bf4\u6ca1\u6709\u627e\u5230\u3002<\/p>\n<p>\u6709\u6ca1\u6709\u4ec0\u4e48\u529e\u6cd5\u544a\u8bc9 CMake\uff0c\u5bf9\u4e8e<code>\/usr\/lib<\/code>\u5f00\u5934\u7684\u6240\u6709\u5e93\uff0c\u90fd\u5728\u8def\u5f84\u524d\u9644\u52a0\u4e00\u4e2a<code>SYSROOT<\/code>\u7684\u8def\u5f84\u5462\uff1f<\/p>\n<p>\u8c22\u8c22<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>5<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"3674021\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : felixlong <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             SET(CFLAGS, &#8220;$CFLAGS &#8211;sysroot=\/var\/sysroot&#8221;)                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3674022\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : MCVector <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8bd5\u8bd5\u770b\u7528 CMAKE_PREFIX_PATH? https:\/\/cmake.org\/cmake\/help\/v3.0\/variable\/CMAKE_PREFIX_PATH.html                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3674023\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : 12101111 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8fd9\u4e2a\u8def\u5f84\u4e0d\u5e94\u8be5\u662f\u4ece pkgconfig \u8bfb\u51fa\u6765\u7684\u5417                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3674024\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : mingl0280 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u65b0\u5efa\u4e00\u4e2a toolchain \u6587\u4ef6\uff0c\u91cc\u9762\u52a0\u4e0a<br \/>set(CMAKE_SYSROOT &#8220;\/var\/sysroot&#8221;)<br \/>\u5373\u53ef\u3002<br \/>\u6ce8\u610f\u53ea\u80fd\u4f7f\u7528 toolchain \u751f\u6548\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3674025\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : waruqi <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8fd8\u53ef\u4ee5\u8bd5\u8bd5\u7528 xmake \u6765\u7f16\u8bd1\uff0c\u4ea4\u53c9\u7f16\u8bd1\u914d\u7f6e\u5f88\u65b9\u4fbf\u7684\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u7528 CMake \u4ea4\u53c9\u7f16\u8bd1\u65f6\u5982\u4f55\u5904\u7406&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/166571"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=166571"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/166571\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=166571"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=166571"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=166571"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}