cmake_minimum_required(VERSION 3.22.1) project("sample") if(CMAKE_SYSTEM_NAME STREQUAL "Android") message(STATUS "Building for Android") add_library(sample SHARED app/src/main/cpp/main.cpp app/src/main/cpp/AndroidOut.cpp ) find_package(game-activity REQUIRED CONFIG) set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u Java_com_google_androidgamesdk_GameActivity_initializeNativeCode") target_link_libraries(sample game-activity::game-activity_static android log) endif() if(CMAKE_SYSTEM_NAME STREQUAL "Windows" OR WIN32) message(STATUS "Building for Windows") endif()