Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into clientserver
Browse files Browse the repository at this point in the history
  • Loading branch information
dpjudas committed Dec 7, 2018
2 parents b03babb + a7c4fc9 commit 3fd9ee2
Show file tree
Hide file tree
Showing 373 changed files with 76,375 additions and 16,244 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -56,3 +56,4 @@
/mapfiles_release/*.map
.DS_Store
/build_vc2017-32
/build2
13 changes: 13 additions & 0 deletions CMakeLists.txt
Expand Up @@ -163,6 +163,7 @@ option( NO_OPENAL "Disable OpenAL sound support" OFF )
find_package( BZip2 )
find_package( JPEG )
find_package( ZLIB )
find_package( asmjit )
# GME
find_path( GME_INCLUDE_DIR gme/gme.h )
find_library( GME_LIBRARIES gme )
Expand Down Expand Up @@ -271,6 +272,7 @@ option(FORCE_INTERNAL_ZLIB "Use internal zlib")
option(FORCE_INTERNAL_JPEG "Use internal jpeg")
option(FORCE_INTERNAL_BZIP2 "Use internal bzip2")
option(FORCE_INTERNAL_GME "Use internal gme")
option(FORCE_INTERNAL_ASMJIT "Use internal asmjit")

# Fast math flags, required by some subprojects
set( ZD_FASTMATH_FLAG "" )
Expand All @@ -291,6 +293,17 @@ else()
set( ZLIB_LIBRARY z )
endif()

if( ASMJIT_FOUND AND NOT FORCE_INTERNAL_ASMJIT )
message( STATUS "Using system asmjit, includes found at ${ASMJIT_INCLUDE_DIR}" )
else()
message( STATUS "Using internal asmjit" )
set( SKIP_INSTALL_ALL TRUE ) # Avoid installing asmjit alongside zdoom
add_subdirectory( asmjit )
set( ASMJIT_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/asmjit )
set( ASMJIT_LIBRARIES asmjit )
set( ASMJIT_LIBRARY asmjit )
endif()

if( JPEG_FOUND AND NOT FORCE_INTERNAL_JPEG )
message( STATUS "Using system jpeg library, includes found at ${JPEG_INCLUDE_DIR}" )
else()
Expand Down
112 changes: 112 additions & 0 deletions asmjit/CMakeLists.txt
@@ -0,0 +1,112 @@
cmake_minimum_required(VERSION 2.8.7)

#make_release_only()

project(asmjit C)

set(ASMJITNAME asmjit)

add_definitions(-DASMJIT_BUILD_EMBED)
add_definitions(-DASMJIT_STATIC)

if(MSVC)
set(CMAKE_DEBUG_POSTFIX "d")
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
endif()

if(APPLE)
# Suppress stdlib.h:334:6: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified)
add_definitions(-Wno-nullability-completeness)
endif()

include_directories(${CMAKE_CURRENT_SOURCE_DIR})

set(ASMJIT_PUBLIC_HDRS
asmjit/arm.h
asmjit/asmjit.h
asmjit/asmjit_apibegin.h
asmjit/asmjit_apiend.h
asmjit/asmjit_build.h
asmjit/base.h
asmjit/base/arch.h
asmjit/base/assembler.h
asmjit/base/codebuilder.h
asmjit/base/codecompiler.h
asmjit/base/codeemitter.h
asmjit/base/codeholder.h
asmjit/base/constpool.h
asmjit/base/cpuinfo.h
asmjit/base/func.h
asmjit/base/globals.h
asmjit/base/inst.h
asmjit/base/logging.h
asmjit/base/misc_p.h
asmjit/base/operand.h
asmjit/base/osutils.h
asmjit/base/regalloc_p.h
asmjit/base/runtime.h
asmjit/base/simdtypes.h
asmjit/base/string.h
asmjit/base/utils.h
asmjit/base/vmem.h
asmjit/base/zone.h
asmjit/x86.h
asmjit/x86/x86assembler.h
asmjit/x86/x86builder.h
asmjit/x86/x86compiler.h
asmjit/x86/x86emitter.h
asmjit/x86/x86globals.h
asmjit/x86/x86inst.h
asmjit/x86/x86instimpl_p.h
asmjit/x86/x86internal_p.h
asmjit/x86/x86logging_p.h
asmjit/x86/x86misc.h
asmjit/x86/x86operand.h
asmjit/x86/x86regalloc_p.h
)
set(ASMJIT_SRCS
asmjit/base/arch.cpp
asmjit/base/assembler.cpp
asmjit/base/codebuilder.cpp
asmjit/base/codecompiler.cpp
asmjit/base/codeemitter.cpp
asmjit/base/codeholder.cpp
asmjit/base/constpool.cpp
asmjit/base/cpuinfo.cpp
asmjit/base/func.cpp
asmjit/base/globals.cpp
asmjit/base/inst.cpp
asmjit/base/logging.cpp
asmjit/base/operand.cpp
asmjit/base/osutils.cpp
asmjit/base/regalloc.cpp
asmjit/base/runtime.cpp
asmjit/base/string.cpp
asmjit/base/utils.cpp
asmjit/base/vmem.cpp
asmjit/base/zone.cpp
asmjit/x86/x86assembler.cpp
asmjit/x86/x86builder.cpp
asmjit/x86/x86compiler.cpp
asmjit/x86/x86inst.cpp
asmjit/x86/x86instimpl.cpp
asmjit/x86/x86internal.cpp
asmjit/x86/x86logging.cpp
asmjit/x86/x86operand.cpp
asmjit/x86/x86operand_regs.cpp
asmjit/x86/x86regalloc.cpp
)

add_library(${ASMJITNAME} ${ASMJIT_SRCS} ${ASMJIT_PUBLIC_HDRS})

set_target_properties(${ASMJITNAME} PROPERTIES OUTPUT_NAME asmjit)

if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL )
install(TARGETS ${ASMJITNAME}
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib )
endif()
if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL )
install(FILES ${ASMJIT_PUBLIC_HDRS} DESTINATION include)
endif()
21 changes: 21 additions & 0 deletions asmjit/asmjit/arm.h
@@ -0,0 +1,21 @@
// [AsmJit]
// Complete x86/x64 JIT and Remote Assembler for C++.
//
// [License]
// Zlib - See LICENSE.md file in the package.

// [Guard]
#ifndef _ASMJIT_ARM_H
#define _ASMJIT_ARM_H

// [Dependencies]
#include "./base.h"

#include "./arm/armassembler.h"
#include "./arm/armbuilder.h"
#include "./arm/armcompiler.h"
#include "./arm/arminst.h"
#include "./arm/armoperand.h"

// [Guard]
#endif // _ASMJIT_ARM_H
47 changes: 47 additions & 0 deletions asmjit/asmjit/asmjit.h
@@ -0,0 +1,47 @@
// [AsmJit]
// Complete x86/x64 JIT and Remote Assembler for C++.
//
// [License]
// Zlib - See LICENSE.md file in the package.

// [Guard]
#ifndef _ASMJIT_ASMJIT_H
#define _ASMJIT_ASMJIT_H

// ============================================================================
// [asmjit_mainpage]
// ============================================================================

//! \mainpage
//!
//! AsmJit - Complete x86/x64 JIT and Remote Assembler for C++.
//!
//! Introduction provided by the project page at https://github.com/asmjit/asmjit.

//! \defgroup asmjit_base AsmJit Base API (architecture independent)
//!
//! \brief Backend Neutral API.

//! \defgroup asmjit_x86 AsmJit X86/X64 API
//!
//! \brief X86/X64 Backend API.

//! \defgroup asmjit_arm AsmJit ARM32/ARM64 API
//!
//! \brief ARM32/ARM64 Backend API.

// [Dependencies]
#include "./base.h"

// [X86/X64]
#if defined(ASMJIT_BUILD_X86)
#include "./x86.h"
#endif // ASMJIT_BUILD_X86

// [ARM32/ARM64]
#if defined(ASMJIT_BUILD_ARM)
#include "./arm.h"
#endif // ASMJIT_BUILD_ARM

// [Guard]
#endif // _ASMJIT_ASMJIT_H
117 changes: 117 additions & 0 deletions asmjit/asmjit/asmjit_apibegin.h
@@ -0,0 +1,117 @@
// [AsmJit]
// Complete x86/x64 JIT and Remote Assembler for C++.
//
// [License]
// Zlib - See LICENSE.md file in the package.

// [Dependencies]
#if !defined(_ASMJIT_BUILD_H)
# include "./build.h"
#endif // !_ASMJIT_BUILD_H

// [Guard]
#if !defined(ASMJIT_API_SCOPE)
# define ASMJIT_API_SCOPE
#else
# error "[asmjit] api-scope is already active, previous scope not closed by asmjit_apiend.h?"
#endif // ASMJIT_API_SCOPE

// ============================================================================
// [C++ Support]
// ============================================================================

// [NoExcept]
#if !ASMJIT_CC_HAS_NOEXCEPT && !defined(noexcept)
# define noexcept ASMJIT_NOEXCEPT
# define ASMJIT_UNDEF_NOEXCEPT
#endif // !ASMJIT_CC_HAS_NOEXCEPT && !noexcept

// [NullPtr]
#if !ASMJIT_CC_HAS_NULLPTR && !defined(nullptr)
# define nullptr NULL
# define ASMJIT_UNDEF_NULLPTR
#endif // !ASMJIT_CC_HAS_NULLPTR && !nullptr

// [Override]
#if !ASMJIT_CC_HAS_OVERRIDE && !defined(override)
# define override
# define ASMJIT_UNDEF_OVERRIDE
#endif // !ASMJIT_CC_HAS_OVERRIDE && !override

// ============================================================================
// [Compiler Support]
// ============================================================================

// [Clang]
#if ASMJIT_CC_CLANG
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wc++11-extensions"
# pragma clang diagnostic ignored "-Wconstant-logical-operand"
# pragma clang diagnostic ignored "-Wunnamed-type-template-args"
#endif // ASMJIT_CC_CLANG

// [GCC]
#if ASMJIT_CC_GCC
# pragma GCC diagnostic push
#endif // ASMJIT_CC_GCC

// [MSC]
#if ASMJIT_CC_MSC
# pragma warning(push)
# pragma warning(disable: 4127) // conditional expression is constant
# pragma warning(disable: 4201) // nameless struct/union
# pragma warning(disable: 4244) // '+=' : conversion from 'int' to 'x', possible loss of data
# pragma warning(disable: 4251) // struct needs to have dll-interface to be used by clients of struct ...
# pragma warning(disable: 4275) // non dll-interface struct ... used as base for dll-interface struct
# pragma warning(disable: 4355) // this used in base member initializer list
# pragma warning(disable: 4480) // specifying underlying type for enum
# pragma warning(disable: 4800) // forcing value to bool 'true' or 'false'
# if _MSC_VER < 1900
# if !defined(vsnprintf)
# define ASMJIT_UNDEF_VSNPRINTF
# define vsnprintf _vsnprintf
# endif // !vsnprintf
# if !defined(snprintf)
# define ASMJIT_UNDEF_SNPRINTF
# define snprintf _snprintf
# endif // !snprintf
# endif
#endif // ASMJIT_CC_MSC

// ============================================================================
// [Custom Macros]
// ============================================================================

// [ASMJIT_NON...]
#if ASMJIT_CC_HAS_DELETE_FUNCTION
#define ASMJIT_NONCONSTRUCTIBLE(...) \
private: \
__VA_ARGS__() = delete; \
__VA_ARGS__(const __VA_ARGS__& other) = delete; \
__VA_ARGS__& operator=(const __VA_ARGS__& other) = delete; \
public:
#define ASMJIT_NONCOPYABLE(...) \
private: \
__VA_ARGS__(const __VA_ARGS__& other) = delete; \
__VA_ARGS__& operator=(const __VA_ARGS__& other) = delete; \
public:
#else
#define ASMJIT_NONCONSTRUCTIBLE(...) \
private: \
inline __VA_ARGS__(); \
inline __VA_ARGS__(const __VA_ARGS__& other); \
inline __VA_ARGS__& operator=(const __VA_ARGS__& other); \
public:
#define ASMJIT_NONCOPYABLE(...) \
private: \
inline __VA_ARGS__(const __VA_ARGS__& other); \
inline __VA_ARGS__& operator=(const __VA_ARGS__& other); \
public:
#endif // ASMJIT_CC_HAS_DELETE_FUNCTION

// [ASMJIT_ENUM]
#if defined(_MSC_VER) && _MSC_VER >= 1400
# define ASMJIT_ENUM(NAME) enum NAME : uint32_t
#else
# define ASMJIT_ENUM(NAME) enum NAME
#endif

0 comments on commit 3fd9ee2

Please sign in to comment.