Add -flto as link flag, also fix missing <string> include in main.cpp causing a build failure with gcc10
This commit is contained in:
parent
d3f14b7a8b
commit
5c5d280dd5
|
@ -22,6 +22,7 @@ endif()
|
||||||
|
|
||||||
if(ENABLE_LTO)
|
if(ENABLE_LTO)
|
||||||
add_compile_options(-O3 -flto)
|
add_compile_options(-O3 -flto)
|
||||||
|
add_link_options(-flto)
|
||||||
set(CMAKE_AR "gcc-ar")
|
set(CMAKE_AR "gcc-ar")
|
||||||
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> qcs <TARGET> <LINK_FLAGS> <OBJECTS>")
|
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> qcs <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||||
set(CMAKE_C_ARCHIVE_FINISH true)
|
set(CMAKE_C_ARCHIVE_FINISH true)
|
||||||
|
|
|
@ -65,7 +65,7 @@ macro(_handle_static)
|
||||||
OUTPUT ${_oname}
|
OUTPUT ${_oname}
|
||||||
DEPENDS ${_LIBUINAME}
|
DEPENDS ${_LIBUINAME}
|
||||||
COMMAND
|
COMMAND
|
||||||
ld -r --whole-archive ${_aname} -o ${_oname}
|
${CMAKE_LINKER} -r --whole-archive ${_aname} -o ${_oname}
|
||||||
COMMAND
|
COMMAND
|
||||||
objcopy --localize-hidden ${_oname}
|
objcopy --localize-hidden ${_oname}
|
||||||
COMMENT "Removing hidden symbols")
|
COMMENT "Removing hidden symbols")
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#ifndef __WIN32__
|
#ifndef __WIN32__
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
Loading…
Reference in New Issue