记录 CMake 相关知识。
Prelude:读文档一定要有耐心!
问题一 CLion: CMakeLists.txt
中 set(CMAKE_CXX_FLAGS -Wall)
不起作用
Solution: 改用 target_compile_options(main PUBLIC -Wall)
Reference:
target_compile_options
GCC: Options to Request or Suppress Warnings
What is the modern method for setting general compile flags in CMake?