Back Midas Rome Roody Rootana
  Midas DAQ System  Not logged in ELOG logo
Entry  22 Sep 2025, Konstantin Olchanski, Info, switch midas to c++17 
    Reply  23 Sep 2025, Pavel Murat, Info, switch midas to c++17 
       Reply  23 Sep 2025, Konstantin Olchanski, Info, switch midas to c++17 
          Reply  23 Sep 2025, Pavel Murat, Info, switch midas to c++17 
    Reply  06 Nov 2025, Konstantin Olchanski, Info, switch midas to c++17 
       Reply  20 Nov 2025, Konstantin Olchanski, Info, switch midas to c++17 
          Reply  20 Nov 2025, Nick Hastings, Info, switch midas to c++17 
          Reply  24 Nov 2025, Stefan Ritt, Info, switch midas to c++17 
Message ID: 3133     Entry time: 24 Nov 2025     In reply to: 3125
Author: Stefan Ritt 
Topic: Info 
Subject: switch midas to c++17 
> > > Following discussions at the MIDAS workshop, we propose to move MIDAS from c++11 to c++17.
> > We shall move forward with this change.
> 
> It is done. Last c++11 MIDAS is midas-2025-11-a (plus the db_delete_key merge).
> 
> I notice the cmake does not actually pass "-std=c++17" to the c++ compiler, and on U-20, it is likely 
> the default c++14 is used. cmake always does the wrong thing and this will need to be fixed later.
> 
> K.O.

We should either use 

set(CMAKE_CSS_STANDARD 17)

or

target_compile_features(<target> PUBLIC cxx_std_17)

but not mix both. We have already the second one for the midas library, like 

target_compile_features(objlib PUBLIC cxx_std_17)

which correctly causes a

c++ -std=gnu++17 ...

(at leas in my case).

If the compiler flag is missing for a target, we should add the target_compile_feature above for that target.

Stefan
ELOG V3.1.4-2e1708b5