From 36ac9747d8abbf337d0967cca8e97bd5e4e51f15 Mon Sep 17 00:00:00 2001 From: Frank Gaede <frank.gaede@desy.de> Date: Wed, 29 Oct 2014 09:36:16 +0000 Subject: [PATCH] - fix nightly builds: avoid 'undefined reference' at link time for 'static const int' defined in gear header file --- DDRec/src/gear/createGearForILD.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/DDRec/src/gear/createGearForILD.cpp b/DDRec/src/gear/createGearForILD.cpp index 0b06802d9..c82bbf6d1 100644 --- a/DDRec/src/gear/createGearForILD.cpp +++ b/DDRec/src/gear/createGearForILD.cpp @@ -158,8 +158,12 @@ namespace DD4hep{ bool isDoubleSided = l.typeFlags[ DDRec::ZDiskPetalsStruct::SensorType::DoubleSided ] ; - int sensorType = ( l.typeFlags[ DDRec::ZDiskPetalsStruct::SensorType::Pixel ] ? - gear::FTDParameters::PIXEL : gear::FTDParameters::STRIP ) ; + + // avoid 'undefined reference' at link time ( if built w/o optimization ): + static const int PIXEL = gear::FTDParameters::PIXEL ; + static const int STRIP = gear::FTDParameters::STRIP ; + int sensorType = ( l.typeFlags[ DDRec::ZDiskPetalsStruct::SensorType::Pixel ] ? PIXEL : STRIP ) ; +// gear::FTDParameters::PIXEL : gear::FTDParameters::STRIP ) ; double zoffset = fabs( l.zOffsetSupport ) ; double signoffset = l.zOffsetSupport > 0 ? 1. : -1 ; -- GitLab