CMake error at CMakeLists.txt:30 (project): No CMAKE_C_COMPILER could be found

后端 未结 19 2443
抹茶落季
抹茶落季 2020-11-22 12:57

I\'m trying make a Visual Studio solution with CMake to compile the latest version of aseprite and CMake keeps giving me the:

No CMAKE_C_COMPILER could be fo         


        
19条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-22 13:43

    I get exactly the reported error if ccache is enabled, when using CMake's Xcode generator. Disabling ccache fixed the problem for me. Below I present a fix/check that works for MacOS, but should work similarly on other platforms.

    Apparently, it is possible to use CMake's Xcode generator (and others) also in combination with ccache, as is described here. But I never tried it out myself.

    # 1) To check if ccache is enabled:
    echo $CC
    echo $CXX
    # This prints something like the following: 
    #     ccache clang -Qunused-arguments -fcolor-diagnostics. 
    # CC or CXX are typically set in the `.bashrc` or `.zshrc` file.
    
    # 2) To disable ccache, use the following:
    CC=clang
    CXX=clang++
    
    # 3) Then regenerate the cmake project
    cmake -G Xcode 
    

提交回复
热议问题