Skip to content

Commit

Permalink
cmake: Fix detection of MSVC-like compilers
Browse files Browse the repository at this point in the history
  • Loading branch information
saprykin committed Apr 21, 2024
1 parent 8b8fd2f commit 2fd4254
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
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 (PLIBSYS_C_COMPILER STREQUAL msvc OR CMAKE_C_SIMULATE_ID STREQUAL MSVC)
if (PLIBSYS_C_COMPILER STREQUAL msvc OR "x${CMAKE_C_SIMULATE_ID}" STREQUAL xMSVC)
list (APPEND PLIBSYS_COMPILE_DEFS -D_CRT_SECURE_NO_WARNINGS)
list (APPEND PLIBSYS_COMPILE_DEFS -D_WINSOCK_DEPRECATED_NO_WARNINGS)
endif()
Expand Down
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
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 "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL xMSVC)
list (APPEND PLIBSYS_TEST_COMPILE_DEFS -D_CRT_SECURE_NO_WARNINGS)
endif()

Expand Down

0 comments on commit 2fd4254

Please sign in to comment.