Windows defender blocked a exe when configuring

My windows defender suddenly said it blocked a threat when configuring a cmake list, I have used this cmake list for a while and this has not happened before, should I ignore it?

Cmake version: 3.23.1

Here’s the threat

Here’s the cmake list

cmake_minimum_required(VERSION 3.21)
set(PROJECT_NAME Game)
project(${PROJECT_NAME} VERSION 1.0.0 LANGUAGES CXX)

# Default to release builds
if(NOT CMAKE_BUILD_TYPE)
   set(CMAKE_BUILD_TYPE Release)
endif()

file(GLOB_RECURSE source_files
   src/**.cpp
   src/**.hpp
   src/**.c
   src/**.h
)

file(GLOB_RECURSE lib_files
   lib/**.a
)

set(SOURCES ${source_files})
set(CMAKE_CXX_STANDARD 17)

add_executable(${PROJECT_NAME} ${SOURCES})
target_include_directories(${PROJECT_NAME} PRIVATE "include" "lib" "res" "src")
target_link_libraries(${PROJECT_NAME}
   ${lib_files}
   opengl32 
)

if (UNIX)
   target_link_libraries(${PROJECT_NAME} pthread)
endif (UNIX)

# Copy data dir to the binary directory
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/res" DESTINATION ${CMAKE_CURRENT_BINARY_DIR})

if(MSVC)
   foreach(lib ${SFML_LIBS})
      get_target_property(lib_path ${lib} LOCATION)
      file(COPY ${lib_path} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
   endforeach()
endif(MSVC)

That is a try_compile executable. Given the example code, it is probably the compiler detection binary. Finding out why it thinks it is a problem would be nice. You can preserve the try_compile bits by configuring with the --debug-trycompile flag.

Same here, see e.g. CRAN Package Check Results for Package rswipl

(the R package uses cmake)

The install log is found here:
https://www.r-project.org/nosvn/R.check/r-devel-windows-x86_64/rswipl-00install.txt

In the CRAN install log, it appears that it isn’t the generation of the try_compile() executable that is failing, but rather copying that executable (I don’t know why we need to copy it).

Defender does not like the “input file” of the copy command, so it’s not copying per se, it’s indeed the exe file that was generated.

For now, my workaround is to add a SET(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) because I do not need the executable.