From c87ba839e36fe6655134fee307dfed027f9c4876 Mon Sep 17 00:00:00 2001 From: dofuuz Date: Sun, 18 Oct 2020 22:00:29 +0900 Subject: [PATCH 1/2] Change filename of MSVC static library to soundio-static.lib - Dynamic and static library had same output filename soundio.lib - To avoid conflict, dynamic/static library should have different name --- CMakeLists.txt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6541f1b4..a527fcc8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,10 +23,6 @@ set(LIBSOUNDIO_VERSION_PATCH 0) set(LIBSOUNDIO_VERSION "${LIBSOUNDIO_VERSION_MAJOR}.${LIBSOUNDIO_VERSION_MINOR}.${LIBSOUNDIO_VERSION_PATCH}") message("Configuring libsoundio version ${LIBSOUNDIO_VERSION}") -if(NOT SOUNDIO_STATIC_LIBNAME) - set(SOUNDIO_STATIC_LIBNAME soundio) -endif() - option(BUILD_STATIC_LIBS "Build static libraries" ON) option(BUILD_DYNAMIC_LIBS "Build dynamic libraries" ON) option(BUILD_EXAMPLE_PROGRAMS "Build example programs" ON) @@ -37,6 +33,13 @@ option(ENABLE_ALSA "Enable ALSA backend" ON) option(ENABLE_COREAUDIO "Enable CoreAudio backend" ON) option(ENABLE_WASAPI "Enable WASAPI backend" ON) +if(NOT SOUNDIO_STATIC_LIBNAME) + set(SOUNDIO_STATIC_LIBNAME soundio) + if(MSVC AND BUILD_DYNAMIC_LIBS) + set(SOUNDIO_STATIC_LIBNAME soundio-static) + endif() +endif() + find_package(Threads) if(Threads_FOUND) set(STATUS_THREADS "OK") From bd16e3cecdac414b0efcadbab1dfe36f749821fc Mon Sep 17 00:00:00 2001 From: dofuuz Date: Sun, 18 Oct 2020 22:43:38 +0900 Subject: [PATCH 2/2] Reduce MSVC warning level --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a527fcc8..2f0b566d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -202,8 +202,8 @@ set(LIBSOUNDIO_LIBS if(MSVC) set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /Wall") - set(LIB_CFLAGS "/TP /W4") - set(EXAMPLE_CFLAGS "/W4") + set(LIB_CFLAGS "/TP /W3") + set(EXAMPLE_CFLAGS "/W3") set(TEST_CFLAGS "${LIB_CFLAGS}") set(TEST_LDFLAGS " ") set(LIBM " ")