CMake cross-compiling: C flags from toolchain file ignored

前端 未结 2 1725
情书的邮戳
情书的邮戳 2020-11-28 10:56

I use cmake for cross compiling. In my toolchain file there is a line

SET(CMAKE_C_FLAGS \"-std=gnu99\")

This variable is not set in CMakeLi

2条回答
  •  时光取名叫无心
    2020-11-28 11:03

    I've found a temporary solution by replacing the line

    SET(CMAKE_C_FLAGS "-std=gnu99")
    

    by

    SET(CMAKE_C_FLAGS "-std=gnu99" CACHE STRING "" FORCE)
    

提交回复
热议问题