Add compiling flags for library and trace modes