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