BUILD.gn
libs = [
"pthread_static.lib",
]
deps = [
":pthread_static",
]
这lips和deps里的pthread_static有什么区别?换做cmake的话该怎么写?
BUILD.gn
libs = [
"pthread_static.lib",
]
deps = [
":pthread_static",
]
这lips和deps里的pthread_static有什么区别?换做cmake的话该怎么写?
gn中的libs和deps主要有以下几点区别:
add_executable(myapp main.cpp)
target_link_libraries(myapp pthread_static)
这里将pthread_static作为一个静态库目标,然后在myapp可执行文件中通过target_link_libraries来链接该静态库。
总结一下,gn中的libs直接指定链接库,deps指定依赖的其他目标。两者在生成目标时的作用是不同的。