静态库打包发布方法
已经提供了一个动态库(.so)或静态库(.a)给其它业务使用,而发布的这个库额本身又依赖了其它的一些第三方库。但是,我们期望业务对这些依赖库无感知,依赖库的变化和增加对业务的编译无影响。即,需要实现在发布动态库(.so)或静态库(.a)的时候把依赖的第三方静态库链接进来。
针对发布动态库(.so)和静态库(.a)时的打包链接第三方依赖库的方法,
工程目录结构
.
├── include
│ ├── testa.h
│ ├── testb.h
│ └── testc.h
├── main.cpp
├── testa.cpp
├── testb.cpp
└── testc.cpp
// testc.h
#pragma once
void testc();
// testc.cpp
#include "include/testc.h"
#include <stdio.h>
void testc()
{
printf("testc zte_printf_s = %s!\n", "success");
}
// testa.h
#pragma once
void testa();
// testa.cpp
#include "include/testa.h"
#include "include/testc.h"
#include <stdio.h>