我使用CMake 2.8.12.2
构建我的项目(在Mac中),其中包含以下两个模块:
project
|
|____ module_a
|
|____ module_b
当module_a
和module_b
构建为STATIC
个库时,cmake
project
时没有警告。但如果我将模块更改为SHARED
库,我会遇到警告:
Variable CMAKE_SHARED_LIBRARY_C_FLAGS has been modified. CMake will ignore
the POSITION_INDEPENDENT_CODE target property for shared libraries and will
use the CMAKE_SHARED_LIBRARY_C_FLAGS variable instead. This may cause
errors if the original content of CMAKE_SHARED_LIBRARY_C_FLAGS was removed.
Policy CMP0018 is not set: Ignore CMAKE_SHARED_LIBRARY_<Lang>_FLAGS
variable. Run "cmake --help-policy CMP0018" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
这对我来说毫无意义,因为我从未处理过CMAKE_SHARED_LIBRARY_C_FLAGS
。
如何修复此警告?我不想忽略它。