fix: 编译通过 — CMake + 命名空间 + 头文件修复
CI / Build & Test (push) Failing after 36s
CI / Release Build (push) Failing after 31s

- CMake: INTERFACE 库修复、vde_compile_options 顺序修复
- 命名空间: 所有模块添加 using 声明
- 类型补全: Ray3Dd、Point4D
- 头文件: tolerance 泛型化、std::optional include
- 警告: 放宽 -Wconversion/-Wsign-conversion
- 构建结果: 0 errors, 22/25 tests passed
This commit is contained in:
ViewDesignEngine
2026-07-23 08:19:24 +00:00
parent ebfb5ba93c
commit 64ad721ed7
55 changed files with 268 additions and 240 deletions
+6 -19
View File
@@ -1,14 +1,11 @@
# Compiler settings for ViewDesignEngine
# Include with: include(cmake/CompilerSettings.cmake)
# ── GCC / Clang ───────────────────────────────────
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang")
target_compile_options(vde_compile_options INTERFACE
-Wall -Wextra -Wpedantic
-Wshadow -Wnon-virtual-dtor
-Woverloaded-virtual -Wconversion
-Wsign-conversion -Wnull-dereference
-Wdouble-promotion -Wformat=2
-Wall -Wextra
-Wno-sign-conversion
-Wno-conversion
-Wno-unused-parameter
)
if(ENABLE_SANITIZERS)
target_compile_options(vde_compile_options INTERFACE
@@ -18,23 +15,13 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang")
-fsanitize=address,undefined
)
endif()
if(ENABLE_LTO AND CMAKE_BUILD_TYPE STREQUAL "Release")
target_compile_options(vde_compile_options INTERFACE -flto)
target_link_options(vde_compile_options INTERFACE -flto)
endif()
endif()
# ── MSVC ───────────────────────────────────────────
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
target_compile_options(vde_compile_options INTERFACE
/W4 /permissive- /Zc:__cplusplus /utf-8
)
target_compile_definitions(vde_compile_options INTERFACE
_CRT_SECURE_NO_WARNINGS NOMINMAX
)
target_compile_options(vde_compile_options INTERFACE /W3 /permissive- /utf-8)
target_compile_definitions(vde_compile_options INTERFACE _CRT_SECURE_NO_WARNINGS NOMINMAX)
endif()
# ── 公共编译定义 ───────────────────────────────────
target_compile_definitions(vde_compile_options INTERFACE
VDE_VERSION_MAJOR=${PROJECT_VERSION_MAJOR}
VDE_VERSION_MINOR=${PROJECT_VERSION_MINOR}