cmake 将源文件生成动态库和静态库

CMakeLists.txt

cmake_minimum_required(VERSION 3.20)
project(tttt)

set(CMAKE_CXX_STANDARD 17)

# 将C/Cpp源文件生成动态库和静态库
add_library(hello_shared SHARED hello.cpp hello.h)
add_library(hello_static STATIC hello.cpp hello.h)



add_executable(tttt main.cpp hello.cpp hello.h)
posted @ 2021-09-05 21:33  道友请留步W  阅读(141)  评论(0编辑  收藏  举报