<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hello,<br><div><div><br></div><div> I'm trying to use other programs to get some info about the cpu and pass it to c++ during compilation. What I'm trying to do looks like this:</div></div><div><br></div><div><div>if($cxx.target.class == 'linux')</div><div>{</div><div>  obj{*}:</div><div>  {</div><div>    cxx.poptions += -DL1_SIZE=`/bin/getconf LEVEL1_DCACHE_SIZE`</div><div>    cxx.poptions += -DL2_SIZE=`/bin/getconf LEVEL2_CACHE_SIZE`</div><div>    cxx.poptions += -DL3_SIZE=`/bin/getconf LEVEL3_CACHE_SIZE`</div><div>    cxx.poptions += -DL4_SIZE=`/bin/getconf LEVEL4_CACHE_SIZE`</div><div>    ... </div><div>    # use some other linux program to get extra cpu information</div><div>  }</div><div>}</div><div>elif($cxx.target.class == 'windows')</div><div>{</div><div>  # call windows programs to get cpu information </div><div>}</div></div><div><div>elif($cxx.target.class == 'macos')</div><div>{</div><div>  # call mac programs to get cpu  information</div><div>}</div></div><div>...</div><div><br></div><div>In this example, I want to call /bin/getfonf to get cpu cache sizes, probably I would need more information. In other OS's I would use other programs to get this same information.</div><div><br></div><div>Can I get the result of external commands inside a buildfile? If not, there is another approach to accomplish something similar?</div><div><br></div><div><br></div><div><br></div></div></div></div></div></div></div></div>