diff --git a/Directory.Build.props b/Directory.Build.props index 0a7fdfdbdbb6a7..1b441f7f653871 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -69,7 +69,7 @@ $(RepoRoot)LICENSE.TXT - + true diff --git a/eng/native/configureplatform.cmake b/eng/native/configureplatform.cmake index ab48a342fe4467..4fccb81a0c714a 100644 --- a/eng/native/configureplatform.cmake +++ b/eng/native/configureplatform.cmake @@ -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 diff --git a/src/coreclr/CMakeLists.txt b/src/coreclr/CMakeLists.txt index 709b5754775d1d..0e75f4473640dd 100644 --- a/src/coreclr/CMakeLists.txt +++ b/src/coreclr/CMakeLists.txt @@ -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) diff --git a/src/coreclr/build-runtime.sh b/src/coreclr/build-runtime.sh index 0de4a51ce5f091..b22383cfaa7556 100755 --- a/src/coreclr/build-runtime.sh +++ b/src/coreclr/build-runtime.sh @@ -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 @@ -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 diff --git a/src/coreclr/clrdefinitions.cmake b/src/coreclr/clrdefinitions.cmake index 8ba4c0d66f981e..2ea61f45e3177a 100644 --- a/src/coreclr/clrdefinitions.cmake +++ b/src/coreclr/clrdefinitions.cmake @@ -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) diff --git a/src/coreclr/configurecompiler.cmake b/src/coreclr/configurecompiler.cmake index 792ea045f05086..c460aad3908e81 100644 --- a/src/coreclr/configurecompiler.cmake +++ b/src/coreclr/configurecompiler.cmake @@ -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) diff --git a/src/coreclr/tests/src/Interop/PInvoke/Generics/CMakeLists.txt b/src/coreclr/tests/src/Interop/PInvoke/Generics/CMakeLists.txt index 1aceaf5d91bfd5..ebb09a85e7b049 100644 --- a/src/coreclr/tests/src/Interop/PInvoke/Generics/CMakeLists.txt +++ b/src/coreclr/tests/src/Interop/PInvoke/Generics/CMakeLists.txt @@ -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 diff --git a/src/installer/settings.cmake b/src/installer/settings.cmake index 9bb9d81106e40a..c43bdbf4fc19ec 100644 --- a/src/installer/settings.cmake +++ b/src/installer/settings.cmake @@ -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) diff --git a/src/libraries/Native/Unix/CMakeLists.txt b/src/libraries/Native/Unix/CMakeLists.txt index d964b445e23cc8..f32da9d6563471 100644 --- a/src/libraries/Native/Unix/CMakeLists.txt +++ b/src/libraries/Native/Unix/CMakeLists.txt @@ -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_)