Merge pull request #1016 from ffontaine/main

CMakeLists.txt: fix build without C++
This commit is contained in:
Stefan Rueger 2022-08-02 18:22:16 +01:00 committed by GitHub
commit 5e9be93100
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -21,7 +21,7 @@
# cmake --build build # cmake --build build
cmake_minimum_required(VERSION 3.12) cmake_minimum_required(VERSION 3.12)
project(avrdude VERSION 7.0) project(avrdude VERSION 7.0 LANGUAGES C)
set(CMAKE_C_STANDARD 11) set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED True) set(CMAKE_C_STANDARD_REQUIRED True)

View File

@ -56,6 +56,8 @@ if(WIN32)
endif() endif()
if(MSVC) if(MSVC)
enable_language(CXX)
add_compile_definitions(_CRT_SECURE_NO_WARNINGS=1) add_compile_definitions(_CRT_SECURE_NO_WARNINGS=1)
add_compile_definitions(_CRT_NONSTDC_NO_WARNINGS=1) add_compile_definitions(_CRT_NONSTDC_NO_WARNINGS=1)
add_compile_definitions(_WINSOCK_DEPRECATED_NO_WARNINGS=1) add_compile_definitions(_WINSOCK_DEPRECATED_NO_WARNINGS=1)