X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=compileoptions.cmake;h=2221781d146f35304bcbf2666ba03eb08be8b091;hb=d424bb734ce61bc98d1cfab815c48c5ad1d01d5e;hp=9fcbb741d09e0ad798cb2da943d6ef22eb144b40;hpb=c2c1abcb71065dd530e0b38045547603c38d1e86;p=platform%2Fupstream%2Fcoreclr.git diff --git a/compileoptions.cmake b/compileoptions.cmake old mode 100644 new mode 100755 index 9fcbb74..2221781 --- a/compileoptions.cmake +++ b/compileoptions.cmake @@ -23,8 +23,10 @@ if (CLR_CMAKE_PLATFORM_UNIX) # after hitting just about 20 errors. add_compile_options(-ferror-limit=4096) - # All warnings that are not explicitly disabled are reported as errors - add_compile_options(-Werror) + if (CLR_CMAKE_WARNINGS_ARE_ERRORS) + # All warnings that are not explicitly disabled are reported as errors + add_compile_options(-Werror) + endif(CLR_CMAKE_WARNINGS_ARE_ERRORS) # Disabled warnings add_compile_options(-Wno-unused-private-field) @@ -36,6 +38,10 @@ if (CLR_CMAKE_PLATFORM_UNIX) # There are constants of type BOOL used in a condition. But BOOL is defined as int # and so the compiler thinks that there is a mistake. add_compile_options(-Wno-constant-logical-operand) + # We use pshpack1/2/4/8.h and poppack.h headers to set and restore packing. However + # clang 6.0 complains when the packing change lifetime is not contained within + # a header file. + add_compile_options(-Wno-pragma-pack) add_compile_options(-Wno-unknown-warning-option) @@ -49,7 +55,6 @@ if (CLR_CMAKE_PLATFORM_UNIX) # Some architectures (e.g., ARM) assume char type is unsigned while CoreCLR assumes char is signed # as x64 does. It has been causing issues in ARM (https://github.com/dotnet/coreclr/issues/4746) add_compile_options(-fsigned-char) - endif(CLR_CMAKE_PLATFORM_UNIX) if(CLR_CMAKE_PLATFORM_UNIX_ARM) @@ -58,8 +63,13 @@ if(CLR_CMAKE_PLATFORM_UNIX_ARM) add_compile_options(-mthumb) add_compile_options(-mfpu=vfpv3) if(ARM_SOFTFP) + add_definitions(-DARM_SOFTFP) add_compile_options(-mfloat-abi=softfp) + if("$ENV{__HostDistroRid}" MATCHES "tizen.*") + add_compile_options(-target armv7l-tizen-linux-gnueabi) + else() add_compile_options(-target armv7-linux-gnueabi) + endif() else() add_compile_options(-target armv7-linux-gnueabihf) endif(ARM_SOFTFP) @@ -91,6 +101,8 @@ if (WIN32) add_compile_options(/Zm200) # Specify Precompiled Header Memory Allocation Limit of 150MB add_compile_options(/wd4960 /wd4961 /wd4603 /wd4627 /wd4838 /wd4456 /wd4457 /wd4458 /wd4459 /wd4091 /we4640) add_compile_options(/Zi) # enable debugging information + add_compile_options(/ZH:SHA_256) # use SHA256 for generating hashes of compiler processed source files. + add_compile_options(/source-charset:utf-8) # Force MSVC to compile source as UTF-8. if (CLR_CMAKE_PLATFORM_ARCH_I386) add_compile_options(/Gz) @@ -116,9 +128,11 @@ if (WIN32) add_compile_options($<$,$>:/MT>) add_compile_options($<$,$>:/MTd>) + set(CMAKE_ASM_MASM_FLAGS "${CMAKE_ASM_MASM_FLAGS} /ZH:SHA_256") + endif (WIN32) -if(CMAKE_ENABLE_CODE_COVERAGE) +if(CLR_CMAKE_ENABLE_CODE_COVERAGE) if(CLR_CMAKE_PLATFORM_UNIX) string(TOUPPER ${CMAKE_BUILD_TYPE} UPPERCASE_CMAKE_BUILD_TYPE) @@ -135,4 +149,4 @@ if(CMAKE_ENABLE_CODE_COVERAGE) message(FATAL_ERROR "Code coverage builds not supported on current platform") endif(CLR_CMAKE_PLATFORM_UNIX) -endif(CMAKE_ENABLE_CODE_COVERAGE) +endif(CLR_CMAKE_ENABLE_CODE_COVERAGE)