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