{"id":2269,"date":"2019-10-13T09:16:59","date_gmt":"2019-10-13T06:16:59","guid":{"rendered":"http:\/\/demensdeum.com\/blog\/?p=2269"},"modified":"2024-12-16T22:32:33","modified_gmt":"2024-12-16T19:32:33","slug":"building-project-with-libraries-emscripten","status":"publish","type":"post","link":"https:\/\/demensdeum.com\/blog\/ja\/2019\/10\/13\/building-project-with-libraries-emscripten\/","title":{"rendered":"Emscripten \u306e\u4f9d\u5b58\u95a2\u4fc2\u3092\u542b\u3080\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u30d3\u30eb\u30c9"},"content":{"rendered":"<p>\u3053\u306e\u6295\u7a3f\u3067\u306f\u3001Emscripten \u3092\u4f7f\u7528\u3057\u3066\u8907\u6570\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u69cb\u6210\u3055\u308c\u308b\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u69cb\u7bc9\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002<br \/>\u73fe\u6642\u70b9\u3067\u306f\u3001Emscripten \u306f\u5171\u6709\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u69cb\u7bc9\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u306a\u3044\u305f\u3081\u3001\u6700\u521d\u306e\u30b9\u30c6\u30c3\u30d7\u306f\u3059\u3079\u3066\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u5171\u6709\u30e9\u30a4\u30d6\u30e9\u30ea\u304b\u3089\u9759\u7684\u30e9\u30a4\u30d6\u30e9\u30ea\u306b\u8ee2\u9001\u3059\u308b\u3053\u3068\u3067\u3059\u3002 Emscripten \u306f\u72ec\u81ea\u306e\u30a4\u30f3\u30af\u30eb\u30fc\u30c9 \u30d5\u30a1\u30a4\u30eb\u3092\u4f7f\u7528\u3057\u3066\u52d5\u4f5c\u3059\u308b\u305f\u3081\u3001\u30d8\u30c3\u30c0\u30fc \u30d5\u30a1\u30a4\u30eb\u306e\u53ef\u8996\u6027\u306b\u95a2\u3059\u308b\u554f\u984c\u306f\u3001\u30b7\u30b9\u30c6\u30e0 \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u304b\u3089 Emscripten \u30c4\u30fc\u30eb\u30c1\u30a7\u30fc\u30f3\u306b\u8ee2\u9001\u3059\u308b\u3053\u3068\u3067\u89e3\u6c7a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-unknown\" data-lang=\"unknown\"><code>ln -s \/usr\/local\/include\/FlameSteelFramework $EMSDK\/fastcomp\/emscripten\/system\/include\/FlameSteelFramework\n<\/code><\/pre>\n<\/div>\n<p>CMake \u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u3001add_library \u30e1\u30bd\u30c3\u30c9\u306e CMakeLists.txt \u30d5\u30a1\u30a4\u30eb\u3067 SHARED->STATIC \u3092\u5909\u66f4\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3001\u3055\u3089\u306b\u9759\u7684\u30ea\u30f3\u30af\u3092\u884c\u3046\u305f\u3081\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\/\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u69cb\u7bc9\u3067\u304d\u307e\u3059\u3002<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-unknown\" data-lang=\"unknown\"><code>emcmake cmake .\nemmake make\n<\/code><\/pre>\n<\/div>\n<p>\u6b21\u306b\u3001\u30ea\u30f3\u30af\u6bb5\u968e\u3067 *.a \u30e9\u30a4\u30d6\u30e9\u30ea \u30d5\u30a1\u30a4\u30eb\u3092\u6307\u5b9a\u3057\u3066\u30e1\u30a4\u30f3 \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u69cb\u7bc9\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u76f8\u5bfe\u30d1\u30b9\u3092\u6307\u5b9a\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002CMakeLists.txt \u30d5\u30a1\u30a4\u30eb\u3067\u5b8c\u5168\u30d1\u30b9\u3092\u6307\u5b9a\u3057\u305f\u5f8c\u3067\u306e\u307f\u30d3\u30eb\u30c9\u304c\u6b63\u3057\u304f\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-unknown\" data-lang=\"unknown\"><code>elseif(EMSCRIPTEN)\ntarget_link_libraries(${FSEGT_PROJECT_NAME} GL GLEW \n\/home\/demensdeum\/Sources\/cube-art-project-bootstrap\/cube-art-project\/sharedLib\/libCubeArtProject.a \n\/home\/demensdeum\/Sources\/cube-art-project-bootstrap\/FlameSteelFramework\/FlameSteelEngineGameToolkitFSGL\/libFlameSteelEngineGameToolkitFSGL.a \n\/home\/demensdeum\/Sources\/cube-art-project-bootstrap\/FlameSteelFramework\/FlameSteelEngineGameToolkit\/libFlameSteelEngineGameToolkit.a \n\/home\/demensdeum\/Sources\/cube-art-project-bootstrap\/FlameSteelFramework\/FlameSteelCore\/libFlameSteelCore.a \n\/home\/demensdeum\/Sources\/cube-art-project-bootstrap\/FlameSteelFramework\/FlameSteelBattleHorn\/libFlameSteelBattleHorn.a \n\/home\/demensdeum\/Sources\/cube-art-project-bootstrap\/FlameSteelFramework\/FSGL\/libFSGL.a \n\/home\/demensdeum\/Sources\/cube-art-project-bootstrap\/FlameSteelFramework\/FlameSteelCommonTraits\/libFlameSteelCommonTraits.a)\nelse()\n<\/code><\/pre>\n<\/div>\n<h3>\u30bd\u30fc\u30b9<\/h3>\n<p><a href=\"https:\/\/emscripten.org\/docs\/compiling\/Building-Projects.html#using-libraries\" rel=\"noopener noreferrer\" target=\"_blank\">https:\/\/emscripten.org\/ docs\/compiling\/Building-Projects.html#using-libraries<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u306e\u6295\u7a3f\u3067\u306f\u3001Emscripten \u3092\u4f7f\u7528\u3057\u3066\u8907\u6570\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u69cb\u6210\u3055\u308c\u308b\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u69cb\u7bc9\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002\u73fe\u6642\u70b9\u3067\u306f\u3001Emscripten \u306f\u5171\u6709\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u69cb\u7bc9\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u306a\u3044\u305f\u3081\u3001\u6700\u521d\u306e\u30b9\u30c6\u30c3\u30d7\u306f\u3059\u3079\u3066\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u5171\u6709\u30e9\u30a4\u30d6\u30e9\u30ea\u304b\u3089\u9759\u7684\u30e9\u30a4\u30d6\u30e9\u30ea\u306b\u8ee2\u9001\u3059\u308b\u3053\u3068\u3067\u3059\u3002 Emscripten \u306f\u72ec\u81ea\u306e\u30a4\u30f3\u30af\u30eb\u30fc\u30c9 \u30d5\u30a1\u30a4\u30eb\u3092\u4f7f\u7528\u3057\u3066\u52d5\u4f5c\u3059\u308b\u305f\u3081\u3001\u30d8\u30c3\u30c0\u30fc \u30d5\u30a1\u30a4\u30eb\u306e\u53ef\u8996\u6027\u306b\u95a2\u3059\u308b\u554f\u984c\u306f\u3001\u30b7\u30b9\u30c6\u30e0 \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u304b\u3089 Emscripten \u30c4\u30fc\u30eb\u30c1\u30a7\u30fc\u30f3\u306b\u8ee2\u9001\u3059\u308b\u3053\u3068\u3067\u89e3\u6c7a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 ln -s \/usr\/local\/include\/FlameSteelFramework $EMSDK\/fastcomp\/emscripten\/system\/include\/FlameSteelFramework CMake \u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u3001add_library \u30e1\u30bd\u30c3\u30c9\u306e CMakeLists.txt \u30d5\u30a1\u30a4\u30eb\u3067 SHARED->STATIC \u3092\u5909\u66f4\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3001\u3055\u3089\u306b\u9759\u7684\u30ea\u30f3\u30af\u3092\u884c\u3046\u305f\u3081\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\/\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u69cb\u7bc9\u3067\u304d\u307e\u3059\u3002 emcmake cmake . emmake make \u6b21\u306b\u3001\u30ea\u30f3\u30af\u6bb5\u968e\u3067 *.a \u30e9\u30a4\u30d6\u30e9\u30ea \u30d5\u30a1\u30a4\u30eb\u3092\u6307\u5b9a\u3057\u3066\u30e1\u30a4\u30f3 \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u69cb\u7bc9\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u76f8\u5bfe\u30d1\u30b9\u3092\u6307\u5b9a\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002CMakeLists.txt \u30d5\u30a1\u30a4\u30eb\u3067\u5b8c\u5168\u30d1\u30b9\u3092\u6307\u5b9a\u3057\u305f\u5f8c\u3067\u306e\u307f\u30d3\u30eb\u30c9\u304c\u6b63\u3057\u304f\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002 elseif(EMSCRIPTEN) target_link_libraries(${FSEGT_PROJECT_NAME} GL GLEW \/home\/demensdeum\/Sources\/cube-art-project-bootstrap\/cube-art-project\/sharedLib\/libCubeArtProject.a \/home\/demensdeum\/Sources\/cube-art-project-bootstrap\/FlameSteelFramework\/FlameSteelEngineGameToolkitFSGL\/libFlameSteelEngineGameToolkitFSGL.a \/home\/demensdeum\/Sources\/cube-art-project-bootstrap\/FlameSteelFramework\/FlameSteelEngineGameToolkit\/libFlameSteelEngineGameToolkit.a \/home\/demensdeum\/Sources\/cube-art-project-bootstrap\/FlameSteelFramework\/FlameSteelCore\/libFlameSteelCore.a \/home\/demensdeum\/Sources\/cube-art-project-bootstrap\/FlameSteelFramework\/FlameSteelBattleHorn\/libFlameSteelBattleHorn.a \/home\/demensdeum\/Sources\/cube-art-project-bootstrap\/FlameSteelFramework\/FSGL\/libFSGL.a \/home\/demensdeum\/Sources\/cube-art-project-bootstrap\/FlameSteelFramework\/FlameSteelCommonTraits\/libFlameSteelCommonTraits.a) else() \u30bd\u30fc\u30b9 https:\/\/emscripten.org\/ docs\/compiling\/Building-Projects.html#using-libraries<\/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":[119,121],"class_list":["post-2269","post","type-post","status-publish","format-standard","hentry","category-techie","category-tutorials","tag-emscripten","tag-hints","entry"],"translation":{"provider":"WPGlobus","version":"3.0.2","language":"ja","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\/ja\/wp-json\/wp\/v2\/posts\/2269","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=2269"}],"version-history":[{"count":7,"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/posts\/2269\/revisions"}],"predecessor-version":[{"id":3939,"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/posts\/2269\/revisions\/3939"}],"wp:attachment":[{"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/media?parent=2269"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/categories?post=2269"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/tags?post=2269"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}