From 2a348cbf908ce0952708cf0f9e223229dbc60605 Mon Sep 17 00:00:00 2001 From: Michael Maltese Date: Tue, 24 May 2016 19:21:49 -0700 Subject: [PATCH] Use command line switches that MSVC understands --- CMakeLists.txt | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 497d1ae..47b5ada 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -192,15 +192,19 @@ set(LIBSOUNDIO_LIBS ${CMAKE_THREAD_LIBS_INIT} ) - - -set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Werror -pedantic") - - -set(LIB_CFLAGS "-std=c11 -fvisibility=hidden -Wall -Werror=strict-prototypes -Werror=old-style-definition -Werror=missing-prototypes -D_REENTRANT -D_POSIX_C_SOURCE=200809L -Wno-missing-braces") -set(EXAMPLE_CFLAGS "-std=c99 -Wall") -set(TEST_CFLAGS "${LIB_CFLAGS} -fprofile-arcs -ftest-coverage") -set(TEST_LDFLAGS "-fprofile-arcs -ftest-coverage") +if(MSVC) + set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /WX /Wall") + set(LIB_CFLAGS "/TP /W4") + set(EXAMPLE_CFLAGS "/W4") + set(TEST_CFLAGS "${LIB_CFLAGS}") + set(TEST_LDFLAGS " ") +else() + set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Werror -pedantic") + set(LIB_CFLAGS "-std=c11 -fvisibility=hidden -Wall -Werror=strict-prototypes -Werror=old-style-definition -Werror=missing-prototypes -D_REENTRANT -D_POSIX_C_SOURCE=200809L -Wno-missing-braces") + set(EXAMPLE_CFLAGS "-std=c99 -Wall") + set(TEST_CFLAGS "${LIB_CFLAGS} -fprofile-arcs -ftest-coverage") + set(TEST_LDFLAGS "-fprofile-arcs -ftest-coverage") +endif() configure_file( "${CMAKE_SOURCE_DIR}/src/config.h.in"