Skip to content

Commit

Permalink
Fix nix* build after last changes
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberium committed May 5, 2017
1 parent 0f42a0a commit 1b3c8ee
Show file tree
Hide file tree
Showing 225 changed files with 683 additions and 287 deletions.
26 changes: 21 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,30 @@ endfunction()

# Macro that replace /Wx with /W0 (supposed to disable warnings)
MACRO(DisableWarnings)
if(MSVC)
set(DisableWarningsFlag " /W0")
set(SearchWarningsFlag1 "/W[0-4]")
set(SearchWarningsFlag2 "/Wall")
else()
set(DisableWarningsFlag " -w")
set(SearchWarningsFlag1 "-[+W?]pedentic")
set(SearchWarningsFlag2 "-Wall")
endif()
foreach(temp_flag
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO CMAKE_C_FLAGS)
if(${temp_flag} MATCHES "/W[0-4]")
string(REGEX REPLACE "/W[0-4]" "/W0" ${temp_flag} "${${temp_flag}}")
if(${temp_flag} MATCHES "${SearchWarningsFlag1}")
string(REGEX REPLACE "${SearchWarningsFlag1}" "${DisableWarningsFlag}" ${temp_flag} "${${temp_flag}}")
elseif(${temp_flag} MATCHES "${SearchWarningsFlag2}")
string(REGEX REPLACE "${SearchWarningsFlag2}" "${DisableWarningsFlag}" ${temp_flag} "${${temp_flag}}")
else()
string(CONCAT ${temp_flag} "${${temp_flag}} /W0")
string(CONCAT ${temp_flag} "${${temp_flag}}" "${DisableWarningsFlag}")
endif()
endforeach()
ENDMACRO()

# Remove duplicate entries in default flags. (occur when after a second make or configure)
RemoveDuplicateSubstring(${CMAKE_CXX_FLAGS} CMAKE_CXX_FLAGS)
RemoveDuplicateSubstring("${CMAKE_CXX_FLAGS}" CMAKE_CXX_FLAGS)

include(cmake/common.cmake)

Expand Down Expand Up @@ -105,7 +116,7 @@ endif()
# find Git: used to get the revision number
find_package(Git)

if (NOT WIN32)
if(NOT MSVC)
# Include cotire to manage PCH support
include(cotire)
endif()
Expand Down Expand Up @@ -238,6 +249,11 @@ endif()
set(DEFINITIONS_RELEASE NDEBUG)
set(DEFINITIONS_DEBUG _DEBUG MANGOS_DEBUG)

if(NOT BUILD_GAME_SERVER AND BUILD_SCRIPTDEV)
set(BUILD_SCRIPTDEV OFF)
message(STATUS "BUILD_SCRIPTDEV forced to OFF due to BUILD_GAME_SERVER is not set")
endif()

# print out the results before continuing
include(cmake/showoptions.cmake)

Expand Down
13 changes: 7 additions & 6 deletions contrib/extractor/loadlib/adt.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#define _CRT_SECURE_NO_DEPRECATE

#include "adt.h"
#include <string.h>

// Helper
int holetab_h[4] = {0x1111, 0x2222, 0x4444, 0x8888};
Expand Down Expand Up @@ -53,7 +54,7 @@ bool ADT_file::prepareLoadedData()

