From 2aadcb08d3091ce439552ff59abef9f8a37e753b Mon Sep 17 00:00:00 2001 From: Vadim Grigoruk Date: Tue, 4 Sep 2018 16:42:29 +0300 Subject: [PATCH] cmake fixes for mingw --- CMakeLists.txt | 19 ++++++++++++------- build/windows/tic80.rc | 8 ++++---- src/ext/file_dialog.c | 1 - 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bf0fddb..0c13d92 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -216,6 +216,10 @@ if(NOT EMSCRIPTEN) target_include_directories(sdl-renderer PRIVATE include) target_include_directories(sdl-renderer PRIVATE src) + if(MINGW) + target_link_libraries(sdl-renderer mingw32) + endif() + add_dependencies(sdl-renderer tic80core SDL2-static SDL2main) target_link_libraries(sdl-renderer tic80core SDL2-static SDL2main) endif() @@ -400,7 +404,7 @@ foreach(TIC80_OUTPUT ${TIC80_OUTPUTS}) add_dependencies(${TIC80_OUTPUT}lib tic80core zlib) target_link_libraries(${TIC80_OUTPUT}lib tic80core zlib) -endforeach(CART_FILE) +endforeach() target_compile_definitions(tic80prolib PRIVATE TIC80_PRO) @@ -422,9 +426,7 @@ endif() foreach(TIC80_OUTPUT ${TIC80_OUTPUTS}) if(WIN32) - # TODO: uncomment this (temporary disabled for VS2017) - # set(TIC80_SRC ${TIC80_SRC} build/windows/tic80.rc) - + set(TIC80_SRC ${TIC80_SRC} build/windows/tic80.rc) add_executable(${TIC80_OUTPUT} WIN32 ${TIC80_SRC}) else() add_executable(${TIC80_OUTPUT} ${TIC80_SRC}) @@ -435,10 +437,13 @@ foreach(TIC80_OUTPUT ${TIC80_OUTPUTS}) target_include_directories(${TIC80_OUTPUT} PRIVATE 3rd-party/sdl-gpu/include) target_include_directories(${TIC80_OUTPUT} PRIVATE 3rd-party/SDL2_net-2.0.1) - if(NOT EMSCRIPTEN) - add_dependencies(${TIC80_OUTPUT} SDL2-static SDL2main) - target_link_libraries(${TIC80_OUTPUT} SDL2-static SDL2main) + if(MINGW) + target_link_libraries(${TIC80_OUTPUT} mingw32) + endif() + if(NOT EMSCRIPTEN) + add_dependencies(${TIC80_OUTPUT} SDL2main SDL2-static) + target_link_libraries(${TIC80_OUTPUT} SDL2-static SDL2main) endif() add_dependencies(${TIC80_OUTPUT} ${TIC80_OUTPUT}lib sdlnet sdlgpu) diff --git a/build/windows/tic80.rc b/build/windows/tic80.rc index 8d659c5..9881691 100644 --- a/build/windows/tic80.rc +++ b/build/windows/tic80.rc @@ -1,8 +1,8 @@ 101 ICON "icon.ico" 1 VERSIONINFO - FILEVERSION 0,60,3,0 - PRODUCTVERSION 0,60,3,0 + FILEVERSION 0,70,6,0 + PRODUCTVERSION 0,70,6,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -19,12 +19,12 @@ BEGIN BEGIN VALUE "CompanyName", "Nesbox" VALUE "FileDescription", "TIC-80" - VALUE "FileVersion", "0.60.3.0" + VALUE "FileVersion", "0.70.6.0" VALUE "InternalName", "tic80.exe" VALUE "LegalCopyright", "http://tic.computer (C) 2017" VALUE "OriginalFilename", "tic80.exe" VALUE "ProductName", "TIC-80" - VALUE "ProductVersion", "0.60.3.0" + VALUE "ProductVersion", "0.70.6.0" END END BLOCK "VarFileInfo" diff --git a/src/ext/file_dialog.c b/src/ext/file_dialog.c index 18dc2a7..ed13edc 100644 --- a/src/ext/file_dialog.c +++ b/src/ext/file_dialog.c @@ -30,7 +30,6 @@ #include #include -FILE* _wfopen(const wchar_t *, const wchar_t *); wchar_t* wcsrchr(const wchar_t *, wchar_t); wchar_t* wcscpy(wchar_t *, const wchar_t *);