summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2014-11-27 14:16:36 +0200
committerTor Lillqvist <tml@collabora.com>2014-11-28 10:23:50 +0200
commitd4f63f5e767d23675240e9dd6d95fc9496ad9df5 (patch)
treeb635600faefbb593ed11cb05082654efabb9d552 /sc
parent8f4549109da2a7a0860cdebedcb2cbe8ddbd601a (diff)
Fix OpenCL-less build harder
Change-Id: I1627f534505c735455c50f9b4f6e4d1c698ab9d2
Diffstat (limited to 'sc')
-rw-r--r--sc/Library_sc.mk4
-rw-r--r--sc/source/core/tool/formulagroup.cxx3
-rw-r--r--sc/source/core/tool/formulaopt.cxx3
-rw-r--r--sc/source/ui/unoobj/docuno.cxx12
4 files changed, 18 insertions, 4 deletions
diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk
index 001891b10483..51ad36ea6004 100644
--- a/sc/Library_sc.mk
+++ b/sc/Library_sc.mk
@@ -660,8 +660,8 @@ $(eval $(call gb_Library_add_exception_objects,sc,\
sc/source/ui/xmlsource/xmlsourcedlg \
))
-$(call gb_Helper_optional,OPENCL,\
-$(eval $(call gb_Library_add_exception_objects,sc,\
+$(eval $(call gb_Helper_optional,OPENCL,\
+$(call gb_Library_add_exception_objects,sc,\
sc/source/core/opencl/formulagroupcl \
sc/source/core/opencl/openclwrapper \
sc/source/core/opencl/opencl_device \
diff --git a/sc/source/core/tool/formulagroup.cxx b/sc/source/core/tool/formulagroup.cxx
index 705029b89f13..328e3c3b0083 100644
--- a/sc/source/core/tool/formulagroup.cxx
+++ b/sc/source/core/tool/formulagroup.cxx
@@ -523,10 +523,11 @@ FormulaGroupInterpreter *FormulaGroupInterpreter::getStatic()
if ( !msInstance )
{
+#if HAVE_FEATURE_OPENCL
const ScCalcConfig& rConfig = ScInterpreter::GetGlobalConfig();
if (officecfg::Office::Common::Misc::UseOpenCL::get())
switchOpenCLDevice(rConfig.maOpenCLDevice, rConfig.mbOpenCLAutoSelect, false);
-
+#endif
if ( !msInstance ) // software fallback
{
SAL_INFO("sc.formulagroup", "Create S/W interpreter");
diff --git a/sc/source/core/tool/formulaopt.cxx b/sc/source/core/tool/formulaopt.cxx
index b0f76c86b048..60378df03122 100644
--- a/sc/source/core/tool/formulaopt.cxx
+++ b/sc/source/core/tool/formulaopt.cxx
@@ -649,10 +649,11 @@ void ScFormulaCfg::Commit()
break;
}
}
+#if HAVE_FEATURE_OPENCL
if(bSetOpenCL)
sc::FormulaGroupInterpreter::switchOpenCLDevice(
GetCalcConfig().maOpenCLDevice, GetCalcConfig().mbOpenCLAutoSelect);
-
+#endif
PutProperties(aNames, aValues);
}
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index a4de29cad0d4..bf89e009ae94 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -2353,7 +2353,11 @@ void ScModelObj::enableAutomaticDeviceSelection(sal_Bool bForce)
ScFormulaOptions aOptions = SC_MOD()->GetFormulaOptions();
aOptions.SetCalcConfig(aConfig);
SC_MOD()->SetFormulaOptions(aOptions);
+#if !HAVE_FEATURE_OPENCL
+ (void) bForce;
+#else
sc::FormulaGroupInterpreter::switchOpenCLDevice(OUString(), true, bForce);
+#endif
}
void ScModelObj::disableAutomaticDeviceSelection()
@@ -2392,19 +2396,27 @@ void ScModelObj::selectOpenCLDevice( sal_Int32 nPlatform, sal_Int32 nDevice )
sal_Int32 ScModelObj::getPlatformID()
throw (uno::RuntimeException, std::exception)
{
+#if !HAVE_FEATURE_OPENCL
+ return -1;
+#else
sal_Int32 nPlatformId;
sal_Int32 nDeviceId;
sc::FormulaGroupInterpreter::getOpenCLDeviceInfo(nDeviceId, nPlatformId);
return nPlatformId;
+#endif
}
sal_Int32 ScModelObj::getDeviceID()
throw (uno::RuntimeException, std::exception)
{
+#if !HAVE_FEATURE_OPENCL
+ return -1;
+#else
sal_Int32 nPlatformId;
sal_Int32 nDeviceId;
sc::FormulaGroupInterpreter::getOpenCLDeviceInfo(nDeviceId, nPlatformId);
return nDeviceId;
+#endif
}
uno::Sequence< sheet::opencl::OpenCLPlatform > ScModelObj::getOpenCLPlatforms()