Bladeren bron

Build system refactoring

Panagiotis Christopoulos Charitos 13 jaren geleden
bovenliggende
commit
90138199a7

+ 36 - 18
CMakeLists.txt

@@ -107,36 +107,54 @@ ELSE()
 ENDIF()
 
 # 
-# Version
+# Config.h
 #
-SET(ANKI_VERSION_MINOR 0)
-SET(ANKI_VERSION_MAJOR 1)
-ADD_DEFINITIONS("-DANKI_VERSION_MINOR=${ANKI_VERSION_MINOR}")
+SET(ANKI_VERSION_MAJOR 0)
+SET(ANKI_VERSION_MINOR 1)
 ADD_DEFINITIONS("-DANKI_VERSION_MAJOR=${ANKI_VERSION_MAJOR}")
+ADD_DEFINITIONS("-DANKI_VERSION_MINOR=${ANKI_VERSION_MINOR}")
+MESSAGE("++ AnKi version: ${ANKI_VERSION_MAJOR}.${ANKI_VERSION_MINOR}")
 
-CONFIGURE_FILE("include/anki/Version.h.cmake" "${CMAKE_CURRENT_BINARY_DIR}/anki/Version.h")
+SET(ANKI_WINDOW_BACKEND "GLXX11" CACHE STRING "The window backend (GLXX11 or EGLX11)")
+ADD_DEFINITIONS("-DANKI_WINDOW_BACKEND_${ANKI_WINDOW_BACKEND}")
+MESSAGE("++ AnKi window backend: ${ANKI_WINDOW_BACKEND}")
 
-INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/anki/Version.h" DESTINATION "${INCLUDE_INSTALL_DIR}/anki")
+SET(ANKI_CPU "X86" CACHE STRING "The CPU arch (X86 or ARM)")
+ADD_DEFINITIONS("-DANKI_CPU_${ANKI_CPU}")
+MESSAGE("++ AnKi CPU: ${ANKI_CPU}")
 
