Skip to content

Commit

Permalink
Hack build generator to work on non-debian linux
Browse files Browse the repository at this point in the history
Suggested in NVIDIAGameWorks#39
  • Loading branch information
borodust committed Sep 16, 2021
1 parent c3d5537 commit e15039a
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions physx/buildtools/cmake_generate_projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ def cmakeExt():


def filterPreset(presetName):
winPresetFilter = ['win','uwp','ps4','switch','xboxone','android','crosscompile','xboxseriesx']
if sys.platform == 'win32':
winPresetFilter = ['win','uwp','ps4','switch','xboxone','android','crosscompile']
if sys.platform == 'win32':
if any(presetName.find(elem) != -1 for elem in winPresetFilter):
return True
else:
else:
if all(presetName.find(elem) == -1 for elem in winPresetFilter):
return True
return False
Expand Down Expand Up @@ -53,12 +53,12 @@ def noPresetProvided():
print('(' + str(counter) + ') ' + presetXml.get('name') +
'.user <--- ' + presetXml.get('comment'))
presetList.append(presetXml.get('name') + '.user')
counter = counter + 1
counter = counter + 1
# Fix Python 2.x.
try:
try:
input = raw_input
except NameError:
pass
except NameError:
pass
mode = int(input('Enter preset number: '))
print('Running generate_projects.bat ' + presetList[mode])
return presetList[mode]
Expand Down Expand Up @@ -181,28 +181,28 @@ def getPlatformCMakeParams(self):
outString = outString + ' -DTARGET_BUILD_PLATFORM=uwp'
outString = outString + ' -DPX_OUTPUT_ARCH=x86'
outString = outString + ' -DCMAKE_SYSTEM_NAME=WindowsStore'
outString = outString + ' -DCMAKE_SYSTEM_VERSION=10.0'
outString = outString + ' -DCMAKE_SYSTEM_VERSION=10.0'
return outString
elif self.targetPlatform == 'uwp32':
outString = outString + ' -AWin32'
outString = outString + ' -DTARGET_BUILD_PLATFORM=uwp'
outString = outString + ' -DPX_OUTPUT_ARCH=x86'
outString = outString + ' -DCMAKE_SYSTEM_NAME=WindowsStore'
outString = outString + ' -DCMAKE_SYSTEM_VERSION=10.0'
outString = outString + ' -DCMAKE_SYSTEM_VERSION=10.0'
return outString
elif self.targetPlatform == 'uwparm32':
outString = outString + ' -AARM'
outString = outString + ' -DTARGET_BUILD_PLATFORM=uwp'
outString = outString + ' -DPX_OUTPUT_ARCH=arm'
outString = outString + ' -DCMAKE_SYSTEM_NAME=WindowsStore'
outString = outString + ' -DCMAKE_SYSTEM_VERSION=10.0'
outString = outString + ' -DCMAKE_SYSTEM_VERSION=10.0'
return outString
elif self.targetPlatform == 'uwparm64':
outString = outString + ' -AARM64'
outString = outString + ' -DTARGET_BUILD_PLATFORM=uwp'
outString = outString + ' -DPX_OUTPUT_ARCH=arm'
outString = outString + ' -DCMAKE_SYSTEM_NAME=WindowsStore'
outString = outString + ' -DCMAKE_SYSTEM_VERSION=10.0'
outString = outString + ' -DCMAKE_SYSTEM_VERSION=10.0'
return outString
elif self.targetPlatform == 'ps4':
outString = outString + ' -DTARGET_BUILD_PLATFORM=ps4'
Expand Down Expand Up @@ -231,7 +231,7 @@ def getPlatformCMakeParams(self):
'/xboxone/XboxOneToolchainVC16.txt'
outString = outString + ' -T v142'
outString = outString + ' -DCMAKE_VS160PATH=' + \
os.environ['VS160PATH']
os.environ['VS160PATH']
outString = outString + ' -DCMAKE_GENERATOR_PLATFORM=Durango'
outString = outString + ' -DSUPPRESS_SUFFIX=ON'
return outString
Expand Down Expand Up @@ -293,6 +293,7 @@ def getPlatformCMakeParams(self):
os.environ['PM_CMakeModules_PATH'] + \
'/linux/LinuxCrossToolchain.x86_64-unknown-linux-gnu.cmake'
elif self.compiler == 'clang':
outString = outString + ' -DCMAKE_LIBRARY_ARCHITECTURE=x86_64-linux-gnu'
if os.environ.get('PM_clang_PATH') is not None:
outString = outString + ' -DCMAKE_C_COMPILER=' + \
os.environ['PM_clang_PATH'] + '/bin/clang'
Expand Down

0 comments on commit e15039a

Please sign in to comment.