Skip to content

Commit

Permalink
tweak(build): Use Boost submodules instead of requiring builders to d…
Browse files Browse the repository at this point in the history
…ownload+extract a full boost.zip somewhere.

This also lets us use/update specific parts.

No more BOOST_ROOT required!
  • Loading branch information
LWSS committed Feb 22, 2024
1 parent 7b17b3e commit 7477ed0
Show file tree
Hide file tree
Showing 81 changed files with 369 additions and 78 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/ci_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,6 @@ jobs:
shell: bash
run: |
mkdir -p "$ROOT_DEP" && cd "$_" || exit 1
echo Downloading boost
curl -s -L https://boostorg.jfrog.io/artifactory/main/release/1.71.0/source/boost_1_71_0.7z -o boost.7z
7z -bso0 x boost.7z -oboost
rm boost.7z
echo "BOOST_ROOT=$PWD\boost\boost_1_71_0" >> "$GITHUB_ENV"
- name: Compile
shell: bash
Expand Down
207 changes: 204 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,210 @@
[submodule "vendor/rnnoise"]
path = vendor/rnnoise
url = https://github.com/mumble-voip/rnnoise.git
[submodule "vendor/boost-preprocessor"]
path = vendor/boost-preprocessor
url = https://github.com/boostorg/preprocessor.git
[submodule "vendor/msgpack-cpp"]
path = vendor/msgpack-cpp
url = https://github.com/msgpack/msgpack-c.git
[submodule "vendor/boost-submodules/boost-preprocessor"]
path = vendor/boost-submodules/boost-preprocessor
url = https://github.com/boostorg/preprocessor.git
[submodule "vendor/boost-submodules/boost-filesystem"]
path = vendor/boost-submodules/boost-filesystem
url = https://github.com/boostorg/filesystem
[submodule "vendor/boost-submodules/boost-locale"]
path = vendor/boost-submodules/boost-locale
url = https://github.com/boostorg/locale
[submodule "vendor/boost-submodules/boost-program-options"]
path = vendor/boost-submodules/boost-program-options
url = https://github.com/boostorg/program_options
[submodule "vendor/boost-submodules/boost-random"]
path = vendor/boost-submodules/boost-random
url = https://github.com/boostorg/random
[submodule "vendor/boost-submodules/boost-system"]
path = vendor/boost-submodules/boost-system
url = https://github.com/boostorg/system
[submodule "vendor/boost-submodules/boost-context"]
path = vendor/boost-submodules/boost-context
url = https://github.com/boostorg/context
[submodule "vendor/boost-submodules/boost-coroutine"]
path = vendor/boost-submodules/boost-coroutine
url = https://github.com/boostorg/coroutine
[submodule "vendor/boost-submodules/boost-thread"]
path = vendor/boost-submodules/boost-thread
url = https://github.com/boostorg/thread
[submodule "vendor/boost-submodules/boost-config"]
path = vendor/boost-submodules/boost-config
url = https://github.com/boostorg/config
[submodule "vendor/boost-submodules/boost-any"]
path = vendor/boost-submodules/boost-any
url = https://github.com/boostorg/any/
[submodule "vendor/boost-submodules/boost-assert"]
path = vendor/boost-submodules/boost-assert
url = https://github.com/boostorg/assert
[submodule "vendor/boost-submodules/boost-function"]
path = vendor/boost-submodules/boost-function
url = https://github.com/boostorg/function
[submodule "vendor/boost-submodules/boost-detail"]
path = vendor/boost-submodules/boost-detail
url = https://github.com/boostorg/detail
[submodule "vendor/boost-submodules/boost-smart-ptr"]
path = vendor/boost-submodules/boost-smart-ptr
url = https://github.com/boostorg/smart_ptr/
[submodule "vendor/boost-submodules/boost-static-assert"]
path = vendor/boost-submodules/boost-static-assert
url = https://github.com/boostorg/static_assert
[submodule "vendor/boost-submodules/boost-throw-exception"]
path = vendor/boost-submodules/boost-throw-exception
url = https://github.com/boostorg/throw_exception
[submodule "vendor/boost-submodules/boost-type-index"]
path = vendor/boost-submodules/boost-type-index
url = https://github.com/boostorg/type_index
[submodule "vendor/boost-submodules/boost-type-traits"]
path = vendor/boost-submodules/boost-type-traits
url = https://github.com/boostorg/type_traits
[submodule "vendor/boost-submodules/boost-predef"]
path = vendor/boost-submodules/boost-predef
url = https://github.com/boostorg/predef
[submodule "vendor/boost-submodules/boost-core"]
path = vendor/boost-submodules/boost-core
url = https://github.com/boostorg/core
[submodule "vendor/boost-submodules/boost-iterator"]
path = vendor/boost-submodules/boost-iterator
url = https://github.com/boostorg/iterator
[submodule "vendor/boost-submodules/boost-move"]
path = vendor/boost-submodules/boost-move
url = https://github.com/boostorg/move
[submodule "vendor/boost-submodules/boost-winapi"]
path = vendor/boost-submodules/boost-winapi
url = https://github.com/boostorg/winapi
[submodule "vendor/boost-submodules/boost-mpl"]
path = vendor/boost-submodules/boost-mpl
url = https://github.com/boostorg/mpl
[submodule "vendor/boost-submodules/boost-integer"]
path = vendor/boost-submodules/boost-integer
url = https://github.com/boostorg/integer
[submodule "vendor/boost-submodules/boost-container-hash"]
path = vendor/boost-submodules/boost-container-hash
url = https://github.com/boostorg/container_hash
[submodule "vendor/boost-submodules/boost-bind"]
path = vendor/boost-submodules/boost-bind
url = https://github.com/boostorg/bind
[submodule "vendor/boost-submodules/boost-unordered"]
path = vendor/boost-submodules/boost-unordered
url = https://github.com/boostorg/unordered
[submodule "vendor/boost-submodules/boost-lexical-cast"]
path = vendor/boost-submodules/boost-lexical-cast
url = https://github.com/boostorg/lexical_cast
[submodule "vendor/boost-submodules/boost-io"]
path = vendor/boost-submodules/boost-io
url = https://github.com/boostorg/io
[submodule "vendor/boost-submodules/boost-date-time"]
path = vendor/boost-submodules/boost-date-time
url = https://github.com/boostorg/date_time
[submodule "vendor/boost-submodules/boost-range"]
path = vendor/boost-submodules/boost-range
url = https://github.com/boostorg/range
[submodule "vendor/boost-submodules/boost-tuple"]
path = vendor/boost-submodules/boost-tuple
url = https://github.com/boostorg/tuple
[submodule "vendor/boost-submodules/boost-concept-check"]
path = vendor/boost-submodules/boost-concept-check
url = https://github.com/boostorg/concept_check/
[submodule "vendor/boost-submodules/boost-utility"]
path = vendor/boost-submodules/boost-utility
url = https://github.com/boostorg/utility
[submodule "vendor/boost-submodules/boost-numeric-conversion"]
path = vendor/boost-submodules/boost-numeric-conversion
url = https://github.com/boostorg/numeric_conversion
[submodule "vendor/boost-submodules/boost-chrono"]
path = vendor/boost-submodules/boost-chrono
url = https://github.com/boostorg/chrono
[submodule "vendor/boost-submodules/boost-array"]
path = vendor/boost-submodules/boost-array
url = https://github.com/boostorg/array
[submodule "vendor/boost-submodules/boost-ratio"]
path = vendor/boost-submodules/boost-ratio
url = https://github.com/boostorg/ratio
[submodule "vendor/boost-submodules/boost-container"]
path = vendor/boost-submodules/boost-container
url = https://github.com/boostorg/container
[submodule "vendor/boost-submodules/boost-math"]
path = vendor/boost-submodules/boost-math
url = https://github.com/boostorg/math
[submodule "vendor/boost-submodules/boost-property-tree"]
path = vendor/boost-submodules/boost-property-tree
url = https://github.com/boostorg/property_tree
[submodule "vendor/boost-submodules/boost-optional"]
path = vendor/boost-submodules/boost-optional
url = https://github.com/boostorg/optional
[submodule "vendor/boost-submodules/boost-fusion"]
path = vendor/boost-submodules/boost-fusion
url = https://github.com/boostorg/fusion
[submodule "vendor/boost-submodules/boost-function-types"]
path = vendor/boost-submodules/boost-function-types
url = https://github.com/boostorg/function_types
[submodule "vendor/boost-submodules/boost-circular-buffer"]
path = vendor/boost-submodules/boost-circular-buffer
url = https://github.com/boostorg/circular_buffer
[submodule "vendor/boost-submodules/boost-bimap"]
path = vendor/boost-submodules/boost-bimap
url = https://github.com/boostorg/bimap
[submodule "vendor/boost-submodules/boost-algorithm"]
path = vendor/boost-submodules/boost-algorithm
url = https://github.com/boostorg/algorithm
[submodule "vendor/boost-submodules/boost-variant"]
path = vendor/boost-submodules/boost-variant
url = https://github.com/boostorg/variant
[submodule "vendor/boost-submodules/boost-serialization"]
path = vendor/boost-submodules/boost-serialization
url = https://github.com/boostorg/serialization
[submodule "vendor/boost-submodules/boost-exception"]
path = vendor/boost-submodules/boost-exception
url = https://github.com/boostorg/exception
[submodule "vendor/boost-submodules/boost-multi-index"]
path = vendor/boost-submodules/boost-multi-index
url = https://github.com/boostorg/multi_index
[submodule "vendor/boost-submodules/boost-foreach"]
path = vendor/boost-submodules/boost-foreach
url = https://github.com/boostorg/foreach
[submodule "vendor/boost-submodules/boost-uuid"]
path = vendor/boost-submodules/boost-uuid
url = https://github.com/boostorg/uuid
[submodule "vendor/boost-submodules/boost-regex"]
path = vendor/boost-submodules/boost-regex
url = https://github.com/boostorg/regex
[submodule "vendor/boost-submodules/boost-crc"]
path = vendor/boost-submodules/boost-crc
url = https://github.com/boostorg/crc
[submodule "vendor/boost-submodules/boost-tti"]
path = vendor/boost-submodules/boost-tti
url = https://github.com/boostorg/tti
[submodule "vendor/boost-submodules/boost-outcome"]
path = vendor/boost-submodules/boost-outcome
url = https://github.com/boostorg/outcome
[submodule "vendor/boost-submodules/boost-asio"]
path = vendor/boost-submodules/boost-asio
url = https://github.com/boostorg/asio
[submodule "vendor/boost-submodules/boost-atomic"]
path = vendor/boost-submodules/boost-atomic
url = https://github.com/boostorg/atomic
[submodule "vendor/boost-submodules/boost-beast"]
path = vendor/boost-submodules/boost-beast
url = https://github.com/boostorg/beast
[submodule "vendor/boost-submodules/boost-intrusive"]
path = vendor/boost-submodules/boost-intrusive
url = https://github.com/boostorg/intrusive
[submodule "vendor/boost-submodules/boost-mp11"]
path = vendor/boost-submodules/boost-mp11
url = https://github.com/boostorg/mp11
[submodule "vendor/boost-submodules/boost-logic"]
path = vendor/boost-submodules/boost-logic
url = https://github.com/boostorg/logic
[submodule "vendor/boost-submodules/boost-endian"]
path = vendor/boost-submodules/boost-endian
url = https://github.com/boostorg/endian
[submodule "vendor/boost-submodules/boost-iostreams"]
path = vendor/boost-submodules/boost-iostreams
url = https://github.com/boostorg/iostreams
[submodule "vendor/boost-submodules/boost-tokenizer"]
path = vendor/boost-submodules/boost-tokenizer
url = https://github.com/boostorg/tokenizer
44 changes: 20 additions & 24 deletions code/components/extra-natives-five/src/VehicleExtraNatives.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1375,35 +1375,37 @@ static HookFunction initFunction([]()

OnKillNetworkDone.Connect([]()
{
g_skipRepairVehicles.clear();
ResetFlyThroughWindscreenParams();

*g_trainsForceDoorsOpen = true;

g_skipRepairVehicles.clear();
g_canPedStandOnVehicles.clear();

g_overrideUseDefaultDriveByClipset = false;
g_overrideCanPedStandOnVehicle = false;
});

fx::ScriptEngine::RegisterNativeHandler("SET_VEHICLE_AUTO_REPAIR_DISABLED", [](fx::ScriptContext& context)
{
auto vehHandle = context.GetArgument<int>(0);
auto shouldDisable = context.GetArgument<bool>(1);

fwEntity* entity = rage::fwScriptGuid::GetBaseFromGuid(vehHandle);

if (shouldDisable)
{
g_skipRepairVehicles.insert(entity);
}
else
if (fwEntity* entity = getAndCheckVehicle(context, "SET_VEHICLE_AUTO_REPAIR_DISABLED"))
{
g_skipRepairVehicles.erase(entity);
auto shouldDisable = context.GetArgument<bool>(1);

if (shouldDisable)
{
g_skipRepairVehicles.insert(entity);
}
else
{
g_skipRepairVehicles.erase(entity);
}
}
});

fx::ScriptEngine::RegisterNativeHandler("ADD_VEHICLE_DELETION_TRACE", [](fx::ScriptContext& context)
{
auto vehHandle = context.GetArgument<int>(0);
fwEntity* entity = rage::fwScriptGuid::GetBaseFromGuid(vehHandle);

if (entity->IsOfType<CVehicle>())
if (fwEntity* entity = getAndCheckVehicle(context, "ADD_VEHICLE_DELETION_TRACE"))
{
g_deletionTraces.insert(entity);
g_deletionTraces2.insert(entity);
Expand All @@ -1412,10 +1414,7 @@ static HookFunction initFunction([]()

fx::ScriptEngine::RegisterNativeHandler("OVERRIDE_VEHICLE_PEDS_CAN_STAND_ON_TOP_FLAG", [](fx::ScriptContext& context)
{
auto vehHandle = context.GetArgument<int>(0);
fwEntity* entity = rage::fwScriptGuid::GetBaseFromGuid(vehHandle);

if (entity->IsOfType<CVehicle>())
if (fwEntity* entity = getAndCheckVehicle(context, "OVERRIDE_VEHICLE_PEDS_CAN_STAND_ON_TOP_FLAG"))
{
bool can = context.GetArgument<bool>(1);
SetCanPedStandOnVehicle(entity, can ? 1 : -1);
Expand All @@ -1424,10 +1423,7 @@ static HookFunction initFunction([]()

fx::ScriptEngine::RegisterNativeHandler("RESET_VEHICLE_PEDS_CAN_STAND_ON_TOP_FLAG", [](fx::ScriptContext& context)
{
auto vehHandle = context.GetArgument<int>(0);
fwEntity* entity = rage::fwScriptGuid::GetBaseFromGuid(vehHandle);

if (entity->IsOfType<CVehicle>())
if (fwEntity* entity = getAndCheckVehicle(context, "RESET_VEHICLE_PEDS_CAN_STAND_ON_TOP_FLAG"))
{
SetCanPedStandOnVehicle(entity, 0);
}
Expand Down
73 changes: 70 additions & 3 deletions code/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,80 @@ workspace "CitizenMP"
"../vendor/rapidjson/include/",
"../vendor/fmtlib/include/",
"deplibs/include/",
"../vendor/boost-preprocessor/include/",
os.getenv("BOOST_ROOT")
"../vendor/boost-submodules/boost-context/include/",
"../vendor/boost-submodules/boost-filesystem/include/",
"../vendor/boost-submodules/boost-locale/include/",
"../vendor/boost-submodules/boost-preprocessor/include/",
"../vendor/boost-submodules/boost-program-options/include/",
"../vendor/boost-submodules/boost-random/include/",
"../vendor/boost-submodules/boost-system/include/",
"../vendor/boost-submodules/boost-thread/include/",

"../vendor/boost-submodules/boost-config/include/",
"../vendor/boost-submodules/boost-any/include/",
"../vendor/boost-submodules/boost-assert/include/",
"../vendor/boost-submodules/boost-detail/include/",
"../vendor/boost-submodules/boost-function/include/",
"../vendor/boost-submodules/boost-smart-ptr/include/",
"../vendor/boost-submodules/boost-static-assert/include/",
"../vendor/boost-submodules/boost-throw-exception/include/",
"../vendor/boost-submodules/boost-type-traits/include/",
"../vendor/boost-submodules/boost-type-index/include/",
"../vendor/boost-submodules/boost-predef/include/",
"../vendor/boost-submodules/boost-core/include/",
"../vendor/boost-submodules/boost-iterator/include/",
"../vendor/boost-submodules/boost-move/include/",
"../vendor/boost-submodules/boost-winapi/include/",
"../vendor/boost-submodules/boost-mpl/include/",
"../vendor/boost-submodules/boost-integer/include/",
"../vendor/boost-submodules/boost-container-hash/include/",
"../vendor/boost-submodules/boost-bind/include/",
"../vendor/boost-submodules/boost-unordered/include/",
"../vendor/boost-submodules/boost-lexical-cast/include/",
"../vendor/boost-submodules/boost-io/include/",
"../vendor/boost-submodules/boost-date-time/include/",
"../vendor/boost-submodules/boost-range/include/",
"../vendor/boost-submodules/boost-tuple/include/",
"../vendor/boost-submodules/boost-concept-check/include/",
"../vendor/boost-submodules/boost-utility/include/",
"../vendor/boost-submodules/boost-numeric-conversion/include/",
"../vendor/boost-submodules/boost-chrono/include/",
"../vendor/boost-submodules/boost-array/include/",
"../vendor/boost-submodules/boost-ratio/include/",
"../vendor/boost-submodules/boost-container/include/",
"../vendor/boost-submodules/boost-math/include/",
"../vendor/boost-submodules/boost-tokenizer/include/",
"../vendor/boost-submodules/boost-property-tree/include/",
"../vendor/boost-submodules/boost-optional/include/",
"../vendor/boost-submodules/boost-fusion/include/",
"../vendor/boost-submodules/boost-function-types/include/",
"../vendor/boost-submodules/boost-circular-buffer/include/",
"../vendor/boost-submodules/boost-bimap/include/",
"../vendor/boost-submodules/boost-algorithm/include/",
"../vendor/boost-submodules/boost-variant/include/",
"../vendor/boost-submodules/boost-serialization/include/",
"../vendor/boost-submodules/boost-exception/include/",
"../vendor/boost-submodules/boost-multi-index/include/",
"../vendor/boost-submodules/boost-foreach/include/",
"../vendor/boost-submodules/boost-uuid/include/",
"../vendor/boost-submodules/boost-regex/include/",
"../vendor/boost-submodules/boost-crc/include/",
"../vendor/boost-submodules/boost-tti/include/",
"../vendor/boost-submodules/boost-outcome/include/",
"../vendor/boost-submodules/boost-coroutine/include/",
"../vendor/boost-submodules/boost-asio/include/",
"../vendor/boost-submodules/boost-atomic/include/",
"../vendor/boost-submodules/boost-beast/include/",
"../vendor/boost-submodules/boost-intrusive/include/",
"../vendor/boost-submodules/boost-iostreams/include/",
"../vendor/boost-submodules/boost-mp11/include/",
"../vendor/boost-submodules/boost-logic/include/",
"../vendor/boost-submodules/boost-endian/include/",
}

filter { 'language:C or language:C++'}
defines { "GTEST_HAS_PTHREAD=0", "BOOST_ALL_NO_LIB" }

defines { "BOOST_NULLPTR=nullptr" }
defines { "_HAS_AUTO_PTR_ETC" } -- until boost gets fixed

filter {}
Expand Down
Loading

3 comments on commit 7477ed0

@hunga516
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have bug,
image

@osmium-cfx
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have bug, image

You need to update your submodules, and rerun premake

@hunga516
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have bug, image

You need to update your submodules, and rerun premake

I have update sub module “git submodule update --jobs=16 --init”, prebuild project, remove fivem folder and git clone again but have some problem

Please sign in to comment.