msvc fixes
This commit is contained in:
parent
df607cd436
commit
9bd42637d3
1 changed files with 51 additions and 15 deletions
40
meson.build
40
meson.build
|
@ -27,23 +27,53 @@ endif
|
||||||
# Warnings
|
# Warnings
|
||||||
compiler_args += [
|
compiler_args += [
|
||||||
'-Wall',
|
'-Wall',
|
||||||
|
]
|
||||||
|
if compiler == 'msvc'
|
||||||
|
compiler_args += [
|
||||||
|
# '/WX',
|
||||||
|
]
|
||||||
|
elif compiler == 'gcc'
|
||||||
|
compiler_args += [
|
||||||
'-Werror',
|
'-Werror',
|
||||||
'-Wno-overloaded-virtual',
|
'-Wno-overloaded-virtual',
|
||||||
]
|
]
|
||||||
|
else
|
||||||
|
error('Unsupported compiler "@0@"', compiler)
|
||||||
|
endif
|
||||||
|
|
||||||
# Debug/Release target
|
# Debug/Release target
|
||||||
if buildtype == 'debug'
|
if buildtype == 'debug'
|
||||||
compiler_args += [
|
compiler_args += [
|
||||||
'-DDEBUG',
|
'-DDEBUG',
|
||||||
'-D_DEBUG',
|
'-D_DEBUG',
|
||||||
|
]
|
||||||
|
if compiler == 'msvc'
|
||||||
|
compiler_args += [
|
||||||
|
'/Od',
|
||||||
|
]
|
||||||
|
elif compiler == 'gcc'
|
||||||
|
compiler_args += [
|
||||||
'-g',
|
'-g',
|
||||||
'-O0',
|
'-O0',
|
||||||
]
|
]
|
||||||
|
else
|
||||||
|
error('Unsupported compiler "@0@"', compiler)
|
||||||
|
endif
|
||||||
else
|
else
|
||||||
compiler_args += [
|
compiler_args += [
|
||||||
'-DNDEBUG',
|
'-DNDEBUG',
|
||||||
|
]
|
||||||
|
if compiler == 'msvc'
|
||||||
|
compiler_args += [
|
||||||
|
'/O2',
|
||||||
|
]
|
||||||
|
elif compiler == 'gcc'
|
||||||
|
compiler_args += [
|
||||||
'-O3',
|
'-O3',
|
||||||
]
|
]
|
||||||
|
else
|
||||||
|
error('Unsupported compiler "@0@"', compiler)
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# OS
|
# OS
|
||||||
|
@ -88,21 +118,27 @@ endif
|
||||||
|
|
||||||
# CPU architecture
|
# CPU architecture
|
||||||
if arch == 'x86'
|
if arch == 'x86'
|
||||||
|
if compiler == 'gcc'
|
||||||
compiler_args += [
|
compiler_args += [
|
||||||
'-m32',
|
'-m32',
|
||||||
]
|
]
|
||||||
linker_args += [
|
linker_args += [
|
||||||
'-m32',
|
'-m32',
|
||||||
]
|
]
|
||||||
|
endif
|
||||||
elif arch == 'x64'
|
elif arch == 'x64'
|
||||||
compiler_args += [
|
compiler_args += [
|
||||||
'-m64',
|
|
||||||
'-DX64BITS',
|
'-DX64BITS',
|
||||||
'-DPLATFORM_64BITS',
|
'-DPLATFORM_64BITS',
|
||||||
]
|
]
|
||||||
|
if compiler == 'gcc'
|
||||||
|
compiler_args += [
|
||||||
|
'-m64',
|
||||||
|
]
|
||||||
linker_args += [
|
linker_args += [
|
||||||
'-m64',
|
'-m64',
|
||||||
]
|
]
|
||||||
|
endif
|
||||||
else
|
else
|
||||||
error('Unsupported arch "@0@"', arch)
|
error('Unsupported arch "@0@"', arch)
|
||||||
endif
|
endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue