Skip to content

Commit

Permalink
Avoid MSVC deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
thbeu committed Oct 28, 2023
1 parent 7faa065 commit d960806
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ install(EXPORT targets

# Initial boilerplate done, now build library and executables.

if(MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif(MSVC)

set(lib_SRC
shpopen.c
dbfopen.c
Expand All @@ -116,7 +120,7 @@ add_library(${PACKAGE} ${lib_SRC})
target_include_directories (${PACKAGE} INTERFACE
$<INSTALL_INTERFACE:include>)

if (NOT MSVC)
if(NOT MSVC)
target_compile_options(${PACKAGE} PRIVATE -Wall -Wextra -pedantic)
endif()

Expand Down Expand Up @@ -169,7 +173,7 @@ set(executables
shptreedump
)

if(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
if(MSVC)
# TODO(schwehr): How to test on Windows?
set(BUILD_TESTING OFF CACHE BOOL "")
else()
Expand Down

0 comments on commit d960806

Please sign in to comment.