[null,null,["最后更新时间 (UTC):2025-08-26。"],[],[],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)."]]