Skip to content

Commit debdd95

Browse files
committed
Simplify CMake configuration based on RFC feedback
1 parent c69f17e commit debdd95

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

libunwind/CMakeLists.txt

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ option(LIBUNWIND_USE_FRAME_HEADER_CACHE "Cache frame headers for unwinding. Requ
5555
option(LIBUNWIND_REMEMBER_HEAP_ALLOC "Use heap instead of the stack for .cfi_remember_state." OFF)
5656
option(LIBUNWIND_INSTALL_HEADERS "Install the libunwind headers." ON)
5757
option(LIBUNWIND_ENABLE_FRAME_APIS "Include libgcc-compatible frame apis." OFF)
58-
option(LIBUNWIND_EXECUTE_ONLY_CODE "Compile libunwind as execute-only." OFF)
5958

6059
set(LIBUNWIND_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}" CACHE STRING
6160
"Define suffix of library directory name (32/64)")
@@ -110,11 +109,6 @@ endif()
110109
option(LIBUNWIND_HIDE_SYMBOLS
111110
"Do not export any symbols from the static library." ${LIBUNWIND_DEFAULT_HIDE_SYMBOLS})
112111

113-
if (LIBUNWIND_EXECUTE_ONLY_CODE AND NOT LLVM_RUNTIMES_BUILD)
114-
message(SEND_ERROR "LIBUNWIND_EXECUTE_ONLY_CODE is only supported "
115-
"for runtimes build of libunwind.")
116-
endif()
117-
118112
# If toolchain is FPXX, we switch to FP64 to save the full FPRs. See:
119113
# https://web.archive.org/web/20180828210612/https://dmz-portal.mips.com/wiki/MIPS_O32_ABI_-_FR0_and_FR1_Interlinking
120114
check_symbol_exists(__mips_hard_float "" __MIPSHF)
@@ -336,15 +330,7 @@ if (C_SUPPORTS_COMMENT_LIB_PRAGMA)
336330
endif()
337331
endif()
338332

339-
if (LIBUNWIND_EXECUTE_ONLY_CODE)
340-
add_compile_flags_if_supported(-mexecute-only)
341-
if (NOT CXX_SUPPORTS_MEXECUTE_ONLY_FLAG)
342-
add_compile_flags_if_supported(-mpure-code)
343-
if (NOT CXX_SUPPORTS_MPURE_CODE_FLAG)
344-
message(SEND_ERROR
345-
"Compiler doesn't support -mexecute-only or -mpure-code option!")
346-
endif()
347-
endif()
333+
if (LLVM_EXECUTE_ONLY_CODE)
348334
add_compile_definitions(_LIBUNWIND_EXECUTE_ONLY_CODE)
349335
endif()
350336

0 commit comments

Comments
 (0)