Skip to content

Commit

Permalink
Disable warnings-as-errors for release branches (dotnet#33664)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkotas authored Mar 18, 2020
1 parent 63c192d commit ef71836
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<LicenseFile>$(RepoRoot)LICENSE.TXT</LicenseFile>

<!-- Indicates this is not an officially supported release. Release branches should set this to false. -->
<!-- Keep it in sync with PRERELEASE in clrdefinitions.cmake -->
<!-- Keep it in sync with PRERELEASE in eng/native/configureplatform.cmake -->
<IsPrerelease>true</IsPrerelease>

<!-- Experimental packages should not be stable -->
Expand Down
4 changes: 4 additions & 0 deletions eng/native/configureplatform.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
include(CheckPIESupported)
include(${CMAKE_CURRENT_LIST_DIR}/functions.cmake)

# If set, indicates that this is not an officially supported release
# Keep in sync with IsPrerelease in Directory.Build.props
set(PRERELEASE 1)

#----------------------------------------
# Detect and set platform variable names
# - for non-windows build platform & architecture is detected using inbuilt CMAKE variables and cross target component configure
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ if(CORECLR_SET_RPATH)
endif(CORECLR_SET_RPATH)

OPTION(CLR_CMAKE_ENABLE_CODE_COVERAGE "Enable code coverage" OFF)
OPTION(CLR_CMAKE_WARNINGS_ARE_ERRORS "Warnings are errors" ON)

# Ensure other tools are present
if (CLR_CMAKE_HOST_WIN32)
Expand Down
6 changes: 0 additions & 6 deletions src/coreclr/build-runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,6 @@ build_cross_architecture_components()
handle_arguments_local() {
case "$1" in

ignorewarnings|-ignorewarnings)
__IgnoreWarnings=1
__CMakeArgs="-DCLR_CMAKE_WARNINGS_ARE_ERRORS=OFF $__CMakeArgs"
;;

nopgooptimize|-nopgooptimize)
__PgoOptimize=0
__SkipRestoreOptData=1
Expand Down Expand Up @@ -149,7 +144,6 @@ __RepoRootDir="$(cd "$__ProjectRoot"/../..; pwd -P)"
__BuildArch=
__BuildType=Debug
__CodeCoverage=0
__IgnoreWarnings=0

# Set the various build properties here so that CMake and MSBuild can pick them up
__Compiler=clang
Expand Down
4 changes: 0 additions & 4 deletions src/coreclr/clrdefinitions.cmake
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
include(clrfeatures.cmake)

# If set, indicates that this is not an officially supported release
# Keep in sync with IsPrerelease in dir.props
set(PRERELEASE 1)

# Features we're currently flighting, but don't intend to ship in officially supported releases
if (PRERELEASE)
add_definitions(-DFEATURE_UTF8STRING)
Expand Down
6 changes: 3 additions & 3 deletions src/coreclr/configurecompiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,10 @@ if (CLR_CMAKE_HOST_UNIX)
endif()
endif(CLR_CMAKE_HOST_DARWIN)

if (CLR_CMAKE_WARNINGS_ARE_ERRORS)
# All warnings that are not explicitly disabled are reported as errors
# Suppress warnings-as-errors in release branches to reduce servicing churn
if (PRERELEASE)
add_compile_options(-Werror)
endif(CLR_CMAKE_WARNINGS_ARE_ERRORS)
endif(PRERELEASE)

# Disabled common warnings
add_compile_options(-Wno-unused-variable)
Expand Down
4 changes: 4 additions & 0 deletions src/coreclr/tests/src/Interop/PInvoke/Generics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ elseif(CLR_CMAKE_TARGET_ARCH_ARM64)
add_definitions(-DTARGET_ARM64)
add_definitions(-DTARGET_ARMARCH)
endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# The ABI for passing parameters with 32-byte alignment has changed in GCC 4.6
add_compile_options(-Wno-psabi)
endif()
set(SOURCES
GenericsNative.IUnknown.cpp
GenericsNative.NullableB.cpp
Expand Down
5 changes: 4 additions & 1 deletion src/installer/settings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ else()
# compiling with -std=c++11.
# add_compile_options(-Weverything)
endif()
add_compile_options(-Werror)
# Suppress warnings-as-errors in release branches to reduce servicing churn
if (PRERELEASE)
add_compile_options(-Werror)
endif()
add_compile_options(-Wno-missing-field-initializers)
add_compile_options(-Wno-unused-function)
add_compile_options(-Wno-unused-local-typedef)
Expand Down
6 changes: 5 additions & 1 deletion src/libraries/Native/Unix/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ if(CMAKE_C_COMPILER_ID STREQUAL Clang)
add_compile_options(-Wthread-safety)
add_compile_options(-Wno-thread-safety-analysis)
endif()
add_compile_options(-Werror)

# Suppress warnings-as-errors in release branches to reduce servicing churn
if (PRERELEASE)
add_compile_options(-Werror)
endif()

if(CLR_CMAKE_TARGET_ARCH_WASM)
add_definitions(-D_WASM_)
Expand Down

0 comments on commit ef71836

Please sign in to comment.