Mac fixes (#1795)
* macOS build fixes (#1773) * macOS build fixes Add missing headers Threads_Pthreads: do not call pthread_setname_np() on macOS as it does not do the same as on Linux DebugStr() -> os_log() * Make the project build with Makefiles on macOS * Fix getting modifier key state on Mac (#1774) We really need to clean up all Carbon calls here (many will go away when the project switches to SDL2 for all platforms) * Fix Xcode build; bump minimum version of macOS (#1775) * Build fixes for the "Unix Makefiles" generator Pass CMAKE_BUILD_TYPE to the external projects * Fix indent * Fix setting CFBundleExecutable value * Improve handling of system libpng Header mismatch can cause a crash, so force the non-system png.h if WITH_SYSTEM_PNG=no * Better handling of TRUE/FALSE with newer versions of jpeglib * Add JPEG include directory
This commit is contained in:
@@ -28,7 +28,7 @@
|
|||||||
</dict>
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>PRODUCT_NAME</string>
|
<string>@SM_EXE_NAME@</string>
|
||||||
<key>CFBundleGetInfoString</key>
|
<key>CFBundleGetInfoString</key>
|
||||||
<string>@SM_EXE_NAME@ @SM_VERSION_TRADITIONAL@</string>
|
<string>@SM_EXE_NAME@ @SM_VERSION_TRADITIONAL@</string>
|
||||||
<key>CFBundleIconFile</key>
|
<key>CFBundleIconFile</key>
|
||||||
|
|||||||
+3
-1
@@ -441,6 +441,7 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WITH_SYSTEM_PNG)
|
if(WITH_SYSTEM_PNG)
|
||||||
|
sm_add_compile_definition("${SM_EXE_NAME}" SYSTEM_PNG)
|
||||||
list(APPEND SMDATA_LINK_LIB ${PNG_LIBRARIES})
|
list(APPEND SMDATA_LINK_LIB ${PNG_LIBRARIES})
|
||||||
else()
|
else()
|
||||||
list(APPEND SMDATA_LINK_LIB "png")
|
list(APPEND SMDATA_LINK_LIB "png")
|
||||||
@@ -611,6 +612,7 @@ target_link_libraries("${SM_EXE_NAME}" ${SMDATA_LINK_LIB})
|
|||||||
|
|
||||||
list(APPEND SM_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
|
list(APPEND SM_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
"${SM_SRC_DIR}/generated")
|
"${SM_SRC_DIR}/generated")
|
||||||
|
list(APPEND SM_INCLUDE_DIRS "${JPEG_INCLUDE_DIR}")
|
||||||
if(NOT APPLE)
|
if(NOT APPLE)
|
||||||
list(APPEND SM_INCLUDE_DIRS
|
list(APPEND SM_INCLUDE_DIRS
|
||||||
"${SM_EXTERN_DIR}/glew-1.5.8/include"
|
"${SM_EXTERN_DIR}/glew-1.5.8/include"
|
||||||
@@ -628,7 +630,6 @@ if(NOT APPLE)
|
|||||||
if(WITH_OGG)
|
if(WITH_OGG)
|
||||||
list(APPEND SM_INCLUDE_DIRS "${SM_EXTERN_DIR}/vorbis")
|
list(APPEND SM_INCLUDE_DIRS "${SM_EXTERN_DIR}/vorbis")
|
||||||
endif()
|
endif()
|
||||||
list(APPEND SM_INCLUDE_DIRS "${JPEG_INCLUDE_DIR}")
|
|
||||||
if(HAS_FFMPEG)
|
if(HAS_FFMPEG)
|
||||||
if(WITH_SYSTEM_FFMPEG)
|
if(WITH_SYSTEM_FFMPEG)
|
||||||
list(APPEND SM_INCLUDE_DIRS "${FFMPEG_INCLUDE_DIR}")
|
list(APPEND SM_INCLUDE_DIRS "${FFMPEG_INCLUDE_DIR}")
|
||||||
@@ -668,6 +669,7 @@ else()
|
|||||||
list(APPEND SM_INCLUDE_DIRS "${SM_EXTERN_DIR}/libpng/include")
|
list(APPEND SM_INCLUDE_DIRS "${SM_EXTERN_DIR}/libpng/include")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
target_include_directories("${SM_EXE_NAME}" PUBLIC ${SM_INCLUDE_DIRS})
|
target_include_directories("${SM_EXE_NAME}" PUBLIC ${SM_INCLUDE_DIRS})
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
|
|||||||
@@ -12,7 +12,11 @@
|
|||||||
#endif
|
#endif
|
||||||
#pragma warning(disable: 4611) /* interaction between '_setjmp' and C++ object destruction is non-portable */
|
#pragma warning(disable: 4611) /* interaction between '_setjmp' and C++ object destruction is non-portable */
|
||||||
#else
|
#else
|
||||||
|
#ifndef SYSTEM_PNG
|
||||||
|
#include "../extern/libpng/include/png.h"
|
||||||
|
#else
|
||||||
#include <png.h>
|
#include <png.h>
|
||||||
|
#endif // SYSTEM_PNG
|
||||||
#endif // _MSC_VER
|
#endif // _MSC_VER
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
|
|||||||
@@ -16,8 +16,9 @@ namespace jpeg
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only Xcode wants this. FIXME
|
// Newer versions of jpeglib and jpeglib-turbo define TRUE/FALSE in a
|
||||||
#if defined(PBBUILD) && defined(SYSTEM_JPEGLIB)
|
// typedef enum {}
|
||||||
|
#if defined(SYSTEM_JPEGLIB) && JPEG_LIB_VERSION > 80
|
||||||
#define TRUE jpeg::TRUE
|
#define TRUE jpeg::TRUE
|
||||||
#define FALSE jpeg::FALSE
|
#define FALSE jpeg::FALSE
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -13,7 +13,11 @@
|
|||||||
#endif
|
#endif
|
||||||
#pragma warning(disable: 4611) /* interaction between '_setjmp' and C++ object destruction is non-portable */
|
#pragma warning(disable: 4611) /* interaction between '_setjmp' and C++ object destruction is non-portable */
|
||||||
#else
|
#else
|
||||||
|
#ifndef SYSTEM_PNG
|
||||||
|
#include "../extern/libpng/include/png.h"
|
||||||
|
#else
|
||||||
#include <png.h>
|
#include <png.h>
|
||||||
|
#endif
|
||||||
#endif // _MSC_VER
|
#endif // _MSC_VER
|
||||||
|
|
||||||
static void SafePngError( png_struct *pPng, const RString &sStr )
|
static void SafePngError( png_struct *pPng, const RString &sStr )
|
||||||
|
|||||||
Reference in New Issue
Block a user