정적 연결을 사용하면 libswappy.so 공유 라이브러리를 번들로 묶을 필요가 없기 때문에 코드 공간이 훨씬 더 줄어듭니다.
CMake 사용(정적 라이브러리만 해당)
CMake를 사용하는 경우 CMake 구성 예를 보려면 다운로드한 라이브러리의 gamesdk/samples/bouncyball/app/CMakeLists.txt 파일을 참고합니다. 여기에는 최종 검사를 실행하고, 적절한 컴파일러 포함 경로를 추가하며, 라이브러리를 연결하는 데 사용할 수 있는 타겟을 생성하는 유틸리티 파일인 gamesdk/samples/gamesdk.cmake가 포함되어 있습니다.
이 유틸리티를 사용하려면 다음 단계를 따르세요.
CMakeLists.txt에 이 파일 포함: include("path/to/gamesdk/samples/gamesdk.cmake")
gamesdk가 포함된 폴더를 사용하여 add_gamesdk_target 함수 호출: add_gamesdk_target(PACKAGE_DIR path/to/gamesdk)
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-08-26(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-08-26(UTC)"],[],[],null,["After you've [downloaded the library](/games/sdk/frame-pacing/opengl) onto your\nmachine and have checked it into your source control system, make the following\nchanges to your project's build settings.\n\nStatic library\n\nDo the following steps to link your project to the static library:\n\n1. Add `gamesdk/include` to your compiler include paths.\n2. Include `swappy/swappyGL.h` for integration with OpenGL ES. In most cases, the header file contains all the functions you need to integrate the library into your engine.\n3. Add a path of the following form in your linker library paths:\n\n ```\n gamesdk/libs/architecture_APIapiLevel_NDKndkVersion_stlVersion_Release\n ```\n\n For example: `gamesdk/libs/arm64-v8a_API24_NDK17_cpp_static_Release`\n4. Add `-lswappy_static` to your linker command.\n\nShared library\n\nThe above steps statically link against a version of the Frame Pacing library\ncompiled for the given ABI, API level, NDK and STL combination. If the combination\nis not available for your settings, you can instead link against the shared\nlibrary:\n\n1. Follow steps 1 and 2 from the previous section to update your compiler include paths and use the appropriate header file.\n2. Add a path of the following form in your linker library paths:\n\n ```\n gamesdk/libs/architecture_APIapiLevel_NDKndkVersion_stlVersion_Release/lib/swappy\n ```\n3. Add `-lswappy` to your linker command.\n\nStatic linking will give you a much smaller code footprint as you don't need to\nbundle the `libswappy.so` shared library.\n\nUsing CMake (static library only)\n\nIf you are using CMake, see the `gamesdk/samples/bouncyball/app/CMakeLists.txt`\nfile in the [downloaded library](/games/sdk/frame-pacing/opengl)\nfor an example CMake configuration. It includes a utility file, `gamesdk/samples/gamesdk.cmake`,\nthat performs final checks, adds the proper compiler include paths and\ngenerates a target that you can use to link the library.\n\nTo use this utility, do the following:\n\n1. Include this file in your CMakeLists.txt: `include(\"`\u003cvar translate=\"no\"\u003epath/to/gamesdk\u003c/var\u003e`/samples/gamesdk.cmake\")`\n2. Call the `add_gamesdk_target` function with the folder containing the gamesdk: `add_gamesdk_target(PACKAGE_DIR `\u003cvar translate=\"no\"\u003epath/to/gamesdk\u003c/var\u003e`)`\n3. In your `target_link_libraries` for your native library, add `swappy` as a dependency: `\n target_link_libraries(native-lib swappy ...)\n `\n\n| **Note:** The path to the gamesdk used for `include` and `add_gamesdk_target` can either be absolute (for example, `/home/yourusername/gamesdk` or `C:\\Android\\gamesdk`) or relative to the `CMakeLists.txt` file.\n\nFor advanced usage of CMake, see the [`gamesdk.cmake` source file](https://android.googlesource.com/platform/frameworks/opt/gamesdk/+/refs/heads/master/samples/gamesdk.cmake)."]]