SVF-tools / SVF

Static Value-Flow Analysis Framework for Source Code
http://svf-tools.github.io/SVF/
Other
1.39k stars 435 forks source link

A question about running SVF on Windows #908

Open anabioticsoul opened 1 year ago

anabioticsoul commented 1 year ago

Hello everyone, I want to use SVF as a lib on Win11 for static analysis in Visual Studio 2022.

Use SVF as an external lib for your own project

I found this link is still a blank page, so how could I build it for VS2022? Thanks a lot!

yuleisui commented 1 year ago

Fixed in README.

anabioticsoul commented 1 year ago

I build SVF on Windows by cmake, but it finally failed.

Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output:
Change Dir: E:/C++ repositories/SVF-master/build/CMakeFiles/CMakeScratch/TryCompile-r4f1lc

Run Build Command(s):C:/PROGRA~2/CMake/bin/ninja.exe cmTC_3957f && [1/2] Building C object CMakeFiles\cmTC_3957f.dir\CheckFunctionExists.c.obj
FAILED: CMakeFiles/cmTC_3957f.dir/CheckFunctionExists.c.obj 

"D:\Program Files\Microsoft\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\Hostx64\x64\cl.exe"  /nologo   /DWIN32 /D_WINDOWS /W3 -fPIC -Werror -Wall -O3 -DCHECK_FUNCTION_EXISTS=pthread_create /MDd /Zi /Ob0 /Od /RTC1 /showIncludes /FoCMakeFiles\cmTC_3957f.dir\CheckFunctionExists.c.obj /FdCMakeFiles\cmTC_3957f.dir\ /FS -c "E:\C++ repositories\SVF-master\build\CMakeFiles\CMakeScratch\TryCompile-9781b5\CheckFunctionExists.c"

cl: command line error D8021 : invalid numeric argument “/Werror”

ninja: build stopped: subcommand failed

I think the lack of Linux head file such as pthread.h may probably cause the error. Could you please help me, thank you very much!