File tree Expand file tree Collapse file tree 3 files changed +4
-5
lines changed
Sources/_TestingInternals Expand file tree Collapse file tree 3 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -466,9 +466,6 @@ extension Array where Element == PackageDescription.CXXSetting {
466
466
467
467
. define( " SWT_NO_LEGACY_TEST_DISCOVERY " , . whenEmbedded( ) ) ,
468
468
. define( " SWT_NO_LIBDISPATCH " , . whenEmbedded( ) ) ,
469
-
470
- // OpenBSD's version of clang doesn't support __has_embed.
471
- . define( " SWT_TESTING_LIBRARY_VERSION " , to: " 0 " , . when( platforms: [ . openbsd] ) )
472
469
]
473
470
474
471
// Capture the testing library's commit info as C++ constants.
Original file line number Diff line number Diff line change 18
18
const char *swt_getTestingLibraryVersion (void ) {
19
19
#if defined(SWT_TESTING_LIBRARY_VERSION)
20
20
// The current environment explicitly specifies a version string to return.
21
+ // All CMake builds should take this path (see CompilerSettings.cmake.)
21
22
return SWT_TESTING_LIBRARY_VERSION;
22
23
#elif __clang_major__ >= 17 && defined(__has_embed)
23
24
#if __has_embed("../../VERSION.txt")
@@ -43,6 +44,9 @@ const char *swt_getTestingLibraryVersion(void) {
43
44
#warning SWT_TESTING_LIBRARY_VERSION not defined and VERSION.txt not found: testing library version is unavailable
44
45
return nullptr ;
45
46
#endif
47
+ #elif defined(__OpenBSD__)
48
+ // OpenBSD's version of clang doesn't support __has_embed or #embed.
49
+ return nullptr ;
46
50
#else
47
51
#warning SWT_TESTING_LIBRARY_VERSION not defined and could not read from VERSION.txt at compile time: testing library version is unavailable
48
52
return nullptr ;
Original file line number Diff line number Diff line change @@ -43,7 +43,5 @@ if(CMAKE_SYSTEM_NAME STREQUAL "WASI")
43
43
add_compile_definitions ("SWT_NO_PIPES" )
44
44
endif ()
45
45
46
- # Avoid using C23's #embed when building with CMake as OpenBSD and Amazon Linux
47
- # 2 are both using older clang versions that don't support it.
48
46
file (STRINGS "../VERSION.txt" SWT_TESTING_LIBRARY_VERSION LIMIT_COUNT 1)
49
47
add_compile_definitions ("$<$<COMPILE_LANGUAGE:CXX>:SWT_TESTING_LIBRARY_VERSION=\" ${SWT_TESTING_LIBRARY_VERSION} \" >" )
You can’t perform that action at this time.
0 commit comments