浏览代码

Build: Fixing the macOS build

bearishsun 6 年之前
父节点
当前提交
daf2129bfa

+ 2 - 1
Documentation/MonoIntegrationGuide.txt

@@ -32,7 +32,8 @@
    - Compile mono project with desired configuration (debug/release, 32/64 bit, SGen builds were not tested). You will receive mono-2.0.dll and mono-2.0.lib as output.
     - Repeat the "genmdesc" step above for each configuration. Doing it once might be enough but be on the safe side.
   - If on Linux/Mac:
-   - "./autogen.sh --prefix="(OutputDir)" --with-preview=yes"" (Replace (OutputDir) with a folder where you want to output the binaries, e.g. "C:\MonoInstall")
+   - "./autogen.sh --prefix="(OutputDir)" --disable-boehm --with-sgen-default-concurrent=no" (Replace (OutputDir) with a folder where you want to output the binaries, e.g. "C:\MonoInstall")
+     - On Mac also add: "--disable-nls"	
    - "./configure"
    - "make"
    - "make install"

+ 28 - 28
Source/EditorCore/GUI/BsGUIFloatDistributionField.cpp

@@ -108,7 +108,7 @@ namespace bs
 	template<class T, class SELF>
 	TGUIDistributionField<T, SELF>::TGUIDistributionField(const PrivatelyConstruct& dummy, const GUIContent& labelContent, 
 		UINT32 labelWidth, const String& style, const GUIDimensions& dimensions, bool withLabel)
