CMakLists.txt文件内容
set(LIB_SRC hello.cpp)
add_library(hello_static STATIC ${LIB_SRC})
set_target_properties(hello_static PROPERTIES OUTPUT_NAME hello)
set_target_properties(hello_static PROPERTIES CLEAN_DIECT_OUTPUT 1)
add_library(hello SHARED ${LIB_SRC})
set_target_properties(hello PROPERTIES OUTPUT_NAME hello)
set_target_properties(hello PROPERTIES CLEAN_DIECT_OUTPUT 1)
报错
CMake Error:
Running
'D:/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe' '-C' 'D:/cmaketest/CMaketest/out/build/x64-debug' '-t' 'recompact'
failed with:
ninja: error: build.ninja:142: multiple rules generate /c/bin/hello.lib [-w dupbuild=err]
貌似set_target_properties命令根本不起作用,只要改成相同的名字就会报错,求拯救一下,已经卡了很久了