cpp-tests EffectsTest一些3D特效

本文分享了在NodeGrid中实现的各种3D效果,包括页面翻转、行列分割、瓷砖关闭、渐隐等,通过添加Sprite并运行特定的动作来展示效果。每个效果都包含在NodeGrid中运行的动作序列,例如使用Sequence结合多种Action实现动态变化。

~~~~我的生活,我的点点滴滴!!


由于官方的例子EffectsTest已经展示了很多效果,看起来还很不错,这里我不分析代码了,例子中特效的介绍请看:3D特效介绍


下面我直接上我自己写的例子及效果图,里面其实好多重复的代码,这里懒得去逐行去添加注释了。


////第五列 第三行
void HelloWorld::PageTurn3DFunc()
{
	NodeGrid *nodeGrid = NodeGrid::create();
	this->addChild(nodeGrid);
	auto Sp = Sprite::create("bang.png");
	Sp->setPosition(Vec2(800+OFFX, 180));
	nodeGrid->addChild(Sp);
	ScaleBy *bottomScaleBy = ScaleBy::create(1.5, 3);
	auto pageTrun = PageTurn3D::create(1.5, Size(20,10));
	nodeGrid->runAction(Sequence::create(pageTrun, pageTrun->reverse(), nullptr));
	Sp->runAction(Sequence::create(bottomScaleBy, bottomScaleBy->reverse(), nullptr));
	m_NodeGrids.push_back(nodeGrid);

	auto tf = LabelTTF::create("PageTurn3D", "Arial", 26);
	tf->setPosition(Vec2(Sp->getPosition().x + OFFX,
		Sp->getPosition().y + Sp->getContentSize().height * 0.5 + tf->getContentSize().height - 10));
	this->addChild(tf,10);
}

//第四列 第三行
void HelloWorld::SplitRowAndColFunc()
{
	NodeGrid *nodeGrid = NodeGrid::create();
	this->addChild(nodeGrid);
	auto Sp = Sprite::create("bang.png");
	Sp->setPosition(Vec2(620+OFFX, 180));
	nodeGrid->addChild(Sp);
	ScaleBy *bottomScaleBy = ScaleBy::create(2, 2);
	SplitRows *splitRow = SplitRows::create(1, 9);
	SplitCols *splitCol = SplitCols::create(1, 9);
	nodeGrid->runAction(Sequence::create(splitRow, splitRow->reverse(), splitCol, splitCol->reverse(), nullptr));
	Sp->runAction(Sequence::create(bottomScaleBy, bottomScaleBy->reverse(), nullptr));
	m_NodeGrids.push_back(nodeGrid);

	auto tf = LabelTTF::create("SplitRowAndCol", "Arial", 26);
	tf->setPosition(Vec2(Sp->getPosition().x + OFFX,
		Sp->getPosition().y + Sp->getContentSize().height * 0.5 + tf->getContentSize().height - 10));
	this->addChild(tf,10);
}

//第三列 第四行
void HelloWorld::TurnOffTilesFunc()
{
	NodeGrid *nodeGrid = NodeGrid::create();
	this->addChild(nodeGrid);
	auto Sp = Sprite::create("bang.png");
	Sp->setPosition(Vec2(440+OFFX, 50));
	nodeGrid->addChild(Sp);
	ScaleBy *bottomScaleBy = ScaleBy::create(1.5, 3);
	auto turnOff = TurnOffTiles::create(1.5, Size(25,15), 30);
	nodeGrid->runAction(Sequence::create(turnOff, turnOff->reverse(), nullptr));
	Sp->runAction(Sequence::create(bottomScaleBy, bottomScaleBy->reverse(), nullptr));
	m_NodeGrids.push_back(nodeGrid);

	auto tf = LabelTTF::create("TurnOffTiles", "Arial", 26);
	tf->setPosition(Vec2(Sp->getPosition().x + OFFX,
		Sp->getPosition().y + Sp->getContentSize().height * 0.5 + tf->getContentSize().height - 10));
	this->addChild(tf,10);
}

