Skip to content

Commit

Permalink
unity build
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNumbat committed Jan 1, 2024
1 parent d2eaf28 commit debccd8
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 30 deletions.
26 changes: 3 additions & 23 deletions rpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,37 +45,17 @@ set(SOURCES_RPP
"vmath.h"
"std/coroutine.h"
"std/initializer_list.h"
"impl/alloc.cpp"
"impl/base.cpp"
"impl/log.cpp"
"impl/math.cpp"
"impl/profile.cpp"
"impl/simd.cpp"
"impl/vmath.cpp"
"impl/unify.cpp"
)

if(UNIX AND NOT APPLE)
set(LINUX TRUE)
endif()

if(WIN32)
set(SOURCES_RPP ${SOURCES_RPP}
"w32/w32_util.h"
"w32/w32_util.cpp"
"w32/async_w32.cpp"
"w32/asyncio_w32.cpp"
"w32/thread_w32.cpp"
"w32/files_w32.cpp"
"w32/net_w32.cpp"
)
set(SOURCES_RPP ${SOURCES_RPP} "w32/w32_util.h" "w32/unify.cpp")
elseif(LINUX)
set(SOURCES_RPP ${SOURCES_RPP}
"pos/async_pos.cpp"
"pos/asyncio_pos.cpp"
"pos/thread_pos.cpp"
"pos/files_pos.cpp"
"pos/net_pos.cpp"
)
set(SOURCES_RPP ${SOURCES_RPP} "pos/unify.cpp")
else()
message(FATAL_ERROR "Unsupported platform: only Windows and Linux are supported.")
endif()
Expand Down
8 changes: 8 additions & 0 deletions rpp/impl/unify.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

#include "alloc.cpp"
#include "base.cpp"
#include "log.cpp"
#include "math.cpp"
#include "profile.cpp"
#include "simd.cpp"
#include "vmath.cpp"
9 changes: 2 additions & 7 deletions rpp/impl/vmath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,8 @@ namespace rpp::Math {

namespace detail {

static __m128 of(F32x4 a) {
return *reinterpret_cast<__m128*>(a.data);
}

static F32x4 to(__m128 a) {
return *reinterpret_cast<F32x4*>(&a);
}
using SIMD::of;
using SIMD::to;

#define MakeShuffleMask(x, y, z, w) (x | (y << 2) | (z << 4) | (w << 6))
#define VecSwizzleMask(vec, mask) _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(vec), mask))
Expand Down
6 changes: 6 additions & 0 deletions rpp/pos/unify.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

#include "async_pos.cpp"
#include "asyncio_pos.cpp"
#include "files_pos.cpp"
#include "net_pos.cpp"
#include "thread_pos.cpp"
7 changes: 7 additions & 0 deletions rpp/w32/unify.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

#include "async_w32.cpp"
#include "asyncio_w32.cpp"
#include "files_w32.cpp"
#include "net_w32.cpp"
#include "thread_w32.cpp"
#include "w32_util.cpp"

0 comments on commit debccd8

Please sign in to comment.