修复CMakeLists.txt中的MSVC支持检查,并调整代码格式
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user