//第三列 第三行
void HelloWorld::FadeOutALLTilesFunc()
{
	//这里把上、下、左、右四种效果合成一个
	NodeGrid *nodeGrid = NodeGrid::create();
	this->addChild(nodeGrid);
	auto Sp = Sprite::create("bang.png");
	Sp->setPosition(Vec2(440+OFFX, 180));
	nodeGrid->addChild(Sp);
	//从左下-右上
	FadeOutBLTiles *FadeOutBL = FadeOutBLTiles::create(0.5, Size(30,25));
	//从右上-左下
	FadeOutTRTiles *FadeOutTR = FadeOutTRTiles::create(0.5, Size(30,25));
	//从上-下
	FadeOutDownTiles *FadeOutDown = FadeOutDownTiles::create(0.5, Size(30,25));
	//从下-上
	FadeOutUpTiles *FadeUp = FadeOutUpTiles::create(0.5, Size(30,25));
	nodeGrid->runAction(Sequence::create(FadeOutBL, FadeOutBL->reverse(), DelayTime::create(0.2),
										 FadeOutTR, FadeOutTR->reverse(), DelayTime::create(0.2),
										 FadeOutDown, FadeOutDown->reverse(),DelayTime::create(0.2),
										 FadeUp, FadeUp->reverse(),nullptr));
	m_NodeGrids.push_back(nodeGrid);

	auto tf = LabelTTF::create("FadeOutALLTiles", "Arial", 26);
	tf->setPosition(Vec2(Sp->getPosition().x + OFFX,
		Sp->getPosition().y + Sp->getContentSize().height * 0.5 + tf->getContentSize().height - 10));
	this->addChild(tf,10);
}

//第二列 第三行
void HelloWorld::ShuffleTilesFunc()
{
	NodeGrid *nodeGrid = NodeGrid::create();
	this->addChild(nodeGrid);
	auto Sp = Sprite::create("bang.png");
	Sp->setPosition(Vec2(260+OFFX, 180));
	nodeGrid->addChild(Sp);
	ScaleBy *bottomScaleBy = ScaleBy::create(2, 2);
	auto shattered = ShuffleTiles::create(2, Size(25,15), 30);
	nodeGrid->runAction(Sequence::create(shattered, shattered->reverse(), nullptr));
	Sp->runAction(Sequence::create(bottomScaleBy, bottomScaleBy->reverse(), nullptr));
	m_NodeGrids.push_back(nodeGrid);

	auto tf = LabelTTF::create("ShuffleTiles", "Arial", 26);
	tf->setPosition(Vec2(Sp->getPosition().x + OFFX,
		Sp->getPosition().y + Sp->getContentSize().height * 0.5 + tf->getContentSize().height - 10));
	this->addChild(tf,10);
}

//第一列 第三行
void HelloWorld::ShatteredTiles3DFunc()
{
	NodeGrid *nodeGrid = NodeGrid::create();
	this->addChild(nodeGrid);
	auto Sp = Sprite::create("bang.png");
	Sp->setPosition(Vec2(80+OFFX, 180));
	nodeGrid->addChild(Sp);
	ScaleBy *bottomScaleBy = ScaleBy::create(1.5, 2);
	nodeGrid->runAction(ShatteredTiles3D::create(3, Size(25,15),5, true));
	Sp->runAction(Sequence::create(bottomScaleBy, bottomScaleBy->reverse(), nullptr));
	m_NodeGrids.push_back(nodeGrid);

	auto tf = LabelTTF::create("ShatteredTiles3D", "Arial", 26);
	tf->setPosition(Vec2(Sp->getPosition().x + OFFX,
		Sp->getPosition().y + Sp->getContentSize().height * 0.5 + tf->getContentSize().height - 10));
	this->addChild(tf,10);

	ShuffleTilesFunc();
}

//第五列
void HelloWorld::LiquidFunc()
{
	NodeGrid *nodeGrid = NodeGrid::create();
	this->addChild(nodeGrid);
	auto Sp = Sprite::create("bang.png");
	Sp->setPosition(Vec2(800 + OFFX, 360));
	nodeGrid->addChild(Sp);
	ScaleBy *bottomScaleBy = ScaleBy::create(2, 2);
	nodeGrid->runAction(Liquid::create(4, Size(15,10),3, 5));
	Sp->runAction(Sequence::create(bottomScaleBy, bottomScaleBy->reverse(), nullptr));
	m_NodeGrids.push_back(nodeGrid);

	auto tf = LabelTTF::create("Liquid", "Arial", 26);
	tf->setPosition(Vec2(Sp->getPosition().x  + OFFX,
		Sp->getPosition().y + Sp->getContentSize().height * 0.5 + tf->getContentSize().height - 10));
	this->addChild(tf,10);
}

