From b05c2f5327f4afa8b861642872370fd54f1249b5 Mon Sep 17 00:00:00 2001 From: David Farrell Date: Tue, 21 Apr 2020 10:52:25 -0700 Subject: [PATCH 1/5] Added install_vcpkg_dependencies.bat to set up dependencies This script will build both vcpkg and the dependencies needed by Tracy. It puts everything in the vcpkg/vcpkg directory, and changes no other state on the machine. It is perfectly safe to erase the vcpkg/vcpkg directory and re-run the script to build the dependencies again, although that should only be needed once. To add new vcpkg dependencies, just modify the 'vcpkg install ...' line in the .bat file. --- .gitignore | 4 ++++ vcpkg/install_vcpkg_dependencies.bat | 10 ++++++++++ 2 files changed, 14 insertions(+) create mode 100644 vcpkg/install_vcpkg_dependencies.bat diff --git a/.gitignore b/.gitignore index 48c593da..dcec2473 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,7 @@ manual/t*.synctex.gz manual/t*.toc profiler/build/win32/packages profiler/build/win32/Tracy.aps + +# include the vcpkg install script but not the files it produces +vcpkg/* +!vcpkg/install_vcpkg_dependencies.bat diff --git a/vcpkg/install_vcpkg_dependencies.bat b/vcpkg/install_vcpkg_dependencies.bat new file mode 100644 index 00000000..089c389c --- /dev/null +++ b/vcpkg/install_vcpkg_dependencies.bat @@ -0,0 +1,10 @@ +@echo off + +REM get vcpkg distribution +if not exist vcpkg git clone https://github.com/Microsoft/vcpkg.git + +REM build vcpkg +if not exist vcpkg\vcpkg.exe call vcpkg\bootstrap-vcpkg.bat + +REM install required packages +vcpkg\vcpkg.exe install --triplet x64-windows-static freetype glfw3 capstone[arm,arm64,x86] From a4a20ddc42f74bfc1a472fa2de9aaef541e23609 Mon Sep 17 00:00:00 2001 From: David Farrell Date: Tue, 21 Apr 2020 10:59:08 -0700 Subject: [PATCH 2/5] Updated Visual Studio project files to use vcpkg directory for dependencies This modifies all of the include and lib paths to point to vcpkg/vcpkg/installed/x64-windows-static/include and lib. With these changes, all executables in Tracy build out of the box in all configurations (assuming you have run the install_vcpkg_depencies.bat script first). Perhaps it would be better to use a single Visual Studio .props file that all of the .vcxproj files point to so that the include and lib paths are set in a single place, but for now the paths are set separately in each .vcxproj. --- capture/build/win32/capture.vcxproj | 8 ++++++-- import-chrome/build/win32/import-chrome.vcxproj | 8 ++++++-- profiler/build/win32/Tracy.vcxproj | 10 ++++++---- update/build/win32/update.vcxproj | 8 ++++++-- 4 files changed, 24 insertions(+), 10 deletions(-) diff --git a/capture/build/win32/capture.vcxproj b/capture/build/win32/capture.vcxproj index d0d59fd2..3808683b 100644 --- a/capture/build/win32/capture.vcxproj +++ b/capture/build/win32/capture.vcxproj @@ -89,10 +89,12 @@ TRACY_NO_STATISTICS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32_LEAN_AND_MEAN;NOMINMAX;_USE_MATH_DEFINES;%(PreprocessorDefinitions) AdvancedVectorExtensions2 stdcpplatest + ..\..\..\vcpkg\vcpkg\installed\x64-windows-static\include - ws2_32.lib;%(AdditionalDependencies) + ws2_32.lib;capstone.lib;%(AdditionalDependencies) Console + ..\..\..\vcpkg\vcpkg\installed\x64-windows-static\lib @@ -121,12 +123,14 @@ TRACY_NO_STATISTICS;NDEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32_LEAN_AND_MEAN;NOMINMAX;_USE_MATH_DEFINES;%(PreprocessorDefinitions) AdvancedVectorExtensions2 stdcpplatest + ..\..\..\vcpkg\vcpkg\installed\x64-windows-static\include true true - ws2_32.lib;%(AdditionalDependencies) + ws2_32.lib;capstone.lib;%(AdditionalDependencies) Console + ..\..\..\vcpkg\vcpkg\installed\x64-windows-static\lib diff --git a/import-chrome/build/win32/import-chrome.vcxproj b/import-chrome/build/win32/import-chrome.vcxproj index 009f03e9..5db6ca78 100644 --- a/import-chrome/build/win32/import-chrome.vcxproj +++ b/import-chrome/build/win32/import-chrome.vcxproj @@ -89,10 +89,12 @@ TRACY_NO_STATISTICS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32_LEAN_AND_MEAN;NOMINMAX;_USE_MATH_DEFINES;%(PreprocessorDefinitions) AdvancedVectorExtensions2 stdcpplatest + ..\..\..\vcpkg\vcpkg\installed\x64-windows-static\include - ws2_32.lib;%(AdditionalDependencies) + ws2_32.lib;capstone.lib;%(AdditionalDependencies) Console + ..\..\..\vcpkg\vcpkg\installed\x64-windows-static\lib @@ -121,12 +123,14 @@ TRACY_NO_STATISTICS;NDEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32_LEAN_AND_MEAN;NOMINMAX;_USE_MATH_DEFINES;%(PreprocessorDefinitions) AdvancedVectorExtensions2 stdcpplatest + ..\..\..\vcpkg\vcpkg\installed\x64-windows-static\include true true - ws2_32.lib;%(AdditionalDependencies) + ws2_32.lib;capstone.lib;%(AdditionalDependencies) Console + ..\..\..\vcpkg\vcpkg\installed\x64-windows-static\lib diff --git a/profiler/build/win32/Tracy.vcxproj b/profiler/build/win32/Tracy.vcxproj index d84fa9ea..8f181716 100644 --- a/profiler/build/win32/Tracy.vcxproj +++ b/profiler/build/win32/Tracy.vcxproj @@ -57,7 +57,7 @@ Disabled true _CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32_LEAN_AND_MEAN;NOMINMAX;_USE_MATH_DEFINES;%(PreprocessorDefinitions) - ..\..\libs\gl3w;..\..\..\imgui;%(AdditionalIncludeDirectories) + ..\..\libs\gl3w;..\..\..\imgui;..\..\..\vcpkg\vcpkg\installed\x64-windows-static\include;%(AdditionalIncludeDirectories) true false true @@ -67,8 +67,9 @@ Fast - ws2_32.lib;opengl32.lib;%(AdditionalDependencies) + ws2_32.lib;opengl32.lib;freetype.lib;glfw3.lib;libpng16.lib;zlib.lib;bz2.lib;capstone.lib;%(AdditionalDependencies) Windows + ..\..\..\vcpkg\vcpkg\installed\x64-windows-static\lib true @@ -82,7 +83,7 @@ true true NDEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32_LEAN_AND_MEAN;NOMINMAX;_USE_MATH_DEFINES;%(PreprocessorDefinitions) - ..\..\libs\gl3w;..\..\..\imgui;%(AdditionalIncludeDirectories) + ..\..\libs\gl3w;..\..\..\imgui;..\..\..\vcpkg\vcpkg\installed\x64-windows-static\include;%(AdditionalIncludeDirectories) true true AdvancedVectorExtensions2 @@ -93,8 +94,9 @@ true true - ws2_32.lib;opengl32.lib;%(AdditionalDependencies) + ws2_32.lib;opengl32.lib;freetype.lib;glfw3.lib;libpng16.lib;zlib.lib;bz2.lib;capstone.lib;%(AdditionalDependencies) Windows + ..\..\..\vcpkg\vcpkg\installed\x64-windows-static\lib true diff --git a/update/build/win32/update.vcxproj b/update/build/win32/update.vcxproj index 739835a0..3ed8a6e7 100644 --- a/update/build/win32/update.vcxproj +++ b/update/build/win32/update.vcxproj @@ -89,10 +89,12 @@ TRACY_NO_STATISTICS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32_LEAN_AND_MEAN;NOMINMAX;_USE_MATH_DEFINES;%(PreprocessorDefinitions) AdvancedVectorExtensions2 stdcpplatest + ..\..\..\vcpkg\vcpkg\installed\x64-windows-static\include - ws2_32.lib;%(AdditionalDependencies) + ws2_32.lib;capstone.lib;%(AdditionalDependencies) Console + ..\..\..\vcpkg\vcpkg\installed\x64-windows-static\lib @@ -121,12 +123,14 @@ TRACY_NO_STATISTICS;NDEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32_LEAN_AND_MEAN;NOMINMAX;_USE_MATH_DEFINES;%(PreprocessorDefinitions) AdvancedVectorExtensions2 stdcpplatest + ..\..\..\vcpkg\vcpkg\installed\x64-windows-static\include true true - ws2_32.lib;%(AdditionalDependencies) + ws2_32.lib;capstone.lib;%(AdditionalDependencies) Console + ..\..\..\vcpkg\vcpkg\installed\x64-windows-static\lib From 09e8ba12085467e953f18cf6a864d54abfaa2976 Mon Sep 17 00:00:00 2001 From: David Farrell Date: Tue, 21 Apr 2020 10:59:37 -0700 Subject: [PATCH 3/5] Updated manual with instructions for install_vcpkg_dependencies.bat --- manual/tracy.tex | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/manual/tracy.tex b/manual/tracy.tex index ebf0ec1f..bb1d879e 100644 --- a/manual/tracy.tex +++ b/manual/tracy.tex @@ -574,12 +574,10 @@ To build the application contained in the \texttt{profiler} directory, you will \paragraph{Windows} -On Windows you will need to use the \texttt{vcpkg} utility, which will automatically download and build the required files. If you are not familiar with this tool, please read the description at the following address: \url{https://docs.microsoft.com/en-us/cpp/build/vcpkg}. Please follow the installation instructions, then execute the following commands: - -\begin{lstlisting}[language=sh] -vcpkg integrate install -vcpkg install --triplet x64-windows-static freetype glfw3 capstone[arm,arm64,x86] -\end{lstlisting} +On Windows you will need to first run the script \texttt{vcpkg\\install\_vcpkg\_dependencies.bat}, which will +automatically download and build the required files using \texttt{vcpkg}. If you are not familiar with this tool, please +read the description at the following address: \url{https://docs.microsoft.com/en-us/cpp/build/vcpkg}. The batch file +downloads files to the \texttt{vcpkg} and modifies no other state on the machine. \paragraph{Unix} From 80fdf7517a791fed7dd24b98c989ace35798156a Mon Sep 17 00:00:00 2001 From: David Farrell Date: Tue, 21 Apr 2020 15:17:11 -0700 Subject: [PATCH 4/5] Use debug vcpkg libraries --- capture/build/win32/capture.vcxproj | 2 +- import-chrome/build/win32/import-chrome.vcxproj | 2 +- profiler/build/win32/Tracy.vcxproj | 4 ++-- update/build/win32/update.vcxproj | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/capture/build/win32/capture.vcxproj b/capture/build/win32/capture.vcxproj index 3808683b..ffea25c1 100644 --- a/capture/build/win32/capture.vcxproj +++ b/capture/build/win32/capture.vcxproj @@ -94,7 +94,7 @@ ws2_32.lib;capstone.lib;%(AdditionalDependencies) Console - ..\..\..\vcpkg\vcpkg\installed\x64-windows-static\lib + ..\..\..\vcpkg\vcpkg\installed\x64-windows-static\debug\lib diff --git a/import-chrome/build/win32/import-chrome.vcxproj b/import-chrome/build/win32/import-chrome.vcxproj index 5db6ca78..a6a5167c 100644 --- a/import-chrome/build/win32/import-chrome.vcxproj +++ b/import-chrome/build/win32/import-chrome.vcxproj @@ -94,7 +94,7 @@ ws2_32.lib;capstone.lib;%(AdditionalDependencies) Console - ..\..\..\vcpkg\vcpkg\installed\x64-windows-static\lib + ..\..\..\vcpkg\vcpkg\installed\x64-windows-static\debug\lib diff --git a/profiler/build/win32/Tracy.vcxproj b/profiler/build/win32/Tracy.vcxproj index 8f181716..4d25bd24 100644 --- a/profiler/build/win32/Tracy.vcxproj +++ b/profiler/build/win32/Tracy.vcxproj @@ -67,9 +67,9 @@ Fast - ws2_32.lib;opengl32.lib;freetype.lib;glfw3.lib;libpng16.lib;zlib.lib;bz2.lib;capstone.lib;%(AdditionalDependencies) + ws2_32.lib;opengl32.lib;freetyped.lib;glfw3.lib;libpng16d.lib;zlibd.lib;bz2d.lib;capstone.lib;%(AdditionalDependencies) Windows - ..\..\..\vcpkg\vcpkg\installed\x64-windows-static\lib + ..\..\..\vcpkg\vcpkg\installed\x64-windows-static\debug\lib true diff --git a/update/build/win32/update.vcxproj b/update/build/win32/update.vcxproj index 3ed8a6e7..46ed6aa9 100644 --- a/update/build/win32/update.vcxproj +++ b/update/build/win32/update.vcxproj @@ -94,7 +94,7 @@ ws2_32.lib;capstone.lib;%(AdditionalDependencies) Console - ..\..\..\vcpkg\vcpkg\installed\x64-windows-static\lib + ..\..\..\vcpkg\vcpkg\installed\x64-windows-static\debug\lib From d5cd9d0221c9b446e06e2229728e42a7ddd5a8c7 Mon Sep 17 00:00:00 2001 From: David Farrell Date: Tue, 21 Apr 2020 16:04:33 -0700 Subject: [PATCH 5/5] Updated manual's vcpkg instructions --- manual/tracy.tex | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/manual/tracy.tex b/manual/tracy.tex index bb1d879e..a8545bbc 100644 --- a/manual/tracy.tex +++ b/manual/tracy.tex @@ -574,10 +574,22 @@ To build the application contained in the \texttt{profiler} directory, you will \paragraph{Windows} -On Windows you will need to first run the script \texttt{vcpkg\\install\_vcpkg\_dependencies.bat}, which will -automatically download and build the required files using \texttt{vcpkg}. If you are not familiar with this tool, please -read the description at the following address: \url{https://docs.microsoft.com/en-us/cpp/build/vcpkg}. The batch file -downloads files to the \texttt{vcpkg} and modifies no other state on the machine. +On Windows you will need to use the \texttt{vcpkg} utility. If you are not familiar with this tool, please read the description at the following address: \url{https://docs.microsoft.com/en-us/cpp/build/vcpkg}. + +There are two ways you can run \texttt{vcpkg} to install the dependencies for Tracy: + +\begin{itemize} +\item \texttt{STANDALONE} -- run this script to download and build both \texttt{vcpkg} and the required dependencies: +\begin{lstlisting}[language=sh] +tracy\vcpkg\install_vcpkg_dependencies.bat +\end{lstlisting} +This writes files only to the \texttt{tracy\textbackslash{}vcpkg\textbackslash{}vcpkg} directory and makes no other changes on your machine. +\item \texttt{SEPARATE} -- install \texttt{vcpkg} by following the instructions on its website, and then execute the following commands: +\begin{lstlisting}[language=sh] +vcpkg integrate install +vcpkg install --triplet x64-windows-static freetype glfw3 capstone[arm,arm64,x86] +\end{lstlisting} +\end{itemize} \paragraph{Unix}