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
compiler_args += [
'-Wall',
]
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
if buildtype == 'debug'
compiler_args += [
'-DDEBUG',
'-D_DEBUG',
]
if compiler == 'msvc'
compiler_args += [
'/Od',
]
elif compiler == 'gcc'
compiler_args += [
'-g',
'-O0',
]
else
error('Unsupported compiler "@0@"', compiler)
endif
else
compiler_args += [
'-DNDEBUG',
]
if compiler == 'msvc'
compiler_args += [
'/O2',
]
elif compiler == 'gcc'
compiler_args += [
'-O3',
]
else
error('Unsupported compiler "@0@"', compiler)
endif
endif
# OS
@ -88,21 +118,27 @@ endif
# CPU architecture
if arch == 'x86'
if compiler == 'gcc'
compiler_args += [
'-m32',
]
linker_args += [
'-m32',
]
endif
elif arch == 'x64'
compiler_args += [
'-m64',
'-DX64BITS',
'-DPLATFORM_64BITS',
]
if compiler == 'gcc'
compiler_args += [
'-m64',
]
linker_args += [
'-m64',
]
endif
else
error('Unsupported arch "@0@"', arch)
endif