mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-19 20:24:49 +00:00
* BugFix: Correct some errors in the module scripts.
* BugFix: Fixes for compiling on Windows.
This commit is contained in:
parent
e7b01902ee
commit
b23554295c
|
|
@ -24,9 +24,6 @@ else()
|
|||
endif()
|
||||
endif()
|
||||
|
||||
enable_language(OBJC)
|
||||
|
||||
|
||||
option(TORQUE_MULTITHREAD "Multi Threading" ON)
|
||||
mark_as_advanced(TORQUE_MULTITHREAD)
|
||||
|
||||
|
|
|
|||
|
|
@ -3,11 +3,19 @@
|
|||
set(BUILD_SHARED_LIBS off CACHE STRING "")
|
||||
add_subdirectory(assimp ${CMAKE_BINARY_DIR}/temp/assimp EXCLUDE_FROM_ALL)
|
||||
|
||||
set(SDL_SHARED on CACHE BOOL "" FORCE)
|
||||
add_subdirectory(sdl ${CMAKE_BINARY_DIR}/temp/sdl2 EXCLUDE_FROM_ALL)
|
||||
|
||||
# Png depends on zlib
|
||||
add_subdirectory(zlib ${CMAKE_BINARY_DIR}/temp/zlib EXCLUDE_FROM_ALL)
|
||||
|
||||
# FIXME: For now we force-on Neon
|
||||
set(PNG_ARM_NEON on CACHE STRING "")
|
||||
set(PNG_STATIC on CACHE STRING "")
|
||||
set(PNG_ARM_NEON on CACHE BOOL "" FORCE)
|
||||
set(PNG_STATIC on CACHE BOOL "" FORCE)
|
||||
set(PNG_BUILD_ZLIB on CACHE BOOL "" FORCE)
|
||||
get_filename_component(ZLIB_ROOT "zlib" REALPATH BASE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
set(ZLIB_ROOT "${ZLIB_ROOT}" CACHE STRING "ZLib root location" FORCE)
|
||||
|
||||
add_subdirectory(lpng ${CMAKE_BINARY_DIR}/temp/lpng EXCLUDE_FROM_ALL)
|
||||
|
||||
add_subdirectory(ljpeg ${CMAKE_BINARY_DIR}/temp/ljpeg EXCLUDE_FROM_ALL)
|
||||
|
|
@ -15,7 +23,7 @@ add_subdirectory(tinyxml ${CMAKE_BINARY_DIR}/temp/tinyxml EXCLUDE_FROM_ALL)
|
|||
|
||||
add_subdirectory(opcode ${CMAKE_BINARY_DIR}/temp/opcode EXCLUDE_FROM_ALL)
|
||||
|
||||
add_subdirectory(zlib ${CMAKE_BINARY_DIR}/temp/zlib EXCLUDE_FROM_ALL)
|
||||
|
||||
add_subdirectory(pcre ${CMAKE_BINARY_DIR}/temp/pcre EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(convexDecomp ${CMAKE_BINARY_DIR}/temp/convexDecomp EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(squish ${CMAKE_BINARY_DIR}/temp/squish EXCLUDE_FROM_ALL)
|
||||
|
|
|
|||
|
|
@ -107,23 +107,23 @@ if (APPLE)
|
|||
file(GLOB TORQUE_PLATFORM_MAC_SOURCES "platformMac/*.mm")
|
||||
endif (APPLE)
|
||||
|
||||
# Handle platformWin32
|
||||
if (WIN32)
|
||||
file(GLOB TORQUE_PLATFORM_WIN_SOURCES "platformWin32/*.cpp")
|
||||
endif (WIN32)
|
||||
|
||||
# Handle platformSDL
|
||||
file(GLOB TORQUE_PLATFORM_SDL_SOURCES "platformSDL/*.cpp" "platformSDL/threads/*.cpp")
|
||||
|
||||
# Link generic libs
|
||||
set(TORQUE_LINK_LIBRARIES ${TORQUE_LINK_LIBRARIES} png "-framework Cocoa" "-framework AppKit" "-framework CoreData" "-framework Foundation")
|
||||
set(TORQUE_COMPILE_DEFINITIONS ICE_NO_DLL PCRE_STATIC TORQUE_ADVANCED_LIGHTING TORQUE_SHADERGEN TORQUE_OPENGL TORQUE_OPCODE TORQUE_ASSIMP TORQUE_SDL TORQUE_COLLADA TORQUE_UNICODE)
|
||||
set(TORQUE_COMPILE_DEFINITIONS ICE_NO_DLL PCRE_STATIC TORQUE_ADVANCED_LIGHTING TORQUE_SHADERGEN
|
||||
TORQUE_OPENGL TORQUE_OPCODE TORQUE_ASSIMP TORQUE_SDL TORQUE_COLLADA
|
||||
TORQUE_UNICODE UNICODE _UNICODE)
|
||||
|
||||
################# Start building libs ###################
|
||||
|
||||
# Set common linkages
|
||||
set(TORQUE_LINK_LIBRARIES tinyxml collada ljpeg squish png_static opcode assimp
|
||||
SDL2 glad pcre convexDecomp)
|
||||
|
||||
# Only link Apple frameworks when on an Apple platform
|
||||
if (APPLE)
|
||||
set(TORQUE_LINK_LIBRARIES ${TORQUE_LINK_LIBRARIES} "-framework Cocoa" "-framework AppKit" "-framework CoreData" "-framework Foundation")
|
||||
endif (APPLE)
|
||||
SDL2 glad pcre convexDecomp zlib)
|
||||
|
||||
# Begin assembling source code payload
|
||||
set (TORQUE_SOURCE_FILES "main/main.cpp"
|
||||
|
|
@ -138,6 +138,19 @@ set (TORQUE_SOURCE_FILES "main/main.cpp"
|
|||
${TORQUE_ENVIRONMENT_SOURCES} ${TORQUE_TERRAIN_SOURCES} ${TORQUE_POSTFX_SOURCES}
|
||||
${TORQUE_I18N_SOURCES} ${TORQUE_CONSOLE_SOURCES} ${TORQUE_SFX_SOURCES} ${TORQUE_GFX_SOURCES})
|
||||
|
||||
|
||||
# When on Windows, we need to link against winsock
|
||||
if (WIN32)
|
||||
set(TORQUE_LINK_LIBRARIES ${TORQUE_LINK_LIBRARIES} WS2_32.LIB)
|
||||
set(TORQUE_SOURCE_FILES ${TORQUE_SOURCE_FILES} ${TORQUE_PLATFORM_WIN_SOURCES})
|
||||
endif (WIN32)
|
||||
|
||||
# Only link Apple frameworks when on an Apple platform
|
||||
if (APPLE)
|
||||
enable_language(OBJC)
|
||||
set(TORQUE_LINK_LIBRARIES ${TORQUE_LINK_LIBRARIES} "-framework Cocoa" "-framework AppKit" "-framework CoreData" "-framework Foundation")
|
||||
endif (APPLE)
|
||||
|
||||
# Search module directories
|
||||
set(TORQUE_MODULE_PATHS "${CMAKE_SOURCE_DIR}/Tools/CMake/modules")
|
||||
foreach (TORQUE_MODULE_PATH ${TORQUE_MODULE_PATHS})
|
||||
|
|
@ -164,6 +177,11 @@ target_compile_definitions(Game PUBLIC ${TORQUE_COMPILE_DEFINITIONS})
|
|||
target_link_libraries(Game ${TORQUE_LINK_LIBRARIES})
|
||||
target_include_directories(Game PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} "${CMAKE_BINARY_DIR}/temp")
|
||||
|
||||
if (WIN32)
|
||||
# FIXME: Torque is angry about these warnings
|
||||
set_target_properties(Game PROPERTIES COMPILE_FLAGS "/wd4018 /wd4100 /wd4121 /wd4127 /wd4130 /wd4244 /wd4245 /wd4389 /wd4511 /wd4512 /wd4800 /wd4995")
|
||||
endif (WIN32)
|
||||
|
||||
if (APPLE)
|
||||
set(EXECUTABLE_NAME "Game")
|
||||
|
||||
|
|
|
|||
|
|
@ -18,4 +18,5 @@ foreach(ITEM ${SCRIPT_FILES})
|
|||
endforeach()
|
||||
|
||||
# Once the full tree is installed, perform configurations on several files
|
||||
CONFIGURE_FILE("game/main.tscript.in" "${CMAKE_INSTALL_PREFIX}/game/main.${TORQUE_SCRIPT_EXTENSION}")
|
||||
CONFIGURE_FILE("game/main.tscript.in" "${CMAKE_BINARY_DIR}/main.${TORQUE_SCRIPT_EXTENSION}")
|
||||
install(FILES "${CMAKE_BINARY_DIR}/main.${TORQUE_SCRIPT_EXTENSION}" DESTINATION "${CMAKE_INSTALL_PREFIX}/game")
|
||||
|
|
@ -27,4 +27,4 @@ if(TORQUE_SFX_OPENAL)
|
|||
set(ALSOFT_UPDATE_BUILD_VERSION OFF CACHE BOOL "Update build Version" UPDATE)
|
||||
|
||||
add_subdirectory("${CMAKE_SOURCE_DIR}/Engine/lib/openal-soft" ${CMAKE_BINARY_DIR}/temp/openal-soft EXCLUDE_FROM_ALL)
|
||||
endif(TORQUE_PHYSICS_BULLET)
|
||||
endif(TORQUE_SFX_OPENAL)
|
||||
|
|
|
|||
|
|
@ -8,4 +8,4 @@ if(TORQUE_TOOLS)
|
|||
"gui/editor/inspector/*.cpp")
|
||||
set(TORQUE_SOURCE_FILES ${TORQUE_SOURCE_FILES} ${TORQUE_TOOLS_SOURCES})
|
||||
set(TORQUE_COMPILE_DEFINITIONS ${TORQUE_COMPILE_DEFINITIONS} TORQUE_TOOLS)
|
||||
endif(TORQUE_PHYSICS_BULLET)
|
||||
endif(TORQUE_TOOLS)
|
||||
|
|
|
|||
Loading…
Reference in a new issue