minecraft-pi-reborn/symbols/CMakeLists.txt

186 lines
4.8 KiB
CMake
Raw Normal View History

2021-09-12 03:18:12 +00:00
project(symbols)
2024-01-06 11:30:23 +00:00
# Definition Files
set(SRC
src/LeafTile.def
src/ServerPlayer.def
src/Tile.def
src/Material.def
src/RakNetInstance.def
src/LiquidTile.def
src/LoginPacket.def
src/ChestTileEntity.def
src/InBedScreen.def
src/LevelSource.def
src/TallGrass.def
src/Player.def
src/ImageButton.def
src/Strings.def
src/ExternalFileLevelStorageSource.def
src/TileEntity.def
src/ItemRenderer.def
src/ModelPart.def
src/Biome.def
src/SimpleChooseLevelScreen.def
src/PauseScreen.def
src/Tesselator.def
src/AABB.def
src/AppPlatform.def
src/Minecraft.def
src/OptionsFile.def
src/EntityRenderer.def
src/RakNet_RakString_SharedString.def
src/ChunkSource.def
src/Vec3.def
src/NetEventCallback.def
src/PathfinderMob.def
src/Level.def
src/RakNet_RakString.def
src/StemTile.def
src/LevelRenderer.def
src/FillingContainer.def
src/HumanoidModel.def
src/TripodCameraRenderer.def
src/FurnaceScreen.def
src/HitResult.def
src/Container.def
src/PerfRenderer.def
src/ParticleEngine.def
src/PlayerRenderer.def
src/GameMode.def
src/Font.def
src/RemotePlayer.def
src/EntityRenderDispatcher.def
src/Texture.def
src/MobRenderer.def
src/LargeFeature.def
src/ContainerMenu.def
src/Textures.def
src/FurnaceTileEntity.def
src/TileRenderer.def
src/GrassTile.def
src/WorkbenchScreen.def
src/Packet.def
src/RandomLevelSource.def
src/SelectWorldScreen.def
src/AuxDataTileItem.def
src/OptionButton.def
src/Touch_IngameBlockSelectionScreen.def
src/OptionsPane.def
src/HeavyTile.def
src/Options.def
src/AppPlatform_linux.def
src/StartGamePacket.def
src/IBuildInput.def
src/ItemInstance.def
src/SoundEngine.def
src/GuiComponent.def
src/NinecraftApp.def
src/Mob.def
src/MouseBuildInput.def
src/FurnaceRecipes.def
src/Recipes.def
src/Button.def
src/ChatPacket.def
src/LevelData.def
src/ServerSideNetworkHandler.def
src/LargeCaveFeature.def
src/Screen.def
src/CreatorMode.def
src/HumanoidMobRenderer.def
src/OptionsScreen.def
src/Gui.def
src/Recipes_Type.def
src/Inventory.def
src/Common.def
src/CommandServer.def
src/RakNet_SystemAddress.def
src/LevelSettings.def
src/ServerLevel.def
src/Item.def
src/extra.h
src/Entity.def
src/RakNet_RakNetGUID.def
src/RakNet_RakPeer.def
src/Config.def
src/ConnectedClient.def
src/Mouse.def
src/GameRenderer.def
src/SurvivalMode.def
src/AppPlatform_readAssetFile_return_value.def
src/TextEditScreen.def
src/StartMenuScreen.def
src/ProgressScreen.def
src/LocalPlayer.def
src/Touch_SelectWorldScreen.def
src/TileItem.def
src/Tile_SoundType.def
src/Options_Option.def
src/LevelStorageSource.def
src/SignTileEntity.def
2024-01-07 07:59:04 +00:00
src/AgableMob.def
src/PrimedTnt.def
src/ItemEntity.def
src/Arrow.def
src/OffsetPosTranslator.def
src/EntityFactory.def
src/MobFactory.def
src/Animal.def
src/Sheep.def
src/PingedCompatibleServer.def
2024-01-06 11:30:23 +00:00
)
# Resolve Definition Files
set(RESOLVED_SRC "")
foreach(FILE IN LISTS SRC)
list(APPEND RESOLVED_SRC "${CMAKE_CURRENT_SOURCE_DIR}/${FILE}")
endforeach()
# Directories
function(set_and_mkdir name dir)
set("${name}" "${dir}" PARENT_SCOPE)
file(MAKE_DIRECTORY "${dir}")
endfunction()
set_and_mkdir(GENERATED_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated")
set_and_mkdir(INCLUDE_OUTPUT_DIR "${GENERATED_DIR}/include")
set_and_mkdir(HEADER_OUTPUT_DIR "${INCLUDE_OUTPUT_DIR}/symbols")
set_and_mkdir(SRC_OUTPUT_DIR "${GENERATED_DIR}/src")
# Files
set(HEADER_OUTPUT_FILE "${HEADER_OUTPUT_DIR}/minecraft.h")
set(SRC_OUTPUT_FILE "${SRC_OUTPUT_DIR}/minecraft.cpp")
# Generate
add_custom_command(
OUTPUT "${SRC_OUTPUT_FILE}" "${HEADER_OUTPUT_FILE}"
DEPENDS ${RESOLVED_SRC}
COMMAND npm start --silent -- "${SRC_OUTPUT_FILE}" "${HEADER_OUTPUT_FILE}" ${RESOLVED_SRC}
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../dependencies/symbol-processor/src"
VERBATIM
)
# Build
add_library(symbols SHARED "${SRC_OUTPUT_FILE}" "${HEADER_OUTPUT_FILE}")
# Show In IDE
add_custom_target(symbols-src
DEPENDS "${SRC_OUTPUT_FILE}" "${HEADER_OUTPUT_FILE}"
SOURCES ${RESOLVED_SRC}
)
# Include Directory
2022-06-25 21:30:08 +00:00
target_include_directories(
symbols
2024-01-06 11:30:23 +00:00
PUBLIC
"$<BUILD_INTERFACE:${INCLUDE_OUTPUT_DIR}>"
2022-06-25 21:30:08 +00:00
"$<INSTALL_INTERFACE:${MCPI_SDK_INCLUDE_DIR}/symbols>"
)
# Disable C++11 String ABI
2024-01-06 11:30:23 +00:00
target_compile_definitions(symbols PUBLIC -D_GLIBCXX_USE_CXX11_ABI=0)
2022-06-25 21:30:08 +00:00
2024-01-06 11:30:23 +00:00
# Install
install(TARGETS symbols DESTINATION "${MCPI_LIB_DIR}")
2022-06-25 21:30:08 +00:00
# SDK
install(TARGETS symbols EXPORT sdk DESTINATION "${MCPI_SDK_LIB_DIR}")
2024-01-06 11:30:23 +00:00
install(DIRECTORY "${INCLUDE_OUTPUT_DIR}/" DESTINATION "${MCPI_SDK_INCLUDE_DIR}/symbols")