Skip to content

Commit 116a8d4

Browse files
committed
Windows compile fixes
1 parent c008ded commit 116a8d4

File tree

6 files changed

+23
-13
lines changed

6 files changed

+23
-13
lines changed

.github/workflows/tsd_ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,25 @@ jobs:
2828
${{github.workspace}}/tsd/cmake/build_deps
2929
3030
- name: Build + install ANARI-SDK
31-
run: cmake --build ${{github.workspace}}/deps_build --config ${{ matrix.config }}
31+
run: cmake --build ${{ github.workspace }}/deps_build --config ${{ matrix.config }}
3232

3333
- name: Configure TSD CMake
3434
run: >
3535
cmake -LA -B ${{github.workspace}}/build
3636
-DBUILD_INTERACTIVE_APPS=OFF
37-
-DCMAKE_PREFIX_PATH=${{github.workspace}}/deps
37+
-DCMAKE_PREFIX_PATH=${{ github.workspace }}/deps
3838
-DCMAKE_BUILD_TYPE=${{ matrix.config }}
3939
-DTSD_USE_ASSIMP=OFF
4040
-DTSD_USE_CUDA=OFF
4141
-DTSD_USE_HDF5=OFF
4242
-DTSD_USE_OPENGL=OFF
4343
-DTSD_USE_TBB=OFF
4444
-DTSD_ENABLE_SERIALIZATION=OFF
45-
${{github.workspace}}/tsd
45+
${{ github.workspace }}/tsd
4646
4747
- name: Build
48-
run: cmake --build ${{github.workspace}}/build --config ${{ matrix.config }}
48+
run: cmake --build ${{ github.workspace }}/build --config ${{ matrix.config }}
4949

5050
- name: Unit Tests
51-
working-directory: ${{github.workspace}}/build
51+
working-directory: ${{ github.workspace }}/build
5252
run: ctest -C ${{ matrix.config }} --output-on-failure

tsd/src/tsd/CMakeLists.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,23 @@ PUBLIC
5353
project_link_libraries(
5454
PUBLIC
5555
anari::helium
56-
anari::anari
5756
PRIVATE
5857
$<BUILD_INTERFACE:tsd_nanovdb>
5958
$<BUILD_INTERFACE:tsd_stb>
6059
$<BUILD_INTERFACE:tsd_tiny_obj_loader>
6160
$<BUILD_INTERFACE:tsd_tinyply>
6261
)
6362

63+
if (WIN32)
64+
project_link_libraries(PUBLIC anari::anari_static)
65+
else()
66+
project_link_libraries(PUBLIC anari::anari)
67+
endif()
68+
69+
if (MSVC)
70+
project_compile_options(PRIVATE /bigobj)
71+
endif()
72+
6473
if (TSD_USE_CUDA)
6574
project_compile_definitions(PUBLIC -DTSD_USE_CUDA=1)
6675
project_link_libraries(PUBLIC CUDA::cudart)

tsd/src/tsd/authoring/importers/import_DLAF.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ void import_DLAF(Context &ctx,
7676
mat->setParameterObject("color"_t, *sampler);
7777
}
7878

79-
ssize_t numRemainingPoints = scene.distances.size();
80-
constexpr ssize_t CHUNK = 1e7;
79+
int64_t numRemainingPoints = scene.distances.size();
80+
constexpr int64_t CHUNK = 1e7;
8181

8282
for (int i = 0; numRemainingPoints > 0; numRemainingPoints -= CHUNK, i++) {
8383
const size_t numPoints =

tsd/src/tsd/authoring/importers/import_NBODY.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ void import_NBODY(Context &ctx,
5757
? ctx.getObject<Material>(0)
5858
: ctx.createObject<Material>(tokens::material::matte);
5959

60-
ssize_t numRemainingPoints = scene.points.size();
61-
constexpr ssize_t CHUNK = 1e7;
60+
int64_t numRemainingPoints = scene.points.size();
61+
constexpr int64_t CHUNK = 1e7;
6262

6363
for (int i = 0; numRemainingPoints > 0; numRemainingPoints -= CHUNK, i++) {
6464
const size_t numPoints =

tsd/src/tsd/containers/IndexedVector.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ template <typename T>
188188
template <typename... Args>
189189
IndexedVectorRef<T> IndexedVector<T>::emplace(Args &&...args)
190190
{
191-
return insert(T(std::forward<Args>(args)...));
191+
return insert(std::move(T(std::forward<Args>(args)...)));
192192
}
193193

194194
template <typename T>

tsd/src/tsd/core/TSDMath.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ static constexpr tsd::math::float3 to_float3(const tsd::math::float4 &v)
2222
return tsd::math::float3(v.x, v.y, v.z);
2323
};
2424

25-
static constexpr bool neql(float a, float b, float eps = 1e-6f)
25+
template <typename T>
26+
static constexpr bool neql(T a, T b, T eps = 1e-6)
2627
{
2728
return std::abs(a - b) <= eps;
2829
}
@@ -39,7 +40,7 @@ static constexpr tsd::math::float3 radians(tsd::math::float3 v)
3940

4041
static constexpr float degrees(float radians)
4142
{
42-
return radians * 180.f / M_PI;
43+
return radians * 180.f / float(M_PI);
4344
};
4445

4546
static constexpr tsd::math::float3 degrees(tsd::math::float3 v)

0 commit comments

Comments
 (0)