欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  移动技术

Android集成OGRE编译脚本

程序员文章站 2024-01-25 08:58:52
Android集成OGRE编译脚本测试的目录结构├── AUTHORS├── BuildingOgre.md├── CMake├── CMakeLists.txt├── CTestConfig.cmake├── Components├── Docs├── ISSUE_TEMPLATE.md├── Jenkinsfile├── LICENSE├── OgreMain├── Other├── PlugIns├── README.md├── RenderSystems├── SD...

Android集成OGRE编译脚本

测试的目录结构

├── AUTHORS
├── BuildingOgre.md
├── CMake
├── CMakeLists.txt
├── CTestConfig.cmake
├── Components
├── Docs
├── ISSUE_TEMPLATE.md
├── Jenkinsfile
├── LICENSE
├── OgreMain
├── Other
├── PlugIns
├── README.md
├── RenderSystems
├── SDK
├── Samples
├── Tests
├── Tools
├── test
│   ├── Android.mk
│   ├── Application.mk
│   ├── build_arm64
|   ├── jni
│   │   ├── Android.mk
│   │   └── Application.mk
├── appveyor.yml
├── build_android
├── build_android_arm64
├── ci-build.cmake
├── ogredeps_android
│   ├── include
│   └── lib
├── ogredeps_android_arm64
│   ├── include
│   └── lib
├── ogredeps_ios
│   ├── include
│   └── lib

Application.mk

# 32位 armeabi-v7a  64位 arm64-v8a
APP_ABI := armeabi-v7a
APP_PLATFORM := android-19
APP_STL := c++_static
APP_CPPFLAGS := -std=c++11
APP_OPTIM := debug

Android.mk

