Skip to content

Commit

Permalink
Fixed UWP build
Browse files Browse the repository at this point in the history
  • Loading branch information
deathkiller committed Feb 23, 2024
1 parent dc50c00 commit 1b4e055
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
14 changes: 8 additions & 6 deletions Sources/nCine/Threading/WindowsAtomic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ namespace nCine
int32_t Atomic32::load(MemoryModel memModel)
{
#if defined(DEATH_TARGET_WINDOWS_RT)
FATAL_MSG("Incompatible memory model");
return 0;
// ReadNoFence/ReadAcquire/ReadRelease is not supported on Windows RT
return value_;
#else
switch (memModel) {
case MemoryModel::RELAXED:
Expand All @@ -29,7 +29,8 @@ namespace nCine
void Atomic32::store(int32_t value, MemoryModel memModel)
{
#if defined(DEATH_TARGET_WINDOWS_RT)
FATAL_MSG("Incompatible memory model");
// WriteNoFence/WriteAcquire/WriteRelease is not supported on Windows RT
value_ = value;
#else
switch (memModel) {
case MemoryModel::RELAXED:
Expand Down Expand Up @@ -97,8 +98,8 @@ namespace nCine
int64_t Atomic64::load(MemoryModel memModel)
{
#if defined(DEATH_TARGET_WINDOWS_RT)
FATAL_MSG("Incompatible memory model");
return 0;
// ReadNoFence/ReadAcquire/ReadRelease is not supported on Windows RT
return value_;
#else
switch (memModel) {
case MemoryModel::RELAXED:
Expand All @@ -118,7 +119,8 @@ namespace nCine
void Atomic64::store(int64_t value, MemoryModel memModel)
{
#if defined(DEATH_TARGET_WINDOWS_RT)
FATAL_MSG("Incompatible memory model");
// WriteNoFence/WriteAcquire/WriteRelease is not supported on Windows RT
value_ = value;
#else
switch (memModel) {
case MemoryModel::RELAXED:
Expand Down
2 changes: 1 addition & 1 deletion Sources/nCine/Threading/WindowsThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ namespace nCine
return false;
#else
return (_sharedBlock != nullptr && ::TerminateThread(_sharedBlock->_handle, 1));
#endif;
#endif
}

ThreadAffinityMask Thread::GetAffinityMask() const
Expand Down
2 changes: 1 addition & 1 deletion cmake/check_atomic.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Based on https://stackoverflow.com/q/69281559

if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
include(CheckCXXSourceCompiles)
include(CMakePushCheckState)

Expand Down
4 changes: 2 additions & 2 deletions cmake/ncine_imported_targets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,9 @@ if(MSVC OR MINGW OR MSYS)
set(VC_LTL_FOUND 1)
endif()
endif()

find_package(OpenGL REQUIRED)
endif()

find_package(OpenGL REQUIRED)
elseif(NOT ANDROID AND NOT NCINE_BUILD_ANDROID) # GCC and LLVM
if(APPLE)
set(CMAKE_FRAMEWORK_PATH ${NCINE_LIBS})
Expand Down

0 comments on commit 1b4e055

Please sign in to comment.