diff --git a/Sources/CMakeLists.txt b/Sources/CMakeLists.txt index b9f8f79..0201dbb 100644 --- a/Sources/CMakeLists.txt +++ b/Sources/CMakeLists.txt @@ -21,6 +21,9 @@ endif() set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake") include(CheckCXXCompilerFlag) +# ssam expects the libs to be in Debug/ +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Debug) + # Use systemwide SDL2 or custom build # RAKE!: Find a way to use their custom built library if # they want to use that instead or if their system only @@ -110,6 +113,8 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang") add_compile_options(-Wno-sign-compare) add_compile_options(-Wno-switch) add_compile_options(-Wno-format-security) + add_definitions(-Wno-logical-op-parentheses) + MESSAGE(WARNING, "re-enable -Wlogical-op-parentheses some day!") if(MACOSX) add_definitions(-DPLATFORM_UNIX=1) @@ -182,9 +187,8 @@ else() set(DEBUGSUFFIX "") endif() -# !!! FIXME: you currently need this, but I'd like to flip this to not use -# !!! FIXME: assembly language. And maybe delete the asm code too. -option(USE_I386_ASM "Use X86 ASM" TRUE) +# This should not be needed anymore, but might be faster on 32bit x86 +option(USE_I386_ASM "Use X86 ASM" FALSE) if (USE_I386_ASM) # You need the Netwide Assembler (NASM) to build this on Intel systems. @@ -198,8 +202,10 @@ if (USE_I386_ASM) else() set(ASMOBJFMT "elf") endif() + MESSAGE(STATUS "Using i386 assembler") else() add_definitions(-DUSE_PORTABLE_C=1) + MESSAGE(STATUS "Using portable C instead of ASM") endif() option(PANDORA "Compile for Pandora" FALSE) @@ -905,12 +911,23 @@ if(BUILD_DEDICATED_SERVER) endif() if(MACOSX) - find_library(COCOA_FRAMEWORK Cocoa) - target_link_libraries(ssam "${COCOA_FRAMEWORK}") - target_link_libraries(ssam "${CMAKE_CURRENT_SOURCE_DIR}/lib/macosx/libSDL2-2.0.0.dylib") + target_link_libraries(ssam ${ZLIB_LIBRARIES}) + if(USE_SYSTEM_SDL2) # use sdl2 framework on system + target_link_libraries(ssam ${SDL2_LIBRARY}) + else() # use local libsdl2 + find_library(COCOA_FRAMEWORK Cocoa) + target_link_libraries(ssam "${COCOA_FRAMEWORK}") + target_link_libraries(ssam "${CMAKE_CURRENT_SOURCE_DIR}/lib/macosx/libSDL2-2.0.0.dylib") + endif() + if(BUILD_DEDICATED_SERVER) - target_link_libraries(SeriousSamDedicated "${COCOA_FRAMEWORK}") - target_link_libraries(SeriousSamDedicated "${CMAKE_CURRENT_SOURCE_DIR}/lib/macosx/libSDL2-2.0.0.dylib") + target_link_libraries(SeriousSamDedicated ${ZLIB_LIBRARIES}) + if(USE_SYSTEM_SDL2) + target_link_libraries(SeriousSamDedicated ${SDL2_LIBRARY}) + else() + target_link_libraries(SeriousSamDedicated "${COCOA_FRAMEWORK}") + target_link_libraries(SeriousSamDedicated "${CMAKE_CURRENT_SOURCE_DIR}/lib/macosx/libSDL2-2.0.0.dylib") + endif() endif() endif() diff --git a/Sources/Engine/Base/Assert.h b/Sources/Engine/Base/Assert.h index 337afe0..80f4aa3 100644 --- a/Sources/Engine/Base/Assert.h +++ b/Sources/Engine/Base/Assert.h @@ -38,6 +38,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #ifdef PLATFORM_UNIX /* rcg10042001 */ #include "SDL_assert.h" #define _assert(x, y, z) SDL_assert(0) +#include // raise() #endif diff --git a/Sources/Engine/Base/CRC.h b/Sources/Engine/Base/CRC.h index 3d56397..eb93255 100644 --- a/Sources/Engine/Base/CRC.h +++ b/Sources/Engine/Base/CRC.h @@ -70,5 +70,35 @@ inline void CRC_AddBlock(ULONG &ulCRC, UBYTE *pubBlock, ULONG ulSize) // end crc calculation inline void CRC_Finish(ULONG &ulCRC) { ulCRC ^= 0xFFFFFFFF; }; +// in 32bit mode, it just returns iPtr ULONG, +// in 64bit mode it returns the CRC hash of iPtr (or 0 if ptr == NULL) +// so either way you should get a value that very likely uniquely identifies the pointer +inline ULONG IntPtrToID(size_t iPtr) +{ +#if PLATFORM_32BIT + return (ULONG)iPtr; +#else + // in case the code relies on 0 having special meaning because of NULL-pointers... + if(iPtr == 0) return 0; + ULONG ret; + CRC_Start(ret); + CRC_AddLONGLONG(ret, iPtr); + CRC_Finish(ret); + return ret; +#endif +} + +// in 32bit mode, it just returns the pointer's address as ULONG, +// in 64bit mode it returns the CRC hash of the pointer's address (or 0 if ptr == NULL) +// so either way you should get a value that very likely uniquely identifies the pointer +inline ULONG PointerToID(void* ptr) +{ +#if PLATFORM_32BIT + return (ULONG)(size_t)ptr; +#else + return IntPtrToID((size_t)ptr); +#endif +} + #endif /* include-once check. */ diff --git a/Sources/Engine/Base/Types.h b/Sources/Engine/Base/Types.h index 1cf1903..a3bc594 100644 --- a/Sources/Engine/Base/Types.h +++ b/Sources/Engine/Base/Types.h @@ -61,37 +61,44 @@ typedef unsigned int UINT; #define PLATFORM_LITTLEENDIAN 1 #endif -#ifdef PLATFORM_WIN32 - #ifdef _WIN64 - #define PLATFORM_64BIT 1 - #else - #define PLATFORM_32BIT 1 - #endif +#if defined(__x86_64__) || defined(_M_X64) || defined(__aarch64__) || defined(_ARCH_PPC64) \ + || defined(_M_IA64) || defined(__IA64__) + + #define PLATFORM_64BIT 1 + +#elif defined(__i386) || defined(_M_IX86) || defined(__arm__) || defined(_M_ARM) || defined(__POWERPC__) \ + || defined(_M_PPC) || defined(_ARCH_PPC) + + #define PLATFORM_32BIT 1 + #else - // AFAIK there were versions of MSVC where UINTPTR_MAX was incorrect, - // so I use different code for Windows above - #include // UINTPTR_MAX - #ifdef UINTPTR_MAX - #if UINTPTR_MAX == 0xffffffffuL - #define PLATFORM_32BIT 1 - #elif UINTPTR_MAX == 0xffffffffffffffffuLL - #define PLATFORM_64BIT 1 - #else - #error WTF, your system seems to be neither 32bit nor 64bit?! - #endif - #else - #error Your system does not provide UINTPRT_MAX, find another way! - #endif - - #if UINTPTR_MAX != SIZE_MAX - // the code uses size_t to store pointers all over the place, so if size_t and uintptr_t - // don't have the same size on your system, you're in real trouble. - // (before panicking however make sure your headers don't just contain bullshit values for UINTPTR_MAX or SIZE_MAX) - #error Seems like on your system sizeof(size_t) != sizeof(uintptr_t) - that is *very* bad. - #endif - + #error "Unknown CPU-Architecture, adapt this code to detect 32/64bitness of your system!" #endif + +// if the compiler complains about the typedef created by MY_STATIC_ASSERT being invalid +// (because of array with negative size), it means the check for cond has failed +#define MY_STATIC_ASSERT(namesuffx, cond) \ + typedef char sesam__check_ ## namesuffx [ (cond) ? 1 : -1 ]; + +// some sanity checks to make sure the PLATFORM_*BIT #defines match the pointer size +// and that size_t is the size of a pointer, as expected (as we sometimes use size_t to store pointers) +#ifdef PLATFORM_32BIT + MY_STATIC_ASSERT(32bit_PointerSize, sizeof(void*) == 4); + + #ifdef PLATFORM_64BIT + #error "PLATFORM_32BIT and PLATFORM_64BIT must not be #defined at the same time!" + #endif +#endif + +#ifdef PLATFORM_64BIT + MY_STATIC_ASSERT(64bit_PointerSize, sizeof(void*) == 8); +#endif + +MY_STATIC_ASSERT(size_tSize, sizeof(size_t) == sizeof(void*)); + +#undef MY_STATIC_ASSERT + // Mac symbols have an underscore prepended... #if PLATFORM_MACOSX #define ASMSYM(x) "_" #x diff --git a/Sources/Engine/Models/Model.cpp b/Sources/Engine/Models/Model.cpp index 76591a8..1ea0dcb 100644 --- a/Sources/Engine/Models/Model.cpp +++ b/Sources/Engine/Models/Model.cpp @@ -481,7 +481,7 @@ ModelTextureVertex::ModelTextureVertex(void) //------------------------------------------ WRITE void ModelPolygonVertex::Write_t( CTStream *pFile) // throw char * { - STUBBED("64-bit issue"); // DG: probably ok, because PtrToIndices() should have been called before this + // DG: this looks like a 64-bit issue, but most probably isn't as PtrToIndices() should have been called before this (*pFile) << (INDEX) (size_t) mpv_ptvTransformedVertex; (*pFile) << (INDEX) (size_t) mpv_ptvTextureVertex; } @@ -490,7 +490,8 @@ void ModelPolygonVertex::Read_t( CTStream *pFile) // throw char * { INDEX itmp; - STUBBED("64-bit issue"); // DG: probably ok, because IndicesToPtrs() should be called afterwards + // DG: this looks like a 64-bit issue, but most probably isn't as IndicesToPtrs() should be + // called afterwards to restore actually valid pointers. (*pFile) >> itmp; mpv_ptvTransformedVertex = (struct TransformedVertexData *) (size_t) itmp; (*pFile) >> itmp; @@ -1068,10 +1069,11 @@ void CModelData::IndicesToPtrs() FOREACHINSTATICARRAY(it1.Current().mp_PolygonVertices, ModelPolygonVertex, it2) { struct ModelPolygonVertex * pMPV = &it2.Current(); - STUBBED("64-bit issue"); // DG: probably ok, the pointers really contain indices from PtrToIndices() + // DG: this looks like a 64-bit issue but is most probably ok, as the pointers + // should contain indices from PtrToIndices() j = (INDEX) (size_t) it2.Current().mpv_ptvTransformedVertex; it2.Current().mpv_ptvTransformedVertex = &md_TransformedVertices[ j]; - STUBBED("64-bit issue"); // DG: probably ok, the pointers really contain indices from PtrToIndices() + // DG: same here j = (INDEX) (size_t) it2.Current().mpv_ptvTextureVertex; it2.Current().mpv_ptvTextureVertex = &md_MipInfos[ i].mmpi_TextureVertices[ j]; } diff --git a/Sources/Engine/Network/SessionState.h b/Sources/Engine/Network/SessionState.h index 717feaf..db23a96 100644 --- a/Sources/Engine/Network/SessionState.h +++ b/Sources/Engine/Network/SessionState.h @@ -60,7 +60,7 @@ public: TIME pe_tmTick; ULONG pe_ulEntityID; ULONG pe_ulTypeID; - ULONG pe_ulEventID; // FIXME: make this void* or uintptr_t/size_t + ULONG pe_ulEventID; CPredictedEvent(void); void Clear(void) {}; diff --git a/Sources/Engine/Sound/SoundObject.cpp b/Sources/Engine/Sound/SoundObject.cpp index 9f20aca..8011ae5 100644 --- a/Sources/Engine/Sound/SoundObject.cpp +++ b/Sources/Engine/Sound/SoundObject.cpp @@ -213,8 +213,7 @@ void CSoundObject::Play(CSoundData *pCsdLink, SLONG slFlags) //CPrintF("PLAY: '%s'", (const char*)pCsdLink->GetName().FileName()); // get prediction tail - STUBBED("64-bit issue"); - CSoundObject *psoTail = GetPredictionTail(EVENT_SOUNDPLAY, (ULONG)(size_t)pCsdLink); + CSoundObject *psoTail = GetPredictionTail(EVENT_SOUNDPLAY, PointerToID(pCsdLink)); // if the event is predicted if (psoTail==NULL) { // do nothing; @@ -350,8 +349,7 @@ void CSoundObject::Stop(void) CSoundObject *psoTail = this; // get prediction tail - STUBBED("64-bit issue"); - psoTail = GetPredictionTail(EVENT_SOUNDSTOP, (ULONG)(size_t)so_pCsdLink); + psoTail = GetPredictionTail(EVENT_SOUNDSTOP, PointerToID(so_pCsdLink)); // if the event is predicted if (psoTail==NULL) { // do nothing; diff --git a/Sources/Engine/Templates/BSP.cpp b/Sources/Engine/Templates/BSP.cpp index ab942cc..16a2b86 100644 --- a/Sources/Engine/Templates/BSP.cpp +++ b/Sources/Engine/Templates/BSP.cpp @@ -19,6 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include #include +#include #include #include #include @@ -219,7 +220,7 @@ void BSPVertexContainer::ElliminatePairedVertices(void) * Create edges from vertices in one container -- must be sorted before. */ template -void BSPVertexContainer::CreateEdges(CDynamicArray > &abed, ULONG ulEdgeTag) +void BSPVertexContainer::CreateEdges(CDynamicArray > &abed, size_t ulEdgeTag) { // if there are no vertices, or the container is not line if (bvc_aVertices.Count()==0 || IsPlannar()) { @@ -372,7 +373,7 @@ void BSPEdge::OptimizeBSPEdges(CDynamicArray -inline void BSPPolygon::AddEdge(const Vector &vPoint0, const Vector &vPoint1, ULONG ulTag) +inline void BSPPolygon::AddEdge(const Vector &vPoint0, const Vector &vPoint1, size_t ulTag) { *bpo_abedPolygonEdges.New() = BSPEdge(vPoint0, vPoint1, ulTag); } @@ -412,7 +413,7 @@ BSPNode::BSPNode(enum BSPNodeLocation bnl) * Constructor for a branch node. */ template -BSPNode::BSPNode(const Plane &plSplitPlane, ULONG ulPlaneTag, +BSPNode::BSPNode(const Plane &plSplitPlane, size_t ulPlaneTag, BSPNode &bnFront, BSPNode &bnBack) : Plane(plSplitPlane) , bn_pbnFront(&bnFront) @@ -731,7 +732,7 @@ void BSPCutter::CutPolygon(BSPPolygon &bpo * -- returns FALSE if polygon is laying on the plane */ template -BOOL BSPCutter::SplitPolygon(BSPPolygon &bpoPolygon, const Plane &plSplitPlane, ULONG ulPlaneTag, +BOOL BSPCutter::SplitPolygon(BSPPolygon &bpoPolygon, const Plane &plSplitPlane, size_t ulPlaneTag, BSPPolygon &bpoFront, BSPPolygon &bpoBack) { (Plane &)bpoFront = (Plane &)bpoPolygon; @@ -802,7 +803,7 @@ BOOL BSPCutter::SplitPolygon(BSPPolygon &b * Split an edge with a plane. */ template -void BSPCutter::SplitEdge(const Vector &vPoint0, const Vector &vPoint1, ULONG ulEdgeTag, +void BSPCutter::SplitEdge(const Vector &vPoint0, const Vector &vPoint1, size_t ulEdgeTag, const Plane &plSplitPlane, BSPPolygon &bpoFront, BSPPolygon &bpoBack, BSPVertexContainer &bvcFront, BSPVertexContainer &bvcBack) @@ -1132,20 +1133,17 @@ void BSPTree::MoveSubTreeToArray(BSPNode * bnInArray.bn_bnlLocation = pbnSubtree->bn_bnlLocation; bnInArray.bn_ulPlaneTag = pbnSubtree->bn_ulPlaneTag; // let plane tag hold pointer to node in array - STUBBED("64-bit issue"); - pbnSubtree->bn_ulPlaneTag = (ULONG)(size_t)&bnInArray; + pbnSubtree->bn_ulPlaneTag = (size_t)&bnInArray; // remap pointers to subnodes if (pbnSubtree->bn_pbnFront==NULL) { bnInArray.bn_pbnFront = NULL; } else { - STUBBED("64-bit issue"); // bn_ulPlaneTag is uint32! bnInArray.bn_pbnFront = (BSPNode*)pbnSubtree->bn_pbnFront->bn_ulPlaneTag; } if (pbnSubtree->bn_pbnBack==NULL) { bnInArray.bn_pbnBack = NULL; } else { - STUBBED("64-bit issue"); // basically the same as above but for back! bnInArray.bn_pbnBack = (BSPNode*)pbnSubtree->bn_pbnBack->bn_ulPlaneTag; } } @@ -1232,8 +1230,9 @@ void BSPTree::Read_t(CTStream &strm) // throw char * } else { bn.bn_pbnBack = &bt_abnNodes[iBack]; } - - strm>>bn.bn_ulPlaneTag; + ULONG ul; + strm>>ul; + bn.bn_ulPlaneTag = ul; } // check end id @@ -1283,7 +1282,7 @@ void BSPTree::Write_t(CTStream &strm) // throw char * } strm< > &abedAll, ULONG ulEdgeTag); + void CreateEdges(CDynamicArray > &abedAll, size_t ulEdgeTag); }; /* @@ -87,7 +87,7 @@ class BSPEdge { public: Vector bed_vVertex0; // edge vertices Vector bed_vVertex1; - size_t bed_ulEdgeTag; // tags for BSPs with tagged edges/planes - FIXME DG: or uintprt_t? + size_t bed_ulEdgeTag; // tags for BSPs with tagged edges/planes /* Default constructor. */ inline BSPEdge(void) {}; @@ -113,7 +113,7 @@ public: size_t bpo_ulPlaneTag; // tags for BSPs with tagged planes (-1 for no tag) /* Add an edge to the polygon. */ - inline void AddEdge(const Vector &vPoint0, const Vector &vPoint1, ULONG ulTag); + inline void AddEdge(const Vector &vPoint0, const Vector &vPoint1, size_t ulTag); /* Default constructor. */ inline BSPPolygon(void) : bpo_ulPlaneTag(-1) {}; @@ -146,7 +146,7 @@ public: BSPNode *bn_pbnFront; // pointer to child node in front of split plane BSPNode *bn_pbnBack; // pointer to child node behind split plane - ULONG bn_ulPlaneTag; // tags for BSPs with tagged planes (-1 for no tag) + size_t bn_ulPlaneTag; // tags for BSPs with tagged planes (-1 for no tag) public: /* Defualt constructor (for arrays only). */ @@ -154,7 +154,7 @@ public: /* Constructor for a leaf node. */ inline BSPNode(enum BSPNodeLocation bnl); /* Constructor for a branch node. */ - inline BSPNode(const Plane &plSplitPlane, ULONG ulPlaneTag, + inline BSPNode(const Plane &plSplitPlane, size_t ulPlaneTag, BSPNode &bnFront, BSPNode &bnBack); /* Constructor for cloning a bsp (sub)tree. */ BSPNode(BSPNode &bnRoot); @@ -180,7 +180,7 @@ template class BSPCutter { public: /* Split an edge with a plane. */ - static inline void SplitEdge(const Vector &vPoint0, const Vector &vPoint1, ULONG ulEdgeTag, + static inline void SplitEdge(const Vector &vPoint0, const Vector &vPoint1, size_t ulEdgeTag, const Plane &plSplitPlane, BSPPolygon &abedFront, BSPPolygon &abedBack, BSPVertexContainer &bvcFront, BSPVertexContainer &bvcBack); @@ -195,7 +195,7 @@ public: CDynamicArray > bc_abedBorderOutside;// edges of border part of polygon facing outwards /* Split a polygon with a plane. */ - static inline BOOL SplitPolygon(BSPPolygon &bpoPolygon, const Plane &plPlane, ULONG ulPlaneTag, + static inline BOOL SplitPolygon(BSPPolygon &bpoPolygon, const Plane &plPlane, size_t ulPlaneTag, BSPPolygon &bpoFront, BSPPolygon &bpoBack); /* Constructor for splitting a polygon with a BSP tree. */ diff --git a/Sources/Entities/Common/Particles.cpp b/Sources/Entities/Common/Particles.cpp index 82bf0e1..204948b 100644 --- a/Sources/Entities/Common/Particles.cpp +++ b/Sources/Entities/Common/Particles.cpp @@ -980,9 +980,9 @@ INDEX Particles_Regeneration(CEntity *pen, FLOAT tmStart, FLOAT tmStop, FLOAT fY vPos2 = Lerp( vSource, vDestination, fT2); } - UBYTE ubR = 192+afStarsPositions[iRnd][1]*64; - UBYTE ubG = 192+afStarsPositions[iRnd][2]*64; - UBYTE ubB = 192+afStarsPositions[iRnd][3]*64; + UBYTE ubR = 192+afStarsPositions[iRnd][0]*64; + UBYTE ubG = 192+afStarsPositions[iRnd][1]*64; + UBYTE ubB = 192+afStarsPositions[iRnd][2]*64; UBYTE ubA = CalculateRatio( fT, 0.0f, 1.0f, 0.4f, 0.01f)*255; COLOR colLine = RGBToColor( ubR, ubG, ubB) | ubA; @@ -1567,7 +1567,7 @@ void Particles_LavaErupting(CEntity *pen, FLOAT fStretchAll, FLOAT fSize, vPos(2) += (fStretchY+(fStretchY*0.25f*afStarsPositions[iRnd1][1]))*fT-fGA/2.0f*fT*fT; vPos(3) += fRndAppearZ+afStarsPositions[iRnd1][2]*fT*fStretchZ*10; - Particle_RenderSquare( vPos, fSize+afStarsPositions[iRnd2][3]*fSize*0.5f, fRndRotation*300*fT, C_WHITE|CT_OPAQUE); + Particle_RenderSquare( vPos, fSize+afStarsPositions[iRnd2][2]*fSize*0.5f, fRndRotation*300*fT, C_WHITE|CT_OPAQUE); // all done Particle_Flush(); @@ -1713,7 +1713,7 @@ void Particles_Rain(CEntity *pen, FLOAT fGridSize, INDEX ctGrids, FLOAT fFactor, for( INDEX iZ=0; iZfLife/2) diff --git a/Sources/Entities/Player.es b/Sources/Entities/Player.es index 4f55061..d02be99 100644 --- a/Sources/Entities/Player.es +++ b/Sources/Entities/Player.es @@ -2238,7 +2238,7 @@ functions: void RenderGameView(CDrawPort *pdp, void *pvUserData) { - BOOL bShowExtras = (ULONG(pvUserData)&GRV_SHOWEXTRAS); + BOOL bShowExtras = (size_t(pvUserData)&GRV_SHOWEXTRAS); // if not yet initialized if(!(m_ulFlags&PLF_INITIALIZED) || (m_ulFlags&PLF_DONTRENDER)) { diff --git a/Sources/build-linux32.sh b/Sources/build-linux32.sh index 467fb9f..4f44315 100755 --- a/Sources/build-linux32.sh +++ b/Sources/build-linux32.sh @@ -17,7 +17,7 @@ cd $_ #cmake -DCMAKE_BUILD_TYPE=Debug -DUSE_I386_ASM=FALSE .. # Right now we force x86, though... -cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32 .. +cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32 -DUSE_I386_ASM=TRUE .. make -j$NCPU diff --git a/Sources/build-mac.sh b/Sources/build-mac.sh index 3fd97e3..a0311cf 100755 --- a/Sources/build-mac.sh +++ b/Sources/build-mac.sh @@ -9,6 +9,6 @@ set -x rm -rf cmake-build mkdir $_ cd $_ -cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_OSX_ARCHITECTURES=i386 .. +cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_OSX_ARCHITECTURES=i386 -DUSE_I386_ASM=TRUE -DUSE_SYSTEM_SDL2=FALSE .. make -j$NCPU diff --git a/Sources/build-mac64.sh b/Sources/build-mac64.sh new file mode 100755 index 0000000..52f295b --- /dev/null +++ b/Sources/build-mac64.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +NCPU=`sysctl -n hw.ncpu` +echo "Will build with 'make -j$NCPU' ... please edit this script if incorrect." + +set -e +set -x + +rm -rf cmake-build +mkdir $_ +cd $_ +cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_OSX_ARCHITECTURES=x86_64 -DUSE_I386_ASM=FALSE .. +make -j$NCPU +