Skip to content

Commit 5f0572b

Browse files
authored
Update CompilerSettings.cmake
Always define SWT_TESTING_LIBRARY_VERSION in CMake
1 parent edde583 commit 5f0572b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

cmake/modules/shared/CompilerSettings.cmake

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ if(CMAKE_SYSTEM_NAME STREQUAL "WASI")
4242
add_compile_definitions("SWT_NO_DYNAMIC_LINKING")
4343
add_compile_definitions("SWT_NO_PIPES")
4444
endif()
45-
if(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
46-
file(STRINGS "../VERSION.txt" SWT_TESTING_LIBRARY_VERSION)
47-
add_compile_definitions("$<$<COMPILE_LANGUAGE:CXX>:SWT_TESTING_LIBRARY_VERSION=\"${SWT_TESTING_LIBRARY_VERSION}\">")
48-
endif()
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+
file(STRINGS "../VERSION.txt" SWT_TESTING_LIBRARY_VERSION LIMIT_COUNT 1)
49+
add_compile_definitions("$<$<COMPILE_LANGUAGE:CXX>:SWT_TESTING_LIBRARY_VERSION=\"${SWT_TESTING_LIBRARY_VERSION}\">")

0 commit comments

Comments
 (0)