cocos2d / cocos2d-x

Cocos2d-x is a suite of open-source, cross-platform, game-development tools utilized by millions of developers across the globe. Its core has evolved to serve as the foundation for Cocos Creator 1.x & 2.x.
https://www.cocos.com/en/cocos2d-x
18.25k stars 7.06k forks source link

MacOS & CMake build error: Objective-C was disabled in PCH file but is currently enabled #20621

Open dmllr opened 3 years ago

dmllr commented 3 years ago

Steps to Reproduce:

  1. Clone the repo, download deps

    git clone https://github.com/cocos2d/cocos2d-x.git
    cd cocos2d-x
    python2 download-deps.py
    git submodule update --init
  2. Generate files

    mkdir build
    cd build
    cmake ..
  3. Build

    make

Error happen when building CCFileUtils-apple.mm

[ 17%] Building CXX object engine/cocos/core/CMakeFiles/cocos2d.dir/platform/apple/CCFileUtils-apple.mm.o
error: Objective-C was disabled in PCH file but is currently enabled
1 error generated.
make[2]: *** [engine/cocos/core/CMakeFiles/cocos2d.dir/platform/apple/CCFileUtils-apple.mm.o] Error 1
make[1]: *** [engine/cocos/core/CMakeFiles/cocos2d.dir/all] Error 2
make: *** [all] Error 2