mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-08-20 09:57:09 +00:00
Handle per-platform source includes
This commit is contained in:
parent
c6916c90bf
commit
7ae87ad51f
|
|
@ -12,7 +12,8 @@
|
|||
"displayName": "Windows64",
|
||||
"inherits": "base",
|
||||
"cacheVariables": {
|
||||
"PLATFORM_DEFINES": "_WINDOWS64"
|
||||
"PLATFORM_DEFINES": "_WINDOWS64",
|
||||
"PLATFORM_FOLDER": "Windows64"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
@ -21,7 +22,8 @@
|
|||
"inherits": "base",
|
||||
"toolchainFile": "${sourceDir}/cmake/toolchains/durango.cmake",
|
||||
"cacheVariables": {
|
||||
"PLATFORM_DEFINES": "_DURANGO;_XBOX_ONE"
|
||||
"PLATFORM_DEFINES": "_DURANGO;_XBOX_ONE",
|
||||
"PLATFORM_FOLDER": "Durango"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
@ -30,7 +32,8 @@
|
|||
"inherits": "base",
|
||||
"toolchainFile": "${sourceDir}/cmake/toolchains/orbis.cmake",
|
||||
"cacheVariables": {
|
||||
"PLATFORM_DEFINES": "__ORBIS__"
|
||||
"PLATFORM_DEFINES": "__ORBIS__",
|
||||
"PLATFORM_FOLDER": "Orbis"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
@ -39,7 +42,8 @@
|
|||
"inherits": "base",
|
||||
"toolchainFile": "${sourceDir}/cmake/toolchains/ps3.cmake",
|
||||
"cacheVariables": {
|
||||
"PLATFORM_DEFINES": "__PS3__"
|
||||
"PLATFORM_DEFINES": "__PS3__",
|
||||
"PLATFORM_FOLDER": "PS3"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
@ -48,7 +52,8 @@
|
|||
"inherits": "base",
|
||||
"toolchainFile": "${sourceDir}/cmake/toolchains/psvita.cmake",
|
||||
"cacheVariables": {
|
||||
"PLATFORM_DEFINES": "__PSVITA__"
|
||||
"PLATFORM_DEFINES": "__PSVITA__",
|
||||
"PLATFORM_FOLDER": "PSVita"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
@ -57,7 +62,8 @@
|
|||
"inherits": "base",
|
||||
"toolchainFile": "${sourceDir}/cmake/toolchains/xbox360.cmake",
|
||||
"cacheVariables": {
|
||||
"PLATFORM_DEFINES": "_XBOX"
|
||||
"PLATFORM_DEFINES": "_XBOX",
|
||||
"PLATFORM_FOLDER": "Xbox"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
|
|
|||
|
|
@ -9,15 +9,15 @@ include("${CMAKE_CURRENT_LIST_DIR}/cmake/sources/Xbox360.cmake")
|
|||
include("${CMAKE_SOURCE_DIR}/cmake/CommonSources.cmake")
|
||||
|
||||
# Combine all source files into a single variable for the target
|
||||
# TODO Add conditions to include sources for the current platform
|
||||
# We cant use CMAKE_CONFIGURE_PRESET here as VS doesn't set it, so just rely on the folder
|
||||
set(MINECRAFT_CLIENT_SOURCES
|
||||
${MINECRAFT_CLIENT_COMMON}
|
||||
# ${MINECRAFT_CLIENT_DURANGO}
|
||||
# ${MINECRAFT_CLIENT_ORBIS}
|
||||
# ${MINECRAFT_CLIENT_PS3}
|
||||
# ${MINECRAFT_CLIENT_PSVITA}
|
||||
${MINECRAFT_CLIENT_WINDOWS}
|
||||
# ${MINECRAFT_CLIENT_XBOX360}
|
||||
$<$<STREQUAL:${PLATFORM_FOLDER},Durango>:${MINECRAFT_CLIENT_DURANGO}>
|
||||
$<$<STREQUAL:${PLATFORM_FOLDER},Orbis>:${MINECRAFT_CLIENT_ORBIS}>
|
||||
$<$<STREQUAL:${PLATFORM_FOLDER},PS3>:${MINECRAFT_CLIENT_PS3}>
|
||||
$<$<STREQUAL:${PLATFORM_FOLDER},PSVita>:${MINECRAFT_CLIENT_PSVITA}>
|
||||
$<$<STREQUAL:${PLATFORM_FOLDER},Windows64>:${MINECRAFT_CLIENT_WINDOWS}>
|
||||
$<$<STREQUAL:${PLATFORM_FOLDER},Xbox360>:${MINECRAFT_CLIENT_XBOX360}>
|
||||
${SOURCES_COMMON}
|
||||
)
|
||||
|
||||
|
|
@ -26,7 +26,7 @@ add_executable(Minecraft.Client WIN32 ${MINECRAFT_CLIENT_SOURCES})
|
|||
target_include_directories(Minecraft.Client PRIVATE
|
||||
"${CMAKE_BINARY_DIR}/generated/" # This is for the generated BuildVer.h
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Windows64/Iggy/include"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_FOLDER}/Iggy/include"
|
||||
"${CMAKE_SOURCE_DIR}/include/"
|
||||
)
|
||||
target_compile_definitions(Minecraft.Client PRIVATE
|
||||
|
|
@ -52,18 +52,18 @@ target_link_libraries(Minecraft.Client PRIVATE
|
|||
XInput9_1_0
|
||||
wsock32
|
||||
legacy_stdio_definitions
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Windows64/Iggy/lib/iggy_w64.lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Windows64/Iggy/lib/iggyperfmon_w64.lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Windows64/Iggy/lib/iggyexpruntime_w64.lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_FOLDER}/Iggy/lib/iggy_w64.lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_FOLDER}/Iggy/lib/iggyperfmon_w64.lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_FOLDER}/Iggy/lib/iggyexpruntime_w64.lib"
|
||||
$<$<CONFIG:Debug>: # Debug 4J libraries
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Windows64/4JLibs/libs/4J_Input_d.lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Windows64/4JLibs/libs/4J_Storage_d.lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Windows64/4JLibs/libs/4J_Render_PC_d.lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_FOLDER}/4JLibs/libs/4J_Input_d.lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_FOLDER}/4JLibs/libs/4J_Storage_d.lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_FOLDER}/4JLibs/libs/4J_Render_PC_d.lib"
|
||||
>
|
||||
$<$<NOT:$<CONFIG:Debug>>: # Release 4J libraries
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Windows64/4JLibs/libs/4J_Input.lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Windows64/4JLibs/libs/4J_Storage.lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Windows64/4JLibs/libs/4J_Render_PC.lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_FOLDER}/4JLibs/libs/4J_Input.lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_FOLDER}/4JLibs/libs/4J_Storage.lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_FOLDER}/4JLibs/libs/4J_Render_PC.lib"
|
||||
>
|
||||
)
|
||||
|
||||
|
|
@ -86,13 +86,15 @@ add_custom_target(CopyRedist ALL
|
|||
add_dependencies(Minecraft.Client CopyRedist)
|
||||
set_property(TARGET CopyRedist PROPERTY FOLDER "Build")
|
||||
|
||||
# Make sure GameHDD exists
|
||||
add_custom_target(EnsureGameHDD ALL
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-E make_directory "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/Windows64/GameHDD"
|
||||
COMMENT "Ensuring GameHDD directory exists..."
|
||||
VERBATIM
|
||||
)
|
||||
# Make sure GameHDD exists on Windows
|
||||
if(CMAKE_CONFIGURE_PRESET STREQUAL "windows64")
|
||||
add_custom_target(EnsureGameHDD ALL
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-E make_directory "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/Windows64/GameHDD"
|
||||
COMMENT "Ensuring GameHDD directory exists..."
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
add_dependencies(Minecraft.Client EnsureGameHDD)
|
||||
set_property(TARGET EnsureGameHDD PROPERTY FOLDER "Build")
|
||||
add_dependencies(Minecraft.Client EnsureGameHDD)
|
||||
set_property(TARGET EnsureGameHDD PROPERTY FOLDER "Build")
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -1,22 +0,0 @@
|
|||
-xc++
|
||||
-m64
|
||||
-std=c++14
|
||||
-Wno-unused-includes
|
||||
-Wno-unsafe-buffer-usage-in-libc-call
|
||||
-Wno-unsafe-buffer-usage
|
||||
-Wno-unused-macros
|
||||
-Wno-c++98-compat
|
||||
-Wno-c++98-compat-pedantic
|
||||
-Wno-pre-c++14-compat
|
||||
-D_LARGE_WORLDS
|
||||
-D_DEBUG_MENUS_ENABLED
|
||||
-D_LIB
|
||||
-D_CRT_NON_CONFORMING_SWPRINTFS
|
||||
-D_CRT_SECURE_NO_WARNINGS
|
||||
-D_WINDOWS64
|
||||
-I
|
||||
./Xbox/Sentient/Include
|
||||
-I
|
||||
../Minecraft.World/x64headers
|
||||
-I
|
||||
./
|
||||
|
|
@ -4,10 +4,10 @@ include("${CMAKE_CURRENT_LIST_DIR}/cmake/sources/Durango.cmake")
|
|||
include("${CMAKE_SOURCE_DIR}/cmake/CommonSources.cmake")
|
||||
|
||||
# Combine all source files into a single variable for the target
|
||||
# TODO Add conditions to include sources for the current platform
|
||||
# We cant use CMAKE_CONFIGURE_PRESET here as VS doesn't set it, so just rely on the folder
|
||||
set(MINECRAFT_WORLD_SOURCES
|
||||
${MINECRAFT_WORLD_COMMON}
|
||||
# ${MINECRAFT_WORLD_DURANGO}
|
||||
$<$<STREQUAL:${PLATFORM_FOLDER},Durango>:${MINECRAFT_WORLD_DURANGO}>
|
||||
${SOURCES_COMMON}
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,18 +0,0 @@
|
|||
-xc++
|
||||
-m64
|
||||
-std=c++14
|
||||
-Wno-unused-includes
|
||||
-Wno-unsafe-buffer-usage-in-libc-call
|
||||
-Wno-unsafe-buffer-usage
|
||||
-Wno-unused-macros
|
||||
-Wno-c++98-compat
|
||||
-Wno-c++98-compat-pedantic
|
||||
-Wno-pre-c++14-compat
|
||||
-D_LARGE_WORLDS
|
||||
-D_DEBUG_MENUS_ENABLED
|
||||
-D_LIB
|
||||
-D_CRT_NON_CONFORMING_SWPRINTFS
|
||||
-D_CRT_SECURE_NO_WARNINGS
|
||||
-D_WINDOWS64
|
||||
-I
|
||||
./x64headers
|
||||
Loading…
Reference in a new issue