mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-26 15:49:30 +00:00
MACOS working
Mac working in this stage
This commit is contained in:
parent
a200554496
commit
0af0b5a24a
5 changed files with 19 additions and 21 deletions
|
|
@ -110,6 +110,7 @@ mark_as_advanced(SDL_X11)
|
|||
mark_as_advanced(SDL_XINPUT)
|
||||
|
||||
add_subdirectory(sdl ${TORQUE_LIB_TARG_DIRECTORY}/sdl2 EXCLUDE_FROM_ALL)
|
||||
|
||||
add_subdirectory(nativeFileDialogs ${TORQUE_LIB_TARG_DIRECTORY}/nfd EXCLUDE_FROM_ALL)
|
||||
|
||||
# Assimp
|
||||
|
|
@ -160,6 +161,10 @@ if (TORQUE_CPU_ARM32 OR TORQUE_CPU_ARM64)
|
|||
endif(NOT APPLE)
|
||||
endif (TORQUE_CPU_ARM32 OR TORQUE_CPU_ARM64)
|
||||
|
||||
if(APPLE)
|
||||
set(PNG_ARM_NEON off CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
|
||||
#PNG
|
||||
set(PNG_STATIC on CACHE BOOL "" FORCE)
|
||||
mark_as_advanced(PNG_STATIC)
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ static nfdresult_t AllocPathSet( NSArray *urls, nfdpathset_t *pathset )
|
|||
assert([urls count]);
|
||||
|
||||
pathset->count = (size_t)[urls count];
|
||||
pathset->indices = NFDi_Malloc( sizeof(size_t)*pathset->count );
|
||||
pathset->indices = (unsigned long*)NFDi_Malloc( sizeof(size_t)*pathset->count );
|
||||
if ( !pathset->indices )
|
||||
{
|
||||
return NFD_ERROR;
|
||||
|
|
@ -89,7 +89,7 @@ static nfdresult_t AllocPathSet( NSArray *urls, nfdpathset_t *pathset )
|
|||
bufsize += [path lengthOfBytesUsingEncoding:NSUTF8StringEncoding] + 1;
|
||||
}
|
||||
|
||||
pathset->buf = NFDi_Malloc( sizeof(nfdchar_t) * bufsize );
|
||||
pathset->buf = (char *)NFDi_Malloc( sizeof(nfdchar_t) * bufsize );
|
||||
if ( !pathset->buf )
|
||||
{
|
||||
return NFD_ERROR;
|
||||
|
|
@ -144,7 +144,7 @@ nfdresult_t NFD_OpenDialog( const nfdchar_t *filterList,
|
|||
// byte count, not char count
|
||||
size_t len = strlen(utf8Path);//NFDi_UTF8_Strlen(utf8Path);
|
||||
|
||||
*outPath = NFDi_Malloc( len+1 );
|
||||
*outPath = (nfdchar_t*)NFDi_Malloc(len+1);
|
||||
if ( !*outPath )
|
||||
{
|
||||
[pool release];
|
||||
|
|
@ -229,7 +229,7 @@ nfdresult_t NFD_SaveDialog( const nfdchar_t *filterList,
|
|||
|
||||
size_t byteLen = [url.path lengthOfBytesUsingEncoding:NSUTF8StringEncoding] + 1;
|
||||
|
||||
*outPath = NFDi_Malloc( byteLen );
|
||||
*outPath = (char *)NFDi_Malloc( byteLen );
|
||||
if ( !*outPath )
|
||||
{
|
||||
[pool release];
|
||||
|
|
@ -269,7 +269,7 @@ nfdresult_t NFD_PickFolder(const nfdchar_t *defaultPath,
|
|||
// byte count, not char count
|
||||
size_t len = strlen(utf8Path);//NFDi_UTF8_Strlen(utf8Path);
|
||||
|
||||
*outPath = NFDi_Malloc( len+1 );
|
||||
*outPath = (char *)NFDi_Malloc( len+1 );
|
||||
if ( !*outPath )
|
||||
{
|
||||
[pool release];
|
||||
|
|
|
|||
|
|
@ -57,7 +57,6 @@ torqueAddSourceDirectories("platform" "platform/threads" "platform/async"
|
|||
"platform/input" "platform/output")
|
||||
|
||||
torqueAddSourceDirectories("platform/nativeDialogs")
|
||||
|
||||
# Handle T3D
|
||||
torqueAddSourceDirectories("T3D/fps" "T3D/fx" "T3D/vehicles" "T3D/physics"
|
||||
"T3D/decal" "T3D/sfx" "T3D/gameBase" "T3D/turret"
|
||||
|
|
@ -199,9 +198,11 @@ torqueAddSourceDirectories("i18n")
|
|||
if (UNIX)
|
||||
torqueAddSourceDirectories("platformPOSIX")
|
||||
|
||||
if (TORQUE_CPU_X32 OR TORQUE_CPU_X64)
|
||||
torqueAddSourceDirectories("platformX86UNIX")
|
||||
endif (TORQUE_CPU_X32 OR TORQUE_CPU_X64)
|
||||
if(NOT APPLE)
|
||||
if (TORQUE_CPU_X32 OR TORQUE_CPU_X64)
|
||||
torqueAddSourceDirectories("platformX86UNIX")
|
||||
endif (TORQUE_CPU_X32 OR TORQUE_CPU_X64)
|
||||
endif(NOT APPLE)
|
||||
endif (UNIX)
|
||||
|
||||
# Handle platformMac
|
||||
|
|
|
|||
|
|
@ -52,14 +52,11 @@ foreach(lang ${languages})
|
|||
set(CMAKE_${lang}_CREATE_STATIC_LIBRARY "${BUILD_LIBTOOL} -static -o <TARGET> <LINK_FLAGS> <OBJECTS> " CACHE INTERNAL "")
|
||||
endforeach()
|
||||
|
||||
set(CMAKE_FRAMEWORK_PATH
|
||||
${CMAKE_DEVELOPER_ROOT}/Library/PrivateFrameworks
|
||||
${XCODE_SDK_ROOT_DIR}/System/Library/Frameworks
|
||||
${CMAKE_FRAMEWORK_PATH} CACHE INTERNAL "")
|
||||
set(CMAKE_FRAMEWORK_PATH "/Applications/XCode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks")
|
||||
|
||||
set(CMAKE_FIND_FRAMEWORK FIRST)
|
||||
set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE INTERNAL "")
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13" CACHE INTERNAL "")
|
||||
set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE STRING "" FORCE)
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13" CACHE STRING "" FORCE)
|
||||
set(CMAKE_XCODE_ATTRIBUTE_SDKROOT macosx)
|
||||
set(CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH "NO")
|
||||
set(CMAKE_SYSTEM_NAME Darwin)
|
||||
|
|
|
|||
|
|
@ -128,11 +128,6 @@ endmacro (filterOut)
|
|||
################# apple frameworks ###################
|
||||
macro(addFramework framework)
|
||||
if (APPLE)
|
||||
find_library(${FRAMEWORK_LIB} ${framework})
|
||||
if(NOT ${FRAMEWORK_LIB})
|
||||
message(STATUS "${framework} not found.")
|
||||
else()
|
||||
set(TORQUE_LINK_LIBRARIES ${TORQUE_LINK_LIBRARIES} "${framework}")
|
||||
endif()
|
||||
set(TORQUE_LINK_LIBRARIES ${TORQUE_LINK_LIBRARIES} "${CMAKE_FRAMEWORK_PATH}/${framework}.framework")
|
||||
endif()
|
||||
endmacro()
|
||||
Loading…
Add table
Add a link
Reference in a new issue