//第五列
void HelloWorld::TwirlFunc()
{
	NodeGrid *nodeGrid = NodeGrid::create();
	this->addChild(nodeGrid);
	auto Sp = Sprite::create("bang.png");
	Sp->setPosition(Vec2(800 + OFFX, 540));
	nodeGrid->addChild(Sp);
	ScaleBy *bottomScaleBy = ScaleBy::create(1.5, 2);
	nodeGrid->runAction(Twirl::create(3, Size(15,10), Vec2(800, 540), 2, 5));
	Sp->runAction(Sequence::create(bottomScaleBy, bottomScaleBy->reverse(), nullptr));
	m_NodeGrids.push_back(nodeGrid);

	auto tf = LabelTTF::create("Twirl", "Arial", 26);
	tf->setPosition(Vec2(Sp->getPosition().x  + OFFX,
		Sp->getPosition().y + Sp->getContentSize().height * 0.5 + tf->getContentSize().height - 10));
	this->addChild(tf,10);

	LiquidFunc();
}

//第四列
void HelloWorld::Ripple3DFunc()
{
	NodeGrid *nodeGrid = NodeGrid::create();
	this->addChild(nodeGrid);
	auto Sp = Sprite::create("bang.png");
	Sp->setPosition(Vec2(620 + OFFX, 360));
	nodeGrid->addChild(Sp);
	ScaleBy *bottomScaleBy = ScaleBy::create(2, 2);
	nodeGrid->runAction(Ripple3D::create(4, Size(15,10),Vec2(240,160), 25, 5, 30));
	Sp->runAction(Sequence::create(bottomScaleBy, bottomScaleBy->reverse(), nullptr));
	m_NodeGrids.push_back(nodeGrid);

	auto tf = LabelTTF::create("Ripple3D", "Arial", 26);
	tf->setPosition(Vec2(Sp->getPosition().x  + OFFX,
		Sp->getPosition().y + Sp->getContentSize().height * 0.5 + tf->getContentSize().height - 10));
	this->addChild(tf,10);
}

//第四列
void HelloWorld::Lens3DFunc()
{
	NodeGrid *nodeGrid = NodeGrid::create();
	this->addChild(nodeGrid);
	auto Sp = Sprite::create("bang.png");
	Sp->setPosition(Vec2(620 + OFFX, 540));
	nodeGrid->addChild(Sp);
	ScaleBy *bottomScaleBy = ScaleBy::create(1, 2);
	nodeGrid->runAction(Lens3D::create(2, Size(15,10),Vec2(240,160), 45));
	Sp->runAction(Sequence::create(bottomScaleBy, bottomScaleBy->reverse(), nullptr));
	m_NodeGrids.push_back(nodeGrid);

	auto tf = LabelTTF::create("Lens3D", "Arial", 26);
	tf->setPosition(Vec2(Sp->getPosition().x  + OFFX,
		Sp->getPosition().y + Sp->getContentSize().height * 0.5 + tf->getContentSize().height - 10));
	this->addChild(tf,10);

	Ripple3DFunc();
}

//第三列
void HelloWorld::Flip3DFunc()
{
	NodeGrid *nodeGrid = NodeGrid::create();
	this->addChild(nodeGrid);
	//X轴
	auto Sp = Sprite::create("bang.png");
	Sp->setPosition(Vec2(440 + OFFX, 540));
	nodeGrid->addChild(Sp);
	ScaleBy *bottomScaleBy = ScaleBy::create(2.0, 4);
	auto flipx = FlipX3D::create(2.0);
	nodeGrid->runAction(Sequence::create(flipx, flipx->reverse(), nullptr));
	Sp->runAction(Sequence::create(bottomScaleBy, bottomScaleBy->reverse(), nullptr));
	m_NodeGrids.push_back(nodeGrid);

	auto tf = LabelTTF::create("FlipX3D", "Arial", 26);
	tf->setPosition(Vec2(Sp->getPosition().x  + OFFX,
		Sp->getPosition().y + Sp->getContentSize().height * 0.5 + tf->getContentSize().height - 10));
	this->addChild(tf,10);

	NodeGrid *nodeGrid1 = NodeGrid::create();
	this->addChild(nodeGrid1);
	//Y轴
	auto SpClone = Sprite::create("bang.png");
	SpClone->setPosition(Vec2(440 + OFFX, 360));
	nodeGrid1->addChild(SpClone);
	ScaleBy *bottomScaleByClone = ScaleBy::create(1.5, 2);
	auto flipy = FlipY3D::create(1.5);
	nodeGrid1->runAction(Sequence::create(flipy, flipy->reverse(), nullptr));
	SpClone->runAction(Sequence::create(bottomScaleByClone, bottomScaleByClone->reverse(), nullptr));
	m_NodeGrids.push_back(nodeGrid1);

	auto tf1 = LabelTTF::create("FlipY3D", "Arial", 26);
	tf1->setPosition(Vec2(SpClone->getPosition().x  + OFFX,
		SpClone->getPosition().y + SpClone->getContentSize().height * 0.5 + tf1->getContentSize().height - 10));
	this->addChild(tf1,10);
}

