msvc fixes

This commit is contained in:
Lauri Räsänen 2024-04-25 04:33:53 +03:00
parent df607cd436
commit 9bd42637d3

View file

@ -27,23 +27,53 @@ endif
# Warnings # Warnings
compiler_args += [ compiler_args += [
'-Wall', '-Wall',
'-Werror',
'-Wno-overloaded-virtual',
] ]
if compiler == 'msvc'
compiler_args += [
# '/WX',
]
elif compiler == 'gcc'
compiler_args += [
'-Werror',
'-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',
'-g',
'-O0',
] ]
if compiler == 'msvc'
compiler_args += [
'/Od',
]
elif compiler == 'gcc'
compiler_args += [
'-g',
'-O0',
]
else
error('Unsupported compiler "@0@"', compiler)
endif
else else
compiler_args += [ compiler_args += [
'-DNDEBUG', '-DNDEBUG',
'-O3',
] ]
if compiler == 'msvc'
compiler_args += [
'/O2',
]
elif compiler == 'gcc'
compiler_args += [
'-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'
compiler_args += [ if compiler == 'gcc'
'-m32', compiler_args += [
] '-m32',
linker_args += [ ]
'-m32', linker_args += [
] '-m32',
]
endif
elif arch == 'x64' elif arch == 'x64'
compiler_args += [ compiler_args += [
'-m64',
'-DX64BITS', '-DX64BITS',
'-DPLATFORM_64BITS', '-DPLATFORM_64BITS',
] ]
linker_args += [ if compiler == 'gcc'
'-m64', compiler_args += [
] '-m64',
]
linker_args += [
'-m64',
]
endif
else else
error('Unsupported arch "@0@"', arch) error('Unsupported arch "@0@"', arch)
endif endif