-		: TGUIField(dummy, labelContent, labelWidth, style, dimensions, withLabel)
+		: TGUIField<SELF>(dummy, labelContent, labelWidth, style, dimensions, withLabel)
 	{
 		mContextMenu = bs_shared_ptr_new<GUIContextMenu>();
 
@@ -273,8 +273,8 @@ namespace bs
 	{
 		mDropDownButton->setTint(color);
 
-		if (mLabel)
-			mLabel->setTint(color);
+		if (this->mLabel)
+			this->mLabel->setTint(color);
 
 		if(mMinInput)
 			mMinInput->setTint(color);
@@ -347,9 +347,9 @@ namespace bs
 		optimalsize.x += dropDownSize.x;
 		optimalsize.y = std::max(optimalsize.y, dropDownSize.y);
 
-		if (mLabel)
+		if (this->mLabel)
 		{
-			Vector2I elemOptimal = mLabel->_calculateLayoutSizeRange().optimal;
+			Vector2I elemOptimal = this->mLabel->_calculateLayoutSizeRange().optimal;
 
 			optimalsize.x += elemOptimal.x;
 			optimalsize.y = std::max(optimalsize.y, elemOptimal.y);
@@ -361,21 +361,21 @@ namespace bs
 	template<class T, class SELF>
 	void TGUIDistributionField<T, SELF>::styleUpdated()
 	{
-		mDropDownButton->setStyle(getSubStyleName(DROP_DOWN_FIELD_STYLE_TYPE));
+		mDropDownButton->setStyle(this->getSubStyleName(DROP_DOWN_FIELD_STYLE_TYPE));
 
-		if (mLabel)
-			mLabel->setStyle(getSubStyleName(getLabelStyleType()));
+		if (this->mLabel)
+			this->mLabel->setStyle(this->getSubStyleName(this->getLabelStyleType()));
 
 		if (mMinInput)
-			mMinInput->setStyle(getSubStyleName(FLOAT_FIELD_STYLE_TYPE));
+			mMinInput->setStyle(this->getSubStyleName(FLOAT_FIELD_STYLE_TYPE));
 
 		if (mMaxInput)
-			mMaxInput->setStyle(getSubStyleName(FLOAT_FIELD_STYLE_TYPE));
+			mMaxInput->setStyle(this->getSubStyleName(FLOAT_FIELD_STYLE_TYPE));
 
 		for (int i = 0; i < NumComponents; i++)
 		{
 			if (mCurveDisplay[i])
-				mCurveDisplay[i]->setStyle(getSubStyleName(CURVES_FIELD_STYLE_TYPES[i]));
+				mCurveDisplay[i]->setStyle(this->getSubStyleName(CURVES_FIELD_STYLE_TYPES[i]));
 		}
 	}
 
@@ -385,18 +385,18 @@ namespace bs
 		constexpr const char* COMP_NAMES[] = { "X", "Y", "Z", "W" };
 		constexpr UINT32 ELEMENT_LABEL_WIDTH = 15;
 
-		if(mLabel)
-			mLayout->removeElement(mLabel);
+		if(this->mLabel)
+			this->mLayout->removeElement(this->mLabel);
 
-		mLayout->clear();
-		mLayout->addElement(mLabel);
+		this->mLayout->clear();
+		this->mLayout->addElement(this->mLabel);
 
-		GUILayout* valueLayout = mLayout->addNewElement<GUILayoutY>();
+		GUILayout* valueLayout = this->mLayout->template addNewElement<GUILayoutY>();
 		switch (mValue.getType())
 		{
 		default:
 		case PDT_Constant:
-			mMinInput = GUIConstantType::create(GUIOptions(), getSubStyleName(FLOAT_FIELD_STYLE_TYPE));
+			mMinInput = GUIConstantType::create(GUIOptions(), this->getSubStyleName(FLOAT_FIELD_STYLE_TYPE));
 			mMaxInput = nullptr;
 			mLabels = { nullptr, nullptr };
 
@@ -424,8 +424,8 @@ namespace bs
 			valueLayout->addElement(mMinInput);
 			break;
 		case PDT_RandomRange: 
-			mMinInput = GUIConstantType::create(GUIOptions(), getSubStyleName(FLOAT_FIELD_STYLE_TYPE));
-			mMaxInput = GUIConstantType::create(GUIOptions(), getSubStyleName(FLOAT_FIELD_STYLE_TYPE));
+			mMinInput = GUIConstantType::create(GUIOptions(), this->getSubStyleName(FLOAT_FIELD_STYLE_TYPE));
+			mMaxInput = GUIConstantType::create(GUIOptions(), this->getSubStyleName(FLOAT_FIELD_STYLE_TYPE));
 
 			for(int i = 0; i < NumComponents; i++)
 				mCurveDisplay[i] = nullptr;
@@ -482,12 +482,12 @@ namespace bs
 				if(NumComponents > 1)
 				{
 					mCurveDisplay[i] = GUICurvesField::create(CurveDrawOption::DrawMarkers, HString(COMP_NAMES[i]),
-						ELEMENT_LABEL_WIDTH, getSubStyleName(CURVES_FIELD_STYLE_TYPES[i]));
+						ELEMENT_LABEL_WIDTH, this->getSubStyleName(CURVES_FIELD_STYLE_TYPES[i]));
 				}
 				else
 				{
 					mCurveDisplay[i] = GUICurvesField::create(CurveDrawOption::DrawMarkers, 
-						getSubStyleName(CURVES_FIELD_STYLE_TYPES[i]));
+						this->getSubStyleName(CURVES_FIELD_STYLE_TYPES[i]));
 				}
 
 				mCurveDisplay[i]->setCurve(mMinCurve[i]);
@@ -513,12 +513,12 @@ namespace bs
 				if(NumComponents > 1)
 				{
 					mCurveDisplay[i] = GUICurvesField::create(CurveDrawOption::DrawMarkers, HString(COMP_NAMES[i]),
-						ELEMENT_LABEL_WIDTH, getSubStyleName(CURVES_FIELD_STYLE_TYPES[i]));
+						ELEMENT_LABEL_WIDTH, this->getSubStyleName(CURVES_FIELD_STYLE_TYPES[i]));
 				}
 				else
 				{
 					mCurveDisplay[i] = GUICurvesField::create(CurveDrawOption::DrawMarkers, 
-						getSubStyleName(CURVES_FIELD_STYLE_TYPES[i]));
+						this->getSubStyleName(CURVES_FIELD_STYLE_TYPES[i]));
 				}
 
 				mCurveDisplay[i]->setCurveRange(mMinCurve[i], mMaxCurve[i]);
@@ -535,17 +535,17 @@ namespace bs
 			break;
 		}
 
