Show architecture in Mac package.

This commit is contained in:
Gonzalo Exequiel Pedone 2023-04-28 17:13:00 -03:00
parent 9e721ba979
commit d5121c737a
No known key found for this signature in database
GPG key ID: B8B09E63E9B85BAF
5 changed files with 33 additions and 9 deletions

3
.gitignore vendored
View file

@ -55,8 +55,6 @@ ui_*.h
Makefile*
*.prl
*.app
*.pro.user*
*.qmlproject.user*
*.autosave
*.qmlc
.qmake.stash
@ -67,6 +65,7 @@ callgrind.out.*
*_qmlcache.qrc
test.o-*
object_script.*
*.user.*
*.user
# Ignore files generated by Python #

View file

@ -30,7 +30,22 @@ if (APPLE)
set(BUILD_INFO_FILE AkVirtualCamera.plugin/Contents/Resources/build-info.txt)
set(APP_LIBDIR AkVirtualCamera.plugin/Contents/Frameworks)
set(MAIN_EXECUTABLE AkVirtualCamera.plugin/Contents/MacOS/AkVirtualCamera)
set(PACKET_TARGET_ARCH ${TARGET_ARCH})
set(PACKET_HIDE_ARCH false)
if (IS_ARM_TARGET)
if (IS_64BITS_TARGET)
set(PACKET_TARGET_ARCH arm64)
else ()
set(PACKET_TARGET_ARCH arm32)
endif()
else ()
if (IS_64BITS_TARGET)
set(PACKET_TARGET_ARCH x64)
else ()
set(PACKET_TARGET_ARCH x86)
endif()
endif()
set(QTIFW_TARGET_DIR "\@ApplicationsDir\@/AkVirtualCamera")
set(OUTPUT_FORMATS "MacPkg")
elseif (WIN32)
@ -39,6 +54,7 @@ elseif (WIN32)
set(BUILD_INFO_FILE share/build-info.txt)
set(MAIN_EXECUTABLE ${TARGET_ARCH}/AkVCamManager.exe)
set(APP_LIBDIR ${TARGET_ARCH})
set(PACKET_HIDE_ARCH true)
if (IS_64BITS_TARGET)
set(PACKET_TARGET_ARCH win64)

View file

@ -170,13 +170,13 @@ namespace AkVCam
}
template<typename T>
static inline T bound(T min, T value, T max)
static inline T bound(T min, T value, T max) const
{
return value < min? min: value > max? max: value;
}
template<typename T>
inline T mod(T value, T mod)
inline T mod(T value, T mod) const
{
return (value % mod + mod) % mod;
}
@ -1681,9 +1681,9 @@ void AkVCam::VideoFramePrivate::hslToRgb(int h, int s, int l, int *r, int *g, in
int m = 2 * l - c;
*r = (2 * (*r) + m) / 2;
*g = (2 * (*g) + m) / 2;
*b = (2 * (*b) + m) / 2;
*r = (2 * (*r) + m) >> 1;
*g = (2 * (*g) + m) >> 1;
*b = (2 * (*b) + m) >> 1;
}
std::vector<uint8_t> AkVCam::initGammaTable()

View file

@ -40,6 +40,15 @@ add_definitions(-DCOMMONS_APPNAME="${COMMONS_APPNAME}"
-DPREFIX="${PREFIX}")
if (APPLE)
check_cxx_source_compiles("
#ifndef __arm__
#error Not ARM
#endif
int main()
{
return 0;
}" IS_ARM_TARGET)
check_cxx_source_compiles("
#ifndef __x86_64__
#error Not x64

View file

@ -8,7 +8,7 @@ buildInfoFile = @BUILD_INFO_FILE@
targetArch = @PACKET_TARGET_ARCH@
version = @VERSION@
outputFormats = @OUTPUT_FORMATS@
hideArch = true
hideArch = @PACKET_HIDE_ARCH@
writeLauncher = false
[MacPkg]