//第二列
void HelloWorld::WavesTiles3DFunc()
{
	NodeGrid *nodeGrid = NodeGrid::create();
	this->addChild(nodeGrid);
	ScaleBy *bottomScaleBy = ScaleBy::create(2, 2);
	auto Sp = Sprite::create("bang.png");
	Sp->setPosition(Vec2(260 + OFFX, 360));
	nodeGrid->addChild(Sp);
	auto bottomShaky3D = WavesTiles3D::create(4, Size(20,10), 5, 100);
	nodeGrid->runAction(bottomShaky3D);
	Sp->runAction(Sequence::create(bottomScaleBy, bottomScaleBy->reverse(),nullptr));
	m_NodeGrids.push_back(nodeGrid);

	auto tf = LabelTTF::create("WavesTiles3D", "Arial", 26);
	tf->setPosition(Vec2(Sp->getPosition().x  + OFFX,
		Sp->getPosition().y + Sp->getContentSize().height * 0.5 + tf->getContentSize().height - 10));
	this->addChild(tf,10);
}

//第二列
void HelloWorld::Waves3DFunc()
{
	NodeGrid *nodeGrid = NodeGrid::create();
	this->addChild(nodeGrid);
	auto Sp = Sprite::create("bang.png");
	Sp->setPosition(Vec2(260 + OFFX, 540));
	nodeGrid->addChild(Sp);
	auto rightShaky3D = Waves3D::create(3, Size(20,10),5, 50);
	nodeGrid->runAction(rightShaky3D);
	ScaleBy *rightScaleBy = ScaleBy::create(1.5, 2);
	Sp->runAction(Sequence::create(rightScaleBy, rightScaleBy->reverse(),nullptr));
	m_NodeGrids.push_back(nodeGrid);

	auto tf = LabelTTF::create("Waves3D", "Arial", 26);
	tf->setPosition(Vec2(Sp->getPosition().x  + OFFX,
		Sp->getPosition().y + Sp->getContentSize().height * 0.5 + tf->getContentSize().height - 10));
	this->addChild(tf,10);

	WavesTiles3DFunc();
}

//第一列
void HelloWorld::ShakyTiles3DFunc()
{
	ScaleBy *bottomScaleBy = ScaleBy::create(1.5, 3);
	auto Sp = Sprite::create("bang.png");
	Sp->setPosition(Vec2(80 + OFFX, 360));
	NodeGrid *nodeGrid = NodeGrid::create();
	nodeGrid->addChild(Sp);
	this->addChild(nodeGrid);
	m_NodeGrids.push_back(nodeGrid);
	auto bottomShaky3D = ShakyTiles3D::create(3, Size(20,10), 3, true);
	nodeGrid->runAction(bottomShaky3D);
	Sp->runAction(Sequence::create(bottomScaleBy, bottomScaleBy->reverse(),nullptr));

	auto tf = LabelTTF::create("ShakyTiles3D", "Arial", 26);
	tf->setPosition(Vec2(Sp->getPosition().x  + OFFX,
						 Sp->getPosition().y + Sp->getContentSize().height * 0.5 + tf->getContentSize().height - 10));
	
	this->addChild(tf,10);
}

