Skip to content

Commit 74e9059

Browse files
authored
[Windows] fix: Remove quotes from compiler warning suppression (flutter#190873)
When want to compile a windows project via another build system, here ninja (e.g. to have native code completion), an error occurs which states: `cl : Command line error D8021 : invalid numeric argument '/wd"4100"'`. This is due to the fact, that quotes aren't supposed to be in the Compiler Warning Suppression flag: > /wdnnnn | Suppresses the compiler warning that is specified by nnnn. For example, /wd4326 suppresses compiler warning C4326. See: https://learn.microsoft.com/en-us/cpp/build/reference/compiler-option-warning-level?view=msvc-170#remarks And core developer of CMake discourages using quotes: https://gitlab.kitware.com/cmake/cmake/-/work_items/21396#note_854664 Fixes flutter#103728 Towards flutter#99584 *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].* ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [ ] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [ ] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. Regarding the tests: Support for CMake integration is still owing (see flutter#99584). Testing this natively would likely need to fix this issue, too. So one can just test this ATM by just comparing the template with the output, which I didn't see an explicit test for (I guess it's tested anyways somewhere by comparing when creating a new project `flutter create .` with the stored output files). Please point me to the location, if there's a better testing strategy for this. Regarding breaking change: I would not consider this as breaking change, although it has an influence on the user files. The compilation works the same before and after. It just plays a role for alternative compilation, which does not affect many people (besides developers for wanting debug native windows code). <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
1 parent 5149053 commit 74e9059

19 files changed

Lines changed: 19 additions & 19 deletions

File tree

‎dev/a11y_assessments/windows/CMakeLists.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ add_definitions(-DUNICODE -D_UNICODE)
3939
# of modifying this function.
4040
function(APPLY_STANDARD_SETTINGS TARGET)
4141
target_compile_features(${TARGET} PUBLIC cxx_std_17)
42-
target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100")
42+
target_compile_options(${TARGET} PRIVATE /W4 /WX /wd4100)
4343
target_compile_options(${TARGET} PRIVATE /EHsc)
4444
target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0")
4545
target_compile_definitions(${TARGET} PRIVATE "$<$<CONFIG:Debug>:_DEBUG>")

‎dev/benchmarks/complex_layout/windows/CMakeLists.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ add_definitions(-DUNICODE -D_UNICODE)
4343
# of modifying this function.
4444
function(APPLY_STANDARD_SETTINGS TARGET)
4545
target_compile_features(${TARGET} PUBLIC cxx_std_17)
46-
target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100")
46+
target_compile_options(${TARGET} PRIVATE /W4 /WX /wd4100)
4747
target_compile_options(${TARGET} PRIVATE /EHsc)
4848
target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0")
4949
target_compile_definitions(${TARGET} PRIVATE "$<$<CONFIG:Debug>:_DEBUG>")

‎dev/integration_tests/data_asset_app/windows/CMakeLists.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ add_definitions(-DUNICODE -D_UNICODE)
3939
# of modifying this function.
4040
function(APPLY_STANDARD_SETTINGS TARGET)
4141
target_compile_features(${TARGET} PUBLIC cxx_std_17)
42-
target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100")
42+
target_compile_options(${TARGET} PRIVATE /W4 /WX /wd4100)
4343
target_compile_options(${TARGET} PRIVATE /EHsc)
4444
target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0")
4545
target_compile_definitions(${TARGET} PRIVATE "$<$<CONFIG:Debug>:_DEBUG>")

‎dev/integration_tests/flavors/windows/CMakeLists.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ add_definitions(-DUNICODE -D_UNICODE)
3939
# of modifying this function.
4040
function(APPLY_STANDARD_SETTINGS TARGET)
4141
target_compile_features(${TARGET} PUBLIC cxx_std_17)
42-
target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100")
42+
target_compile_options(${TARGET} PRIVATE /W4 /WX /wd4100)
4343
target_compile_options(${TARGET} PRIVATE /EHsc)
4444
target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0")
4545
target_compile_definitions(${TARGET} PRIVATE "$<$<CONFIG:Debug>:_DEBUG>")

‎dev/integration_tests/flutter_gallery/windows/CMakeLists.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ add_definitions(-DUNICODE -D_UNICODE)
3232
# Compilation settings that should be applied to most targets.
3333
function(APPLY_STANDARD_SETTINGS TARGET)
3434
target_compile_features(${TARGET} PUBLIC cxx_std_17)
35-
target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100")
35+
target_compile_options(${TARGET} PRIVATE /W4 /WX /wd4100)
3636
target_compile_options(${TARGET} PRIVATE /EHsc)
3737
target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0")
3838
target_compile_definitions(${TARGET} PRIVATE "$<$<CONFIG:Debug>:_DEBUG>")

‎dev/integration_tests/record_use_test_app/windows/CMakeLists.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ add_definitions(-DUNICODE -D_UNICODE)
3939
# of modifying this function.
4040
function(APPLY_STANDARD_SETTINGS TARGET)
4141
target_compile_features(${TARGET} PUBLIC cxx_std_17)
42-
target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100")
42+
target_compile_options(${TARGET} PRIVATE /W4 /WX /wd4100)
4343
target_compile_options(${TARGET} PRIVATE /EHsc)
4444
target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0")
4545
target_compile_definitions(${TARGET} PRIVATE "$<$<CONFIG:Debug>:_DEBUG>")

‎dev/integration_tests/ui/windows/CMakeLists.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ add_definitions(-DUNICODE -D_UNICODE)
3939
# of modifying this function.
4040
function(APPLY_STANDARD_SETTINGS TARGET)
4141
target_compile_features(${TARGET} PUBLIC cxx_std_17)
42-
target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100")
42+
target_compile_options(${TARGET} PRIVATE /W4 /WX /wd4100)
4343
target_compile_options(${TARGET} PRIVATE /EHsc)
4444
target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0")
4545
target_compile_definitions(${TARGET} PRIVATE "$<$<CONFIG:Debug>:_DEBUG>")

‎dev/integration_tests/windowing_test/windows/CMakeLists.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ add_definitions(-DUNICODE -D_UNICODE)
3939
# of modifying this function.
4040
function(APPLY_STANDARD_SETTINGS TARGET)
4141
target_compile_features(${TARGET} PUBLIC cxx_std_17)
42-
target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100")
42+
target_compile_options(${TARGET} PRIVATE /W4 /WX /wd4100)
4343
target_compile_options(${TARGET} PRIVATE /EHsc)
4444
target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0")
4545
target_compile_definitions(${TARGET} PRIVATE "$<$<CONFIG:Debug>:_DEBUG>")

‎dev/integration_tests/windows_startup_test/windows/CMakeLists.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ add_definitions(-DUNICODE -D_UNICODE)
3939
# of modifying this function.
4040
function(APPLY_STANDARD_SETTINGS TARGET)
4141
target_compile_features(${TARGET} PUBLIC cxx_std_17)
42-
target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100")
42+
target_compile_options(${TARGET} PRIVATE /W4 /WX /wd4100)
4343
target_compile_options(${TARGET} PRIVATE /EHsc)
4444
target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0")
4545
target_compile_definitions(${TARGET} PRIVATE "$<$<CONFIG:Debug>:_DEBUG>")

‎dev/manual_tests/windows/CMakeLists.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ add_definitions(-DUNICODE -D_UNICODE)
3232
# Compilation settings that should be applied to most targets.
3333
function(APPLY_STANDARD_SETTINGS TARGET)
3434
target_compile_features(${TARGET} PUBLIC cxx_std_17)
35-
target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100")
35+
target_compile_options(${TARGET} PRIVATE /W4 /WX /wd4100)
3636
target_compile_options(${TARGET} PRIVATE /EHsc)
3737
target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0")
3838
target_compile_definitions(${TARGET} PRIVATE "$<$<CONFIG:Debug>:_DEBUG>")

0 commit comments

Comments
 (0)