Skip to content

Conversation

@Anglebase
Copy link
Contributor

@Anglebase Anglebase commented Jul 27, 2025

包含更改

重构(目录结构更改)

  • 文件夹demo被重命名为examples
  • tests目录内容与tests/tests目录内容交换
  • 文件夹include被重命名为export
  • src文件夹下头文件与源文件分离,头文件复制到新建include文件夹下

以上修改均已修改对应的CMakeLists.txt文件,且已测试构建

文件更改

  • .gitignore添加/target忽略Cup的构建目录
  • export/ege.hsrc/compress.cppsrc/image.cpp添加条件编译以兼容Cup构建
  • tests/putimage_alphablend_comprehensive_test.cpp添加NOMINMAX宏屏蔽<Windows.h>中的minmax宏定义
  • 添加Cup配置文件cup.toml

未对脚本内容进行任何更改

Cup 包发行过程说明

Cup 通过检索仓库的发行版标签来获取发行版并安装到本地,发行时建议创意一个专门用于发行的分支(例如publish-vX.Y.Z),并清理发行非必要的文件(例如文档),然后通过该分支创建一个发行版标签,Cup要求发行版标签必须为vX.Y.Z的形式

Bug反馈

在本地构建xege时(未做更改,CMake, Visual Studio 17 2022)原demo目录下的源文件构建不出可执行文件(使用Cup测试构建时可以正常构建出可执行文件),我也并没有发现 CMake 代码有什么Bug

Summary by CodeRabbit

  • 新功能

    • 新增 cup.toml 配置文件,支持项目构建配置与依赖管理。
    • 新增 tests/tests/CMakeLists.txt,完善测试用例的构建与注册流程。
  • 修复与优化

    • .gitignore 现已忽略 /target 目录。
    • CMake 构建脚本调整,优化 include 目录和示例路径。
    • 条件化第三方库头文件的包含方式,提升不同构建环境下的兼容性。
    • 修正资源文件末尾多余空格。
  • 样式与配置

    • 扩展 .vscode/settings.json 的文件关联,支持更多 C++ 标准头文件及 *.temp 文件。
  • 测试

    • 测试源码 include 路径优化,移除相对路径前缀,提升可维护性。
    • 测试构建配置重构,采用子目录管理方式,简化主 CMakeLists.txt。
  • 重构

    • 统一库链接名称选择逻辑,便于区分不同构建模式下的链接库。

@coderabbitai
Copy link

coderabbitai bot commented Jul 27, 2025

Walkthrough

本次变更涉及构建系统、测试配置、头文件引用、条件编译和编辑器设置的调整。主要内容包括:新增和调整 CMake/CUP 配置文件、条件包含库头文件、标准化测试头文件引用方式、扩展 VSCode C++ 头文件关联、以及 .gitignore 文件的更新。未涉及导出或公共实体声明的更改。

Changes

文件/路径 变更摘要
.gitignore 新增 /target 目录到忽略列表
.vscode/settings.json 大幅扩展 C++ 头文件关联,新增 *.temp 关联为 plaintext
CMakeLists.txt xege 静态库 include 路径由 include 改为 export,demo 改为 examples
cup.toml 新增 CUP 构建配置文件,声明依赖、构建宏、测试与示例配置
examples/egelogo.rc 删除行尾多余空格
export/ege.h 增加条件宏 _LINK_NAME,根据 CUP_BUILD 切换链接库名
src/CMakeLists.txt xege 目标新增私有 include 路径 ${PROJECT_SOURCE_DIR}/include
src/compress.cpp, src/image.cpp zlib/png 头文件根据 CUP_BUILD 宏条件选择本地或系统路径
tests/CMakeLists.txt 删除原测试配置,改为 add_subdirectory(tests)
tests/tests/CMakeLists.txt 新增测试子目录 CMake 配置,定义测试库与各测试可执行文件
tests/putimage_*.cpp 头文件引用由相对路径改为直接引用;部分文件加 NOMINMAX

Sequence Diagram(s)

sequenceDiagram
    participant 开发者
    participant CMake
    participant xege
    participant test_framework
    participant 测试可执行文件

    开发者->>CMake: 配置项目(包含 CUP/新 include 路径/子目录)
    CMake->>xege: 构建 xege 静态库(按条件包含头文件/链接库)
    CMake->>test_framework: 构建测试框架静态库
    CMake->>测试可执行文件: 构建各测试用例,链接 xege 和 test_framework
    测试可执行文件->>xege: 运行测试时调用
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15–20 minutes

