mirror of
https://github.com/nillerusr/source-engine.git
synced 2026-08-07 17:29:36 +00:00
fix windows build scripts, add windows opus support
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
# encoding: utf-8
|
||||
# masm.py -- Microsoft Macro Assembler file support
|
||||
|
||||
from waflib import Errors, Logs, Task
|
||||
from waflib.TaskGen import extension
|
||||
|
||||
class masm(Task.Task):
|
||||
"""
|
||||
Compiles assembler files with masm
|
||||
"""
|
||||
color = 'BLUE'
|
||||
run_str = '${AS} ${ASFLAGS} ${ASMPATH_ST:INCPATHS} ${ASMDEFINES_ST:DEFINES} ${AS_TGT_F}${TGT} ${AS_SRC_F}${SRC}'
|
||||
|
||||
@extension('.masm')
|
||||
def create_masm_task(self, node):
|
||||
return self.create_compiled_task('masm', node)
|
||||
|
||||
def configure(conf):
|
||||
conf.env.AS = conf.env.CC[0].replace('CL.exe', 'ml64.exe')
|
||||
conf.env.ASFLAGS = ['/nologo', '/c']
|
||||
conf.env.AS_SRC_F = ['']
|
||||
conf.env.AS_TGT_F = ['/Fo']
|
||||
@@ -0,0 +1,48 @@
|
||||
#!/usr/bin/env python
|
||||
# encoding: utf-8
|
||||
# Rafaël Kooi 2019
|
||||
|
||||
from waflib import TaskGen
|
||||
|
||||
banned_extensions_list = ["rc", "asm", "masm"]
|
||||
|
||||
@TaskGen.feature('c', 'cxx', 'fc')
|
||||
@TaskGen.after_method('propagate_uselib_vars')
|
||||
def add_pdb_per_object(self):
|
||||
"""For msvc/fortran, specify a unique compile pdb per object, to work
|
||||
around LNK4099. Flags are updated with a unique /Fd flag based on the
|
||||
task output name. This is separate from the link pdb.
|
||||
"""
|
||||
if not hasattr(self, 'compiled_tasks'):
|
||||
return
|
||||
|
||||
link_task = getattr(self, 'link_task', None)
|
||||
|
||||
for task in self.compiled_tasks:
|
||||
if task.inputs and (task.inputs[0].name.lower().split(".")[-1] in banned_extensions_list):
|
||||
continue
|
||||
|
||||
add_pdb = False
|
||||
for flagname in ('CFLAGS', 'CXXFLAGS', 'FCFLAGS'):
|
||||
# several languages may be used at once
|
||||
for flag in task.env[flagname]:
|
||||
if flag[1:].lower() == 'zi':
|
||||
add_pdb = True
|
||||
break
|
||||
|
||||
if add_pdb:
|
||||
node = task.outputs[0].change_ext('.pdb')
|
||||
pdb_flag = '/Fd:' + node.abspath()
|
||||
|
||||
for flagname in ('CFLAGS', 'CXXFLAGS', 'FCFLAGS'):
|
||||
buf = [pdb_flag]
|
||||
for flag in task.env[flagname]:
|
||||
if flag[1:3] == 'Fd' or flag[1:].lower() == 'fs' or flag[1:].lower() == 'mp':
|
||||
continue
|
||||
buf.append(flag)
|
||||
task.env[flagname] = buf
|
||||
|
||||
if link_task and not node in link_task.dep_nodes:
|
||||
link_task.dep_nodes.append(node)
|
||||
if not node in task.outputs:
|
||||
task.outputs.append(node)
|
||||
@@ -42,7 +42,7 @@ def sdl2_configure_path(conf, path):
|
||||
]
|
||||
libpath = 'lib'
|
||||
if conf.env.COMPILER_CC == 'msvc':
|
||||
if conf.env.DEST_CPU == 'x86_64':
|
||||
if conf.env.DEST_CPU in ['x86_64', 'amd64']:
|
||||
libpath = 'lib/x64'
|
||||
else:
|
||||
libpath = 'lib/' + conf.env.DEST_CPU
|
||||
|
||||
Reference in New Issue
Block a user