CMake: generator expressions split across arguments, and values re-exported with PARENT_SCOPE

Đang mở
#594 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
cmake, python
Lĩnh vực
build-system, tooling

Hướng nghiên cứu

Start in build_systems/cmake and find the code that parses generator expressions and reads CMAKE_CXX_FLAGS; inspect the existing CLI11 and cxxopts fixtures first. Reproduce the whitespace-split expression and function PARENT_SCOPE cases, then run the relevant CMake checks. Done means both fixtures credit -Werror and the warning flags.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Problem

  • CLI11: $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wall $<$<BOOL:..>:-Werror>>, a generator expression split across whitespace-separated arguments, isn't credited. The same text joined with ; is. CMake joins arguments with ; before evaluating, so the reader should too.
  • cxxopts: set(CMAKE_CXX_FLAGS "... -Werror") inside a function, then set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} PARENT_SCOPE), loses everything. A direct set(... PARENT_SCOPE) works.

Done when

Both fixtures credit -Werror and the warning flags, in build_systems/cmake.

Split from #487. Checked against main at 4b4dbb6c on 2026-12-03: the cases above were reproduced with small fixtures or found in the code.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt

Ngôn ngữ chính
Python
Star
4
Fork
1
Merge trung bình
6 giờ 31 phút
Pull request đã merge (30 ngày)
238

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của cpp-best-practices/project_validator

Tất cả issue của cpp-best-practices/project_validator

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.