1
0
Fork 0
mirror of https://github.com/hermitcore/libhermit.git synced 2025-03-09 00:00:03 +01:00

add check for -fstrength-reduce & -finline-functions

This commit is contained in:
Stefan Lankes 2017-08-07 09:26:13 +02:00
parent e2bcdaf7db
commit a6db410278

View file

@ -19,6 +19,17 @@ target_compile_options(arch_x86_loader
PRIVATE -O2 -Wall -m64 -std=gnu99 -ffreestanding -mno-red-zone
-fomit-frame-pointer)
include(CheckCCompilerFlag)
check_c_compiler_flag(-fstrength-reduce HAS_STRENGTH_REDUCE)
if (HAS_STRENGTH_REDUCE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstrength-reduce")
endif()
check_c_compiler_flag(-finline-functions HAS_INLINE_FUNCTIONS)
if (HAS_INLINE_FUNCTIONS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -finline-functions")
endif()
target_link_libraries(arch_x86_loader
arch_x86_loader_asm
"-Wl,-T -Wl,${CMAKE_CURRENT_LIST_DIR}/link.ld"