//第一列
void HelloWorld::Shaky3DFunc()
{
	auto Sp = Sprite::create("bang.png");
	Sp->setPosition(Vec2(80 + OFFX, 540));
	//3.x中已经改变了,Node中已经没有setGird与getGird接口了,改到NodeGird里面了
	NodeGrid *leftNodeGrid = NodeGrid::create();
	leftNodeGrid->addChild(Sp);
	this->addChild(leftNodeGrid);
	m_NodeGrids.push_back(leftNodeGrid);
	auto leftShaky3D = Shaky3D::create(3, Size(10,10), 2, true);
	leftNodeGrid->runAction(leftShaky3D);
	ScaleBy *leftScaleBy = ScaleBy::create(1.5, 3);
	Sp->runAction(Sequence::create(leftScaleBy, leftScaleBy->reverse(),nullptr));

	auto tf = LabelTTF::create("Shaky3D", "Arial", 26);
	tf->setPosition(Vec2(Sp->getPosition().x  + OFFX,
		Sp->getPosition().y + Sp->getContentSize().height * 0.5 + tf->getContentSize().height - 10));
	this->addChild(tf,10);

	ShakyTiles3DFunc();

	//设置一个update定时器,每帧去查询是否结束了晃动
	schedule( schedule_selector(HelloWorld::checkAnim) );
}

//这个函数很有用,没有他,效果不会恢复原状
void HelloWorld::checkAnim(float dt)
{
	//由于晃动结束后,他是不会自己恢复原状的,只能设置Node类中一个Grid属性,看Node源码就知道了。
	std::vector<NodeGrid*>::iterator iter;
	for( iter = m_NodeGrids.begin(); iter != m_NodeGrids.end(); ++ iter)
	{
		auto s2 = (*iter);
		//由于这里只有Shaky3D这一种特效,所以用了getNumberOfRunningActions(当前正在运行的Action个数)
		//及此node是否有grid属性。
		if ( s2->getNumberOfRunningActions() == 0 && s2->getGrid() != NULL)
		{
			//要设置成NULL,才会恢复原状
			s2->setGrid(NULL);
		}
	}
}


上面用到的最多的是声明一个NodeGrid的对象,然后添加sprite到其里面,最后是NodeGird去runActions(),sprite是不能直接运行Grid3DAction里面效果的,只能是NodeGird对象。

由于屏幕就那么大,选取的精灵图片也小,不如官方例子那样醒目,但是还是能看出效果的,但是gif上传大小受限,只能一减在减,看不到全过程





