Skip to content

Commit

Permalink
Fix cmake exe unicode bug (#145)
Browse files Browse the repository at this point in the history
Makefile and main.cpp was unrelated changes.
  • Loading branch information
eric15342335 committed Jun 17, 2024
1 parent 7e261ac commit 97bb929
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ else()
set(OUTPUT_NAME "stocksim")
endif()

add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:-utf-8>")

add_executable(${OUTPUT_NAME}
src/main.cpp
src/random_price.cpp
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ OUTPUT = stocksim-msvc.exe
endif
endif

# -GL can further reduce size, but more likely to flag as malicious
msvc: src/*.cpp include/*.h clean
cl -std:c++17 -EHsc -utf-8 -Iinclude -W1 -WX -O1 -guard:cf -MP \
src/*.cpp -Fe:$(OUTPUT)
Expand Down
2 changes: 0 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ void enableWindowsVTProcessing(void) {
consoleMode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING;
SetConsoleMode(GetStdHandle(STD_OUTPUT_HANDLE), consoleMode);
std::cout << "Experimental Windows VT processing enabled." << std::endl;
// Enable Data Execution Prevention (DEP) for the process
SetProcessDEPPolicy(PROCESS_DEP_ENABLE);
}
#else
#define enableWindowsVTProcessing() // Do nothing
Expand Down

0 comments on commit 97bb929

Please sign in to comment.