mirror of
https://github.com/QuasarApp/QuasarAppCI.git
synced 2025-04-26 05:44:31 +00:00
add defines support
This commit is contained in:
parent
c08533e754
commit
c994279040
@ -14,14 +14,6 @@ class CMake(Make):
|
||||
def makePrefix(self):
|
||||
return "C"
|
||||
|
||||
def mainCmd(self):
|
||||
options = [
|
||||
'cmake',
|
||||
"-B cmake_build"
|
||||
]
|
||||
|
||||
return ' '.join(options)
|
||||
|
||||
def make(self):
|
||||
return 'cmake --build cmake_build --target all'
|
||||
|
||||
@ -39,12 +31,25 @@ class CMake(Make):
|
||||
return command
|
||||
|
||||
def linuxXmakeCmd(self, props):
|
||||
return self.mainCmd()
|
||||
defines = self.getDefinesList(props)
|
||||
|
||||
def windowsXmakeCmd(self, props):
|
||||
defines += [
|
||||
'-DCMAKE_PREFIX_PATH=$QTDIR',
|
||||
'-B cmake_build'
|
||||
]
|
||||
|
||||
options = [
|
||||
'cmake -DCMAKE_PREFIX_PATH=%QTDIR%',
|
||||
'cmake',
|
||||
]
|
||||
options += defines
|
||||
|
||||
return ' '.join(options)
|
||||
|
||||
def windowsXmakeCmd(self, props):
|
||||
defines = self.getDefinesList(props)
|
||||
|
||||
defines += [
|
||||
'-DCMAKE_PREFIX_PATH=%QTDIR%',
|
||||
'-DBUILD_SHARED_LIBS=1',
|
||||
'-DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc',
|
||||
'-DQT_QMAKE_EXECUTABLE=%QTDIR%/bin/qmake.exe',
|
||||
@ -52,6 +57,11 @@ class CMake(Make):
|
||||
'-B cmake_build'
|
||||
]
|
||||
|
||||
options = [
|
||||
'cmake',
|
||||
]
|
||||
options += defines
|
||||
|
||||
return ' '.join(options)
|
||||
|
||||
def androidXmakeMultiAbiCmd(self, props):
|
||||
@ -59,8 +69,9 @@ class CMake(Make):
|
||||
secret = SecretManager(file, props)
|
||||
toochainFile = 'build/cmake/android.toolchain.cmake'
|
||||
|
||||
options = [
|
||||
'cmake -GNinja',
|
||||
defines = self.getDefinesList(props)
|
||||
|
||||
defines += [
|
||||
'-DCMAKE_PREFIX_PATH=$QTDIR',
|
||||
'-DQT_QMAKE_EXECUTABLE=$QTDIR/bin/qmake',
|
||||
'-DANDROID_ABI=arm64-v8a',
|
||||
@ -77,6 +88,11 @@ class CMake(Make):
|
||||
'-B cmake_build'
|
||||
]
|
||||
|
||||
options = [
|
||||
'cmake -GNinja',
|
||||
]
|
||||
options += defines
|
||||
|
||||
return ' '.join(options)
|
||||
|
||||
def androidXmakeSinglAbiCmd(self, props):
|
||||
@ -84,8 +100,9 @@ class CMake(Make):
|
||||
secret = SecretManager(file, props)
|
||||
toochainFile = 'build/cmake/android.toolchain.cmake'
|
||||
|
||||
options = [
|
||||
'cmake -GNinja',
|
||||
defines = self.getDefinesList(props)
|
||||
|
||||
defines += [
|
||||
'-DCMAKE_PREFIX_PATH=$QTDIR',
|
||||
'-DQT_QMAKE_EXECUTABLE=$QTDIR/bin/qmake',
|
||||
'-DANDROID_ABI=$ANDROID_ABI',
|
||||
@ -100,16 +117,30 @@ class CMake(Make):
|
||||
'-B cmake_build'
|
||||
]
|
||||
|
||||
options = [
|
||||
'cmake -GNinja',
|
||||
]
|
||||
options += defines
|
||||
|
||||
return ' '.join(options)
|
||||
|
||||
def androidXmakeCmd(self, props):
|
||||
return self.androidXmakeSinglAbiCmd(props)
|
||||
|
||||
def wasmXmakeCmd(self, props):
|
||||
options = [
|
||||
'cmake -DCMAKE_PREFIX_PATH=$QTDIR',
|
||||
|
||||
defines = self.getDefinesList(props)
|
||||
|
||||
defines += [
|
||||
'-DCMAKE_PREFIX_PATH=$QTDIR',
|
||||
'-DTARGET_PLATFORM_TOOLCHAIN=wasm32',
|
||||
'-B cmake_build'
|
||||
]
|
||||
|
||||
options = [
|
||||
'cmake',
|
||||
]
|
||||
|
||||
options += defines
|
||||
|
||||
return ' '.join(options)
|
||||
|
@ -320,6 +320,9 @@ class Make(BaseModule):
|
||||
|
||||
return factory
|
||||
|
||||
def getDefinesList(self, props):
|
||||
return str(props.getProperty('defines')).split(' ')
|
||||
|
||||
def getPropertyes(self):
|
||||
|
||||
base = super().getPropertyes()
|
||||
@ -350,4 +353,9 @@ class Make(BaseModule):
|
||||
label='Folder with repository data',
|
||||
default="Repo"
|
||||
),
|
||||
util.StringParameter(
|
||||
name='defines',
|
||||
label='Custom Defines list: Example: -DHANOI_ADMOD=1',
|
||||
default=""
|
||||
),
|
||||
]
|
||||
|
Loading…
x
Reference in New Issue
Block a user