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:
parent
e2bcdaf7db
commit
a6db410278
1 changed files with 11 additions and 0 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Reference in a new issue