Skip to content

Commit

Permalink
Fix preprocessor options for MSVC, so assert works
Browse files Browse the repository at this point in the history
  • Loading branch information
rHermes committed May 5, 2024
1 parent 1f292a1 commit bcfd298
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions include/hage/core/assert.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "misc.hpp"

#include <stdexcept>
#include <string_view>
#include <utility>

Expand Down
6 changes: 5 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ foreach (target_var IN ITEMS hage_atomic hage_logging hage_core)


if (MSVC)
target_compile_options(${target_var} ${priv_type} /W4 /utf-8 /permissive- /Zc:__cplusplus)
target_compile_options(${target_var} ${priv_type} /W4 /utf-8)

# These options make msvc act sane.
# This is to make sure that the new preprocessor is chosen, which is required
target_compile_options(${target_var} ${pub_type} /permissive- /Zc:__cplusplus /Zc:preprocessor)
else ()
target_compile_options(${target_var} ${priv_type} -Wall -Wextra -Wpedantic)

Expand Down

0 comments on commit bcfd298

Please sign in to comment.