game/godot

Godot - Introduction to the buildsystem

C/H 2018. 12. 11. 08:30

Introduction to the buildsystem

SCons

Godot uses SCons to build. We love it, we are not changing it for anything else. We are not even sure other build systems are up to the task of building Godot. We constantly get requests to move the build system to CMake, or Visual Studio, but this is not going to happen. There are many reasons why we have chosen SCons over other alternatives, for example:
Godot은 SCons를 사용하여 빌드합니다. 우리는 그것을 사랑하고, 우리는 다른 것을 위해 그것을 바꾸지 않을 것입니다. 우리는 심지어 다른 빌드 시스템이 Godot을 빌드하는 작업까지 하는지 확신하지 못합니다. 우리는 끊임없이 빌드 시스템을 CMake 나 Visual Studio로 옮길 것을 요청 받습니다, 그러나 이것은 일어나지 않을 것입니다. 우리가 다른 대안들에 비해 SCons를 선택한 이유는 다음과 같습니다.

  • Godot can be compiled for a dozen different platforms. All PC platforms, all mobile platforms, many consoles, and many web-based platforms (such as HTML5 and Chrome PNACL).
    Godot은 12 개의 다른 플랫폼 용으로 컴파일 할 수 있습니다. 모든 PC 플랫폼, 모든 모바일 플랫폼, 많은 콘솔 및 많은 웹 기반 플랫폼 (예 : HTML5 및 Chrome PNACL)
  • Developers often need to compile for several of the platforms at the same time, or even different targets of the same platform. They can’t afford reconfiguring and rebuilding the project each time. SCons can do this with no sweat, without breaking the builds.
    개발자는 동시에 여러 플랫폼을 컴파일하거나 동일한 플랫폼의 여러 대상을 컴파일해야하는 경우가 있습니다. 그들은 매번 프로젝트를 재구성하고 재구성 할 여력이 없습니다. SCons는 빌드를 깨지 않고 땀을 흘리지 않고이 작업을 수행 할 수 있습니다.
  • SCons will never break a build no matter how many changes, configurations, additions, removals etc. You have more chances to die struck by lightning than needing to clean and rebuild in SCons.
    SCons는 얼마나 많은 변경, 구성, 추가, 제거 등이 있더라도 빌드를 손상시키지 않습니다. SCons에서 청소하고 다시 빌드해야하는 것보다 번개가 치는 더 많은 기회가 있습니다.
  • Godot build process is not simple. Several files are generated by code (binders), others are parsed (shaders), and others need to offer customization (plugins). This requires complex logic which is easier to write in an actual programming language (like Python) rather than using a mostly macro-based language only meant for building.
    Godot 빌드 프로세스는 간단하지 않습니다. 여러 파일이 코드 (바인더)에 의해 생성되고, 다른 파일은 구문 분석 (셰이더)되고 다른 파일은 사용자 정의 (플러그인)를 제공해야합니다. 이를 위해서는 빌딩용으로만 사용되는 매크로 기반 언어를 사용하는 대신 실제 프로그래밍 언어 (Python과 같은)로 작성하는 것이 더 쉬운 복잡한 논리가 필요합니다.
  • Godot build process makes heavy use of cross compiling tools. Each platform has a specific detection process, and all these must be handled as specific cases with special code written for each.
    Godot 빌드 프로세스는 크로스 컴파일 도구를 많이 사용합니다. 각 플랫폼에는 특정 탐지 프로세스가 있으며 이러한 모든 것은 특정 코드로 작성된 특정 사례로 처리되어야합니다.

So, please try to keep an open mind and get at least a little familiar with it if you are planning to build Godot yourself.
그래서, 너 자신을 Godot을 만들 계획이라면 열린 마음을 유지하고 적어도 조금 익숙해 지도록 노력하십시오.

Setup

Please refer to the documentation for Compiling for Android, Compiling for iOS, Compiling for macOS, Compiling for Universal Windows Platform, Compiling for the Web, Compiling for Windows and Compiling for X11 (Linux, *BSD).
Android 용 컴파일, iOS 용 컴파일, macOS 용 컴파일, Universal Windows 플랫폼 용 컴파일, 웹용 컴파일, Windows 용 컴파일 및 X11 용 컴파일 (Linux, *BSD)에 대한 설명서를 참조하십시오.

Note that for Windows/Visual Studio, you need to use x86_x64 Cross Tools Command Prompt for VS 2017 or similar, depending on your install, instead of the standard Windows command prompt to enter the commands below.
Windows/Visual Studio의 경우 아래 명령을 입력하는 표준 Windows 명령 프롬프트 대신 설치에 따라 VS 2017 용 x86_x64 교차 도구 명령 프롬프트를 사용해야합니다.

Platform selection

Godot’s build system will begin by detecting the platforms it can build for. If not detected, the platform will simply not appear on the list of available platforms. The build requirements for each platform are described in the rest of this tutorial section.
Godot의 빌드 시스템은 빌드 할 수있는 플랫폼을 감지함으로써 시작됩니다. 감지되지 않으면 플랫폼이 사용 가능한 플랫폼 목록에 표시되지 않습니다. 각 플랫폼의 빌드 요구 사항은이 자습서 섹션의 나머지 부분에서 설명합니다.

