Skip to content

Commit

Permalink
Add --dynamic-runtime option to compile with /MD[d] in MSVC for compat
Browse files Browse the repository at this point in the history
  • Loading branch information
sinbad committed Jun 30, 2020
1 parent d8c7f97 commit 4182c8c
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 2 deletions.
16 changes: 14 additions & 2 deletions build3/premake4.lua
Original file line number Diff line number Diff line change
Expand Up @@ -370,12 +370,24 @@ end
defines {"BT_CLAMP_VELOCITY_TO=9999"}
end

newoption
{
trigger = "dynamic-runtime",
description = "Enable dynamic DLL CRT runtime"
}
configurations {"Release", "Debug"}
configuration "Release"
flags { "Optimize", "EnableSSE2","StaticRuntime", "NoMinimalRebuild", "FloatFast"}
flags { "Optimize", "EnableSSE2", "NoMinimalRebuild", "FloatFast"}
if not _OPTIONS["dynamic-runtime"] then
flags { "StaticRuntime" }
end
configuration "Debug"
defines {"_DEBUG=1"}
flags { "Symbols", "StaticRuntime" , "NoMinimalRebuild", "NoEditAndContinue" ,"FloatFast"}
flags { "Symbols" , "NoMinimalRebuild", "NoEditAndContinue" ,"FloatFast"}
if not _OPTIONS["dynamic-runtime"] then
flags { "StaticRuntime" }
end


if os.is("Linux") or os.is("macosx") then
if os.is64bit() then
Expand Down
28 changes: 28 additions & 0 deletions build_visual_studio_vr_pybullet_double_dynamic.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
IF NOT EXIST bin mkdir bin
IF NOT EXIST bin\openvr_api.dll copy examples\ThirdPartyLibs\openvr\bin\win32\openvr_api.dll bin
IF NOT EXIST bin\openvr64pi.dll copy examples\ThirdPartyLibs\openvr\bin\win64\openvr_api.dll bin\openvr64pi.dll

#aargh, see https://github.com/ValveSoftware/openvr/issues/412


#find a python version (hopefully just 1) and use this
dir c:\python* /b /ad > tmp1234.txt

set /p myvar1= < tmp1234.txt
set myvar=c:/%myvar1%
del tmp1234.txt

rem you can also override and hardcode the Python path like this (just remove the # hashmark in next line)
rem SET myvar=c:\python-3.5.2

cd build3


premake4 --dynamic-runtime --double --standalone-examples --enable_stable_pd --enable_multithreading --midi --enable_static_vr_plugin --enable_openvr --enable_pybullet --python_include_dir="%myvar%/include" --python_lib_dir="%myvar%/libs" --targetdir="../bin" vs2010

rem premake4 --double --enable_multithreading --midi --enable_static_vr_plugin --enable_openvr --enable_pybullet --python_include_dir="%myvar%/include" --python_lib_dir="%myvar%/libs" --targetdir="../binserver" vs2010
rem premake4 --double --enable_grpc --enable_multithreading --midi --enable_static_vr_plugin --enable_openvr --enable_pybullet --python_include_dir="%myvar%/include" --python_lib_dir="%myvar%/libs" --targetdir="../binserver" vs2010
rem premake4 --serial --audio --double --midi --enable_openvr --enable_pybullet --python_include_dir="%myvar%/include" --python_lib_dir="%myvar%/libs" --targetdir="../bin" vs2010

start vs2010

0 comments on commit 4182c8c

Please sign in to comment.