From 8a1c874af064413073505511d2a0e5624ff5732e Mon Sep 17 00:00:00 2001 From: HALX99 Date: Thu, 5 Nov 2020 19:39:02 +0800 Subject: [PATCH 1/9] Create .lgtm.yml --- .lgtm.yml | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 .lgtm.yml diff --git a/.lgtm.yml b/.lgtm.yml new file mode 100644 index 0000000000..5aeb34dcd2 --- /dev/null +++ b/.lgtm.yml @@ -0,0 +1,83 @@ +########################################################################################## +# The engine-x Customize file classifications. # +# Results from files under any classifier will be excluded from LGTM # +# statistics. # +########################################################################################## + +########################################################################################## +# Use the `path_classifiers` block to define changes to the default classification of # +# files. # +########################################################################################## +path_classifiers: + test: + - tests + library: + - external + +######################################################################################### +# Use the `queries` block to change the default display of query results. # +######################################################################################### +queries: + # Start by hiding the results of all queries. + - exclude: "external" + +######################################################################################### +# Define changes to the default code extraction process. # +# Each block configures the extraction of a single language, and modifies actions in a # +# named step. Every named step includes automatic default actions, # +# except for the 'prepare' step. The steps are performed in the following sequence: # +# prepare # +# after_prepare # +# configure (C/C++ only) # +# before_index # +# index # +########################################################################################## + +######################################################################################### +# Environment variables available to the steps: # +######################################################################################### + +# LGTM_SRC +# The root of the source tree. +# LGTM_WORKSPACE +# An existing (initially empty) folder outside the source tree. +# Used for temporary download and setup commands. + +######################################################################################### +# Use the extraction block to define changes to the default code extraction process # +# for one or more languages. The settings for each language are defined in a child # +# block, with one or more steps. # +######################################################################################### + +extraction: + # Define settings for C/C++ analysis + ##################################### + cpp: + # Add an `after-prepare` step if you need to run commands after the prepare step. + # Each command should be listed on a separate line. + # This step is useful for C/C++ analysis where you want to prepare the environment + # for the `configure` step without changing the default behavior for that step. + after_prepare: + - mkdir -p $LGTM_WORKSPACE/latest-gcc-symlinks + - ln -s /usr/bin/g++-6 $LGTM_WORKSPACE/latest-gcc-symlinks/g++ + - ln -s /usr/bin/gcc-6 $LGTM_WORKSPACE/latest-gcc-symlinks/gcc + - export PATH=$LGTM_WORKSPACE/latest-gcc-symlinks:$PATH + - export GNU_MAKE=make + - export GIT=true + - export BUILD_TARGET=linux + - export TRAVIS_OS_NAME=linux + - export TRAVIS_PULL_REQUEST=true + # The `configure` step generates build configuration files which the `index` step + # then uses to build the codebase. + configure: + command: + - cd $LGTM_SRC + - tools/travis-scripts/before-install.sh + # The `index` step builds the code and extracts information during the build + # process. + index: + # Override the autobuild process by specifying a list of custom build commands + # to use instead. + build_command: + - cd $LGTM_SRC + - tools/travis-scripts/run-script.sh From 449d8ce0e2525e810f4d5f5134799bf0343aefbe Mon Sep 17 00:00:00 2001 From: halx99 Date: Thu, 5 Nov 2020 22:24:30 +0800 Subject: [PATCH 2/9] fix #255 [ci build] --- .../renderer/backend/metal/RenderTargetMTL.mm | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/cocos/renderer/backend/metal/RenderTargetMTL.mm b/cocos/renderer/backend/metal/RenderTargetMTL.mm index afdb4e8e9a..64701ed21f 100644 --- a/cocos/renderer/backend/metal/RenderTargetMTL.mm +++ b/cocos/renderer/backend/metal/RenderTargetMTL.mm @@ -96,24 +96,28 @@ void RenderTargetMTL::applyRenderPassAttachments(const RenderPassParams& params, #endif } - auto depthAttachment = getDepthAttachment(); - if(depthAttachment){ - descriptor.depthAttachment.texture = depthAttachment.texture; - descriptor.depthAttachment.level = depthAttachment.level; - // descriptor.depthAttachment.slice = depthAttachment.layer; - descriptor.depthAttachment.loadAction = getLoadAction(params, TargetBufferFlags::DEPTH); - descriptor.depthAttachment.storeAction = getStoreAction(params, TargetBufferFlags::DEPTH); - descriptor.depthAttachment.clearDepth = params.clearDepthValue; + if(bitmask::any(this->_flags, RenderTargetFlag::DEPTH)) { + auto depthAttachment = getDepthAttachment(); + if(depthAttachment){ + descriptor.depthAttachment.texture = depthAttachment.texture; + descriptor.depthAttachment.level = depthAttachment.level; + // descriptor.depthAttachment.slice = depthAttachment.layer; + descriptor.depthAttachment.loadAction = getLoadAction(params, TargetBufferFlags::DEPTH); + descriptor.depthAttachment.storeAction = getStoreAction(params, TargetBufferFlags::DEPTH); + descriptor.depthAttachment.clearDepth = params.clearDepthValue; + } } - auto stencilAttachment = getStencilAttachment(); - if(stencilAttachment) { - descriptor.stencilAttachment.texture = stencilAttachment.texture; - descriptor.stencilAttachment.level = depthAttachment.level; - // descriptor.stencilAttachment.slice = depthAttachment.layer; - descriptor.stencilAttachment.loadAction = getLoadAction(params, TargetBufferFlags::STENCIL); - descriptor.stencilAttachment.storeAction = getStoreAction(params, TargetBufferFlags::STENCIL); - descriptor.stencilAttachment.clearStencil= params.clearStencilValue; + if(bitmask::any(this->_flags, RenderTargetFlag::STENCIL)) { + auto stencilAttachment = getStencilAttachment(); + if(stencilAttachment) { + descriptor.stencilAttachment.texture = stencilAttachment.texture; + descriptor.stencilAttachment.level = stencilAttachment.level; + // descriptor.stencilAttachment.slice = depthAttachment.layer; + descriptor.stencilAttachment.loadAction = getLoadAction(params, TargetBufferFlags::STENCIL); + descriptor.stencilAttachment.storeAction = getStoreAction(params, TargetBufferFlags::STENCIL); + descriptor.stencilAttachment.clearStencil = params.clearStencilValue; + } } #if 0 if (multisampledDepth) { From 8e3520172694d79e9b9f34b85d42ad1252011a74 Mon Sep 17 00:00:00 2001 From: halx99 Date: Thu, 5 Nov 2020 22:51:33 +0800 Subject: [PATCH 3/9] fix #255 [ci build] --- cocos/renderer/backend/metal/RenderTargetMTL.mm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cocos/renderer/backend/metal/RenderTargetMTL.mm b/cocos/renderer/backend/metal/RenderTargetMTL.mm index 64701ed21f..5ec92b8561 100644 --- a/cocos/renderer/backend/metal/RenderTargetMTL.mm +++ b/cocos/renderer/backend/metal/RenderTargetMTL.mm @@ -96,7 +96,7 @@ void RenderTargetMTL::applyRenderPassAttachments(const RenderPassParams& params, #endif } - if(bitmask::any(this->_flags, RenderTargetFlag::DEPTH)) { + if(bitmask::any(this->_flags, RenderTargetFlag::DEPTH_AND_STENCIL)) { auto depthAttachment = getDepthAttachment(); if(depthAttachment){ descriptor.depthAttachment.texture = depthAttachment.texture; @@ -106,9 +106,7 @@ void RenderTargetMTL::applyRenderPassAttachments(const RenderPassParams& params, descriptor.depthAttachment.storeAction = getStoreAction(params, TargetBufferFlags::DEPTH); descriptor.depthAttachment.clearDepth = params.clearDepthValue; } - } - - if(bitmask::any(this->_flags, RenderTargetFlag::STENCIL)) { + auto stencilAttachment = getStencilAttachment(); if(stencilAttachment) { descriptor.stencilAttachment.texture = stencilAttachment.texture; @@ -119,6 +117,7 @@ void RenderTargetMTL::applyRenderPassAttachments(const RenderPassParams& params, descriptor.stencilAttachment.clearStencil = params.clearStencilValue; } } + #if 0 if (multisampledDepth) { // We're rendering into our temporary MSAA texture and doing an automatic resolve. From a2a7166808cac6377ba236519bd6b036b21034e4 Mon Sep 17 00:00:00 2001 From: halx99 Date: Fri, 6 Nov 2020 08:56:25 +0800 Subject: [PATCH 4/9] [Metal] matching depth stencil state --- cocos/renderer/CCRenderer.cpp | 2 -- cocos/renderer/backend/DepthStencilState.cpp | 4 +++ cocos/renderer/backend/DepthStencilState.h | 2 +- .../renderer/backend/metal/CommandBufferMTL.h | 1 + .../backend/metal/CommandBufferMTL.mm | 14 +++++----- .../backend/metal/RenderPipelineMTL.h | 2 +- .../backend/metal/RenderPipelineMTL.mm | 26 +++++-------------- .../renderer/backend/metal/RenderTargetMTL.mm | 13 ++++++---- 8 files changed, 30 insertions(+), 34 deletions(-) diff --git a/cocos/renderer/CCRenderer.cpp b/cocos/renderer/CCRenderer.cpp index 9532a49429..4c1e56526c 100644 --- a/cocos/renderer/CCRenderer.cpp +++ b/cocos/renderer/CCRenderer.cpp @@ -199,7 +199,6 @@ void Renderer::init() auto device = backend::Device::getInstance(); _commandBuffer = device->newCommandBuffer(); // @MTL: the depth stencil flags must same render target and _depthStencilDescriptor - // TODO: can use one? _depthStencilDescriptor.depthStencilFlags = TargetBufferFlags::DEPTH_AND_STENCIL; _defaultRT = device->newDefaultRenderTarget(TargetBufferFlags::COLOR | _depthStencilDescriptor.depthStencilFlags); @@ -352,7 +351,6 @@ void Renderer::visitRenderQueue(RenderQueue& queue) //Process Global-Z > 0 Queue // doVisitRenderQueue(queue.getSubQueue(RenderQueue::QUEUE_GROUP::GLOBALZ_POS)); - } void Renderer::doVisitRenderQueue(const std::vector& renderCommands) diff --git a/cocos/renderer/backend/DepthStencilState.cpp b/cocos/renderer/backend/DepthStencilState.cpp index 7fca913798..c2f3751005 100644 --- a/cocos/renderer/backend/DepthStencilState.cpp +++ b/cocos/renderer/backend/DepthStencilState.cpp @@ -40,6 +40,10 @@ bool StencilDescriptor::operator==(const StencilDescriptor &rhs) const DepthStencilState::~DepthStencilState() {} +bool DepthStencilState::isEnabled() const { + return bitmask::any(_depthStencilInfo.depthStencilFlags, TargetBufferFlags::DEPTH_AND_STENCIL); +} + void DepthStencilState::update(const DepthStencilDescriptor& descriptor) { _depthStencilInfo = descriptor; _isBackFrontStencilEqual = descriptor.backFaceStencil == descriptor.frontFaceStencil; diff --git a/cocos/renderer/backend/DepthStencilState.h b/cocos/renderer/backend/DepthStencilState.h index 69e5410481..26960a84ae 100644 --- a/cocos/renderer/backend/DepthStencilState.h +++ b/cocos/renderer/backend/DepthStencilState.h @@ -74,7 +74,7 @@ class DepthStencilState : public cocos2d::Ref public: virtual void update(const DepthStencilDescriptor& descriptor); const DepthStencilDescriptor& getDepthStencilInfo()const { return _depthStencilInfo; } - bool isEnabled() const { return bitmask::any(_depthStencilInfo.depthStencilFlags, TargetBufferFlags::DEPTH_AND_STENCIL); } + bool isEnabled() const; protected: /** * @param descriptor Specifies depth and stencil descriptor. diff --git a/cocos/renderer/backend/metal/CommandBufferMTL.h b/cocos/renderer/backend/metal/CommandBufferMTL.h index 05a2496c62..c70f60cf82 100644 --- a/cocos/renderer/backend/metal/CommandBufferMTL.h +++ b/cocos/renderer/backend/metal/CommandBufferMTL.h @@ -226,6 +226,7 @@ private: dispatch_semaphore_t _frameBoundarySemaphore; const RenderTarget* _currentRenderTarget = nil; // weak ref RenderPassParams _currentRenderPassParams; + TargetBufferFlags _currentRenderTargetFlags = TargetBufferFlags::NONE; NSAutoreleasePool* _autoReleasePool = nil; std::vector>> _captureCallbacks; diff --git a/cocos/renderer/backend/metal/CommandBufferMTL.mm b/cocos/renderer/backend/metal/CommandBufferMTL.mm index cd91cf4a1f..24bfd7c58b 100644 --- a/cocos/renderer/backend/metal/CommandBufferMTL.mm +++ b/cocos/renderer/backend/metal/CommandBufferMTL.mm @@ -200,15 +200,17 @@ void CommandBufferMTL::beginFrame() id CommandBufferMTL::getRenderCommandEncoder(const RenderTarget* renderTarget, const RenderPassParams& renderPassParams) { - if(_mtlRenderEncoder != nil && _currentRenderPassParams == renderPassParams && _currentRenderTarget == renderTarget) + if(_mtlRenderEncoder != nil && + _currentRenderPassParams == renderPassParams && + _currentRenderTarget == renderTarget && + _currentRenderTargetFlags == renderTarget->getTargetFlags()) { return _mtlRenderEncoder; } - else - { - _currentRenderTarget = renderTarget; - _currentRenderPassParams = renderPassParams; - } + + _currentRenderTarget = renderTarget; + _currentRenderPassParams = renderPassParams; + _currentRenderTargetFlags = renderTarget->getTargetFlags(); if(_mtlRenderEncoder != nil) { diff --git a/cocos/renderer/backend/metal/RenderPipelineMTL.h b/cocos/renderer/backend/metal/RenderPipelineMTL.h index 5d8124a578..1af026fa5d 100644 --- a/cocos/renderer/backend/metal/RenderPipelineMTL.h +++ b/cocos/renderer/backend/metal/RenderPipelineMTL.h @@ -62,7 +62,7 @@ private: void setBlendState(MTLRenderPipelineColorAttachmentDescriptor*, const BlendDescriptor&); void setShaderModules(const PipelineDescriptor&); void setBlendStateAndFormat(const BlendDescriptor&); - void getAttachmentFormat(const RenderTarget* renderTarget, PixelFormat colorAttachmentsFormat[MAX_COLOR_ATTCHMENT], PixelFormat&, PixelFormat&); + void chooseAttachmentFormat(const RenderTarget* renderTarget, PixelFormat colorAttachmentsFormat[MAX_COLOR_ATTCHMENT], PixelFormat&, PixelFormat&); id _mtlRenderPipelineState = nil; id _mtlDevice = nil; diff --git a/cocos/renderer/backend/metal/RenderPipelineMTL.mm b/cocos/renderer/backend/metal/RenderPipelineMTL.mm index 6599f25887..2a0bf3dfe1 100644 --- a/cocos/renderer/backend/metal/RenderPipelineMTL.mm +++ b/cocos/renderer/backend/metal/RenderPipelineMTL.mm @@ -183,7 +183,7 @@ void RenderPipelineMTL::update(const RenderTarget* renderTarget, const PipelineD memset(&hashMe, 0, sizeof(hashMe)); const auto& blendDescriptor = pipelineDescirptor.blendDescriptor; - getAttachmentFormat(renderTarget, _colorAttachmentsFormat, _depthAttachmentFormat, _stencilAttachmentFormat); + chooseAttachmentFormat(renderTarget, _colorAttachmentsFormat, _depthAttachmentFormat, _stencilAttachmentFormat); auto program = static_cast(pipelineDescirptor.programState->getProgram()); hashMe.vertexShaderHash = program->getVertexShader()->getHashValue(); hashMe.fragmentShaderHash = program->getFragmentShader()->getHashValue(); @@ -292,33 +292,21 @@ void RenderPipelineMTL::setShaderModules(const PipelineDescriptor& descriptor) _mtlRenderPipelineDescriptor.fragmentFunction = fragShaderModule->getMTLFunction(); } -void RenderPipelineMTL::getAttachmentFormat(const RenderTarget* renderTarget, +void RenderPipelineMTL::chooseAttachmentFormat(const RenderTarget* renderTarget, PixelFormat colorAttachmentsFormat[MAX_COLOR_ATTCHMENT], PixelFormat& depthFormat, PixelFormat& stencilFormat) { + // Sets color attachment format auto rtMTL = static_cast(renderTarget); auto rtflags = rtMTL->getTargetFlags(); for(auto i = 0; i < MAX_COLOR_ATTCHMENT; ++i) { - if (bitmask::any(rtflags, getMRTColorFlag(i))) - { - colorAttachmentsFormat[i] = rtMTL->getColorAttachmentPixelFormat(i); - } - else - { - colorAttachmentsFormat[i] = PixelFormat::NONE; - } + colorAttachmentsFormat[i] = bitmask::any(rtflags, getMRTColorFlag(i)) ? rtMTL->getColorAttachmentPixelFormat(i) : PixelFormat::NONE; } - if (bitmask::any(rtflags, RenderTargetFlag::DEPTH_AND_STENCIL)) - { - depthFormat = rtMTL->getDepthAttachmentPixelFormat(); - stencilFormat =rtMTL->getStencilAttachmentPixelFormat(); - } - else - { - depthFormat = stencilFormat = PixelFormat::NONE; - } + // Sets depth and stencil attachment format, match RenderTargetMTL::applyRenderPassAttachments + depthFormat = bitmask::any(rtflags, RenderTargetFlag::DEPTH) ? rtMTL->getDepthAttachmentPixelFormat() : PixelFormat::NONE; + stencilFormat = bitmask::any(rtflags, RenderTargetFlag::STENCIL) ? rtMTL->getStencilAttachmentPixelFormat() : PixelFormat::NONE; } void RenderPipelineMTL::setBlendStateAndFormat(const BlendDescriptor& blendDescriptor) diff --git a/cocos/renderer/backend/metal/RenderTargetMTL.mm b/cocos/renderer/backend/metal/RenderTargetMTL.mm index 5ec92b8561..b72c6d4268 100644 --- a/cocos/renderer/backend/metal/RenderTargetMTL.mm +++ b/cocos/renderer/backend/metal/RenderTargetMTL.mm @@ -96,7 +96,8 @@ void RenderTargetMTL::applyRenderPassAttachments(const RenderPassParams& params, #endif } - if(bitmask::any(this->_flags, RenderTargetFlag::DEPTH_AND_STENCIL)) { + // Sets descriptor depth and stencil params, should match RenderTargetMTL::chooseAttachmentFormat + if(bitmask::any(this->_flags, RenderTargetFlag::DEPTH)) { auto depthAttachment = getDepthAttachment(); if(depthAttachment){ descriptor.depthAttachment.texture = depthAttachment.texture; @@ -106,7 +107,9 @@ void RenderTargetMTL::applyRenderPassAttachments(const RenderPassParams& params, descriptor.depthAttachment.storeAction = getStoreAction(params, TargetBufferFlags::DEPTH); descriptor.depthAttachment.clearDepth = params.clearDepthValue; } - + } + + if(bitmask::any(this->_flags, RenderTargetFlag::STENCIL)) { auto stencilAttachment = getStencilAttachment(); if(stencilAttachment) { descriptor.stencilAttachment.texture = stencilAttachment.texture; @@ -117,7 +120,7 @@ void RenderTargetMTL::applyRenderPassAttachments(const RenderPassParams& params, descriptor.stencilAttachment.clearStencil = params.clearStencilValue; } } - + #if 0 if (multisampledDepth) { // We're rendering into our temporary MSAA texture and doing an automatic resolve. @@ -174,7 +177,7 @@ PixelFormat RenderTargetMTL::getColorAttachmentPixelFormat(int index) const PixelFormat RenderTargetMTL::getDepthAttachmentPixelFormat() const { // FIXME: engine-x only support D24S8 - if(bitmask::any(_flags, TargetBufferFlags::DEPTH_AND_STENCIL)) { + if(bitmask::any(_flags, TargetBufferFlags::DEPTH)) { if(isDefaultRenderTarget() || !_depth) return PixelFormat::D24S8; return _depth.texture->getTextureFormat(); @@ -184,7 +187,7 @@ PixelFormat RenderTargetMTL::getDepthAttachmentPixelFormat() const PixelFormat RenderTargetMTL::getStencilAttachmentPixelFormat() const { // FIXME: engine-x only support D24S8 - if(bitmask::any(_flags, TargetBufferFlags::DEPTH_AND_STENCIL)) { + if(bitmask::any(_flags, TargetBufferFlags::STENCIL)) { if(isDefaultRenderTarget() || !_stencil) return PixelFormat::D24S8; return _stencil.texture->getTextureFormat(); From d4284b880ec66d5aa3041d9d1556055da3673ec5 Mon Sep 17 00:00:00 2001 From: HALX99 Date: Fri, 6 Nov 2020 09:33:26 +0800 Subject: [PATCH 5/9] Update comment --- cocos/renderer/backend/metal/RenderPipelineMTL.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos/renderer/backend/metal/RenderPipelineMTL.mm b/cocos/renderer/backend/metal/RenderPipelineMTL.mm index 2a0bf3dfe1..5d24966c71 100644 --- a/cocos/renderer/backend/metal/RenderPipelineMTL.mm +++ b/cocos/renderer/backend/metal/RenderPipelineMTL.mm @@ -297,14 +297,14 @@ void RenderPipelineMTL::chooseAttachmentFormat(const RenderTarget* renderTarget, PixelFormat& depthFormat, PixelFormat& stencilFormat) { - // Sets color attachment format + // choose color attachment format auto rtMTL = static_cast(renderTarget); auto rtflags = rtMTL->getTargetFlags(); for(auto i = 0; i < MAX_COLOR_ATTCHMENT; ++i) { colorAttachmentsFormat[i] = bitmask::any(rtflags, getMRTColorFlag(i)) ? rtMTL->getColorAttachmentPixelFormat(i) : PixelFormat::NONE; } - // Sets depth and stencil attachment format, match RenderTargetMTL::applyRenderPassAttachments + // choose depth and stencil attachment format, match RenderTargetMTL::applyRenderPassAttachments depthFormat = bitmask::any(rtflags, RenderTargetFlag::DEPTH) ? rtMTL->getDepthAttachmentPixelFormat() : PixelFormat::NONE; stencilFormat = bitmask::any(rtflags, RenderTargetFlag::STENCIL) ? rtMTL->getStencilAttachmentPixelFormat() : PixelFormat::NONE; } From f60e68645465ce79f694386b5f5896b1b9748a21 Mon Sep 17 00:00:00 2001 From: HALX99 Date: Fri, 6 Nov 2020 21:13:56 +0800 Subject: [PATCH 6/9] Update README_CN.md --- README_CN.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README_CN.md b/README_CN.md index 6724330661..ab15638cbd 100644 --- a/README_CN.md +++ b/README_CN.md @@ -103,3 +103,4 @@ ### 参考链接 * engine-x-3rd: https://github.com/c4games/engine-x-3rd * official v4: https://gitee.com/mirrors/cocos2d-x + * Git快速手册: https://github.com/c4games/engine-x/wiki/Git-Guides From 1d4527772e0aacaf94ed5d89ee7a10fcae594ab1 Mon Sep 17 00:00:00 2001 From: halx99 Date: Sat, 7 Nov 2020 10:20:59 +0800 Subject: [PATCH 7/9] Update README for xcode12 build simulator guide --- README.md | 2 +- README_CN.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 224739f3d5..f92ddcf9e8 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ # cmake -S . -B build -GXcode -DCMAKE_TOOLCHAIN_FILE=cmake/ios.mini.cmake "-DCMAKE_OSX_ARCHITECTURES=armv7;arm64" # for simulator x86_64 - # cmake -S . -B build -GXcode -DCMAKE_TOOLCHAIN_FILE=cmake/ios.mini.cmake -DCMAKE_OSX_SYSROOT=iphonesimulator + # cmake -S . -B build -GXcode -DCMAKE_TOOLCHAIN_FILE=cmake/ios.mini.cmake -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_OSX_ARCHITECTURES=x86_64 ``` 4. After cmake generate finish, you can open xcode project at ```build``` folder and run cpp-tests or other test targets. diff --git a/README_CN.md b/README_CN.md index ab15638cbd..99742a160d 100644 --- a/README_CN.md +++ b/README_CN.md @@ -86,7 +86,7 @@ # cmake -S . -B build -GXcode -DCMAKE_TOOLCHAIN_FILE=cmake/ios.mini.cmake "-DCMAKE_OSX_ARCHITECTURES=armv7;arm64" # for simulator x86_64 - # cmake -S . -B build -GXcode -DCMAKE_TOOLCHAIN_FILE=cmake/ios.mini.cmake -DCMAKE_OSX_SYSROOT=iphonesimulator + # cmake -S . -B build -GXcode -DCMAKE_TOOLCHAIN_FILE=cmake/ios.mini.cmake -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_OSX_ARCHITECTURES=x86_64 ``` 4. 之后就可以用xcode打开, 选择cpp-tests编译运行 From 520cc31f1b3c1c69541611151a64cfd900f2e72e Mon Sep 17 00:00:00 2001 From: halx99 Date: Sat, 7 Nov 2020 10:36:22 +0800 Subject: [PATCH 8/9] Add cmake option -DLUA_ENGINE=luajit to switch lua engine to luajit [ci build] --- .github/workflows/win32-ci.yml | 2 +- cocos/CMakeLists.txt | 3 --- external/config.json | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/win32-ci.yml b/.github/workflows/win32-ci.yml index 7a949c83f2..1f9345aa1a 100644 --- a/.github/workflows/win32-ci.yml +++ b/.github/workflows/win32-ci.yml @@ -34,7 +34,7 @@ jobs: # Note the current convention is to use the -S and -B options here to specify source # and build directories, but this is only available with CMake 3.13 and higher. # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 - run: cmake -S %GITHUB_WORKSPACE% -B %GITHUB_WORKSPACE%/build_x86 -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -A Win32 -DBUILD_EXTENSION_IMGUIEXT=ON + run: cmake -S %GITHUB_WORKSPACE% -B %GITHUB_WORKSPACE%/build_x86 -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -A Win32 -DBUILD_EXTENSION_IMGUIEXT=ON -DLUA_ENGINE=luajit - name: Build shell: cmd diff --git a/cocos/CMakeLists.txt b/cocos/CMakeLists.txt index 10e567d8f1..280f2817be 100644 --- a/cocos/CMakeLists.txt +++ b/cocos/CMakeLists.txt @@ -69,9 +69,6 @@ if (NOT DEFINED CC_FORCE_USE_GLES) set(CC_FORCE_USE_GLES FALSE CACHE INTERNAL "Force use GLES" ) endif() -set(LUA_ENGINE "plainlua" CACHE INTERNAL "The lua core lib, luajit or plainlua") -set(LUA_VERSION "5.3.6" CACHE INTERNAL "The plainlua version") - project(cocos2d_libs) include(2d/CMakeLists.txt) diff --git a/external/config.json b/external/config.json index f653984985..934a44d873 100644 --- a/external/config.json +++ b/external/config.json @@ -1,5 +1,5 @@ { - "version": "v86", + "version": "v87", "zip_file_size": "107642814", "repo_name": "engine-x-3rd", "repo_parent": "https://github.com/c4games/", From f80a6ef25c0addb3ad7a79028ffd197b58765316 Mon Sep 17 00:00:00 2001 From: halx99 Date: Sat, 7 Nov 2020 11:53:01 +0800 Subject: [PATCH 9/9] Update config.json [ci build] --- external/config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/config.json b/external/config.json index 934a44d873..f9aac1af7a 100644 --- a/external/config.json +++ b/external/config.json @@ -1,5 +1,5 @@ { - "version": "v87", + "version": "v88", "zip_file_size": "107642814", "repo_name": "engine-x-3rd", "repo_parent": "https://github.com/c4games/",