From 4fd2f8c52471cb3f22488f4d1dbf448127300a5b Mon Sep 17 00:00:00 2001 From: Audrey Dutcher Date: Fri, 6 Sep 2019 19:46:28 -0700 Subject: [PATCH] Final tweaks to MSVC build (#1139) * Quote paths in msvc postbuildevent scripts * Update MSVC readme with some new advice --- msvc/README.TXT | 24 +++++++++++++-- msvc/unicorn/unicorn/unicorn.vcxproj | 30 +++++++++---------- .../unicorn_static/unicorn_static.vcxproj | 26 ++++++++-------- 3 files changed, 49 insertions(+), 31 deletions(-) diff --git a/msvc/README.TXT b/msvc/README.TXT index 94f9a6d0..7853b8dd 100644 --- a/msvc/README.TXT +++ b/msvc/README.TXT @@ -5,15 +5,33 @@ Zak Escano - January 2017 These notes are to help myself and others with the upkeep of the msvc native port of unicorn-engine. + +:: Command line build instructions + + msbuild -m -p:Configuration=Release -p:Platform=Win32 + msbuild -m -p:Configuration=Release -p:Platform=x64 + +Then bundle and release the folder "distro". + + :: Build settings -Visual Studio Version: Visual Studio 2012 v11.061219.00 Update 5 -Platform Toolset: Visual Studio 2012 - Windows XP (v110_xp) +Visual Studio Version: Visual Studio 2017 v15.9.15 +Platform Toolset: Default. Known to work with the 8.1 SDK Character Set: Use Multi-Byte Character Set Runtime Library Debug: Multi-threaded Debug (/MTd) Runtime Library Release: Multi-threaded (/MT) Precompiled Header: Not Using Precompiled Headers -Additional Options: /wd4018 /wd4244 /wd4267 +Additional Options: /wd4018 /wd4244 /wd4267 + + +:: Build advice + +- If you see warnings about spectre-mitigated libraries and then some strange + errors, the errors may be related to the spectre libraries. Install them. + (via the visual studio installation manager) +- The "platform default" target SDK may not actually be installed for you. Try + installing the Windows 8.1 SDK via the visual studio installation manager. :: Changes porting unicorn from GNU/GCC to MSVC. diff --git a/msvc/unicorn/unicorn/unicorn.vcxproj b/msvc/unicorn/unicorn/unicorn.vcxproj index aee78ed0..27f7762b 100644 --- a/msvc/unicorn/unicorn/unicorn.vcxproj +++ b/msvc/unicorn/unicorn/unicorn.vcxproj @@ -145,15 +145,15 @@ $(SolutionDir)$(Platform)\$(Configuration)\ - mkdir $(SolutionDir)distro\ -mkdir $(SolutionDir)distro\include -mkdir $(SolutionDir)distro\include\unicorn -mkdir $(SolutionDir)distro\$(Platform) + mkdir "$(SolutionDir)distro\" +mkdir "$(SolutionDir)distro\include" +mkdir "$(SolutionDir)distro\include\unicorn" +mkdir "$(SolutionDir)distro\$(Platform)" -copy $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName).dll $(SolutionDir)distro\$(Platform)\ -copy $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName).lib $(SolutionDir)distro\$(Platform)\ +copy "$(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName).dll" "$(SolutionDir)distro\$(Platform)\" +copy "$(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName).lib" "$(SolutionDir)distro\$(Platform)\" -copy $(SolutionDir)..\include\unicorn\*.h $(SolutionDir)distro\include\unicorn\ +copy "$(SolutionDir)..\include\unicorn\*.h" "$(SolutionDir)distro\include\unicorn\" @@ -180,15 +180,15 @@ copy $(SolutionDir)..\include\unicorn\*.h $(SolutionDir)distro\include\unicorn\ $(SolutionDir)$(Platform)\$(Configuration)\ - mkdir $(SolutionDir)distro\ -mkdir $(SolutionDir)distro\include -mkdir $(SolutionDir)distro\include\unicorn -mkdir $(SolutionDir)distro\$(Platform) + mkdir "$(SolutionDir)distro\" +mkdir "$(SolutionDir)distro\include" +mkdir "$(SolutionDir)distro\include\unicorn" +mkdir "$(SolutionDir)distro\$(Platform)" -copy $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName).dll $(SolutionDir)distro\$(Platform)\ -copy $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName).lib $(SolutionDir)distro\$(Platform)\ +copy "$(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName).dll" "$(SolutionDir)distro\$(Platform)\" +copy "$(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName).lib" "$(SolutionDir)distro\$(Platform)\" -copy $(SolutionDir)..\include\unicorn\*.h $(SolutionDir)distro\include\unicorn\ +copy "$(SolutionDir)..\include\unicorn\*.h" "$(SolutionDir)distro\include\unicorn\" @@ -360,4 +360,4 @@ copy $(SolutionDir)..\include\unicorn\*.h $(SolutionDir)distro\include\unicorn\ - \ No newline at end of file + diff --git a/msvc/unicorn/unicorn_static/unicorn_static.vcxproj b/msvc/unicorn/unicorn_static/unicorn_static.vcxproj index 28b6b8ec..08d8cd02 100644 --- a/msvc/unicorn/unicorn_static/unicorn_static.vcxproj +++ b/msvc/unicorn/unicorn_static/unicorn_static.vcxproj @@ -310,14 +310,14 @@ ..\prebuild_script.bat - mkdir $(SolutionDir)distro\ -mkdir $(SolutionDir)distro\include -mkdir $(SolutionDir)distro\include\unicorn -mkdir $(SolutionDir)distro\$(Platform) + mkdir "$(SolutionDir)distro\" +mkdir "$(SolutionDir)distro\include" +mkdir "$(SolutionDir)distro\include\unicorn" +mkdir "$(SolutionDir)distro\$(Platform)" -copy $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName).lib $(SolutionDir)distro\$(Platform)\ +copy "$(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName).lib" "$(SolutionDir)distro\$(Platform)\" -copy $(SolutionDir)..\include\unicorn\*.h $(SolutionDir)distro\include\unicorn\ +copy "$(SolutionDir)..\include\unicorn\*.h" "$(SolutionDir)distro\include\unicorn\" @@ -350,18 +350,18 @@ copy $(SolutionDir)..\include\unicorn\*.h $(SolutionDir)distro\include\unicorn\ ..\prebuild_script.bat - mkdir $(SolutionDir)distro\ -mkdir $(SolutionDir)distro\include -mkdir $(SolutionDir)distro\include\unicorn -mkdir $(SolutionDir)distro\$(Platform) + mkdir "$(SolutionDir)distro\" +mkdir "$(SolutionDir)distro\include" +mkdir "$(SolutionDir)distro\include\unicorn" +mkdir "$(SolutionDir)distro\$(Platform)" -copy $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName).lib $(SolutionDir)distro\$(Platform)\ +copy "$(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName).lib" "$(SolutionDir)distro\$(Platform)\" -copy $(SolutionDir)..\include\unicorn\*.h $(SolutionDir)distro\include\unicorn\ +copy "$(SolutionDir)..\include\unicorn\*.h" "$(SolutionDir)distro\include\unicorn\" - \ No newline at end of file +