Skip to content

Commit

Permalink
We now linking runtime library dynamically; defined HZ_ENABLE_ASSERTS…
Browse files Browse the repository at this point in the history
… if HZ_DEBUG is on.
  • Loading branch information
TheCherno committed Feb 2, 2019
1 parent 709b40d commit f67f96a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 20 deletions.
9 changes: 3 additions & 6 deletions Hazel/Hazel.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@
<AdditionalIncludeDirectories>src;vendor\spdlog\include;vendor\GLFW\include;vendor\Glad\include;vendor\imgui;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<Optimization>Disabled</Optimization>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<AdditionalOptions>/MDd %(AdditionalOptions)</AdditionalOptions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
Expand All @@ -109,8 +108,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<MinimalRebuild>false</MinimalRebuild>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<AdditionalOptions>/MD %(AdditionalOptions)</AdditionalOptions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
Expand All @@ -136,8 +134,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<MinimalRebuild>false</MinimalRebuild>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<AdditionalOptions>/MD %(AdditionalOptions)</AdditionalOptions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
Expand Down
4 changes: 4 additions & 0 deletions Hazel/src/Hazel/Core.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
#error Hazel only supports Windows!
#endif

#ifdef HZ_DEBUG
#define HZ_ENABLE_ASSERTS
#endif

#ifdef HZ_ENABLE_ASSERTS
#define HZ_ASSERT(x, ...) { if(!(x)) { HZ_ERROR("Assertion Failed: {0}", __VA_ARGS__); __debugbreak(); } }
#define HZ_CORE_ASSERT(x, ...) { if(!(x)) { HZ_CORE_ERROR("Assertion Failed: {0}", __VA_ARGS__); __debugbreak(); } }
Expand Down
9 changes: 3 additions & 6 deletions Sandbox/Sandbox.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@
<AdditionalIncludeDirectories>..\Hazel\vendor\spdlog\include;..\Hazel\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<Optimization>Disabled</Optimization>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<AdditionalOptions>/MDd %(AdditionalOptions)</AdditionalOptions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
Expand All @@ -102,8 +101,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<MinimalRebuild>false</MinimalRebuild>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<AdditionalOptions>/MD %(AdditionalOptions)</AdditionalOptions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
Expand All @@ -123,8 +121,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<MinimalRebuild>false</MinimalRebuild>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<AdditionalOptions>/MD %(AdditionalOptions)</AdditionalOptions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
Expand Down
16 changes: 8 additions & 8 deletions premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ project "Hazel"
location "Hazel"
kind "SharedLib"
language "C++"
staticruntime "off"

targetdir ("bin/" .. outputdir .. "/%{prj.name}")
objdir ("bin-int/" .. outputdir .. "/%{prj.name}")
Expand Down Expand Up @@ -56,7 +57,6 @@ project "Hazel"

filter "system:windows"
cppdialect "C++17"
staticruntime "On"
systemversion "latest"

defines
Expand All @@ -73,23 +73,24 @@ project "Hazel"

filter "configurations:Debug"
defines "HZ_DEBUG"
buildoptions "/MDd"
runtime "Debug"
symbols "On"

filter "configurations:Release"
defines "HZ_RELEASE"
buildoptions "/MD"
runtime "Release"
optimize "On"

filter "configurations:Dist"
defines "HZ_DIST"
buildoptions "/MD"
runtime "Release"
optimize "On"

project "Sandbox"
location "Sandbox"
kind "ConsoleApp"
language "C++"
staticruntime "off"

targetdir ("bin/" .. outputdir .. "/%{prj.name}")
objdir ("bin-int/" .. outputdir .. "/%{prj.name}")
Expand All @@ -113,7 +114,6 @@ project "Sandbox"

filter "system:windows"
cppdialect "C++17"
staticruntime "On"
systemversion "latest"

defines
Expand All @@ -123,15 +123,15 @@ project "Sandbox"

filter "configurations:Debug"
defines "HZ_DEBUG"
buildoptions "/MDd"
runtime "Debug"
symbols "On"

filter "configurations:Release"
defines "HZ_RELEASE"
buildoptions "/MD"
runtime "Release"
optimize "On"

filter "configurations:Dist"
defines "HZ_DIST"
buildoptions "/MD"
runtime "Release"
optimize "On"

0 comments on commit f67f96a

Please sign in to comment.