Skip to content

Commit

Permalink
Windows|MinGW: Build improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Sep 1, 2019
1 parent 60b7284 commit 40fe3b5
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 22 deletions.
10 changes: 1 addition & 9 deletions doomsday/apps/client/CMakeLists.txt
Expand Up @@ -213,15 +213,7 @@ elseif (APPLE)
link_framework (client PUBLIC QTKit) # MusicPlayer
endif ()
endif ()
if (TARGET SDL2)
if (MINGW)
target_link_libraries (client PUBLIC mingw32) # for SDL_main handling
endif ()
target_link_libraries (client PUBLIC SDL2)
endif ()
if (TARGET SDL2_mixer)
target_link_libraries (client PUBLIC SDL2_mixer)
endif ()
target_link_sdl2 (client PUBLIC)
if (TARGET DirectX)
target_link_libraries (client PUBLIC DirectX)
endif ()
Expand Down
12 changes: 12 additions & 0 deletions doomsday/cmake/FindSDL2Libs.cmake
@@ -1,5 +1,17 @@
find_package (PkgConfig QUIET)

macro (target_link_sdl2 target vis)
if (TARGET SDL2)
if (MINGW)
target_link_libraries (${target} ${vis} mingw32) # for SDL_main handling
endif ()
target_link_libraries (${target} ${vis} SDL2)
endif ()
if (TARGET SDL2_mixer)
target_link_libraries (${target} ${vis} SDL2_mixer)
endif ()
endmacro ()

if (TARGET SDL2)
return ()
endif ()
Expand Down
2 changes: 1 addition & 1 deletion doomsday/libs/core/include/de/data/pathtree.h
Expand Up @@ -475,7 +475,7 @@ class PathTreeIterator
return val;
}

String key() const {
uint32_t key() const {
DE_ASSERT(_current != _nodes.end());
return _current->first;
}
Expand Down
6 changes: 3 additions & 3 deletions doomsday/libs/core/src/data/ziparchive.cpp
Expand Up @@ -749,10 +749,10 @@ void ZipArchive::operator >> (Writer &to) const
}

static bool recognizeZipExtension(String const &ext)
{
{
for (const char *e : {".pack", ".demo", ".save", ".addon", ".pk3", ".zip"})
{
if (!iCmpStrCase(ext, e)) return true;
if (!iCmpStr(ext, e)) return true;
}
return false;
}
Expand All @@ -769,7 +769,7 @@ bool ZipArchive::recognize(File const &file)

bool ZipArchive::recognize(NativePath const &path)
{
return recognizeZipExtension(path.toString().fileNameExtension());
return recognizeZipExtension(path.toString().fileNameExtension().lower());
}

void ZipArchive::ZipEntry::update()
Expand Down
2 changes: 1 addition & 1 deletion doomsday/tests/test_glsandbox/CMakeLists.txt
Expand Up @@ -13,7 +13,7 @@ deng_add_application (test_glsandbox
testwindow.h
)

target_link_libraries (test_glsandbox PRIVATE SDL2)
target_link_sdl2 (test_glsandbox PUBLIC)
deng_link_libraries (test_glsandbox PRIVATE DengGui)

if (APPLE)
Expand Down
14 changes: 6 additions & 8 deletions doomsday/tools/md2tool/md2tool.c
Expand Up @@ -26,14 +26,12 @@
// MACROS ------------------------------------------------------------------

#ifdef _WIN32
#define stricmp _stricmp
#define cprintf _cprintf
#endif

#ifdef __GNUC__
#include <strings.h>
#define stricmp strcasecmp
#define cprintf printf
# define stricmp _stricmp
# define cprintf _cprintf
#elif defined __GNUC__
# include <strings.h>
# define stricmp strcasecmp
# define cprintf printf
#endif

// TYPES -------------------------------------------------------------------
Expand Down

0 comments on commit 40fe3b5

Please sign in to comment.