diff --git a/CMakeLists.txt b/CMakeLists.txt index eb91f14..18a42e1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,15 +17,15 @@ endif() if (VCPKG_TARGET_TRIPLET) # If using vcpkg, don't specify versions, they're in the manifest find_package(SDL2 CONFIG REQUIRED) - find_package(SDL2-mixer CONFIG REQUIRED) + find_package(SDL2_mixer CONFIG REQUIRED) else() list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake") find_package(SDL2 2.0.0 REQUIRED) find_package(SDL2_mixer 2.0.0 REQUIRED) # For compatibility with vcpkg, configure SDL2_mixer as an imported shared library - add_library(SDL2::SDL2_mixer SHARED IMPORTED) - set_property(TARGET SDL2::SDL2_mixer PROPERTY IMPORTED_LOCATION "${SDL2_MIXER_LIBRARY}") - set_property(TARGET SDL2::SDL2_mixer PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${SDL2_MIXER_INCLUDE_DIRS}") + add_library(SDL2_mixer::SDL2_mixer SHARED IMPORTED) + set_property(TARGET SDL2_mixer::SDL2_mixer PROPERTY IMPORTED_LOCATION "${SDL2_MIXER_LIBRARY}") + set_property(TARGET SDL2_mixer::SDL2_mixer PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${SDL2_MIXER_INCLUDE_DIRS}") endif() include(CheckIncludeFiles) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3177820..550bc60 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -88,7 +88,7 @@ target_link_libraries(abuse sdlport) target_link_libraries(abuse imlib) target_link_libraries(abuse net) target_link_libraries(abuse SDL2::SDL2) -target_link_libraries(abuse SDL2::SDL2_mixer) +target_link_libraries(abuse SDL2_mixer::SDL2_mixer) if(OPENGL_FOUND) target_link_libraries(abuse ${OPENGL_LIBRARIES}) endif(OPENGL_FOUND) @@ -116,7 +116,7 @@ if(WIN32) RUNTIME DESTINATION "." LIBRARY DESTINATION ".") install(FILES $ DESTINATION ".") - install(FILES $ DESTINATION ".") + install(FILES $ DESTINATION ".") else() # Under Linux, we want the tools in bin install(TARGETS abuse abuse-tool RUNTIME DESTINATION bin diff --git a/src/common.h b/src/common.h index 56f59df..4794c07 100644 --- a/src/common.h +++ b/src/common.h @@ -40,6 +40,8 @@ using namespace lol; // // Custom utility functions // +// TODO: Can these be changed to pre-compiler definitions? I'm assuming some compiler didn't optimize +// properly and these are inline functions due to that. static inline int Min(int a, int b) { return a < b ? a : b; } static inline int Max(int a, int b) { return a > b ? a : b; } static inline unsigned int Min(unsigned int a, unsigned int b) { return a < b ? a : b; } @@ -48,6 +50,11 @@ static inline long Min(long a, long b) { return a < b ? a : b; } static inline long Max(long a, long b) { return a > b ? a : b; } static inline unsigned long Min(unsigned long a, unsigned long b) { return a < b ? a : b; } static inline unsigned long Max(unsigned long a, unsigned long b) { return a > b ? a : b; } +#if _WIN64 +// 64-bit Windows considers size_t to be unsigned long long +static inline unsigned long Min(unsigned long long a, unsigned long long b) { return a < b ? a : b; } +static inline unsigned long Max(unsigned long long a, unsigned long long b) { return a > b ? a : b; } +#endif static inline float Min(float a, float b) { return a < b ? a : b; } static inline float Max(float a, float b) { return a > b ? a : b; } diff --git a/src/lisp/CMakeLists.txt b/src/lisp/CMakeLists.txt index 3ef9071..28cae30 100644 --- a/src/lisp/CMakeLists.txt +++ b/src/lisp/CMakeLists.txt @@ -11,7 +11,7 @@ include_directories( ${abuse_SOURCE_DIR}/src/imlib ) -target_link_libraries(lisp SDL2::SDL2_mixer) +target_link_libraries(lisp SDL2_mixer::SDL2_mixer) #INCLUDES = -I$(srcdir) -I$(srcdir)/../ -I$(srcdir)/../imlib $(SDL2_CFLAGS) #CPPFLAGS = @CPPFLAGS@ -DNO_CHECK diff --git a/src/net/CMakeLists.txt b/src/net/CMakeLists.txt index 47c6044..aead869 100644 --- a/src/net/CMakeLists.txt +++ b/src/net/CMakeLists.txt @@ -12,7 +12,7 @@ include_directories( ${abuse_SOURCE_DIR}/src/imlib ) -target_link_libraries(net SDL2::SDL2_mixer) +target_link_libraries(net SDL2_mixer::SDL2_mixer) add_definitions(-DNO_CHECK) diff --git a/src/sdlport/CMakeLists.txt b/src/sdlport/CMakeLists.txt index de14094..e724cd5 100644 --- a/src/sdlport/CMakeLists.txt +++ b/src/sdlport/CMakeLists.txt @@ -18,6 +18,6 @@ include_directories( ${abuse_SOURCE_DIR}/src/imlib ) -target_link_libraries(sdlport SDL2::SDL2 SDL2::SDL2_mixer) +target_link_libraries(sdlport SDL2::SDL2 SDL2_mixer::SDL2_mixer) # #CPPFLAGS = @CPPFLAGS@ -DNO_CHECK -DASSETDIR=\"$(assetdir)\"