Skip to content

Commit 742b305

Browse files
committed
Merge bitcoin/bitcoin#32491: build: document why we check for std::system
8f4ba90 build: document why we check for std::system (fanquake) Pull request description: It's probably debatable if we support targets like iOS, but for now, document why we are checking for this standard library feature. Trying to use `std::system` for a `aarch64-darwin-ios` target results in: ```bash test.cpp:7:10: error: 'system' is unavailable: not available on iOS 7 | std::system("some_command"); | ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_stdlib.h:203:6: note: 'system' has been explicitly marked unavailable here 203 | int system(const char *) __DARWIN_ALIAS_C(system); | ^ 1 error generated. ``` ACKs for top commit: Sjors: ACK 8f4ba90 Tree-SHA512: 219cac205b36004c607194f6956c2ce6153f192bd4349e505b52c4e511e403e195ce0f462ae10c515e67f1e95d4b1636d526c8e4376004044853b574a84df427
2 parents c521192 + 8f4ba90 commit 742b305

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cmake/introspection.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ endif()
1919
include(TestAppendRequiredLibraries)
2020
test_append_atomic_library(core_interface)
2121

22+
# Even though ::system is part of the standard library, we still check
23+
# for it, to support building targets that don't have it, such as iOS.
2224
check_cxx_symbol_exists(std::system "cstdlib" HAVE_STD_SYSTEM)
2325
check_cxx_symbol_exists(::_wsystem "stdlib.h" HAVE__WSYSTEM)
2426
if(HAVE_STD_SYSTEM OR HAVE__WSYSTEM)

0 commit comments

Comments
 (0)