<think>好的,我现在需要帮助用户解决在编译aws-sdk-cpp时遇到的std::regex_error错误,特别是涉及到SmithyClientTest.cpp的问题。首先,我需要回顾之前的对话,确保理解上下文。用户之前询问了如何排除某个特定文件的编译,现在新的问题是关于std::regex_error的错误。 首先,我需要分析std::regex_error的可能原因。根据经验,这种错误通常与正则表达式的语法或编译器对C++11正则表达式的支持有关。用户提到的是在编译aws-sdk-cpp时出现的问题,尤其是在SmithyClientTest.cpp中,所以可能该测试文件中的某个正则表达式触发了错误。 接下来,我需要考虑用户的环境。用户可能使用的是较旧的GCC版本(比如GCC 4.9之前),因为早期版本的GCC对C++11正则表达式的支持不完全,容易导致std::regex_error。或者,用户可能在Windows上使用MinGW,这也可能导致类似的问题。 接下来,我需要参考用户提供的站内引用。引用[1]提到了智能指针和互斥锁,这可能与资源管理有关,但当前问题涉及正则表达式,可能关联不大。引用[2]提到CMake构建与Visual Studio的链接,这可能提示用户可能在Windows环境下使用CMake进行编译,但需要进一步确认。 回顾用户之前的问题,用户尝试通过CMake配置排除特定代码行或文件。现在的问题可能与代码中的正则表达式有关,可能需要修改代码或调整编译选项。例如,可以尝试禁用相关的测试用例,或者升级编译器以支持更好的正则表达式实现。 可能的解决方案包括: 1. 禁用涉及正则表达式的测试用例,特别是SmithyClientTest.cpp中的相关部分。 2. 升级编译器到支持C++11正则表达式的版本(如GCC 5以上或Clang 3.4以上)。 3. 修改代码中的正则表达式,确保语法正确且与当前编译器兼容。 4. 使用其他正则表达式库(如Boost.Regex)替换标准库的实现。 我需要验证这些可能性,并给出具体的步骤。例如,如何通过CMake排除测试文件,或者如何替换正则表达式库。同时,需要确保回答结构清晰,步骤详细,帮助用户逐步解决问题。 另外,用户可能希望尽可能少地修改代码,因此优先考虑通过CMake配置来禁用测试,或者调整编译器标志。如果用户的环境允许,升级编译器可能是根本解决办法,但用户可能需要临时解决方案。 最后,需要生成相关问题,帮助用户进一步解决可能遇到的类似问题,例如如何处理其他编译错误,如何优化构建配置等。</think>### 分步解决方案:解决aws-sdk-cpp编译时的`std::regex_error`错误 --- ### **问题根源分析** `std::regex_error`通常由以下原因导致: 1. **正则表达式语法错误**:正则表达式字符串不符合C++标准语法[^1]。 2. **编译器兼容性问题**:旧版本编译器(如GCC < 5或Clang < 3.4)对C++11正则表达式支持不完善[^2]。 3. **Unicode处理异常**:某些环境下字符编码与正则表达式引擎不兼容。 --- ### **方法1:禁用`SmithyClientTest.cpp`中的问题代码** #### 步骤1:通过CMake排除文件编译 在AWS SDK的`CMakeLists.txt`中定位相关测试文件,并注释其包含: ```cmake # 原始配置(位于aws-cpp-sdk-core-tests的CMakeLists.txt) file(GLOB CORE_TEST_SOURCE "smithy/client/*.cpp" # 注释或移除SmithyClientTest.cpp # "smithy/client/SmithyClientTest.cpp" ... ) ``` #### 步骤2:重新生成构建系统 ```bash rm -rf build && mkdir build && cd build cmake .. -DCMAKE_BUILD_TYPE=Release # 清理旧构建并重新配置 make aws-cpp-sdk-core # 仅编译核心模块(跳过测试) ``` --- ### **方法2:修复正则表达式兼容性** #### 步骤1:检查问题代码中的正则表达式 在`SmithyClientTest.cpp`中搜索`std::regex`相关代码,例如: ```cpp // 示例:可能存在问题的正则表达式 std::regex pattern("\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z"); ``` #### 步骤2:替换为兼容语法 调整正则表达式以适配旧编译器: ```cpp // 修改为明确转义或简化语法 std::regex pattern("[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z"); ``` --- ### **方法3:强制使用C++11及以上标准** #### 步骤1:在CMake中显式设置C++标准 在`aws-sdk-cpp/CMakeLists.txt`中添加: ```cmake set(CMAKE_CXX_STANDARD 11) # 或更高版本(14/17) set(CMAKE_CXX_STANDARD_REQUIRED ON) ``` #### 步骤2:检查编译器版本 ```bash g++ --version # 确认GCC >= 5 或 Clang >= 3.4 ``` --- ### **方法4:替换正则表达式库(高级)** #### 步骤1:链接Boost.Regex库 安装Boost并修改CMake配置: ```cmake find_package(Boost COMPONENTS regex REQUIRED) target_link_libraries(aws-cpp-sdk-core PRIVATE Boost::regex) ``` #### 步骤2:重定义`std::regex`命名空间 在代码中添加预处理指令: ```cpp #include <boost/regex.hpp> namespace std { using boost::regex; using boost::regex_error; } // 仅限测试代码 ``` --- ### **验证与调试** 1. **编译日志过滤** 使用`grep`定位错误来源: ```bash make 2>&1 | grep -C 10 "regex_error" ``` 2. **最小化复现代码** 提取触发错误的代码片段单独测试: ```cpp #include <regex> int main() { std::regex test("[a-z]+\\d*"); return 0; } ``` --- ### 相关问题 1. **如何检测C++编译器的正则表达式支持?** 通过预定义宏(如`__GNUC__`)判断编译器版本。 2. **AWS SDK中有哪些模块依赖正则表达式?** Smithy模型解析和HTTP头处理模块可能涉及正则操作[^3]。 3. **CMake中如何按条件排除特定平台代码?** 使用`if()`语句结合`CMAKE_SYSTEM_NAME`或`CMAKE_CXX_COMPILER_ID`[^2]。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值