Possibly related PRs

Suggested labels

enhancement

Poem

小兔子挥动爪,
构建脚本悄然加;
测试路径更清晰,
条件宏把库切换;
VSCode 头文件齐,
一路跳跃无阻碍!
🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (13)
.gitignore (1)

16-17: 新增 /target 忽略项 OK,但可统一书写风格
现有规则中既有 build/(无前导 /),也有 /out/target(有前导 /)。前导 / 会将规则限定在仓库根目录;若将来某些子目录中也出现 target/,可能无法被忽略。保持同一写法能避免歧义。

建议:

-/out
-/target
+out/
+target/
src/compress.cpp (1)

2-6: 硬编码 "zlib/zlib.h" 路径可读性一般,可考虑统一包含方式
若 Cup 后续将 zlib 目录放到 include path 中,则仍可直接 #include <zlib.h>,避免显式写层级;或者在 cup.toml 中暴露 ZLIB_INCLUDE_DIR 宏来减少魔法字符串。当前实现没问题,只是可读性稍差。

示例改动:

-#ifdef CUP_BUILD
-#include "zlib/zlib.h"
-#else
-#include <zlib.h>
-#endif
+#if defined(CUP_BUILD)
+#  include <zlib.h>            // Cup 已将 vendor/zlib 目录加入 includePath
+#else
+#  include <zlib.h>
+#endif
.vscode/settings.json (1)

3-80: 建议:用通配符精简对标准库头文件的语言映射

一次性枚举数十个标准/内部头文件不仅维护成本高,也容易遗漏或与未来新标准头脱节。VS Code 支持 glob pattern,例如:

"files.associations": {
  "*.temp": "plaintext",
  "**/{algorithm,atomic,bitset,*.h,*stddef*,*.stdint*,*.cxx}": "cpp"
}

这样既覆盖常见 STL 头,又保持配置轻量。请评估是否可以用更通用的规则替代逐个列举。

tests/putimage_rotate_test.cpp (1)

6-8: 保持头文件次序以减少隐式依赖

performance_timer.h 里可能依赖 test_framework.h 对宏定义或别名的声明,当前顺序为:

#include "test_framework.h"
#include "performance_timer.h"
#include "image_generator.h"

若文件间无相互依赖,可忽略;若存在,请保持被依赖文件在前。留意未来修改导致的顺序敏感问题。

src/CMakeLists.txt (1)

7-9: 新增 include/ 私有搜索路径合理,但建议注明目的

此处给 xege 添加 PRIVATE ${PROJECT_SOURCE_DIR}/include

  1. 目的应是供 src 内部 .cpp 引用拆分出的公共头。最好在注释中说明“此目录仅供库内部使用,外部请使用 export/”。
  2. 若未来 include/ 中也有被外部项目引用的头文件,应改为 PUBLIC 而非 PRIVATE。请根据实际需求确认。
tests/putimage_alphablend_comprehensive_test.cpp (1)

30-34: 局部定义 NOMINMAX → 建议统一在 CMake 层设置

当前只有本文件显式 #define NOMINMAX,其余测试依赖 CMake 的全局 add_compile_definitions(NOMINMAX)
为避免双重定义或遗漏,建议删除此处宏定义并完全依赖 CMake 统一设置,或反之。示例 diff:

-#define NOMINMAX 1
src/image.cpp (1)

25-29: 建议校验 Cup 模式下 libpng 头文件路径是否可解析

加入条件编译后,Cup 构建时改为 #include "libpng/png.h"。请确认:

  1. cup.toml / CMake 在 Cup 模式下已把 libpnginclude 目录(而不是其父目录)加入 include_directories,否则可能出现找不到头文件的编译错误。
  2. 二方包升级或切换到系统编译时,CUP_BUILD 宏状态与 include 路径保持一致,避免混用导致 ODR 或 ABI 冲突。
  3. 其余源文件对 libpng 的引用方式保持一致,便于后续维护。

如路径需调整,可考虑改为仅 #include <png.h> 并在 Cup 模式通过 include_directories 指向 libpng 根目录,减少硬编码路径。

cup.toml (2)

28-36: VS 编译选项遗漏了 /Zc:__cplusplus,与 CMake 配置不一致

tests/tests/CMakeLists.txt 中对 MSVC 目标统一添加了 /Zc:__cplusplus 以启用正确的 __cplusplus 值。
建议在 Cup 的 VS 生成器同样加入,保持行为一致:

 compile_options = ["/utf-8", "/Zc:__cplusplus"]

