* convert genproto
into an option instead if an action because we need the action name for the deps folder
* disable windows specific options for other os + add category to all options * update readme
This commit is contained in:
parent
3b536044be
commit
2c0a28c8ea
10
.github/workflows/emu-build-all-linux.yml
vendored
10
.github/workflows/emu-build-all-linux.yml
vendored
@ -87,21 +87,13 @@ jobs:
|
|||||||
ls -la ./build/deps/linux/gmake2/protobuf/install32/bin/*
|
ls -la ./build/deps/linux/gmake2/protobuf/install32/bin/*
|
||||||
ls -la ./build/deps/linux/gmake2/protobuf/install64/bin/*
|
ls -la ./build/deps/linux/gmake2/protobuf/install64/bin/*
|
||||||
|
|
||||||
### generate from .proto file
|
|
||||||
- name: Generate from .proto file
|
|
||||||
shell: bash
|
|
||||||
working-directory: ${{ github.workspace }}
|
|
||||||
run: |
|
|
||||||
sudo chmod 777 ./${{env.THIRD_PARTY_BASE_DIR}}/common/linux/premake/premake5
|
|
||||||
./${{env.THIRD_PARTY_BASE_DIR}}/common/linux/premake/premake5 --file=premake5.lua --os=linux genproto
|
|
||||||
|
|
||||||
### generate project files
|
### generate project files
|
||||||
- name: Generate project files
|
- name: Generate project files
|
||||||
shell: bash
|
shell: bash
|
||||||
working-directory: ${{ github.workspace }}
|
working-directory: ${{ github.workspace }}
|
||||||
run: |
|
run: |
|
||||||
sudo chmod 777 ./${{env.THIRD_PARTY_BASE_DIR}}/common/linux/premake/premake5
|
sudo chmod 777 ./${{env.THIRD_PARTY_BASE_DIR}}/common/linux/premake/premake5
|
||||||
./${{env.THIRD_PARTY_BASE_DIR}}/common/linux/premake/premake5 --file=premake5.lua --emubuild=${{ github.sha }} --os=linux gmake2
|
./${{env.THIRD_PARTY_BASE_DIR}}/common/linux/premake/premake5 --file=premake5.lua --genproto --emubuild=${{ github.sha }} --os=linux gmake2
|
||||||
|
|
||||||
## mandatory Linux packages
|
## mandatory Linux packages
|
||||||
- name: Install required packages
|
- name: Install required packages
|
||||||
|
9
.github/workflows/emu-build-all-win.yml
vendored
9
.github/workflows/emu-build-all-win.yml
vendored
@ -94,19 +94,12 @@ jobs:
|
|||||||
dir /b /a build\deps\win\vs2022\protobuf\install32\bin\*
|
dir /b /a build\deps\win\vs2022\protobuf\install32\bin\*
|
||||||
dir /b /a build\deps\win\vs2022\protobuf\install64\bin\*
|
dir /b /a build\deps\win\vs2022\protobuf\install64\bin\*
|
||||||
|
|
||||||
### generate from .proto file
|
|
||||||
- name: Generate from .proto file
|
|
||||||
shell: cmd
|
|
||||||
working-directory: ${{ github.workspace }}
|
|
||||||
run: |
|
|
||||||
"${{env.THIRD_PARTY_BASE_DIR}}\common\win\premake\premake5.exe" --file=premake5.lua --os=windows genproto
|
|
||||||
|
|
||||||
### generate project files
|
### generate project files
|
||||||
- name: Generate project files
|
- name: Generate project files
|
||||||
shell: cmd
|
shell: cmd
|
||||||
working-directory: ${{ github.workspace }}
|
working-directory: ${{ github.workspace }}
|
||||||
run: |
|
run: |
|
||||||
"${{env.THIRD_PARTY_BASE_DIR}}\common\win\premake\premake5.exe" --file=premake5.lua --emubuild=${{ github.sha }} --dosstub --winrsrc --winsign --os=windows vs2022
|
"${{env.THIRD_PARTY_BASE_DIR}}\common\win\premake\premake5.exe" --file=premake5.lua --genproto --emubuild=${{ github.sha }} --dosstub --winrsrc --winsign --os=windows vs2022
|
||||||
|
|
||||||
### build target
|
### build target
|
||||||
- name: Build target
|
- name: Build target
|
||||||
|
@ -178,7 +178,7 @@ This will:
|
|||||||
Open CMD in the repo folder, then run the following
|
Open CMD in the repo folder, then run the following
|
||||||
* For `MSYS2`
|
* For `MSYS2`
|
||||||
```shell
|
```shell
|
||||||
./third-party/common/win/premake/premake5.exe --file=premake5.lua --os=windows gmake2
|
./third-party/common/win/premake/premake5.exe --file=premake5.lua --genproto --os=windows gmake2
|
||||||
|
|
||||||
cd ./build/project/gmake2/win
|
cd ./build/project/gmake2/win
|
||||||
```
|
```
|
||||||
@ -201,7 +201,7 @@ Open CMD in the repo folder, then run the following
|
|||||||
```
|
```
|
||||||
* For `Visual Studio 2022`
|
* For `Visual Studio 2022`
|
||||||
```batch
|
```batch
|
||||||
third-party\common\win\premake\premake5.exe --file=premake5.lua --os=windows vs2022
|
third-party\common\win\premake\premake5.exe --file=premake5.lua --genproto --os=windows vs2022
|
||||||
```
|
```
|
||||||
You can then go to the folder `build\project\vs2022\win` and open the produced `.sln` file in Visual Studio.
|
You can then go to the folder `build\project\vs2022\win` and open the produced `.sln` file in Visual Studio.
|
||||||
Or, if you prefer to do it from command line, open the `Developer Command Prompt for VS 2022` inside the above folder, then:
|
Or, if you prefer to do it from command line, open the `Developer Command Prompt for VS 2022` inside the above folder, then:
|
||||||
@ -219,7 +219,7 @@ This will build a release version of the emu in the folder `build\win\<toolchain
|
|||||||
### On Linux:
|
### On Linux:
|
||||||
Open a terminal in the repo folder, then run the following
|
Open a terminal in the repo folder, then run the following
|
||||||
```shell
|
```shell
|
||||||
./third-party/common/linux/premake/premake5 --file=premake5.lua --os=linux gmake2
|
./third-party/common/linux/premake/premake5 --file=premake5.lua --genproto --os=linux gmake2
|
||||||
cd ./build/project/gmake2/linux
|
cd ./build/project/gmake2/linux
|
||||||
```
|
```
|
||||||
*(Optional)* You can use `Clang` compiler instead of `GCC` by running these 2 commands in the current terminal instance
|
*(Optional)* You can use `Clang` compiler instead of `GCC` by running these 2 commands in the current terminal instance
|
||||||
|
42
premake5.lua
42
premake5.lua
@ -74,11 +74,7 @@ end
|
|||||||
|
|
||||||
local deps_dir = path.getabsolute(path.join('build', 'deps', os_iden, _ACTION), _MAIN_SCRIPT_DIR)
|
local deps_dir = path.getabsolute(path.join('build', 'deps', os_iden, _ACTION), _MAIN_SCRIPT_DIR)
|
||||||
|
|
||||||
newaction {
|
function genproto()
|
||||||
trigger = "genproto",
|
|
||||||
description = "Generate .cpp/.h files from .proto file",
|
|
||||||
|
|
||||||
onStart = function ()
|
|
||||||
local deps_install_prefix = ''
|
local deps_install_prefix = ''
|
||||||
if os.is64bit() then
|
if os.is64bit() then
|
||||||
deps_install_prefix = 'install64'
|
deps_install_prefix = 'install64'
|
||||||
@ -113,40 +109,46 @@ newaction {
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local ok_cmd = os.execute(protoc_exe .. ' dll/net.proto -I./dll/ --cpp_out=' .. out_dir)
|
return os.execute(protoc_exe .. ' dll/net.proto -I./dll/ --cpp_out=' .. out_dir)
|
||||||
if ok_cmd then
|
end
|
||||||
print("Success!")
|
|
||||||
else
|
newoption {
|
||||||
error("protoc error")
|
category = 'protobuf files',
|
||||||
end
|
trigger = "genproto",
|
||||||
end
|
description = "Generate .cc/.h files from .proto file",
|
||||||
}
|
}
|
||||||
|
|
||||||
newoption {
|
newoption {
|
||||||
|
category = 'build',
|
||||||
trigger = "emubuild",
|
trigger = "emubuild",
|
||||||
description = "Set the EMU_BUILD_STRING",
|
description = "Set the EMU_BUILD_STRING",
|
||||||
value = "your_string",
|
value = "your_string",
|
||||||
default = os.date("%Y_%m_%d-%H_%M_%S"),
|
default = os.date("%Y_%m_%d-%H_%M_%S"),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- windows options
|
||||||
|
if os.target() == 'windows' then
|
||||||
|
|
||||||
newoption {
|
newoption {
|
||||||
category = "win build",
|
category = "build",
|
||||||
trigger = "dosstub",
|
trigger = "dosstub",
|
||||||
description = "Change the DOS stub of the Windows builds",
|
description = "Change the DOS stub of the Windows builds",
|
||||||
}
|
}
|
||||||
|
|
||||||
newoption {
|
newoption {
|
||||||
category = "win build",
|
category = "build",
|
||||||
trigger = "winsign",
|
trigger = "winsign",
|
||||||
description = "Sign Windows builds with a fake certificate",
|
description = "Sign Windows builds with a fake certificate",
|
||||||
}
|
}
|
||||||
|
|
||||||
newoption {
|
newoption {
|
||||||
category = "win build",
|
category = "build",
|
||||||
trigger = "winrsrc",
|
trigger = "winrsrc",
|
||||||
description = "Add resources to Windows builds",
|
description = "Add resources to Windows builds",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
end
|
||||||
|
-- End windows options
|
||||||
|
|
||||||
|
|
||||||
-- common defines
|
-- common defines
|
||||||
@ -302,6 +304,16 @@ local x64_deps_overlay_libdir = {
|
|||||||
path.join(deps_dir, "ingame_overlay/deps/mini_detour/install64/lib"),
|
path.join(deps_dir, "ingame_overlay/deps/mini_detour/install64/lib"),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- generate proto
|
||||||
|
if _OPTIONS["genproto"] then
|
||||||
|
if genproto() then
|
||||||
|
print("Success!")
|
||||||
|
else
|
||||||
|
error("protoc error")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- End generate proto
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- tokenization
|
-- tokenization
|
||||||
|
Loading…
x
Reference in New Issue
Block a user