Skip to content

Instantly share code, notes, and snippets.

View CppHotReload's full-sized avatar

Cpp Hot Reload CppHotReload

View GitHub Profile
@CppHotReload
CppHotReload / reset_repo.md
Last active June 13, 2020 19:58
reset repository - 2020

From various authors, just what worked for me.

Safe Method creating an orphan branch

Check out to a temporary branch:

git checkout --orphan TEMP_BRANCH

Add all the files:

git add -A

@CppHotReload
CppHotReload / log.cpp
Created February 11, 2020 20:15
Coming back from edit mode
<21:11:16> (C++ Hot Reload) - Reload time: 5.28298 seconds
Setup time: 0.018578 seconds
Compile time: 3.45727 seconds
Link time: 1.80714 seconds
'Editor.exe' (Win32): Loaded 'E:\Amazon\Lumberyard_1.21\dev\SamplesProject\Gem\Code\CppHotReload\Intermediate\MyComponent_v17.dll'. Symbols loaded.
'Editor.exe' (Win32): Loaded 'E:\Amazon\Lumberyard_1.21\dev\SamplesProject\Gem\Code\CppHotReload\Intermediate\MyComponent_v18.dll'. Symbols loaded.
<21:11:16> [Error] (Component) - The same component UUID ({0C09F774-DECA-40C4-8B54-3A93033EC381}) / name (MyComponent) was registered twice. This isn't allowed, it can cause lifetime management issues / crashes.
This situation can happen by declaring a component in a header and registering it from two different Gems.
@CppHotReload
CppHotReload / gist:56ef233c9464a86897b95957feaaf24e
Created February 7, 2020 06:42
MyComponent.cpp compile log
MyComponent_v1_main.cpp
E:/Amazon/Lumberyard_1.21/dev/SamplesProject/Gem/Code/CppHotReload/Intermediate/Temp/MyComponent_v1_main.cpp: warning C4652: compiler option 'CDecl(/Gd)' inconsistent with precompiled header; current command-line option will override that defined in the precompiled header
E:/Amazon/Lumberyard_1.21/dev/SamplesProject/Gem/Code/CppHotReload/Intermediate/Temp/MyComponent_v1_main.cpp: warning C4652: compiler option 'support for new floating-point model (/FP)' inconsistent with precompiled header; current command-line option will override that defined in the precompiled header
E:/Amazon/Lumberyard_1.21/dev/SamplesProject/Gem/Code/CppHotReload/Intermediate/Temp/MyComponent_v1_main.cpp: warning C4652: compiler option 'DLL library (/MD)' inconsistent with precompiled header; current command-line option will override that defined in the precompiled header
E:/Amazon/Lumberyard_1.21/dev/SamplesProject/Gem/Code/CppHotReload/Intermediate/Temp/MyComponent_v1_main.cpp: warning C4652: compiler option '
@CppHotReload
CppHotReload / gist:7ac3ac7343260fb2432a02188998cf9a
Created February 7, 2020 06:39
Ly SamplesProject build options
1>[7807/7976] cxxshlib (win_x64_vs2017|profile): BinTemp\win_x64_vs2017_profile\SamplesProject\Gem\Code\SamplesProject_rc\SamplesProject.auto_gen.2581533.res BinTemp\win_x64_vs2017_profile\SamplesProject\Gem\Code\CppHotReload\CppHotReload.cpp.2581533.obj BinTemp\win_x64_vs2017_profile\SamplesProject\Gem\Code\CppHotReload\CppHotReloadEvents.cpp.2581533.obj BinTemp\win_x64_vs2017_profile\SamplesProject\Gem\Code\CppHotReload\CppHotReloadInit.cpp.2581533.obj BinTemp\win_x64_vs2017_profile\SamplesProject\Gem\Code\CppHotReload\CppHotReloadModule.cpp.2581533.obj BinTemp\win_x64_vs2017_profile\SamplesProject\Gem\Code\Source\Core\EditorGame.cpp.2581533.obj BinTemp\win_x64_vs2017_profile\SamplesProject\Gem\Code\Source\Core\GameplaySampleGame.cpp.2581533.obj BinTemp\win_x64_vs2017_profile\SamplesProject\Gem\Code\Source\Core\GameplaySampleGameRules.cpp.2581533.obj BinTemp\win_x64_vs2017_profile\SamplesProject\Gem\Code\Source\Game\Actor.cpp.2581533.obj BinTemp\win_x64_vs2017_profile\SamplesProject\Gem\Code\Source\Game\Fly
@CppHotReload
CppHotReload / gist:0f6db1af6aa236019aabb4fc59737fb8
Created February 7, 2020 06:38
Ly MyComponent.cpp build options
'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX64\\x64\\CL.exe', '/bigobj', '/nologo', '/W3', '/WX', '/MP', '/Gy', '/GF', '/Gm-', '/fp:fast', '/Zc:wchar_t', '/Zc:forScope', '/Gd', '/Zc:inline', '/wd4530', '/wd4577', '/FS', '/Ox', '/Ob2', '/Ot', '/Oi', '/Oy-', '/GR-', '/showIncludes', '/MD', '/Z7', '/YuStdAfx.h', '/Fpe:\\Amazon\\Lumberyard_1.21\\dev\\BinTemp\\win_x64_vs2017_profile\\SamplesProject\\Gem\\Code\\StdAfx.2581533.pch', '/Ie:\\Amazon\\Lumberyard_1.21\\dev\\SamplesProject\\Gem\\Code\\Include', '/Ie:\\Amazon\\Lumberyard_1.21\\dev\\SamplesProject\\Gem\\Code\\Source', '/Ie:\\Amazon\\Lumberyard_1.21\\dev\\BinTemp\\win_x64_vs2017_profile\\SamplesProject\\Gem\\Code', '/Ie:\\Amazon\\Lumberyard_1.21\\dev\\SamplesProject\\Gem\\Code', '/Ie:\\Amazon\\Lumberyard_1.21\\dev\\Code\\CryEngine\\CryCommon', '/Ie:\\Amazon\\Lumberyard_1.21\\dev\\Code\\CryEngine\\CryAction', '/Ie:\\Amazon\\Lumberyard_1.21\\dev\\Gems\\InAppPurchases\\Code\\Include', '/Ie:\\Amazon
1>[3439/7974] pch_msvc (win_x64_vs2017|profile): SamplesProject\Gem\Code\StdAfx.cpp -> BinTemp\win_x64_vs2017_profile\SamplesProject\Gem\Code\StdAfx.2581533.obj
BinTemp\win_x64_vs2017_profile\SamplesProject\Gem\Code\StdAfx.2581533.pch
1>['C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX64\\x64\\CL.exe',
'/YcStdAfx.h', '/bigobj', '/nologo', '/W3', '/WX', '/MP', '/Gy', '/GF', '/Gm-', '/fp:fast', '/Zc:wchar_t', '/Zc:forScope', '/Gd', '/Zc:inline', '/wd4530', '/wd4577', '/FS', '/Ox', '/Ob2', '/Ot', '/Oi', '/Oy-', '/GR-', '/showIncludes', '/MD', '/Z7',
'/Ie:\\Amazon\\Lumberyard_1.21\\dev\\SamplesProject\\Gem\\Code\\Include', '/Ie:\\Amazon\\Lumberyard_1.21\\dev\\SamplesProject\\Gem\\Code\\Source', '/Ie:\\Amazon\\Lumberyard_1.21\\dev\\BinTemp\\win_x64_vs2017_profile\\SamplesProject\\Gem\\Code', '/Ie:\\Amazon\\Lumberyard_1.21\\dev\\SamplesProject\\Gem\\Code', '/Ie:\\Amazon\\Lumberyard_1.21\\dev\\Code\\CryEngine\\CryCommon', '/Ie:\\Amazon\\Lumberyard_1.21
@CppHotReload
CppHotReload / gist:d039b66faa8d80bd8420e47fdedf3448
Created February 2, 2020 22:40
Unique way to make it work, including all objs -_-U
"E:/Amazon/Lumberyard_1.21/dev/BinTemp/win_x64_vs2017_profile/SamplesProject/Gem/Code/StdAfx.2581533.obj" /OUT:"E:/Amazon/Lumberyard_1.21/dev/SamplesProject/Gem/Code/CppHotReload/Intermediate/MyComponent_v1.dll" /LIBPATH:"E:/Amazon/Lumberyard_1.21/dev/BinTemp/win_x64_vs2017_profile/Code/Framework/AzCore/AzCore" /LIBPATH:"E:/Amazon/Lumberyard_1.21/dev/BinTemp/win_x64_vs2017_profile/Code/Framework/AzFramework/AzFramework" /LIBPATH:"E:/Amazon/Lumberyard_1.21/dev/BinTemp/win_x64_vs2017_profile/Code/Framework/AzGameFramework/AzGameFramework" /LIBPATH:"E:/Amazon/Lumberyard_1.21/dev/BinTemp/win_x64_vs2017_profile/Code/Framework/GridMate" /LIBPATH:"E:/Amazon/Lumberyard_1.21/dev/BinTemp/win_x64_vs2017_profile/Gems/CryLegacy/Code" /LIBPATH:"E:/Amazon/Lumberyard_1.21/3rdParty/Lua/5.1.1.8-az/build/win_x64/vc140/release" /LIBPATH:"E:/Amazon/Lumberyard_1.21/3rdParty/zstd/1.35/build/win_x64/vc140/release" /LIBPATH:"E:/Amazon/Lumberyard_1.21/3rdParty/lz4/r128-pkg.2/build/win_x64/vc140/release" /LIBPATH:"E:/Amazon/Lumberyard
1>------ Build started: Project: _WAF_, Configuration: [All] profile x64 ------
1>[WAF] Engine Root: e:\Amazon\Lumberyard_1.21\dev\
1>[WAF] Executing 'build_win_x64_vs2017_profile' in 'e:\Amazon\Lumberyard_1.21\dev\BinTemp\win_x64_vs2017_profile'
1>[WARN] Missing JDK path from Setup Assistant detected. Target platforms that require java will be disabled. Please re-run Setup Assistant with "Compile For Android" enabled and run the configure command again.
1>[SETTINGS] msvs_version = 15 (default 14)
1>[SETTINGS] win_vs2017_vswhere_args = -version [15,16) (default -version [15.7.27703.2035,15.9.28307.665])
1>[SETTINGS] specs_to_include_in_project_generation = all,game_and_engine,engine_and_editor,game,gem_tests (default all, game, game_and_engine)
1>[SETTINGS] Target Output folder (win_x64_vs2017/profile): Bin64vc141
1>[WARNING] Incredibuild disabled by build option
1>[WARN] Invalid module 'AmazonQtControlGallery' in spec 'all'
@CppHotReload
CppHotReload / gist:12eeccb85eb0b6d78a479e3d5871e465
Created February 1, 2020 13:42
Amazon\Lumberyard_1.21 - build_win_x64_vs2017_release
1>------ Build started: Project: _WAF_, Configuration: [Engine and Editor] release x64 ------
1>[WAF] Engine Root: e:\Amazon\Lumberyard_1.21\dev\
1>[WAF] Executing 'build_win_x64_vs2017_release' in 'e:\Amazon\Lumberyard_1.21\dev\BinTemp\win_x64_vs2017_release'
1>[WARN] Missing JDK path from Setup Assistant detected. Target platforms that require java will be disabled. Please re-run Setup Assistant with "Compile For Android" enabled and run the configure command again.
1>[SETTINGS] msvs_version = 15 (default 14)
1>[SETTINGS] win_vs2017_vswhere_args = -version [15,16) (default -version [15.7.27703.2035,15.9.28307.665])
1>[SETTINGS] specs_to_include_in_project_generation = game_and_engine,engine_and_editor (default all, game, game_and_engine)
1>[SETTINGS] Target Output folder (win_x64_vs2017/release): Bin64vc141.Release
1>[WARNING] Incredibuild disabled by build option
1>[WARN] Invalid module 'LmbrAWS' in spec 'engine_and_editor'