LOCAL_PATH := $(call my-dir)

        # 此处为OGRE库目录
        OGRE_SRC_DIR :=$(LOCAL_PATH)/../../..

        # 根据 APP_ABI 选择对应的LIB和DEP
        OGRE_LIB_DIR :=$(LOCAL_PATH)/../../../build_android_arm64/lib
        OGRE_DEP_DIR :=$(OGRE_SRC_DIR)/ogredeps_android_arm64

        TEST_SRC_DIR :=$(OGRE_SRC_DIR)/TestOgre

        $(warning  "----------------------------")
        $(warning  "OGRE_SRC_DIR=$(OGRE_SRC_DIR)")
        $(warning  "OGRE_LIB_DIR=$(OGRE_LIB_DIR)")
        $(warning  "OGRE_DEP_DIR=$(OGRE_DEP_DIR)")
        $(warning  "LOCAL_PATH=$(LOCAL_PATH)")
        $(warning  "TEST_SRC_DIR=$(TEST_SRC_DIR)")
        $(warning  "----------------------------")

        include $(CLEAR_VARS)
        LOCAL_MODULE:= libzzip
        LOCAL_SRC_FILES:= $(OGRE_DEP_DIR)/lib/libzzip.a
        $(warning  "libzzip=$(LOCAL_SRC_FILES)")
        $(warning  "----------------------------")
        LOCAL_EXPORT_C_INCLUDES := $(OGRE_DEP_DIR)/include/zzip
        include $(PREBUILT_STATIC_LIBRARY)

        include $(CLEAR_VARS)
        LOCAL_MODULE:= libPlugin_ParticleFXStatic
        LOCAL_SRC_FILES:= $(OGRE_LIB_DIR)/libPlugin_ParticleFXStatic.a
        LOCAL_EXPORT_C_INCLUDES := $(OGRE_SRC_DIR)/Plugins/ParticleFX/include
        include $(PREBUILT_STATIC_LIBRARY)

        include $(CLEAR_VARS)
        LOCAL_MODULE:= libPlugin_OctreeSceneManagerStatic
        LOCAL_SRC_FILES:= $(OGRE_LIB_DIR)/libPlugin_OctreeSceneManagerStatic.a
        LOCAL_EXPORT_C_INCLUDES := $(OGRE_SRC_DIR)/Plugins/OctreeSceneManager/include
        include $(PREBUILT_STATIC_LIBRARY)


        include $(CLEAR_VARS)
        LOCAL_MODULE:= libCodec_STBIStatic
        LOCAL_SRC_FILES:= $(OGRE_LIB_DIR)/libCodec_STBIStatic.a
        LOCAL_EXPORT_C_INCLUDES := $(OGRE_SRC_DIR)/Plugins/STBICodec/include
        include $(PREBUILT_STATIC_LIBRARY)

        include $(CLEAR_VARS)
        LOCAL_MODULE:= libOgreRTShaderSystemStatic
        LOCAL_SRC_FILES:= $(OGRE_LIB_DIR)/libOgreRTShaderSystemStatic.a
        LOCAL_EXPORT_C_INCLUDES := $(OGRE_SRC_DIR)/Components/RTShaderSystem/include
        include $(PREBUILT_STATIC_LIBRARY)

        include $(CLEAR_VARS)
        LOCAL_MODULE:= libOgreBitesStatic
        LOCAL_SRC_FILES:= $(OGRE_LIB_DIR)/libOgreBitesStatic.a
        LOCAL_EXPORT_C_INCLUDES := $(OGRE_SRC_DIR)/Components/Bites/include \
            $(OGRE_SRC_DIR)/RenderSystems/GLES2/include
        include $(PREBUILT_STATIC_LIBRARY)

        include $(CLEAR_VARS)
        LOCAL_MODULE:= libRenderSystem_GLES2Static
        LOCAL_SRC_FILES:= $(OGRE_LIB_DIR)/libRenderSystem_GLES2Static.a
        LOCAL_EXPORT_C_INCLUDES := $(OGRE_SRC_DIR)/RenderSystems/GLES2/include
        include $(PREBUILT_STATIC_LIBRARY)

        include $(CLEAR_VARS)
        LOCAL_MODULE:= libOgreGLSupportStatic
        LOCAL_SRC_FILES:= $(OGRE_LIB_DIR)/libOgreGLSupportStatic.a
        LOCAL_EXPORT_C_INCLUDES := $(OGRE_SRC_DIR)/RenderSystems/GLES2/include/EGL \
            $(OGRE_SRC_DIR)/RenderSystems/GLSupport/include/EGL \
            $(OGRE_SRC_DIR)/RenderSystems/GLSupport/include
        include $(PREBUILT_STATIC_LIBRARY)

        include $(CLEAR_VARS)
        LOCAL_MODULE:= libOgreMainStatic
        LOCAL_SRC_FILES:= $(OGRE_LIB_DIR)/libOgreMainStatic.a
        LOCAL_EXPORT_C_INCLUDES := $(OGRE_SRC_DIR)/OgreMain/include \
            $(OGRE_SRC_DIR)/OgreMain/src \
            $(OGRE_SRC_DIR)/OgreMain/Threading/include
        include $(PREBUILT_STATIC_LIBRARY)


        include $(CLEAR_VARS)
                LOCAL_MODULE    := libTestOgre

        LOCAL_LDLIBS    := -landroid -lc -lm -ldl -llog -lEGL -lGLESv2 -lz -ljnigraphics

        LOCAL_LDLIBS    += -L$(OGRE_LIB_DIR) -L$(OGRE_DEP_DIR)/lib

        LOCAL_LDLIBS    += -lRenderSystem_GLES2Static -lOgreGLSupportStatic -lPlugin_OctreeSceneManagerStatic -lOgreBitesStatic -lOgreRTShaderSystemStatic -lOgreOverlayStatic -lOgreMainStatic -lPlugin_ParticleFXStatic -lCodec_STBIStatic
        LOCAL_LDLIBS    += -lzzip -lfreetype
        LOCAL_LDLIBS    += $(OGRE_LIB_DIR)/libcpufeatures.a

        LOCAL_CFLAGS := -I$(TEST_SRC_DIR)/include \
    	    -I$(TEST_SRC_DIR)/src \
            -I$(OGRE_LIB_DIR)/../include \
            -I$(OGRE_SRC_DIR)/OgreMain/include/Threading/include \
            -I$(OGRE_SRC_DIR)/Components/Overlay/include \
            -I$(OGRE_SRC_DIR)/RenderSystems/GLES2/include \
            -I$(OGRE_SRC_DIR)/RenderSystems/GLES2/src/GLSLES/include \
            -I$(OGRE_SRC_DIR)/RenderSystems/GLES2/include/EGL \
            -I$(OGRE_SRC_DIR)/RenderSystems/GLSupport/include/EGL \
            -I$(OGRE_SRC_DIR)/RenderSystems/GLSupport/include/GLSL \
            -I$(OGRE_SRC_DIR)/RenderSystems/GLSupport/include \
            -I$(OGRE_SRC_DIR)/OgreMain/src \
            -I$(OGRE_SRC_DIR)/Plugins/OctreeSceneManager/include \
            -I$(OGRE_SRC_DIR)/Components/RTShaderSystem/include \
            -I$(OGRE_SRC_DIR)/Components/Bites/include \
            -I$(OGRE_SRC_DIR)/Plugins/OctreeSceneManager/include \
            -I$(OGRE_DEP_DIR)/include/zzip

        LOCAL_CFLAGS += -fexceptions -frtti -x c++ -D___ANDROID___ -DANDROID -DZZIP_OMIT_CONFIG_H -DINCLUDE_RTSHADER_SYSTEM=1
        LOCAL_CFLAGS += -g

        LOCAL_STATIC_LIBRARIES := libCodec_STBIStatic \
            libPlugin_ParticleFXStatic \
            libPlugin_OctreeSceneManagerStatic \
            libOgreBitesStatic \
            libRenderSystem_GLES2Static \
            libOgreGLSupportStatic \
            libOgreMainStatic \
            libOgreRTShaderSystemStatic

    	LOCAL_SRC_FILES := $(TEST_SRC_DIR)/src/Jni.cpp \
			$(TEST_SRC_DIR)/src/TestSceneManager.cpp


include $(BUILD_SHARED_LIBRARY)

本文地址:https://blog.csdn.net/miyu1994/article/details/107152308