# HG changeset patch # User koda # Date 1246496326 0 # Node ID 59a9bebc4988478fd6a6ba1acd718882575335b4 # Parent 458c08d74ae6008a5b9a748a6b88e5f1265a4239 -Smaxx' solution for compiling frontend with static libs in windows -reverted to realloc() for more compatibility diff -r 458c08d74ae6 -r 59a9bebc4988 QTfrontend/CMakeLists.txt --- a/QTfrontend/CMakeLists.txt Wed Jul 01 22:50:27 2009 +0000 +++ b/QTfrontend/CMakeLists.txt Thu Jul 02 00:58:46 2009 +0000 @@ -151,8 +151,7 @@ hwconsts.h ) -set(hwfr_rez - hedgewars.qrc) +set(hwfr_rez hedgewars.qrc) qt4_add_resources(hwfr_rez_src ${hwfr_rez}) @@ -166,27 +165,33 @@ ${hwfr_hdrs} ${hwfr_rez_src}) + set(HW_LINK_LIBS ${QT_LIBRARIES} ${SDL_LIBRARY} openalbridge ) -#since openalbridge is linked statically with non-m$ compilers we need to explicitly link dependencies -if(NOT MSVC) +#since openalbridge is linked statically with non-m$ compilers we need to explicitly link dependencies +#moreover in windows they need to be compiled in a particular order +if(NOT MSVC AND NOT APPLE) set(HW_LINK_LIBS ${OPENAL_LIBRARY} + ${VORBISFILE_LIBRARY} + ${VORBIS_LIBRARY} ${OGG_LIBRARY} - ${VORBIS_LIBRARY} ${HW_LINK_LIBS} ) -if(NOT APPLE) +endif(NOT MSVC AND NOT APPLE) +#no vorbisfile required here +if(APPLE) set(HW_LINK_LIBS - ${VORBISFILE_LIBRARY} + ${OPENAL_LIBRARY} + ${VORBIS_LIBRARY} + ${OGG_LIBRARY} ${HW_LINK_LIBS} ) -endif(NOT APPLE) -endif(NOT MSVC) +endif(APPLE) if(WIN32 AND NOT UNIX) @@ -206,7 +211,9 @@ ) endif(WIN32 AND NOT UNIX) -target_link_libraries(hedgewars - ${HW_LINK_LIBS}) + +target_link_libraries(hedgewars ${HW_LINK_LIBS}) + install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hedgewars${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION ${target_dir}) + diff -r 458c08d74ae6 -r 59a9bebc4988 openalbridge/wrappers.c --- a/openalbridge/wrappers.c Wed Jul 01 22:50:27 2009 +0000 +++ b/openalbridge/wrappers.c Thu Jul 02 00:58:46 2009 +0000 @@ -35,16 +35,11 @@ void *Realloc (void *aptr, size_t nbytes) { -#ifndef _WIN32 - aptr = reallocf(aptr, nbytes); -#else aptr = realloc(aptr, nbytes); -#endif + if (aptr == NULL) { fprintf(stderr, "ERROR: not enough memory! realloc() failed\n"); -#ifdef _WIN32 free(aptr); -#endif exit(-1); } return aptr;