37-58: link_libs 列表出现重复,可通过 table 继承减少维护成本

"MinGW Makefiles""Ninja" 两个生成器的 link_libs 完全一致,若后续需要增删库,需要两处同步修改。
可考虑抽取为自定义 profile 或通过 generator."*" 通配减少重复。

tests/tests/CMakeLists.txt (4)

5-8: 全局 add_definitions 会污染所有目标

最好改用 target_compile_definitions,只作用于需要的 target,避免库用户意外继承:

target_compile_definitions(test_framework PUBLIC SHOW_CONSOLE=1 EGE_GRAPH_NO_LIB NOMINMAX)

10-19: 系统库列表在每个可执行 target 重复链接,可抽象以降低重复

可封装函数或使用 target_link_libraries(<exe> PRIVATE ${COMMON_LINK_LIBS})
重复代码越多,后续修改(如新增 d2d1)就越容易遗漏。


31-35: test_framework 静态库本身无需链接系统库

该库只暴露工具函数/类,不直接调用 Windows API,把系统库链接到最终可执行程序即可,能减少不必要的依赖传递。


45-114: 多个可执行目标的重复 CMake 逻辑可用宏简化

目前 add_executable + target_link_libraries 六次复制粘贴,不易维护。
示例重构:

function(add_putimage_test name)
    add_executable(${name} ../${name}.cpp)
    target_link_libraries(${name} PRIVATE test_framework xege ${SYSTEM_LIBS})
    set_target_properties(${name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
    add_test(NAME ${name} COMMAND ${name})
endfunction()

foreach(t IN ITEMS performance basic alphablend transparent rotate comparison alphablend_comprehensive)
    add_putimage_test(putimage_${t}_test)
endforeach()
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 02f6075 and a3a27de.

⛔ Files ignored due to path filters (2)
  • examples/getimage.jpg is excluded by !**/*.jpg
  • examples/getimage.png is excluded by !**/*.png
📒 Files selected for processing (18)
  • .gitignore (1 hunks)
  • .vscode/settings.json (2 hunks)
  • CMakeLists.txt (2 hunks)
  • cup.toml (1 hunks)
  • examples/egelogo.rc (1 hunks)
  • export/ege.h (1 hunks)
  • src/CMakeLists.txt (1 hunks)
  • src/compress.cpp (1 hunks)
  • src/image.cpp (1 hunks)
  • tests/CMakeLists.txt (1 hunks)
  • tests/putimage_alphablend_comprehensive_test.cpp (1 hunks)
  • tests/putimage_alphablend_test.cpp (1 hunks)
  • tests/putimage_basic_test.cpp (1 hunks)
  • tests/putimage_comparison_test.cpp (1 hunks)
  • tests/putimage_performance_test.cpp (1 hunks)
  • tests/putimage_rotate_test.cpp (1 hunks)
  • tests/putimage_transparent_test.cpp (1 hunks)
  • tests/tests/CMakeLists.txt (1 hunks)
🔇 Additional comments (14)
examples/egelogo.rc (1)

1-1: 仅去除尾部空格,变更无风险
资源路径保持不变,编译行为不受影响。

export/ege.h (2)

48-52: 条件编译实现良好

这段代码很好地实现了基于构建系统的条件库链接。通过 CUP_BUILD 宏来控制链接不同的库文件,为 Cup 构建工具提供了支持,同时保持了向后兼容性。宏定义清晰,逻辑简单易懂。


58-60: pragma 指令使用正确

正确地将硬编码的库名称替换为 _LINK_NAME 宏,实现了条件库链接的目标。这种方式可以根据构建配置自动选择合适的库文件,既支持传统的 graphics.lib,也支持 Cup 构建系统的 xege.lib。

tests/putimage_alphablend_test.cpp (1)

11-13: 确认 CMake 是否已为 tests 目录添加 include_directories

相对路径前缀被去掉后,编译器只能从默认包含路径或 CMake target_include_directories 中找到 image_generator.h 等文件。请确认 tests/tests/CMakeLists.txt 中已添加:

target_include_directories(test_framework PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

否则在非 IDE 构建环境下可能出现“file not found”错误。

tests/putimage_transparent_test.cpp (1)

7-9: 同上:移除 “../” 后需要保证头文件搜索路径正确

如果 test_framework 静态库暴露的头文件不在默认搜索路径,请在 CMake 中通过 PUBLIC include 目录转出。否则跨目录引用时仍会失败。

tests/putimage_comparison_test.cpp (1)

10-12: 确认包含路径及统一风格

多数测试文件均迁移到同级包含路径,但仍有个别文件(如 putimage_basic_test.cpp)可能保留旧相对路径。建议统一,避免 IDE 与命令行行为不一致。

tests/putimage_performance_test.cpp (1)

10-12: ✔️ 头文件包含路径调整与新 CMake 布局保持一致

由相对路径改为直接文件名,配合 tests/tests/CMakeLists.txt 中的
target_include_directories(test_framework …) 已经能够解析到正确头文件;本段没有其它隐患。

CMakeLists.txt (2)

95-95: 公开头目录改为 export/ 与目录重构一致,👍

外部使用者只需包含 export,符合封装意图。无额外问题。


262-262: 同步示例目录名:demoexamples

名称变更已在文件系统中完成,CMake 调用保持一致;务必同时更新 CI 脚本或文档中的运行示例指令。

tests/putimage_basic_test.cpp (1)

7-9: 测试头文件路径统一 OK

修改与新的 target_include_directories(test_framework …) 相匹配,无功能风险。

tests/CMakeLists.txt (1)

1-1: 单行委托构建配置简洁有效

add_subdirectory(tests) 将测试构建逻辑下沉,符合目录置换后的层级,且降低了顶层 CMakeLists 的复杂度。👍

cup.toml (2)

10-12: jobs = 0 的语义可能导致串行编译,请确认

在 Cup 的语法中,jobs = 0 有的实现会被解释为 使用 1 个 job,而不是 使用全部 CPU
请确认 Cup 对 0 的解释是否符合预期,否则 CI/本地构建都可能退化为单线程。


16-24: [tests] 中仅列出工具源码,未包含真正的测试用例

tests/tests/*.cpp 目录下还有 putimage_*_test.cpp 等文件,这些才是最终的可执行测试。
Cup 在生成 test target 时只会编译 sources 数组,当前配置会导致测试目标缺失。
请补充或使用通配符:

sources = ["tests/tests/*.cpp"]
tests/tests/CMakeLists.txt (1)

37-42: /source-charset:utf-8 仅在 VS2019+ 支持,旧版本编译器会报错

虽然工程主要面向 VS2022,但既然还保留了 VS2015/2017 的生成器,建议条件判断版本:

if (MSVC_VERSION GREATER_EQUAL 1920)  # VS2019+
    target_compile_options(test_framework PUBLIC /source-charset:utf-8)
endif()

Comment on lines +13 to +15
[dependencies]
libpng = { url = "@Anglebase/libpng", version = "0.1.0" }

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

缺少 zlib 依赖会导致 libpng 连接失败

源代码中 src/compress.cpp / src/image.cpp 明确包含/调用 zlib 接口,但此处仅声明了 libpng
大多数二进制/源码包的 libpng 并不会自动拉取 zlib,结果是链接阶段找不到 compressBound 等符号。
建议显式声明:

 [dependencies]
 libpng = { url = "@Anglebase/libpng", version = "0.1.0" }
+zlib   = { url = "@Anglebase/zlib",  version = "0.1.0" }
🤖 Prompt for AI Agents
In cup.toml around lines 13 to 15, the dependency declaration includes libpng
but is missing the required zlib dependency, which causes linking failures due
to unresolved zlib symbols. Add an explicit zlib dependency alongside libpng in
the dependencies section to ensure proper linking and avoid missing symbols like
compressBound.

Comment on lines +2 to +3
include_directories(../include)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

使用相对路径包含 ../include 易在目录结构调整时失效

应改为项目根路径,避免测试子目录被移动/重命名后找不到头文件:

-include_directories(../include)
+include_directories(${PROJECT_SOURCE_DIR}/include)
🤖 Prompt for AI Agents
In tests/tests/CMakeLists.txt at lines 2 to 3, the include_directories uses a
relative path '../include' which can break if the directory structure changes.
Replace the relative path with an absolute path based on the project root
directory to ensure the include path remains valid even if the tests
subdirectory is moved or renamed.

@wysaid
Copy link
Collaborator

wysaid commented Aug 1, 2025

有冲突呀, @Anglebase 有没有时间解决一下冲突, 然后就可以考虑合入了~

@wysaid
Copy link
Collaborator

wysaid commented Aug 1, 2025

看了下修改的目录结构, 感觉这种实现方式不太好, 强制要求根目录有一个 export 目录。
是否可以增加一些配置, 比如可以自己指定 export 目录?
这个 export 目录是否可以动态生成?
比如说允许一开始不存在, 然后我自己编写脚本, 在执行构建的时候生成这个目录?

总之就是这种集成方式影响项目本身结构了, 侵入性太强了...

@wysaid wysaid requested a review from Copilot August 1, 2025 10:45
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adapts the project structure and build configuration to support the Cup build tool, implementing directory restructuring and conditional compilation.

  • Restructures directories: demoexamples, separates headers/sources, and reorganizes test structure
  • Adds conditional compilation support for Cup build system using CUP_BUILD preprocessor flag
  • Introduces Cup configuration file and updates CMake build scripts to support both build systems

Reviewed Changes

Copilot reviewed 16 out of 101 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/tests/CMakeLists.txt New CMake configuration for reorganized test structure with complete build setup
tests/*.cpp Updates include paths from relative ../ to direct includes for reorganized structure
tests/CMakeLists.txt Simplified to delegate to subdirectory build configuration
src/image.cpp Adds conditional libpng include path for Cup builds
src/compress.cpp Adds conditional zlib include path for Cup builds
src/CMakeLists.txt Adds include directory for project headers
export/ege.h Implements conditional library linking logic for different build systems
cup.toml New Cup build tool configuration file
CMakeLists.txt Updates include paths and example directory references
.vscode/settings.json Extends file associations for development environment

@@ -0,0 +1,137 @@
# 包含EGE头文件目录
include_directories(../include)
Copy link

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using include_directories() is deprecated. Use target_include_directories() with specific scope (PUBLIC/PRIVATE/INTERFACE) instead to avoid polluting the global include namespace.

Suggested change
include_directories(../include)
# Include directories for specific targets

Copilot uses AI. Check for mistakes.
Comment on lines +5 to +7
add_definitions(-DSHOW_CONSOLE=1)
add_definitions(-DEGE_GRAPH_NO_LIB)
add_definitions(-DNOMINMAX)
Copy link

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using add_definitions() is deprecated. Use target_compile_definitions() with specific scope instead to avoid polluting the global compile definitions.

Suggested change
add_definitions(-DSHOW_CONSOLE=1)
add_definitions(-DEGE_GRAPH_NO_LIB)
add_definitions(-DNOMINMAX)
target_compile_definitions(test_framework PUBLIC -DSHOW_CONSOLE=1)
target_compile_definitions(test_framework PUBLIC -DEGE_GRAPH_NO_LIB)
target_compile_definitions(test_framework PUBLIC -DNOMINMAX)

Copilot uses AI. Check for mistakes.
Comment on lines +5 to +7
add_definitions(-DSHOW_CONSOLE=1)
add_definitions(-DEGE_GRAPH_NO_LIB)
add_definitions(-DNOMINMAX)
Copy link

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using add_definitions() is deprecated. Use target_compile_definitions() with specific scope instead to avoid polluting the global compile definitions.

Suggested change
add_definitions(-DSHOW_CONSOLE=1)
add_definitions(-DEGE_GRAPH_NO_LIB)
add_definitions(-DNOMINMAX)
target_compile_definitions(test_framework PUBLIC -DSHOW_CONSOLE=1 -DEGE_GRAPH_NO_LIB -DNOMINMAX)
target_compile_definitions(putimage_performance_test PUBLIC -DSHOW_CONSOLE=1 -DEGE_GRAPH_NO_LIB -DNOMINMAX)

Copilot uses AI. Check for mistakes.
Comment on lines +5 to +7
add_definitions(-DSHOW_CONSOLE=1)
add_definitions(-DEGE_GRAPH_NO_LIB)
add_definitions(-DNOMINMAX)
Copy link

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using add_definitions() is deprecated. Use target_compile_definitions() with specific scope instead to avoid polluting the global compile definitions.

Suggested change
add_definitions(-DSHOW_CONSOLE=1)
add_definitions(-DEGE_GRAPH_NO_LIB)
add_definitions(-DNOMINMAX)
target_compile_definitions(test_framework PUBLIC -DSHOW_CONSOLE=1)
target_compile_definitions(test_framework PUBLIC -DEGE_GRAPH_NO_LIB)
target_compile_definitions(test_framework PUBLIC -DNOMINMAX)

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants