Skip to content

Commit 8ba1434

Browse files
committed
build: ignore deprecation warnings on Windows
Adjust the compile flags for TSCBasic on Windows. Avoid the separate checks and addition of flags in favour of generator expressions.
1 parent ede125c commit 8ba1434

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Sources/TSCBasic/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ add_library(TSCBasic
4949
Thread.swift
5050
Tuple.swift
5151
misc.swift)
52+
target_compile_options(TSCBasic PUBLIC
53+
# Don't use GNU strerror_r on Android.
54+
"$<$<PLATFORM_ID:Android>:SHELL:-Xcc -U_GNU_SOURCE>"
55+
# Ignore secure function warnings on Windows.
56+
"$<$<PLATFORM_ID:Windows>:SHELL:-Xcc -D_CRT_SECURE_NO_WARNINGS>")
5257
target_link_libraries(TSCBasic PUBLIC
5358
TSCLibc)
5459
if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
@@ -67,9 +72,4 @@ install(TARGETS TSCBasic
6772
RUNTIME DESTINATION bin)
6873
endif()
6974

70-
# Don't use GNU strerror_r on Android.
71-
if(CMAKE_SYSTEM_NAME STREQUAL Android)
72-
target_compile_options(TSCBasic PUBLIC "SHELL:-Xcc -U_GNU_SOURCE")
73-
endif()
74-
7575
set_property(GLOBAL APPEND PROPERTY TSC_EXPORTS TSCBasic)

0 commit comments

Comments
 (0)