정적 연결을 사용하면 libtuningfork.so 공유 라이브러리를 번들로 묶을 필요가 없기 때문에 코드 공간이 훨씬 더 줄어듭니다.
CMake 사용(정적 라이브러리만 해당)
CMake를 사용하는 경우 CMake 구성 예를 보려면 gamesdk/samples/tuningfork/insightsdemo/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)
[null,null,["최종 업데이트: 2025-08-26(UTC)"],[],[],null,["The following sections describe how to integrate the Tuning Fork library\ninto your toolchain and how to use the functions that the library provides. The\nlibrary is available as a static or shared library in the AGDK Libraries.\n\nAfter you've [downloaded the SDK](/games/sdk#download) to your machine and\nchecked it into your source control system, make the changes listed in the\nfollowing sections to your project's build settings.\n\nBefore you begin\n\nYou should integrate the [Android Frame Pacing library](/games/sdk/frame-pacing)\nbefore integrating the Tuning Fork library. If you do this, the\nTuning Fork library can automatically record frame time; there is no\nneed to explicitly call the tick functions yourself.\n\nSee the following integration guides for more information:\n\n- [Integrate Android Frame Pacing into your OpenGL renderer](/games/sdk/frame-pacing/opengl)\n- [Integrate Android Frame Pacing into your Vulkan renderer](/games/sdk/frame-pacing/vulkan)\n\nStatic library\n\nTo link your project to the static library, do the following:\n\n1. Add `gamesdk/include` to your compiler include paths.\n2. 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 Look in `gamesdk/libs` and pick the one that best suits your toolchain (for\n example, `gamesdk/libs/arm64-v8a_API24_NDK17_cpp_static_Release`).\n3. Add `-ltuningfork_static` to your linker command (and `-lswappy_static` if\n you integrated the Android Frame Pacing library).\n\n4. Add the `INTERNET` permission to your `AndroidManifest.xml` file:\n\n \u003cuses-permission android:name=\"android.permission.INTERNET\" /\u003e\n\nShared library\n\nThe steps in the [static library](#static-library) section statically link\nagainst a version of the Tuning Fork library compiled for the given ABI,\nAPI level, NDK, and STL combination. If the combination is not available for\nyour settings, you can instead link against the shared library:\n\n1. Add `gamesdk/include` to your compiler include paths.\n2. Add a path of the following form in your linker library paths:\n\n ```\n gamesdk/libs/architecture_APIapiLevel_NDKndkVersion_stlVersion_Release/lib/tuningfork\n ```\n3. Add `-ltuningfork` to your linker command (and `-lswappy` if you integrated\n the Android Frame Pacing library).\n\n4. Add the `INTERNET` permission to your `AndroidManifest.xml` file:\n\n \u003cuses-permission android:name=\"android.permission.INTERNET\" /\u003e\n\nStatic linking gives you a much smaller code footprint as you don't need to\nbundle the `libtuningfork.so` shared library.\n\nUsing CMake (static library only)\n\nIf you are using CMake, see the\n`gamesdk/samples/tuningfork/insightsdemo/app/CMakeLists.txt` file for an example\nCMake configuration. It includes a utility file,\n`gamesdk/samples/gamesdk.cmake`, which performs final checks, adds the proper\ncompiler include paths, and generates a target that you can use to link the\nlibrary.\n\nTo use this utility, do the following:\n\n1. Include this file in your `CMakeLists.txt` file: `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\n `\u003cvar translate=\"no\"\u003epath/to/gamesdk\u003c/var\u003e`)`\n3. In your `target_link_libraries` for your native library, add `tuningfork` as a dependency (and `swappy` if you integrated the Android Frame Pacing library): ` target_link_libraries(native-lib swappy tuningfork ...) `\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)."]]