고도엔진에서 보안을 위한 gd extension 설정

 https://docs.godotengine.org/ko/4.x/tutorials/scripting/cpp/gdextension_cpp_example.html#workflow-overview



3. godot-cpp를 '서브모듈'로 추가 (폴더명은 'godot-cpp'로 생성됨) 


깃 관리 중이라면

git submodule add -b 4.5 https://github.com/godotengine/godot-cpp


고도 바인딩

godot --dump-extension-api


# 파일 이름은 실제 사용자님의 실행 파일 이름과 같아야 합니다.

# 예: Godot_v4.5-stable_win64.exe

./Godot_v4.5.1-stable_win64.exe --dump-extension-api


켜졌다가 꺼짐.

이제 만들어진 json파일을  c++폴더안에 넣고 해당 루트에서 배쉬로 명령어

scons platform=<platform> extension_api.json=<PATH_TO_FILE>


scons platform=windows api_file=extension_api.json -j8



완료.

bin폴더 생기고 이 파일이 있어야함.

고도 프로젝트에 src폴더를 만들고 파일 c++을 만듦


에제 파일 만들고,


scons platform=<platform>


c++폴더에서 하지말고 프로젝트 상위폴더에서 Sconstruct를 받아서 놓고 해야함.

명령어

scons platform=windows

치면됨

scons platform=windows -j8 

더 빠르게

target=template_release. 릴리즈 빌드명령어

scons platform=windows target=template_release -j8


여기에  파일을 만들어야함

gdexample.gdextension



구조

demo가 프로젝트 루트여야함. 나는 demo를 폴더로 생성해서 잘못됨;;


bin파일이 업데이틑 안될 때

고도엔진 전부 끄고 싹밀고 다시 컴파일 ㄱ

scons platform=windows target=template_release -c

bin 삭제 명령어


아 원래 demo폴더 유지로 써야할 듯 뭔가 경로를 못찾음.;;

디버그

scons platform=windows -j8

릴리즈

scons platform=windows target=template_release -j8


왜 못찾나 했더니 에디터는 릴리즈를 인식못함 디버그용으로 만들고 작업한 후 빌드할 때는 릴리즈를 씀 결국 둘다 빌드해두어야함.



안드로이드 빌드 명령어

1. 디버그(Debug) 세트 - 에디터 실행 및 개발용

  • scons platform=android target=template_debug arch=arm64 -j11

  • scons platform=android target=template_debug arch=x86_64 -j11

2. 릴리즈(Release) 세트 - 실제 구글 플레이 배포용

  • scons platform=android target=template_release arch=arm64 -j11

  • scons platform=android target=template_release arch=x86_64 -j11

  • x86_64 (최신태블릿용): scons platform=android target=template_release arch=x86_64 -j11

  • x86 (구형 시뮬레이터용): scons platform=android target=template_release arch=x86_32 -j11

  • 이것도 해주어야함.


    밑에꺼는 고도가 지원안해서 만들어서 동작하는지 보려고 해봄.

    32비트 

    scons platform=android target=template_release arch=arm32 -j11
    

    x86 32비트 (구형 에뮬레이터용)

    scons platform=android target=template_release arch=x86_32 -j11





    참조를 28로 고정해놓아서 이걸 설치했는데 여기가 경로다됨 

    안드로이드 빌드하려면 이걸 수정해야한다.

    댓글

    이 블로그의 인기 게시물

    고도엔진을 안드로이드애플리케이션에 임베드하는거 공부하기

    [코틀린] 고도엔진 안드로이드 플러그인 최종정리

    godot용 android plugin 제작