forked from cwtch.im/cwtch-ui
linux cmake fix for arm64 compiling
This commit is contained in:
parent
7741b255da
commit
899da5fea1
|
@ -40,12 +40,19 @@ endif()
|
|||
# default. In most cases, you should add new options to specific targets instead
|
||||
# of modifying this function.
|
||||
function(APPLY_STANDARD_SETTINGS TARGET)
|
||||
# Not ideal, there doesn't appear to be a way to get target arch so getting host arch. won't work for cross compiling
|
||||
execute_process(COMMAND uname -m OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE ARCH)
|
||||
target_compile_features(${TARGET} PUBLIC cxx_std_14)
|
||||
target_compile_options(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:-O3>")
|
||||
target_compile_definitions(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:NDEBUG>")
|
||||
# -Os -fno-ident (optimize for size, and strip idents, don't generate a build-id, fix hash style)
|
||||
target_compile_options(${TARGET} PRIVATE -Wall -Werror -Os -fno-ident)
|
||||
# on x86_64 use an included elf_x86_64.x for reproducibility. for other arches don't (and then don't be reproducible)
|
||||
if(${ARCH} STREQUAL "x86_64")
|
||||
target_link_libraries(${TARGET} PRIVATE -Qn -Os -Wl,-s,--hash-style=gnu,--build-id=none,--script=${PROJECT_BUILD_DIR}/../elf_x86_64.x)
|
||||
else()
|
||||
target_link_libraries(${TARGET} PRIVATE -Qn -Os -Wl,-s,--hash-style=gnu,--build-id=none)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Flutter library and tool build rules.
|
||||
|
|
Loading…
Reference in New Issue