-		mDropDownButton = GUIButton::create(HString::dummy(), getSubStyleName(DROP_DOWN_FIELD_STYLE_TYPE));
+		mDropDownButton = GUIButton::create(HString::dummy(), this->getSubStyleName(DROP_DOWN_FIELD_STYLE_TYPE));
 		mDropDownButton->onClick.connect([this]()
 		{
-			const Rect2I bounds = mDropDownButton->getBounds(mParentWidget->getPanel());
+			const Rect2I bounds = mDropDownButton->getBounds(this->mParentWidget->getPanel());
 			const Vector2I center(bounds.x + bounds.width / 2, bounds.y + bounds.height / 2);
 
-			mContextMenu->open(center, *mParentWidget);
+			mContextMenu->open(center, *(this->mParentWidget));
 		});
 
-		mLayout->addNewElement<GUIFixedSpace>(10);
-		mLayout->addElement(mDropDownButton);
+		this->mLayout->template addNewElement<GUIFixedSpace>(10);
+		this->mLayout->addElement(mDropDownButton);
 	}
 
 	template class BS_ED_EXPORT TGUIDistributionField<float, GUIFloatDistributionField>;

+ 4 - 3
Source/EditorCore/GUI/BsGUIFloatDistributionField.h

@@ -43,6 +43,7 @@ namespace bs
 	template<class T, class SELF>
 	class BS_ED_EXPORT TGUIDistributionField : public TGUIField<SELF>
 	{
+		using PrivatelyConstruct = typename TGUIField<SELF>::PrivatelyConstruct;
 		using GUIConstantType = typename impl::TGUIDistributionMeta<T>::ConstantField;
 		enum { NumComponents = TCurveProperties<T>::NumComponents };
 
@@ -155,7 +156,7 @@ namespace bs
 	GUIFloatDistributionField final : public TGUIDistributionField<float, GUIFloatDistributionField>
 	{
 	public:
-		using TGUIDistributionField::TGUIDistributionField;
+		using TGUIDistributionField<float, GUIFloatDistributionField>::TGUIDistributionField;
 
 		/** Returns type name of the GUI element used for finding GUI element styles. */
 		static const String& getGUITypeName();
@@ -169,7 +170,7 @@ namespace bs
 	GUIVector2DistributionField final : public TGUIDistributionField<Vector2, GUIVector2DistributionField>
 	{
 	public:
-		using TGUIDistributionField::TGUIDistributionField;
+		using TGUIDistributionField<Vector2, GUIVector2DistributionField>::TGUIDistributionField;
 
 		/** Returns type name of the GUI element used for finding GUI element styles. */
 		static const String& getGUITypeName();
@@ -183,7 +184,7 @@ namespace bs
 	GUIVector3DistributionField final : public TGUIDistributionField<Vector3, GUIVector3DistributionField>
 	{
 	public:
-		using TGUIDistributionField::TGUIDistributionField;
+		using TGUIDistributionField<Vector3, GUIVector3DistributionField>::TGUIDistributionField;
 
 		/** Returns type name of the GUI element used for finding GUI element styles. */
 		static const String& getGUITypeName();

+ 1 - 2
Source/EditorCore/Handles/BsHandleDrawManager.cpp

@@ -177,8 +177,7 @@ namespace bs
 			mLastFrameIdx = frameIdx;
 		}
 
-		const Transform& tfrm = camera->getTransform();
-		const Vector<DrawHelper::ShapeMeshData>& meshes = 
+		const Vector<DrawHelper::ShapeMeshData>& meshes =
 			mDrawHelper->buildMeshes(DrawHelper::SortType::BackToFront, camera.get(), camera->getLayers());
 
 		mActiveMeshes.push_back(meshes);

+ 1 - 1
Source/EditorManaged/CMakeLists.txt

@@ -33,6 +33,6 @@ else()
 	endif()
 
 	add_custom_target(MBansheeEditor
-			COMMAND xbuild /p:Configuration=${CS_PROJ_CONFIG} ${BS_CS_PROJ}
+			COMMAND msbuild /p:Configuration=${CS_PROJ_CONFIG} ${CMAKE_CURRENT_SOURCE_DIR}/${BS_CS_PROJ}
 			COMMENT "Building managed assembly \"MBansheeEditor\"")
 endif()