diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 262cfe8..728a5d1 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -52,6 +52,12 @@ target_link_libraries(ggwave-common PRIVATE ${CMAKE_DL_LIBS} ) +if (MINGW) + target_link_libraries(ggwave-common PUBLIC + stdc++ + ) +endif() + if (GGWAVE_SUPPORT_SDL2) # ggwave-common-sdl2 diff --git a/examples/ggwave-common.cpp b/examples/ggwave-common.cpp index 6607d27..f28240d 100644 --- a/examples/ggwave-common.cpp +++ b/examples/ggwave-common.cpp @@ -47,9 +47,9 @@ std::vector readFile(const char* filename) { } std::string getBinaryPath() { -#ifdef __EMSCRIPTEN__ +#if defined(__EMSCRIPTEN__) || defined(_WIN32) return ""; -#endif +#else std::string result; void* p = reinterpret_cast(dummy); @@ -73,4 +73,5 @@ std::string getBinaryPath() { } return result; +#endif } diff --git a/examples/third-party/imgui/CMakeLists.txt b/examples/third-party/imgui/CMakeLists.txt index 84043d0..584e368 100644 --- a/examples/third-party/imgui/CMakeLists.txt +++ b/examples/third-party/imgui/CMakeLists.txt @@ -31,6 +31,12 @@ target_link_libraries(imgui PRIVATE ${ADDITIONAL_LIBRARIES} ) +if (MINGW) + target_link_libraries(imgui PUBLIC + stdc++ + ) +endif() + if (GGWAVE_SUPPORT_SDL2) if (MINGW) find_package(PkgConfig REQUIRED) @@ -57,7 +63,6 @@ if (GGWAVE_SUPPORT_SDL2) imgui opengl32 ${SDL2_LIBRARIES} - stdc++ ) target_link_libraries(imgui-sdl2 PRIVATE diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 965cd5e..a2981f5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -21,3 +21,9 @@ if (BUILD_SHARED_LIBS) GGWAVE_SHARED ) endif() + +if (MINGW) + target_link_libraries(${TARGET} PUBLIC + stdc++ + ) +endif() diff --git a/tests/test-ggwave.c b/tests/test-ggwave.c index 54a812a..2719eb8 100644 --- a/tests/test-ggwave.c +++ b/tests/test-ggwave.c @@ -30,7 +30,7 @@ int main() { ret = ggwave_encode(instance, payload, 4, GGWAVE_TX_PROTOCOL_AUDIBLE_FAST, 50, waveform, 0); CHECK(ret > 0); - ret = ggwave_decode(instance, waveform, sizeof(int16_t)*ret, decoded); + ret = ggwave_decode(instance, waveform, sizeof(signed)*ret, decoded); CHECK(ret == 4); CHECK(strcmp(decoded, payload) == 0); diff --git a/tests/test-ggwave.cpp b/tests/test-ggwave.cpp index 24775cc..bbdea63 100644 --- a/tests/test-ggwave.cpp +++ b/tests/test-ggwave.cpp @@ -7,6 +7,7 @@ #include #include #include +#include float frand() { return float(rand()%RAND_MAX)/RAND_MAX; }