어떻게 한 걸음 한 걸음 안드로이드를.mk를 Cmkelist로 변경합니다.txt

3857 단어

선언: 다른 사람의 코드를 연구한 결과 구글이 현재 안드로이드 스튜디오에서 cmkelist를 지원하고 mk 방식을 포기하는 것을 추천하고 있음을 발견했다.비교적 알이 아프지만 학습의 한 방식이기도 하다.Cmakelist 사용 방법


대비하다

  • LOCAL_MODULE,LOCAL_SRC_FILES mk 쓰기, 전체 mk 파일은 두 부분으로 나누는데 주로 쓰기 전 부분을 배우기 위해서이다
  • LOCAL_PATH := $(call my-dir)
    
    include $(CLEAR_VARS)
    
    LOCAL_MODULE    := KRoom
    LOCAL_SRC_FILES := KRoom.cpp \
                       ./manager/JniManager.cpp \
                       ./manager/AVMediaPlayer.cpp \
                       ./manager/AudioManager.cpp \
                       ./manager/VideoManager.cpp \
                       ./opengl/NativeRender.cpp \
                       ./common/Buffer.cpp \
                       ./common/Mutex.cpp \
                       ./common/Frame.cpp \
                       ./common/FrameMap.cpp \
                       ./common/FrameList.cpp \
                       ./common/FrameSub.cpp \
                       ./common/FrameSubMap.cpp \
                       ./common/util.cpp \
                       ./stream/StreamDecoder.cpp \
                       ./stream/StreamPlayer.cpp    \
                       ./vedio/VideoDecoder.cpp   \
                       ./shellmp4/FileControl.cpp   \
                       ./shellmp4/HttpShellInterface.cpp    \
                       ./shellmp4/MakeAACHead.cpp   \
                       ./shellmp4/MP4Control.cpp    \
                       ./shellmp4/MP4Handler.cpp    \
                       ./shellmp4/ShellMain.cpp \
                       ./shellmp4/ShellMp4.cpp  \
                       ./shellmp4/GetData.cpp   \
                       check.c \
                       md5.c
    

    뒷부분
    LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -llog 
    # for native audio
    LOCAL_LDLIBS    += -lOpenSLES
    # for native bitmap
    LOCAL_LDLIBS    += -ljnigraphics
    # for native opengl es v2
    LOCAL_LDLIBS    += -lGLESv2
    # for native opengl es v1
    LOCAL_LDLIBS    += -lGLESv1_CM
    # for native asset manager
    LOCAL_LDLIBS    += -landroid
    LOCAL_CFLAGS += -g
    LOCAL_STATIC_LIBRARIES  := avcodec avutil x264 macdecoder reverb 
    #LOCAL_STATIC_LIBRARIES     := faad2 faac avcodec avutil x264 macdecoder reverb 
    LOCAL_SHARED_LIBRARIES := decoding
    
    LOCAL_C_INCLUDES := \
            $(LOCAL_PATH)/ffmpeg/   \
            $(LOCAL_PATH)/shellmp4/
            
    include $(BUILD_SHARED_LIBRARY)
    

    cmakelist로 변환하기
    add_library( # Sets the name of the library.
                 KRoom
    
                 # Sets the library as a shared library.
                 SHARED
    
                 # Provides a relative path to your source file(s).
                 ./main/cpp/kroom/KRoom.cpp
                 ./main/cpp/kroom/manager/JniManager.cpp
                 ./main/cpp/kroom/manager/AVMediaPlayer.cpp
                 ./main/cpp/kroom/manager/AudioManager.cpp
                 ./main/cpp/kroom/manager/VideoManager.cpp
                 ./main/cpp/kroom/opengl/NativeRender.cpp
                 ./main/cpp/kroom/common/Buffer.cpp
                 ./main/cpp/kroom/common/Mutex.cpp
                 ./main/cpp/kroom/common/Frame.cpp
                 ./main/cpp/kroom/common/FrameMap.cpp
                 ./main/cpp/kroom/common/FrameList.cpp
                 ./main/cpp/kroom/common/FrameSub.cpp
                 ./main/cpp/kroom/common/FrameSubMap.cpp
                 ./main/cpp/kroom/common/util.cpp
                 ./main/cpp/kroom/stream/StreamDecoder.cpp
                 ./main/cpp/kroom/stream/StreamPlayer.cpp
                 ./main/cpp/kroom/vedio/VideoDecoder.cpp
                 ./main/cpp/kroom/shellmp4/FileControl.cpp
                 ./main/cpp/kroom/shellmp4/HttpShellInterface.cpp
                 ./main/cpp/kroom/shellmp4/MakeAACHead.cpp
                 ./main/cpp/kroom/shellmp4/MP4Control.cpp
                 ./main/cpp/kroom/shellmp4/MP4Handler.cpp
                 ./main/cpp/kroom/shellmp4/ShellMain.cpp
                 ./main/cpp/kroom/shellmp4/ShellMp4.cpp
                 ./main/cpp/kroom/shellmp4/GetData.cpp
                 ./main/cpp/kroom/check.c
                 ./main/cpp/kroom/md5.c )
    

    좋은 웹페이지 즐겨찾기