From 72bdee3ddb0e2af58209a25517e30fe637b94935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Bourbonnais?= Date: Thu, 23 Mar 2023 20:23:05 -0400 Subject: [PATCH] Fixes for building on windows (#47) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Don't link to pthread on windows Define a symbol instead of an int, MVSC can't see it as a constant. Signed-off-by: FĂ©lix Bourbonnais --- tests/CMakeLists.txt | 10 +++++++++- tests/OTIOCompositionTests.c | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 479a894..597770e 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -27,7 +27,15 @@ foreach(TEST ${TESTS}) cmocka copentime copentimelineio - pthread) + ) + + if (WIN32) + # don't link pthread + else() + target_link_libraries(C${TEST} PUBLIC + pthread + ) + endif() target_compile_definitions(C${TEST} PRIVATE SAMPLE_DATA_DIR=${CMAKE_CURRENT_SOURCE_DIR}/sample_data/) add_test(NAME C${TEST} COMMAND C${TEST}) diff --git a/tests/OTIOCompositionTests.c b/tests/OTIOCompositionTests.c index b85ae25..23de5b7 100644 --- a/tests/OTIOCompositionTests.c +++ b/tests/OTIOCompositionTests.c @@ -2058,7 +2058,7 @@ static void otio_nesting_deeply_nesting_test(void **state) { assert_true(RationalTime_equal(stack_transformed_time_fifty_clip, middle)); assert_true(RationalTime_equal(stack_transformed_time_ninetynine_clip, last)); - int num_wrappers = 10; + #define num_wrappers 10 Stack *wrappers[num_wrappers]; struct ClipWrapperPair clipWrapperPair; clipWrapperPair.clip = clip;