diff --git a/4J.Input/meson.build b/4J.Input/meson.build new file mode 100644 index 000000000..abad05d4e --- /dev/null +++ b/4J.Input/meson.build @@ -0,0 +1,21 @@ +input_sources = files( + '4J_Input.cpp', + 'INP_ForceFeedback.cpp', + 'INP_Keyboard.cpp', + 'INP_Main.cpp', + 'INP_StringCheck.cpp', + 'stdafx.cpp', +) + +lib_input = static_library('4J_Input', + input_sources, + include_directories : include_directories('.'), + cpp_args : global_cpp_args + global_cpp_defs + [ + '-include', meson.current_source_dir() / 'stdafx.h', + ], +) + +input_dep = declare_dependency( + link_with : lib_input, + include_directories : include_directories('.'), +) diff --git a/4J.Profile/meson.build b/4J.Profile/meson.build new file mode 100644 index 000000000..fe70cbfbb --- /dev/null +++ b/4J.Profile/meson.build @@ -0,0 +1,22 @@ +profile_sources = files( + '4J_Profile.cpp', + 'PRO_AwardManager.cpp', + 'PRO_Data.cpp', + 'PRO_Main.cpp', + 'PRO_RichPresence.cpp', + 'PRO_Sys.cpp', + 'stdafx.cpp', +) +# 4jprofile stink +lib_profile = static_library('4J_Profile', + profile_sources, + include_directories : include_directories('.'), + cpp_args : global_cpp_args + global_cpp_defs + [ + '-include', meson.current_source_dir() / 'stdafx.h', + ], +) + +profile_dep = declare_dependency( + link_with : lib_profile, + include_directories : include_directories('.'), +) diff --git a/4J.Render/meson.build b/4J.Render/meson.build new file mode 100644 index 000000000..5257819c8 --- /dev/null +++ b/4J.Render/meson.build @@ -0,0 +1,24 @@ +render_sources = files( + '4J_Render.cpp', + 'RendererCbuff.cpp', + 'RendererCore.cpp', + 'RendererMatrix.cpp', + 'RendererState.cpp', + 'RendererTexture.cpp', + 'RendererVertex.cpp', + 'stdafx.cpp', +) + +lib_render = static_library('4J_Render', + render_sources, + include_directories : include_directories('.'), + dependencies : [png_dep, glfw_dep, gl_dep, thread_dep], + cpp_args : global_cpp_args + global_cpp_defs + [ + '-include', meson.current_source_dir() / 'stdafx.h', + ], +) + +render_dep = declare_dependency( + link_with : lib_render, + include_directories : include_directories('.'), +) diff --git a/4J.Storage/meson.build b/4J.Storage/meson.build new file mode 100644 index 000000000..03843c8e4 --- /dev/null +++ b/4J.Storage/meson.build @@ -0,0 +1,20 @@ +storage_sources = files( + '4J_Storage.cpp', + 'stdafx.cpp', + 'STO_DLC.cpp', + 'STO_Main.cpp', + 'STO_SaveGame.cpp', +) + +lib_storage = static_library('4J_Storage', + storage_sources, + include_directories : include_directories('.'), + cpp_args : global_cpp_args + global_cpp_defs + [ + '-include', meson.current_source_dir() / 'stdafx.h', + ], +) + +storage_dep = declare_dependency( + link_with : lib_storage, + include_directories : include_directories('.'), +) diff --git a/Minecraft.Client/Build/stdafx.h b/Minecraft.Client/Build/stdafx.h index 41f8edbdd..fd6a38f23 100644 --- a/Minecraft.Client/Build/stdafx.h +++ b/Minecraft.Client/Build/stdafx.h @@ -294,18 +294,12 @@ typedef XUID GameSessionUID; #include "../Platform/Windows64/Iggy/gdraw/gdraw_d3d11.h" #include "../Platform/Windows64/Windows64_UIController.h" #elif defined __linux__ - // FIXME: Make Linux/ versions of all of these - // #include "../Platform/Windows64/Sentient/MinecraftTelemetry.h" // conflicts with Common/Telemetry/TelemetryManager.h, no idea whats up with that - #include "../Platform/OrbisMedia/strings.h" // using Orbis or Vita strings because IDS_CONTENT_RESTRICTION exists - #include "../Platform/Windows64/Windows64_App.h" - #include "../Platform/Windows64/Sentient/DynamicConfigurations.h" - #include "../Platform/Windows64/Sentient/SentientTelemetryCommon.h" - #include "../Platform/Windows64/GameConfig/Minecraft.spa.h" - #include "../Platform/Windows64/XML/ATGXmlParser.h" - #include "../Platform/Windows64/Social/SocialManager.h" + // Linux build: avoid pulling in Windows64 platform headers (they cause + // symbol/class redefinitions). Use Linux-specific stubs and controller. + // FIXME: Produce proper Linux equivalents for telemetry/sentient/etc. + #include "../Platform/OrbisMedia/strings.h" // temporary strings + #include "../Platform/Xbox/Sentient/SentientTelemetryCommon.h" #include "Common/Audio/SoundEngine.h" - //#include "../Platform/Windows64/Iggy/include/iggy.h" - #include "../Platform/Windows64/Iggy/gdraw/gdraw_d3d11.h" #include "../Platform/Linux/Linux_UIController.h" #elif defined __PSVITA__ #include "../Platform/PSVita/PSVita_App.h" diff --git a/Minecraft.Client/meson.build b/Minecraft.Client/meson.build new file mode 100644 index 000000000..5e073ba56 --- /dev/null +++ b/Minecraft.Client/meson.build @@ -0,0 +1,42 @@ +# get all those files +_client_build_raw = run_command( + 'sh', '-c', + 'find "' + meson.current_source_dir() / 'Build' + '" -name "*.cpp" ! -path "*/redist64/*"', + check : true, +).stdout().strip().split('\n') + +# linux files +_linux_cpp_sources = files( + 'Platform/Linux/Linux_App.cpp', + 'Platform/Linux/linux_game_stubs.cpp', + 'Platform/Linux/LinuxGL.cpp', + 'Platform/Linux/Linux_Minecraft.cpp', + 'Platform/Linux/Linux_UIController.cpp', +) + +_linux_c_sources = files( + 'Platform/Linux/Iggy/gdraw/gdraw_glfw.c', +) + +executable('Minecraft.Client', + _client_build_raw + _linux_cpp_sources + _linux_c_sources, + include_directories : include_directories('Build'), + dependencies : [ + render_dep, + input_dep, + profile_dep, + storage_dep, + world_dep, + gl_dep, + glu_dep, + glfw_dep, + thread_dep, + dl_dep, + ], + cpp_args : global_cpp_args + global_cpp_defs + [ + '-DUNICODE', '-D_UNICODE', + '-include', meson.current_source_dir() / 'Build/stdafx.h', + ], + c_args : global_cpp_defs + ['-DUNICODE', '-D_UNICODE'], + install : false, +) diff --git a/Minecraft.World/Build/stdafx.h b/Minecraft.World/Build/stdafx.h index 421f7e1cf..3d035b858 100644 --- a/Minecraft.World/Build/stdafx.h +++ b/Minecraft.World/Build/stdafx.h @@ -242,7 +242,7 @@ void MemSect(int sect); // FIXME: Move and port to ../Minecraft.Client/Linux #include "../../Minecraft.Client/Platform/Linux/Linux_App.h" #include "../../Minecraft.Client/Platform/OrbisMedia/strings.h" -#include "../../Minecraft.Client/Platform/Windows64/Sentient/SentientTelemetryCommon.h" + #include "../../Minecraft.Client/Platform/Xbox/Sentient/SentientTelemetryCommon.h" // #include "../../Minecraft.Client/Platform/Windows64/Sentient/MinecraftTelemetry.h" #else #include "../../Minecraft.Client/Platform/Orbis/Orbis_App.h" diff --git a/Minecraft.World/meson.build b/Minecraft.World/meson.build new file mode 100644 index 000000000..54958f894 --- /dev/null +++ b/Minecraft.World/meson.build @@ -0,0 +1,30 @@ +# GET IT ALLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL +# Note: the files below are commented-out in CMakeLists.txt (missing headers or +# unfinished ports) and must be excluded from the build. +_world_sources_raw = run_command( + 'sh', '-c', + 'find "' + meson.current_source_dir() + '" -name "*.cpp"' + + ' ! -name "DurangoStats.cpp"' + + ' ! -name "MemoryChunkStorage.cpp"' + + ' ! -name "MemoryLevelStorage.cpp"' + + ' ! -name "MemoryLevelStorageSource.cpp"' + + ' ! -name "NbtSlotFile.cpp"' + + ' ! -name "SkyIslandDimension.cpp"' + + ' ! -name "ZonedChunkStorage.cpp"' + + ' ! -name "ZoneFile.cpp"' + + ' ! -name "ZoneIo.cpp"', + check : true, +).stdout().strip().split('\n') + +lib_world = static_library('Minecraft.World', + _world_sources_raw, + include_directories : include_directories('Build', 'Build/x64headers'), + cpp_args : global_cpp_args + global_cpp_defs + [ + '-include', meson.current_source_dir() / 'Build/stdafx.h', + ], +) + +world_dep = declare_dependency( + link_with : lib_world, + include_directories : include_directories('Build/x64headers'), +) diff --git a/README.md b/README.md index c9146ba6a..839ca08f5 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,55 @@ cmake . && make -j$(nproc) ``` --- +### we also got meson say hi meson hii +[Meson](https://mesonbuild.com/) is bettr pls use over cmake + +#### Install Meson + +```bash +# Debian/Ubuntu +sudo apt install meson ninja-build + +# Arch/Manjaro +sudo pacman -S meson ninja +``` + +#### Configure & Build + +```bash +# 1. Configure that bih +meson setup build_meson + +# 2. Build +ninja -C build_meson +``` + +The binary is output to: + +``` +build_meson/Minecraft.Client +``` + +#### Clean + +Remove the build directory to do a full clean: + +(CAREFUL SPONGEBOB CAREFUL) +```bash +rm -rf build_meson +``` + +Then re-run `meson setup build_meson` to reconfigure. + +#### if u want release which u probably don't need right now +```bash +# Release build +meson setup build_release --buildtype=release +ninja -C build_release +``` + +--- + ## Running (this is temp) @@ -82,3 +131,4 @@ cmake . && make -j$(nproc) ``` (todo refactor) +(todo refactor more) \ No newline at end of file diff --git a/meson.build b/meson.build new file mode 100644 index 000000000..47bcbf6f6 --- /dev/null +++ b/meson.build @@ -0,0 +1,45 @@ +project('4jcraft-chucklegrounds', ['cpp', 'c'], + version : '0.1.0', + default_options : [ + 'cpp_std=gnu++11', + 'warning_level=0', + 'buildtype=debug', + ], +) + +cc = meson.get_compiler('cpp') + +# system deps +gl_dep = dependency('gl') +glu_dep = dependency('glu') +glfw_dep = dependency('glfw3') +png_dep = dependency('libpng') +thread_dep = dependency('threads') +dl_dep = cc.find_library('dl') + +# compile flags (chagne ts juicey) +global_cpp_args = [ + '-fpermissive', + '-Wtemplate-body', + '-Wshift-count-overflow', +] + +# global ccp defs type shi +global_cpp_defs = [ + '-DSPLIT_SAVES', + '-D_LARGE_WORLDS', + '-D_EXTENDED_ACHIEVEMENTS', + '-D_DEBUG_MENUS_ENABLED', + '-D_DEBUG', + '-DDEBUG', + '-DLINUX', + '-D_LINUX', + '-D__linux__', +] + +subdir('4J.Render') +subdir('4J.Input') +subdir('4J.Profile') +subdir('4J.Storage') +subdir('Minecraft.World') +subdir('Minecraft.Client')