Skip to content

Commit

Permalink
MSVC-like compilers on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed May 9, 2024
1 parent db1845b commit be10a91
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ add_program(pass3)
add_program(raw2wav c)
add_program(music5 c)

foreach(t IN ITEMS music5 raw2wav)
target_compile_definitions(${t} PRIVATE $<$<BOOL:${MSVC}>:_CRT_SECURE_NO_WARNINGS>)
endforeach()

enable_testing()

set(raw ${CMAKE_CURRENT_BINARY_DIR}/snd.raw)
Expand Down
1 change: 1 addition & 0 deletions src/music5.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#ifdef _WIN32
#include <direct.h>
#define realpath(N,R) _fullpath((R),(N),_MAX_PATH)
#define chdir _chdir
#else
#include <unistd.h>
#endif
Expand Down

0 comments on commit be10a91

Please sign in to comment.