From 45162bb934fdc82155ce19a672ba3dcc69ad1ff0 Mon Sep 17 00:00:00 2001 From: Jeffrey Hsu Date: Fri, 5 Dec 2025 23:10:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DCMakeLists.txt=E4=B8=AD?= =?UTF-8?q?=E7=9A=84MSVC=E6=94=AF=E6=8C=81=E6=A3=80=E6=9F=A5=EF=BC=8C?= =?UTF-8?q?=E5=B9=B6=E8=B0=83=E6=95=B4=E4=BB=A3=E7=A0=81=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0bd11c5..44dcda2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,10 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(GTEST_VERSION 1.17.0) enable_testing() +if (MSVC) + message(FATAL_ERROR "MSVC is not supported. Please use GCC or Clang.") +endif () + include_directories(include) include(FetchContent) @@ -74,10 +78,10 @@ set(EXECUTABLE_SOURCES "${CMAKE_SOURCE_DIR}/src/3110.c" ) -foreach(src_file IN LISTS EXECUTABLE_SOURCES) +foreach (src_file IN LISTS EXECUTABLE_SOURCES) get_filename_component(exe_name "${src_file}" NAME_WE) add_executable(${exe_name} ${src_file}) -endforeach() +endforeach () set(LIBRARY_SOURCES)