-#
-# Defines
-#
-ADD_DEFINITIONS("-DANKI_MATH_INTEL_SIMD")
-ADD_DEFINITIONS("-Dthread_local=__thread")
+OPTION(ANKI_ENABLE_MATH_SIMD "Enable or not math SIMD optimizations" ON)
+
+IF(ANKI_ENABLE_MATH_SIMD)
+	IF(ANKI_CPU STREQUAL "X86")
+		SET(ANKI_MATH_SIMD "SSE")
+	ELSEIF(ANKI_CPU STREQUAL "ARM")
+		SET(ANKI_MATH_SIMD "NEON")
+	ELSE()
+		MESSAGE(FATAL "Wrong ANKI_CPU set")
+	ENDIF()
+ELSE()
+	SET(ANKI_MATH_SIMD "NONE")
+ENDIF()
+
+ADD_DEFINITIONS("-DANKI_MATH_SIMD_${ANKI_MATH_SIMD}")
+MESSAGE("++ AnKi math SIMD: ${ANKI_MATH_SIMD}")
 
 IF(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
-	ADD_DEFINITIONS("-DANKI_PLATFORM_LINUX")
+	SET(ANKI_PLATFORM "LINUX")
 ELSEIF(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
-	ADD_DEFINITIONS("-DANKI_PLATFORM_WINDOWS")
+	SET(ANKI_PLATFORM "WINDOWS")
 ENDIF()
+ADD_DEFINITIONS("-DANKI_PLATFORM_${ANKI_PLATFORM}")
+MESSAGE("++ AnKi platform: ${ANKI_PLATFORM}")
+
+CONFIGURE_FILE("include/anki/Config.h.cmake" "${CMAKE_CURRENT_BINARY_DIR}/anki/Config.h")
+INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/anki/Config.h" DESTINATION "${INCLUDE_INSTALL_DIR}/anki")
 
 #
-# Window backend
+# Defines
 #
-SET(ANKI_WINDOW_BACKEND "GLXX11" CACHE STRING "The window backend (GLXX11 or EGLX11)")
-ADD_DEFINITIONS("-DANKI_WINDOW_BACKEND_${ANKI_WINDOW_BACKEND}")
-
-MESSAGE("++ Window backend: ${ANKI_WINDOW_BACKEND}")
+ADD_DEFINITIONS("-Dthread_local=__thread")
 
 #
 # Compiler flags

+ 12 - 0
include/anki/Config.h.cmake

@@ -0,0 +1,12 @@
+#ifndef ANKI_CONFIG_H
+#define ANKI_CONFIG_H
+
+#define ANKI_VERSION_MINOR ${ANKI_VERSION_MINOR}
+#define ANKI_VERSION_MAJOR ${ANKI_VERSION_MAJOR}
+#define ANKI_REVISION ${ANKI_REVISION}
+#define ANKI_CPU_${ANKI_CPU}
+#define ANKI_MATH_SIMD_${ANKI_MATH_SIMD}
+#define ANKI_WINDOW_BACKEND_${ANKI_WINDOW_BACKEND}
+#define ANKI_PLATFORM_${ANKI_PLATFORM}
+
+#endif

+ 0 - 8
include/anki/Version.h.cmake

@@ -1,8 +0,0 @@
-#ifndef ANKI_VERSION_H
-#define ANKI_VERSION_H
-
-#define ANKI_VERSION_MINOR ${ANKI_VERSION_MINOR}
-#define ANKI_VERSION_MAJOR ${ANKI_VERSION_MAJOR}
-#define ANKI_REVISION ${ANKI_REVISION}
-
-#endif

+ 2 - 2
include/anki/math/Mat4.h

@@ -39,7 +39,7 @@ public:
 	const F32& operator()(const U i, const U j) const;
 	F32& operator[](const U i);
 	const F32& operator[](const U i) const;
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 	__m128& getMm(const U i);
 	const __m128& getMm(const U i) const;
 #endif
@@ -125,7 +125,7 @@ private:
 		std::array<std::array<F32, 4>, 4> arr2;
 		F32 carr1[16]; ///< For gdb
 		F32 carr2[4][4]; ///< For gdb
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 		std::array<__m128, 4> arrMm;
 #endif
 	};

+ 23 - 23
include/anki/math/Mat4.inl.h

@@ -9,7 +9,7 @@ namespace anki {
 // Copy
 inline Mat4::Mat4(const Mat4& b)
 {
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 	for(U i = 0; i < 4; i++)
 	{
 		arrMm[i] = b.arrMm[i];
@@ -25,7 +25,7 @@ inline Mat4::Mat4(const Mat4& b)
 // F32
 inline Mat4::Mat4(const F32 f)
 {
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 	for(U i = 0; i < 4; i++)
 	{
 		arrMm[i] = _mm_set1_ps(f);
@@ -193,7 +193,7 @@ inline const F32& Mat4::operator[](const U i) const
 	return arr1[i];
 }
 
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 inline const __m128& Mat4::getMm(const U i) const
 {
 	return arrMm[i];
@@ -212,7 +212,7 @@ inline __m128& Mat4::getMm(const U i)
 // =
 inline Mat4& Mat4::operator=(const Mat4& b)
 {
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 	for(U i = 0; i < 4; i++)
 	{
 		arrMm[i] = b.arrMm[i];
@@ -230,7 +230,7 @@ inline Mat4& Mat4::operator=(const Mat4& b)
 inline Mat4 Mat4::operator+(const Mat4& b) const
 {
 	Mat4 c;
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 	for(U i = 0; i < 4; i++)
 	{
 		c.arrMm[i] = _mm_add_ps(arrMm[i], b.arrMm[i]);
@@ -247,7 +247,7 @@ inline Mat4 Mat4::operator+(const Mat4& b) const
 // +=
 inline Mat4& Mat4::operator+=(const Mat4& b)
 {
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 	for(U i = 0; i < 4; i++)
 	{
 		arrMm[i] = _mm_add_ps(arrMm[i], b.arrMm[i]);
@@ -265,7 +265,7 @@ inline Mat4& Mat4::operator+=(const Mat4& b)
 inline Mat4 Mat4::operator-(const Mat4& b) const
 {
 	Mat4 c;
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 	for(U i = 0; i < 4; i++)
 	{
 		c.arrMm[i] = _mm_sub_ps(arrMm[i], b.arrMm[i]);
@@ -282,7 +282,7 @@ inline Mat4 Mat4::operator-(const Mat4& b) const
 // -=
 inline Mat4& Mat4::operator-=(const Mat4& b)
 {
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 	for(U i = 0; i < 4; i++)
 	{
 		arrMm[i] = _mm_sub_ps(arrMm[i], b.arrMm[i]);
@@ -300,7 +300,7 @@ inline Mat4& Mat4::operator-=(const Mat4& b)
 inline Mat4 Mat4::operator*(const Mat4& b) const
 {
 	Mat4 c;
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 	Mat4 t(b);
 	t.transpose();
 	for(U i = 0; i < 4; i++)
@@ -364,7 +364,7 @@ inline Bool Mat4::operator!=(const Mat4& b) const
 inline Mat4 Mat4::operator+(const F32 f) const
 {
 	Mat4 c;
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 	__m128 mm;
 	mm = _mm_set1_ps(f);
 	for(U i = 0; i < 4; i++)
@@ -383,7 +383,7 @@ inline Mat4 Mat4::operator+(const F32 f) const
 // 4x4 += F32
 inline Mat4& Mat4::operator+=(const F32 f)
 {
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 	__m128 mm;
 	mm = _mm_set1_ps(f);
 	for(U i = 0; i < 4; i++)
@@ -403,7 +403,7 @@ inline Mat4& Mat4::operator+=(const F32 f)
 inline Mat4 Mat4::operator-(const F32 f) const
 {
 	Mat4 r;
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 	__m128 mm;
 	mm = _mm_set1_ps(f);
 	for(U i = 0; i < 4; i++)
@@ -422,7 +422,7 @@ inline Mat4 Mat4::operator-(const F32 f) const
 // 4x4 -= F32
 inline Mat4& Mat4::operator-=(const F32 f)
 {
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 	__m128 mm;
 	mm = _mm_set1_ps(f);
 	for(U i = 0; i < 4; i++)
@@ -442,7 +442,7 @@ inline Mat4& Mat4::operator-=(const F32 f)
 inline Mat4 Mat4::operator*(const F32 f) const
 {
 	Mat4 r;
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 	__m128 mm;
 	mm = _mm_set1_ps(f);
 	for(U i = 0; i < 4; i++)
@@ -461,7 +461,7 @@ inline Mat4 Mat4::operator*(const F32 f) const
 // 4x4 *= F32
 inline Mat4& Mat4::operator*=(const F32 f)
 {
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 	__m128 mm;
 	mm = _mm_set1_ps(f);
 	for(U i = 0; i < 4; i++)
@@ -481,7 +481,7 @@ inline Mat4& Mat4::operator*=(const F32 f)
 inline Mat4 Mat4::operator/(const F32 f) const
 {
 	Mat4 r;
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 	__m128 mm;
 	mm = _mm_set1_ps(f);
 	for(U i = 0; i < 4; i++)
@@ -500,7 +500,7 @@ inline Mat4 Mat4::operator/(const F32 f) const
 // 4x4 /= F32
 inline Mat4& Mat4::operator/=(const F32 f)
 {
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 	__m128 mm;
 	mm = _mm_set1_ps(f);
 	for(U i = 0; i < 4; i++)
@@ -523,7 +523,7 @@ inline Mat4& Mat4::operator/=(const F32 f)
 // Mat4 * Vec4
 inline Vec4 Mat4::operator*(const Vec4& b) const
 {
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 	Vec4 v;
 	for(U i = 0; i < 4; i++)
 	{
@@ -557,7 +557,7 @@ inline Vec4 Mat4::operator*(const Vec4& b) const
 inline void Mat4::setRows(const Vec4& a, const Vec4& b, const Vec4& c,
 	const Vec4& d)
 {
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 	arrMm[0] = a.getMm();
 	arrMm[1] = b.getMm();
 	arrMm[2] = c.getMm();
@@ -585,7 +585,7 @@ inline void Mat4::setRows(const Vec4& a, const Vec4& b, const Vec4& c,
 // setRow
 inline void Mat4::setRow(const U i, const Vec4& v)
 {
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 	arrMm[i] = v.getMm();
 #else
 	(*this)(i, 0) = v.x();
@@ -629,7 +629,7 @@ inline void Mat4::setColumn(const U i, const Vec4& v)
 // transpose
 inline void Mat4::transpose()
 {
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 	_MM_TRANSPOSE4_PS(arrMm[0], arrMm[1], arrMm[2], arrMm[3]);
 #else
 	F32 tmp = (*this)(0, 1);
@@ -927,7 +927,7 @@ inline Mat4 operator+(const F32 f, const Mat4& m4)
 inline Mat4 operator-(const F32 f, const Mat4& m4)
 {
 	Mat4 r;
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 	__m128 mm;
 	mm = _mm_set1_ps(f);
 	for(U i = 0; i < 4; i++)
@@ -953,7 +953,7 @@ inline Mat4 operator*(const F32 f, const Mat4& m4)
 inline Mat4 operator/(const F32 f, const Mat4& m4)
 {
 	Mat4 r;
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 	__m128 mm;
 	mm = _mm_set1_ps(f);
 	for(U i = 0; i < 4; i++)

+ 1 - 1
include/anki/math/Math.inl.h

@@ -5,7 +5,7 @@ namespace anki {
 //==============================================================================
 inline F32 Math::sqrt(const F32 f)
 {
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 	__m128 mm = _mm_set_ss(f);
 	mm = _mm_sqrt_ss(mm);
 	F32 o;

+ 1 - 1
include/anki/math/MathSimd.h

@@ -1,7 +1,7 @@
 #ifndef ANKI_MATH_MATH_SIMD_H
 #define ANKI_MATH_MATH_SIMD_H
 
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 #	include <smmintrin.h>
 #endif
 

+ 1 - 1
include/anki/math/Vec3.inl.h

@@ -410,7 +410,7 @@ inline void Vec3::transform(const Vec3& translate, const Quat& rotate,
 // Mat4
 inline Vec3 Vec3::getTransformed(const Mat4& transform) const
 {
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 	Vec3 out;
 	Vec4 v4((*this), 1.0);
 	for(U i = 0; i < 3; i++)

+ 3 - 3
include/anki/math/Vec4.h

@@ -24,7 +24,7 @@ public:
 	explicit Vec4(const Vec3& v3, const F32 w);
 	Vec4(const Vec4& b);
 	explicit Vec4(const Quat& q);
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 	explicit Vec4(const __m128& mm);
 #endif
 	/// @}
@@ -41,7 +41,7 @@ public:
 	F32 w() const;
 	F32& operator[](const U i);
 	F32 operator[](const U i) const;
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 	__m128& getMm();
 	const __m128& getMm() const;
 #endif
@@ -115,7 +115,7 @@ private:
 
 		std::array<F32, 4> arr;
 
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 		__m128 mm;
 #endif
 	};

+ 17 - 17
include/anki/math/Vec4.inl.h

@@ -9,7 +9,7 @@ namespace anki {
 // default
 inline Vec4::Vec4()
 {
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 	mm = _mm_setzero_ps();
 #else
 	arr[0] = arr[1] = arr[2] = arr[3] = 0.0;
@@ -19,7 +19,7 @@ inline Vec4::Vec4()
 // F32
 inline Vec4::Vec4(F32 f)
 {
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 	mm = _mm_set1_ps(f);
 #else
 	arr[0] = arr[1] = arr[2] = arr[3] = f;
@@ -29,7 +29,7 @@ inline Vec4::Vec4(F32 f)
 // F32[]
 inline Vec4::Vec4(const F32 arr_[])
 {
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 	mm = _mm_load_ps(arr_);
 #else
 	arr[0] = arr_[0];
@@ -43,7 +43,7 @@ inline Vec4::Vec4(const F32 arr_[])
 inline Vec4::Vec4(const F32 x_, const F32 y_, const F32 z_,
 	const F32 w_)
 {
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 	mm = _mm_set_ps(w_, z_, y_, x_);
 #else
 	x() = x_;
@@ -83,7 +83,7 @@ inline Vec4::Vec4(const Vec3& v3, const F32 w_)
 // Copy
 inline Vec4::Vec4(const Vec4& b)
 {
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 	mm = b.mm;
 #else
 	x() = b.x();
@@ -103,7 +103,7 @@ inline Vec4::Vec4(const Quat& q)
 }
 
 // __m128
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 inline Vec4::Vec4(const __m128& mm_)
 {
 	mm = mm_;
@@ -164,7 +164,7 @@ inline F32 Vec4::w() const
 	return vec.w;
 }
 
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 inline __m128& Vec4::getMm()
 {
 	return mm;
@@ -194,7 +194,7 @@ inline Vec3 Vec4::xyz() const
 // =
 inline Vec4& Vec4::operator=(const Vec4& b)
 {
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 	mm = b.mm;
 #else
 	x() = b.x();
@@ -208,7 +208,7 @@ inline Vec4& Vec4::operator=(const Vec4& b)
 // +
 inline Vec4 Vec4::operator+(const Vec4& b) const
 {
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 	return Vec4(_mm_add_ps(mm, b.mm));
 #else
 	return Vec4(x() + b.x(), y() + b.y(), z() + b.z(), w() + b.w());
@@ -218,7 +218,7 @@ inline Vec4 Vec4::operator+(const Vec4& b) const
 // +=
 inline Vec4& Vec4::operator+=(const Vec4& b)
 {
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 	mm = _mm_add_ps(mm, b.mm);
 #else
 	x() += b.x();
@@ -232,7 +232,7 @@ inline Vec4& Vec4::operator+=(const Vec4& b)
 // -
 inline Vec4 Vec4::operator-(const Vec4& b) const
 {
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 	return Vec4(_mm_sub_ps(mm, b.mm));
 #else
 	return Vec4(x() - b.x(), y() - b.y(), z() - b.z(), w() - b.w());
@@ -242,7 +242,7 @@ inline Vec4 Vec4::operator-(const Vec4& b) const
 // -=
 inline Vec4& Vec4::operator-=(const Vec4& b)
 {
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 	mm = _mm_sub_ps(mm, b.mm);
 #else
 	x() -= b.x();
@@ -256,7 +256,7 @@ inline Vec4& Vec4::operator-=(const Vec4& b)
 // *
 inline Vec4 Vec4::operator*(const Vec4& b) const
 {
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 	return Vec4(_mm_mul_ps(mm, b.mm));
 #else
 	return Vec4(x() * b.x(), y() * b.y(), z() * b.z(), w() * b.w());
@@ -266,7 +266,7 @@ inline Vec4 Vec4::operator*(const Vec4& b) const
 // *=
 inline Vec4& Vec4::operator*=(const Vec4& b)
 {
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 	mm = _mm_mul_ps(mm, b.mm);
 #else
 	x() *= b.x();
@@ -280,7 +280,7 @@ inline Vec4& Vec4::operator*=(const Vec4& b)
 // /
 inline Vec4 Vec4::operator/(const Vec4& b) const
 {
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 	return Vec4(_mm_div_ps(mm, b.mm));
 #else
 	return Vec4(x() / b.x(), y() / b.y(), z() / b.z(), w() / b.w());
@@ -290,7 +290,7 @@ inline Vec4 Vec4::operator/(const Vec4& b) const
 // /=
 inline Vec4& Vec4::operator/=(const Vec4& b)
 {
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 	mm = _mm_div_ps(mm, b.mm);
 #else
 	x() /= b.x();
@@ -412,7 +412,7 @@ inline Vec4 Vec4::operator*(const Mat4& m4) const
 // dot
 inline F32 Vec4::dot(const Vec4& b) const
 {
-#if defined(ANKI_MATH_INTEL_SIMD)
+#if defined(ANKI_MATH_SIMD_SSE)
 	F32 o;
 	_mm_store_ss(&o, _mm_dp_ps(mm, b.mm, 0xF1));
 	return o;

+ 8 - 3
src/util/CMakeLists.txt

@@ -1,4 +1,9 @@
-FILE(GLOB_RECURSE ANKI_UTIL_SOURCES *.cpp)
-FILE(GLOB_RECURSE ANKI_UTIL_HEADERS *.h)
+SET(ANKI_UTIL_SOURCES Assert.cpp BinaryStream.cpp Exception.cpp Functions.cpp Scanner.cpp StringList.cpp)
 
-ADD_LIBRARY(ankiutil ${ANKI_UTIL_SOURCES} ${ANKI_UTIL_HEADERS})
+IF(ANKI_PLATFORM STREQUAL "LINUX")
+	SET(ANKI_UTIL_SOURCES ${ANKI_UTIL_SOURCES} HighRezTimerPosix.cpp FilesystemPosix.cpp)
+ELSE()
+	MESSAGE(FATAL "See file")
+ENDIF()
+
+ADD_LIBRARY(ankiutil ${ANKI_UTIL_SOURCES})

+ 0 - 0
src/util/Filesystem.cpp → src/util/FilesystemPosix.cpp


+ 4 - 3
src/util/HighRezTimer.cpp → src/util/HighRezTimerPosix.cpp

@@ -19,9 +19,10 @@ static struct timespec gstart;
 static struct timeval gstart;
 #endif
 
-struct Dummy
+/// A dummy struct that inits the timer
+struct DummyInitTimer
 {
-	Dummy()
+	DummyInitTimer()
 	{
 #if HAVE_CLOCK_GETTIME
 		clock_gettime(CLOCK_MONOTONIC, &gstart);
@@ -31,7 +32,7 @@ struct Dummy
 	}
 };
 
-static Dummy dummy;
+static DummyInitTimer dummy;
 
 //==============================================================================
 void HighRezTimer::start()