Skip to content

Commit

Permalink
cmake: Fix compatibility with older versions
Browse files Browse the repository at this point in the history
  • Loading branch information
saprykin committed Apr 21, 2024
1 parent a102cf1 commit 8b8fd2f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License
#
# Copyright (C) 2018-2023 Alexander Saprykin <saprykin.spb@gmail.com>
# Copyright (C) 2018-2024 Alexander Saprykin <saprykin.spb@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
Expand Down Expand Up @@ -806,7 +806,7 @@ set (CMAKE_REQUIRED_LIBRARIES ${SAVED_CMAKE_REQUIRED_LIBRARIES})
set (SAVED_CMAKE_REQUIRED_FLAGS ${SAVED_CMAKE_REQUIRED_FLAGS})

# Disable useless warnings
if (MSVC OR CMAKE_C_SIMULATE_ID STREQUAL "MSVC")
if (PLIBSYS_C_COMPILER STREQUAL msvc OR CMAKE_C_SIMULATE_ID STREQUAL MSVC)
list (APPEND PLIBSYS_COMPILE_DEFS -D_CRT_SECURE_NO_WARNINGS)
list (APPEND PLIBSYS_COMPILE_DEFS -D_WINSOCK_DEPRECATED_NO_WARNINGS)
endif()
Expand Down
4 changes: 2 additions & 2 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License
#
# Copyright (C) 2018-2023 Alexander Saprykin <saprykin.spb@gmail.com>
# Copyright (C) 2018-2024 Alexander Saprykin <saprykin.spb@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
Expand Down Expand Up @@ -30,7 +30,7 @@ plibsys_detect_target_os (PLIBSYS_TESTS_TARGET_OS)
list (APPEND PLIBSYS_TEST_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/../src)
list (APPEND PLIBSYS_TEST_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/../src)

if (MSVC OR CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
if (MSVC OR CMAKE_CXX_SIMULATE_ID STREQUAL MSVC)
list (APPEND PLIBSYS_TEST_COMPILE_DEFS -D_CRT_SECURE_NO_WARNINGS)
endif()

Expand Down

0 comments on commit 8b8fd2f

Please sign in to comment.