Add clang cflags

dev
Lzu Tao 2018-11-30 16:15:33 +07:00
parent 0a0683f5b2
commit c55d65b35d
1 changed files with 43 additions and 40 deletions

View File

@ -46,7 +46,7 @@ zstd_libversion = ''
zstd_rootdir = '../..'
# =============================================================================
# Installing directories
# Installation directories
# =============================================================================
if host_machine_os == os_windows
@ -125,6 +125,9 @@ add_project_arguments('-DXXH_NAMESPACE=ZSTD_', language: [ 'c' ])
if [compiler_gcc, compiler_clang].contains(cc_id)
common_warning_flags = [ '-Wextra', '-Wundef', '-Wshadow', '-Wcast-align', '-Wcast-qual' ]
if cc_id == compiler_clang
common_warning_flags += ['-Werror', '-Wconversion', '-Wno-sign-conversion', '-Wdocumentation']
endif
cc_compile_flags = cc.get_supported_arguments(common_warning_flags + ['-Wstrict-prototypes'])
cxx_compile_flags = cxx.get_supported_arguments(common_warning_flags)
add_project_arguments(cc_compile_flags, language : 'c')
@ -132,10 +135,10 @@ if [compiler_gcc, compiler_clang].contains(cc_id)
elif cc_id == compiler_msvc
msvc_compile_flags = [ '/D_UNICODE', '/DUNICODE' ]
if enable_multithread
msvc_compile_flags += [ '/MP' ]
msvc_compile_flags += '/MP'
endif
if enable_static_runtime
msvc_compile_flags += [ '/MT' ]
msvc_compile_flags += '/MT'
endif
add_project_arguments(msvc_compile_flags, language: ['c', 'cpp'])
endif