From 008e7207e10cfe125c5a95d0571e452358908d20 Mon Sep 17 00:00:00 2001 From: Death Killer <884052+deathkiller@users.noreply.github.com> Date: Mon, 16 Oct 2023 19:05:49 +0200 Subject: [PATCH] Fixed build --- .github/workflows/windows.yml | 10 ++++++++-- .github/workflows/windows_clang.yml | 10 ++++++++-- .github/workflows/windows_v143.yml | 10 ++++++++-- Sources/nCine/Threading/PosixThread.cpp | 6 ++++-- 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 92ace41d..78666e9f 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -66,14 +66,20 @@ jobs: - name: 'Configure CMake' run: | + $archexts = '${{ matrix.ArchExts }}' switch('${{ matrix.Platform }}') { 'x86' { $arch = 'Win32' } - 'x64' { $arch = 'x64' } + 'x64' { + $arch = 'x64' + if(($archext -eq 'SSE') -or ($archext -eq 'SSE2')) { + $archexts = '' + } + } } rm -force ".\Content\Translations\*.po" - cmake -B ".\_build\" -D CMAKE_BUILD_TYPE=${{ matrix.BuildType }} -A $arch -D CMAKE_SYSTEM_PROCESSOR=$arch -D NCINE_ARCH_EXTENSIONS="${{ matrix.ArchExts }}" -D NCINE_PREFERRED_BACKEND=${{ matrix.Backend }} -D NCINE_STRIP_BINARIES=ON -D NCINE_COPY_DEPENDENCIES=ON -D CMAKE_GENERATOR_TOOLSET=v142 + cmake -B ".\_build\" -D CMAKE_BUILD_TYPE=${{ matrix.BuildType }} -A $arch -D CMAKE_SYSTEM_PROCESSOR=$arch -D NCINE_ARCH_EXTENSIONS=$archexts -D NCINE_PREFERRED_BACKEND=${{ matrix.Backend }} -D NCINE_STRIP_BINARIES=ON -D NCINE_COPY_DEPENDENCIES=ON -D CMAKE_GENERATOR_TOOLSET=v142 - name: 'Build' run: | diff --git a/.github/workflows/windows_clang.yml b/.github/workflows/windows_clang.yml index 926684b1..7550f1cf 100644 --- a/.github/workflows/windows_clang.yml +++ b/.github/workflows/windows_clang.yml @@ -65,14 +65,20 @@ jobs: - name: 'Configure CMake' run: | + $archexts = '${{ matrix.ArchExts }}' switch('${{ matrix.Platform }}') { 'x86' { $arch = 'Win32' } - 'x64' { $arch = 'x64' } + 'x64' { + $arch = 'x64' + if(($archext -eq 'SSE') -or ($archext -eq 'SSE2')) { + $archexts = '' + } + } } rm -force ".\Content\Translations\*.po" - cmake -B ".\_build\" -D CMAKE_BUILD_TYPE=${{ matrix.BuildType }} -A $arch -D CMAKE_SYSTEM_PROCESSOR=$arch -D NCINE_ARCH_EXTENSIONS="${{ matrix.ArchExts }}" -D NCINE_PREFERRED_BACKEND=${{ matrix.Backend }} -D NCINE_STRIP_BINARIES=ON -D NCINE_COPY_DEPENDENCIES=ON -T ClangCL + cmake -B ".\_build\" -D CMAKE_BUILD_TYPE=${{ matrix.BuildType }} -A $arch -D CMAKE_SYSTEM_PROCESSOR=$arch -D NCINE_ARCH_EXTENSIONS=$archexts -D NCINE_PREFERRED_BACKEND=${{ matrix.Backend }} -D NCINE_STRIP_BINARIES=ON -D NCINE_COPY_DEPENDENCIES=ON -T ClangCL - name: 'Build' run: | diff --git a/.github/workflows/windows_v143.yml b/.github/workflows/windows_v143.yml index 2e8f1be4..b8723b55 100644 --- a/.github/workflows/windows_v143.yml +++ b/.github/workflows/windows_v143.yml @@ -65,14 +65,20 @@ jobs: - name: 'Configure CMake' run: | + $archexts = '${{ matrix.ArchExts }}' switch('${{ matrix.Platform }}') { 'x86' { $arch = 'Win32' } - 'x64' { $arch = 'x64' } + 'x64' { + $arch = 'x64' + if(($archext -eq 'SSE') -or ($archext -eq 'SSE2')) { + $archexts = '' + } + } } rm -force ".\Content\Translations\*.po" - cmake -B ".\_build\" -D CMAKE_BUILD_TYPE=${{ matrix.BuildType }} -A $arch -D CMAKE_SYSTEM_PROCESSOR=$arch -D NCINE_ARCH_EXTENSIONS="${{ matrix.ArchExts }}" -D NCINE_PREFERRED_BACKEND=${{ matrix.Backend }} -D NCINE_STRIP_BINARIES=ON -D NCINE_COPY_DEPENDENCIES=ON -D CMAKE_GENERATOR_TOOLSET=v143 + cmake -B ".\_build\" -D CMAKE_BUILD_TYPE=${{ matrix.BuildType }} -A $arch -D CMAKE_SYSTEM_PROCESSOR=$arch -D NCINE_ARCH_EXTENSIONS=$archexts -D NCINE_PREFERRED_BACKEND=${{ matrix.Backend }} -D NCINE_STRIP_BINARIES=ON -D NCINE_COPY_DEPENDENCIES=ON -D CMAKE_GENERATOR_TOOLSET=v143 - name: 'Build' run: | diff --git a/Sources/nCine/Threading/PosixThread.cpp b/Sources/nCine/Threading/PosixThread.cpp index 87034c76..33c78145 100644 --- a/Sources/nCine/Threading/PosixThread.cpp +++ b/Sources/nCine/Threading/PosixThread.cpp @@ -169,7 +169,7 @@ namespace nCine void Thread::SetName(const char* name) { if (_sharedBlock == nullptr || _sharedBlock->_handle == 0) { - return 0; + return; } const auto nameLength = strnlen(name, MaxThreadNameLength); @@ -287,13 +287,15 @@ namespace nCine # else pthread_getaffinity_np(_sharedBlock->_handle, sizeof(cpu_set_t), &affinityMask.cpuSet_); # endif + + return affinityMask; } void Thread::SetAffinityMask(ThreadAffinityMask affinityMask) { if (_sharedBlock == nullptr || _sharedBlock->_handle == 0) { LOGW("Cannot set the affinity mask for a not yet created thread"); - return affinityMask; + return; } # if defined(DEATH_TARGET_APPLE)