]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Fix ZSTD_BUILD_TESTS=ON build with MSVC 3180/head
authorTaylor Braun-Jones <taylor@braun-jones.org>
Thu, 30 Jun 2022 17:20:42 +0000 (13:20 -0400)
committerTaylor Braun-Jones <taylor@braun-jones.org>
Thu, 30 Jun 2022 17:20:42 +0000 (13:20 -0400)
Fixes:

    Command line error D8021 : invalid numeric argument '/Wno-deprecated-declarations'

build/cmake/tests/CMakeLists.txt

index 8bba6ea65a60f198726b3076c65c39d7766ddb5f..6c1ea298a1cd6f4f985fa0494bc58fcaeac21baf 100644 (file)
@@ -57,7 +57,9 @@ target_link_libraries(datagen libzstd_static)
 # fullbench
 #
 add_executable(fullbench ${PROGRAMS_DIR}/datagen.c ${PROGRAMS_DIR}/util.c ${PROGRAMS_DIR}/timefn.c ${PROGRAMS_DIR}/benchfn.c ${PROGRAMS_DIR}/benchzstd.c ${TESTS_DIR}/fullbench.c)
-set_property(TARGET fullbench APPEND PROPERTY COMPILE_OPTIONS "-Wno-deprecated-declarations")
+if (NOT MSVC)
+    target_compile_options(fullbench PRIVATE "-Wno-deprecated-declarations")
+endif()
 target_link_libraries(fullbench libzstd_static)
 add_test(NAME fullbench COMMAND fullbench ${ZSTD_FULLBENCH_FLAGS})
 
@@ -65,7 +67,9 @@ add_test(NAME fullbench COMMAND fullbench ${ZSTD_FULLBENCH_FLAGS})
 # fuzzer
 #
 add_executable(fuzzer ${PROGRAMS_DIR}/datagen.c ${PROGRAMS_DIR}/util.c ${PROGRAMS_DIR}/timefn.c ${TESTS_DIR}/fuzzer.c)
-set_property(TARGET fuzzer APPEND PROPERTY COMPILE_OPTIONS "-Wno-deprecated-declarations")
+if (NOT MSVC)
+    target_compile_options(fuzzer PRIVATE "-Wno-deprecated-declarations")
+endif()
 target_link_libraries(fuzzer libzstd_static)
 AddTestFlagsOption(ZSTD_FUZZER_FLAGS "$ENV{FUZZERTEST} $ENV{FUZZER_FLAGS}"
     "Semicolon-separated list of flags to pass to the fuzzer test (see `fuzzer -h` for usage)")
@@ -78,7 +82,9 @@ add_test(NAME fuzzer COMMAND fuzzer ${ZSTD_FUZZER_FLAGS})
 # zstreamtest
 #
 add_executable(zstreamtest ${PROGRAMS_DIR}/datagen.c ${PROGRAMS_DIR}/util.c ${PROGRAMS_DIR}/timefn.c ${TESTS_DIR}/seqgen.c ${TESTS_DIR}/zstreamtest.c)
-set_property(TARGET zstreamtest APPEND PROPERTY COMPILE_OPTIONS "-Wno-deprecated-declarations")
+if (NOT MSVC)
+    target_compile_options(zstreamtest PRIVATE "-Wno-deprecated-declarations")
+endif()
 target_link_libraries(zstreamtest libzstd_static)
 AddTestFlagsOption(ZSTD_ZSTREAM_FLAGS "$ENV{ZSTREAM_TESTTIME} $ENV{FUZZER_FLAGS}"
     "Semicolon-separated list of flags to pass to the zstreamtest test (see `zstreamtest -h` for usage)")