SCons is invoked by just calling scons.
SCons는 단지 scons를 호출하여 호출됩니다.

However, this will do nothing except list the available platforms, for example:
그러나 이렇게하면 사용 가능한 플랫폼을 나열하는 것 외에는 아무 것도 할 수 없습니다. 예를 들면 다음과 같습니다.

user@host:~/godot$ scons
scons: Reading SConscript files ...
No valid target platform selected.
The following were detected:
    android
    server
    javascript
    windows
    x11

Please run scons again with argument: platform=<string>
scons: done reading SConscript files.
scons: Building targets ...
scons: `.' is up to date.
scons: done building targets.

To build for a platform (for example, x11), run with the platform= (or just p= to make it short) argument:
플랫폼 (예: x11)을 빌드하려면 platform= (또는 단지 p= 짧게 만듭니다) 인수로 실행하십시오.

user@host:~/godot$ scons platform=x11

This will start the build process, which will take a while. If you want scons to build faster, use the -j <cores> parameter to specify how many cores will be used for the build. Or just leave it using one core, so you can use your computer for something else :)
이렇게하면 빌드 프로세스가 시작되고 시간이 걸릴 것입니다. scons를보다 빠르게 빌드하려면 -j <core> 매개 변수를 사용하여 빌드에 사용될 코어 수를 지정하십시오. 또는 하나의 코어 만 사용하여 컴퓨터를 사용할 수 있습니다. :)

Example for using 4 cores:
4 코어 사용 예:

user@host:~/godot$ scons platform=x11 -j 4

Note that there are currently issues with parallel builds for at least some users, so if you are running into errors, try building without the -j parameter.
현재 일부 사용자의 경우 병렬 빌드에 문제가 있으므로 오류가 발생하는 경우 -j 매개 변수없이 빌드 해보십시오.

Resulting binary

The resulting binaries will be placed in the bin/ subdirectory, generally with this naming convention:
생성된 바이너리는 일반적으로 다음과 같은 명명 규칙을 사용하여 bin/ 하위 디렉토리에 배치됩니다.

godot.<platform>.[opt].[tools/debug].<architecture>[extension]

For the previous build attempt the result would look like this:
이전 빌드 시도의 결과는 다음과 같습니다.

user@host:~/godot$ ls bin
bin/godot.x11.tools.64

This means that the binary is for X11, is not optimized, has tools (the whole editor) compiled in, and is meant for 64 bits.
이것은 바이너리가 X11용이고 최적화되지 않았으며 도구 (전체 편집기)가 컴파일되어 있고 64 비트 용인 것을 의미합니다.

A Windows binary with the same configuration will look like this.
동일한 구성을 가진 Windows 바이너리는 다음과 같습니다.

C:\GODOT> DIR BIN/
godot.windows.tools.64.exe

Just copy that binary to wherever you like, as it contains the project manager, editor and all means to execute the game. However, it lacks the data to export it to the different platforms. For that the export templates are needed (which can be either downloaded from godotengine.org, or you can build them yourself).
이 바이너리는 프로젝트 관리자, 편집자 및 게임을 실행하기위한 모든 수단을 포함하고 있기 때문에 원하는 곳에 복사하십시오. 그러나 다른 플랫폼으로 내보내는 데 필요한 데이터가 부족합니다. 이를 위해 내보내기 템플릿이 필요합니다 (godotengine.org에서 다운로드하거나 직접 만들 수 있습니다).

Aside from that, there are a few standard options that can be set in all build targets, and which will be explained below.
그 외에도 모든 빌드 대상에서 설정할 수있는 몇 가지 표준 옵션이 있으며 아래에서 설명합니다.

Tools

Tools are enabled by default in all PC targets (Linux, Windows, macOS), disabled for everything else. Disabling tools produces a binary that can run projects but that does not include the editor or the project manager.
도구는 모든 PC 대상 (Linux, Windows, macOS)에서 기본적으로 사용하도록 설정되고 다른 모든 항목에서는 사용하지 않도록 설정됩니다. 비활성화 도구는 프로젝트를 실행할 수 있지만 편집기나 프로젝트 관리자는 포함하지 않는 바이너리를 생성합니다.

scons platform=<platform> tools=yes/no

Target

Target controls optimization and debug flags. Each mode means:
타겟은 최적화 및 디버그 플래그를 제어합니다. 각 모드의 의미는 다음과 같습니다.

  • debug: Build with C++ debugging symbols, runtime checks (performs checks and reports error) and none to little optimization.
    C++ 디버깅 기호, 런타임 검사 (검사 및보고 오류 수행) 및 조금씩 최적화.
  • release_debug: Build without C++ debugging symbols and optimization, but keep the runtime checks (performs checks and reports errors). Official binaries use this configuration.
    C++ 디버깅 기호 및 최적화없이 빌드하고 런타임 검사를 유지합니다 (검사 및보고 오류 수행). 공식 바이너리는이 구성을 사용합니다.
  • release: Build without symbols, with optimization and with little to no runtime checks. This target can’t be used together with tools=yes, as the tools require some debug functionality and run-time checks to run.
    심볼없는 빌드, 최적화 및 런타임 체크가 거의 또는 전혀 없음. 이 도구는 도구가 실행되기 위해 디버그 기능과 런타임 검사가 필요하기 때문에 tools=yes와 함께 사용할 수 없습니다
scons platform=<platform> target=debug/release_debug/release

This flag appends the “.debug” suffix (for debug), or “.tools” (for debug with tools enabled). When optimization is enabled (release) it appends the “.opt” suffix.
이 플래그는 디버그용 ".debug"접미어 또는 도구가 활성화된 디버그용 ".tools"를 추가합니다. 최적화가 활성화 (릴리즈)되면 ".opt"접미사가 추가됩니다.

Bits

Bits is meant to control the CPU or OS version intended to run the binaries. It is focused mostly on desktop platforms and ignored everywhere else.
비트는 바이너리를 실행하기위한 CPU 또는 OS 버전을 제어하기위한 것입니다. 주로 데스크톱 플랫폼에 중점을두고 어디에서나 무시됩니다.

  • 32: Build binaries for 32 bits platform.
    32 비트 플랫폼 용 바이너리 빌드.
  • 64: Build binaries for 64 bits platform.
    64 비트 플랫폼 용 바이너리 빌드.
  • default: Build whatever the build system feels is best. On Linux this depends on the host platform (if not cross compiling), on Mac it defaults to 64 bits and on Windows it defaults to 32 bits.
    빌드 시스템이 가장 좋다고 생각하는 것을 빌드하십시오. 리눅스에서 이것은 호스트 플랫폼에 의존하며 (크로스 컴파일하지 않는 경우), Mac에서는 기본적으로 64 비트로, Windows에서는 기본적으로 32 비트로 설정됩니다.
scons platform=<platform> bits=default/32/64

This flag appends “.32” or “.64” suffixes to resulting binaries when relevant.
이 플래그는 관련성이있는 결과 바이너리에 ".32"또는 ".64"접미사를 추가합니다.

Other build options

There are several other build options that you can use to configure the way Godot should be built (compiler, debug options, etc.) as well as the features to include/disable.
Godot을 빌드하는 방법 (컴파일러, 디버그 옵션 등)은 물론 include/disable 할 기능을 구성하는데 사용할 수있는 몇 가지 다른 빌드 옵션이 있습니다.

Check the output of scons --help for details about each option for the version you are willing to compile.
컴파일하려는 버전의 각 옵션에 대한 자세한 내용은 scons --help의 출력을 확인하십시오.

Export templates

Official export templates are downloaded from the Godot Engine site: godotengine.org. However, you might want to build them yourself (in case you want newer ones, you are using custom modules, or simply don’t trust your own shadow).
공식 내보내기 템플릿은 Godot Engine 사이트 (godotengine.org)에서 다운로드 할 수 있습니다. 그러나, 직접 빌드하고 싶을 수도 있습니다 (최신 모듈을 원하거나 사용자 정의 모듈을 사용하거나 자신의 그림자를 신뢰하지 않는 경우).

If you download the official export templates package and unzip it, you will notice that most are just optimized binaries or packages for each platform:
공식 내보내기 템플릿 패키지를 다운로드하고 압축을 풀면 대부분이 각 플랫폼에 최적화 된 바이너리 또는 패키지라는 것을 알게 될 것입니다.

android_debug.apk
android_release.apk
javascript_debug.zip
javascript_release.zip
linux_server_32
linux_server_64
linux_x11_32_debug
linux_x11_32_release
linux_x11_64_debug
linux_x11_64_release
osx.zip
version.txt
windows_32_debug.exe
windows_32_release.exe
windows_64_debug.exe
windows_64_release.exe

To create those yourself, just follow the instructions detailed for each platform in this same tutorial section. Each platform explains how to create its own template.
직접 작성하려면이 자습서 섹션의 각 플랫폼에 대한 자세한 지침을 따르십시오. 각 플랫폼은 자체 템플릿을 만드는 방법을 설명합니다.

If you are developing for multiple platforms, macOS is definitely the most convenient host platform for cross compilation, since you can cross-compile for almost every target (except for UWP). Linux and Windows come in second place, but Linux has the advantage of being the easier platform to set this up.
다중 플랫폼 용으로 개발할 경우 MacOS는 거의 모든 대상 (UWP 제외)에 대해 크로스 컴파일 할 수 있기 때문에 크로스 컴파일을위한 가장 편리한 호스트 플랫폼입니다. 리눅스와 윈도우가 2위를 차지했지만 리눅스는 이것을 설정하기위한 보다 쉬운 플랫폼이라는 장점이있다.

반응형

'game > godot' 카테고리의 다른 글

Godot - Compiling  (0) 2018.12.12
Godot - Getting the source  (0) 2018.12.12
Godot - Compiling for Windows  (0) 2018.12.10
Godot - Compiling for X11 (Linux, *BSD)  (0) 2018.12.08
Godot - Compiling for macOS  (0) 2018.12.07