bool adt_MHDR::prepareLoadedData()
{
if (fcc != 'MHDR')
if (!strncmp(fcc_txt, "MHDR", 4))
return false;

if (size != sizeof(adt_MHDR) - 8)
Expand All @@ -72,7 +73,7 @@ bool adt_MHDR::prepareLoadedData()

bool adt_MCIN::prepareLoadedData()
{
if (fcc != 'MCIN')
if (!strncmp(fcc_txt, "MCIN", 4))
return false;

// Check cells data
Expand All @@ -86,7 +87,7 @@ bool adt_MCIN::prepareLoadedData()

bool adt_MH2O::prepareLoadedData()
{
if (fcc != 'MH2O')
if (!strncmp(fcc_txt, "MH2O", 4))
return false;

// Check liquid data
Expand All @@ -98,7 +99,7 @@ bool adt_MH2O::prepareLoadedData()

bool adt_MCNK::prepareLoadedData()
{
if (fcc != 'MCNK')
if (!strncmp(fcc_txt, "MCNK", 4))
return false;

// Check height map
Expand All @@ -113,7 +114,7 @@ bool adt_MCNK::prepareLoadedData()

bool adt_MCVT::prepareLoadedData()
{
if (fcc != 'MCVT')
if (!strncmp(fcc_txt, "MCVT", 4))
return false;

if (size != sizeof(adt_MCVT) - 8)
Expand All @@ -124,7 +125,7 @@ bool adt_MCVT::prepareLoadedData()

bool adt_MCLQ::prepareLoadedData()
{
if (fcc != 'MCLQ')
if (!strncmp(fcc_txt, "MCLQ", 4))
return false;

return true;
Expand Down
3 changes: 2 additions & 1 deletion contrib/extractor/loadlib/loadlib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "../mpq_libmpq.h"

#include <stdio.h>
#include <string.h>

class MPQFile;

Expand Down Expand Up @@ -50,7 +51,7 @@ bool FileLoader::prepareLoadedData()
{
// Check version
version = (file_MVER*) data;
if (version->fcc != 'MVER')
if (!strncmp(version->fcc_txt, "MVER", 4))
return false;
if (version->ver != FILE_FORMAT_VERSION)
return false;
Expand Down
7 changes: 4 additions & 3 deletions contrib/extractor/loadlib/wdt.cpp
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
#define _CRT_SECURE_NO_DEPRECATE

#include "wdt.h"
#include <string.h>

bool wdt_MWMO::prepareLoadedData()
{
if (fcc != 'MWMO')
if (!strncmp(fcc_txt, "MWMO", 4))
return false;
return true;
}

bool wdt_MPHD::prepareLoadedData()
{
if (fcc != 'MPHD')
if (!strncmp(fcc_txt, "MPHD", 4))
return false;
return true;
}

bool wdt_MAIN::prepareLoadedData()
{
if (fcc != 'MAIN')
if (!strncmp(fcc_txt, "MAIN", 4))
return false;
return true;
}
Expand Down
7 changes: 5 additions & 2 deletions dep/libmpq/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@ DisableWarnings()

include_directories(${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/libmpq
${CMAKE_CURRENT_SOURCE_DIR}/win
${CMAKE_SOURCE_DIR}/dep/src/zlib
${CMAKE_SOURCE_DIR}/dep/src/bzip2)

file(GLOB mpqfiles libmpq/*.c libmpq/*.h *.h)

add_library(mpqlib STATIC ${mpqfiles})
target_link_libraries(mpqlib zlib)
target_compile_options(mpqlib PRIVATE /wd4103)

if(MSVC)
target_compile_options(mpqlib PRIVATE /wd4103)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/win)
endif()
2 changes: 1 addition & 1 deletion dep/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if (BUILD_GAME_SERVER OR BUILD_LOGIN_SERVER)
add_subdirectory(gsoap)
endif()

if(BUID_BUILD_MMAP_EXTRACTOR OR BUILD_MMAP_EXTRACTOR OR BUILD_MMAP_EXTRACTOR)
if(BUILD_EXTRACTOR OR BUILD_VMAP_EXTRACTOR OR BUILD_MMAP_EXTRACTOR)
add_subdirectory(bzip2)
endif()

Expand Down
2 changes: 1 addition & 1 deletion dep/src/g3dlite/System.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include "G3D/units.h"
#include "G3D/FileSystem.h"
#include <time.h>
#include <intrin.h>

#include <cstring>
#include <cstdio>
Expand All @@ -49,6 +48,7 @@
# include <conio.h>
# include <sys/timeb.h>
# include "G3D/RegistryUtil.h"
# include <intrin.h>

#elif defined(G3D_LINUX)

Expand Down
15 changes: 15 additions & 0 deletions src/game/AI/ScriptDevAI/PreCompiledHeader.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// add here most rarely modified headers to speed up debug build compilation

#ifndef PRECOMPILED_H
#define PRECOMPILED_H

#ifndef MSVC
#include "pchdef.h"
#endif

#include "AI/ScriptDevAI/include/sc_creature.h"
#include "AI/ScriptDevAI/include/sc_gossip.h"
#include "AI/ScriptDevAI/include/sc_grid_searchers.h"
#include "AI/ScriptDevAI/include/sc_instance.h"

#endif
2 changes: 2 additions & 0 deletions src/game/AI/ScriptDevAI/ScriptDevAIMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */

#include "AI/ScriptDevAI/PreCompiledHeader.h"
#include "Policies/Singleton.h"
#include "Config/Config.h"
#include "Database/DatabaseEnv.h"
Expand All @@ -11,6 +12,7 @@
#include "system/system.h"
#include "ScriptDevAIMgr.h"
#include "include/sc_creature.h"
#include "Entities/Player.h"

#ifdef BUILD_SCRIPTDEV
#include "system/ScriptLoader.h"
Expand Down
2 changes: 1 addition & 1 deletion src/game/AI/ScriptDevAI/base/escort_ai.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SD%Complete: 100
SDCategory: Npc
EndScriptData */


#include "AI/ScriptDevAI/PreCompiledHeader.h"
#include "escort_ai.h"
#include "../system/system.h"

Expand Down
1 change: 1 addition & 0 deletions src/game/AI/ScriptDevAI/base/escort_ai.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

// Remove this include, when EscortAI stores uint32 quest-id instead of Quest*
#include "Globals/ObjectMgr.h"
#include "AI/ScriptDevAI/include/sc_creature.h"

enum EscortState
{
Expand Down
2 changes: 1 addition & 1 deletion src/game/AI/ScriptDevAI/base/follower_ai.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SDComment: This AI is under development
SDCategory: Npc
EndScriptData */


#include "AI/ScriptDevAI/PreCompiledHeader.h"
#include "follower_ai.h"

const float MAX_PLAYER_DISTANCE = 100.0f;
Expand Down
2 changes: 2 additions & 0 deletions src/game/AI/ScriptDevAI/base/follower_ai.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#ifndef SC_FOLLOWERAI_H
#define SC_FOLLOWERAI_H

#include "AI/ScriptDevAI/include/sc_creature.h"

enum FollowState
{
STATE_FOLLOW_NONE = 0x000,
Expand Down
2 changes: 1 addition & 1 deletion src/game/AI/ScriptDevAI/base/guard_ai.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ SD%Complete: 90
SDCategory: Guards
EndScriptData */


#include "AI/ScriptDevAI/PreCompiledHeader.h"
#include "guard_ai.h"

// This script is for use within every single guard to save coding time
Expand Down
2 changes: 2 additions & 0 deletions src/game/AI/ScriptDevAI/base/guard_ai.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#ifndef SC_GUARDAI_H
#define SC_GUARDAI_H

#include "AI/ScriptDevAI/include/sc_creature.h"

enum
{
GENERIC_CREATURE_COOLDOWN = 5000,
Expand Down
2 changes: 1 addition & 1 deletion src/game/AI/ScriptDevAI/base/pet_ai.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SDComment: Intended to be used with Guardian/Protector/Minipets. Little/no contr
SDCategory: Npc
EndScriptData */


#include "AI/ScriptDevAI/PreCompiledHeader.h"
#include "pet_ai.h"

ScriptedPetAI::ScriptedPetAI(Creature* pCreature) : CreatureAI(pCreature)
Expand Down
2 changes: 2 additions & 0 deletions src/game/AI/ScriptDevAI/base/pet_ai.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#ifndef SC_PET_H
#define SC_PET_H

#include "AI/ScriptDevAI/include/sc_creature.h"

// Using CreatureAI for now. Might change later and use PetAI (need to export for dll first)
class ScriptedPetAI : public CreatureAI
{
Expand Down
2 changes: 1 addition & 1 deletion src/game/AI/ScriptDevAI/include/sc_creature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */


#include "AI/ScriptDevAI/PreCompiledHeader.h"
#include "Entities/Item.h"
#include "Spells/Spell.h"
#include "WorldPacket.h"
Expand Down
1 change: 1 addition & 0 deletions src/game/AI/ScriptDevAI/include/sc_creature.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include "Chat/Chat.h"
#include "Server/DBCStores.h" // Mostly only used the Lookup acces, but a few cases really do use the DBC-Stores
#include "AI/BaseAI/CreatureAI.h"

// Spell targets used by SelectSpell
enum SelectTarget
Expand Down
3 changes: 1 addition & 2 deletions src/game/AI/ScriptDevAI/include/sc_grid_searchers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */



#include "AI/ScriptDevAI/PreCompiledHeader.h"
#include "Grids/Cell.h"
#include "Grids/CellImpl.h"
#include "Grids/GridNotifiers.h"
Expand Down
2 changes: 1 addition & 1 deletion src/game/AI/ScriptDevAI/include/sc_instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */


#include "AI/ScriptDevAI/PreCompiledHeader.h"

/**
Function that uses a door or a button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ SDName: Battleground
SD%Complete: 100
SDComment: Spirit guides in battlegrounds will revive all players every 30 sec
SDCategory: Battlegrounds
EndScriptData */
EndScriptData
*/

#include "AI/ScriptDevAI/PreCompiledHeader.h"

// **** Script Info ****
// Spiritguides in battlegrounds resurrecting many players at once
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ SDName: Alterac_Mountains
SD%Complete: 0
SDComment: Placeholder
SDCategory: Alterac Mountains
EndScriptData */
EndScriptData
/* ContentData
*/

#include "AI/ScriptDevAI/PreCompiledHeader.h"/* ContentData
EndContentData */


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ SDName: Arathi Highlands
SD%Complete: 100
SDComment: Quest support: 660, 665
SDCategory: Arathi Highlands
EndScriptData */
EndScriptData
/* ContentData
*/

#include "AI/ScriptDevAI/PreCompiledHeader.h"/* ContentData
npc_professor_phizzlethorpe
npc_kinelory
EndContentData */
Expand Down
Loading

0 comments on commit 1b3c8ee

Please sign in to comment.