Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 0 additions & 58 deletions Build_All.bat

This file was deleted.

27 changes: 24 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
cmake_minimum_required (VERSION 3.15)

set(CMAKE_SUPPRESS_REGENERATION true)


set(CMAKE_CONFIGURATION_TYPES Debug Release)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
set(Is64Bit ON CACHE BOOL "Used via cmake commandline during project generation to determine 64 or 32bit.")

project ("FileXT")
project (FileXT)

include_directories(${PROJECT_SOURCE_DIR}/FileXT)
file(GLOB SRC_FILES ${PROJECT_SOURCE_DIR}/FileXT/*.cpp ${PROJECT_SOURCE_DIR}/FileXT/*.h)
Expand All @@ -18,6 +18,27 @@ target_precompile_headers(FileXT
FileXT/pch.h
)

if (${Is64Bit})
set(output_name "filext_x64")
else()
set(output_name "filext")

if (UNIX)
target_link_options(FileXT PUBLIC "-m32")
target_compile_options(FileXT PUBLIC "-m32")
endif()
endif()

set_target_properties(FileXT
PROPERTIES
PREFIX ""
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/bin/$<CONFIG>"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/bin/$<CONFIG>"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/bin/$<CONFIG>"
)

set_target_properties(FileXT PROPERTIES OUTPUT_NAME ${output_name})

set_property(TARGET FileXT PROPERTY CXX_STANDARD 17)

add_subdirectory(FileXTTest)
148 changes: 115 additions & 33 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,117 @@
{
"version": 2,
"configurePresets": [
{
"name": "linux-debug",
"displayName": "Linux Debug",
"description": "Target the Windows Subsystem for Linux (WSL) or a remote Linux system.",
"generator": "Ninja",
"binaryDir": "${sourceDir}/Build_Linux",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/Build_Linux/install"
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": { "hostOS": [ "Linux" ] },
"microsoft.com/VisualStudioRemoteSettings/CMake/1.0": { "sourceDir": "$env{HOME}/.vs/$ms{projectDirName}" }
}
},
{
"name": "linux-release",
"displayName": "Linux Release",
"description": "Target the Windows Subsystem for Linux (WSL) or a remote Linux system.",
"generator": "Ninja",
"binaryDir": "${sourceDir}/Build_Linux/",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/Build_Linux/install/${presetName}"
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": { "hostOS": [ "Linux" ] },
"microsoft.com/VisualStudioRemoteSettings/CMake/1.0": { "sourceDir": "$env{HOME}/.vs/$ms{projectDirName}" }
}
}
]
"version": 2,
"configurePresets": [
{
"name": "x64-linux",
"displayName": "x64 Linux",
"description": "Target the Windows Subsystem for Linux (WSL) or a remote Linux system.",
"generator": "Ninja Multi-Config",
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install/${presetName}",
"Is64Bit": "TRUE"
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": { "hostOS": [ "Linux" ] },
"microsoft.com/VisualStudioRemoteSettings/CMake/1.0": { "sourceDir": "$env{HOME}/.vs/$ms{projectDirName}" }
}
},
{
"name": "x86-linux",
"displayName": "x86 Linux",
"description": "Target the Windows Subsystem for Linux (WSL) or a remote Linux system.",
"generator": "Ninja Multi-Config",
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install/${presetName}",
"Is64Bit": "FALSE"
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": { "hostOS": [ "Linux" ] },
"microsoft.com/VisualStudioRemoteSettings/CMake/1.0": { "sourceDir": "$env{HOME}/.vs/$ms{projectDirName}" }
}
},
{
"name": "x86-windows",
"displayName": "x86 Windows",
"description": "Standard Windows 32-bit target.",
"generator": "Visual Studio 17 2022",
"architecture": "Win32",
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install/${presetName}",
"Is64Bit": "FALSE"
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": { "hostOS": [ "Windows" ] },
"microsoft.com/VisualStudioRemoteSettings/CMake/1.0": { "sourceDir": "$env{HOME}/.vs/$ms{projectDirName}" }
}
},
{
"name": "x64-windows",
"displayName": "x64 Windows",
"description": "Standard Windows 64-bit target.",
"generator": "Visual Studio 17 2022",
"architecture": "x64",
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install/${presetName}",
"Is64Bit": "TRUE"
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": { "hostOS": [ "Windows" ] },
"microsoft.com/VisualStudioRemoteSettings/CMake/1.0": { "sourceDir": "$env{HOME}/.vs/$ms{projectDirName}" }
}
}
],
"buildPresets": [
{
"name": "x64-linux-debug",
"displayName": "Debug",
"configurePreset": "x64-linux",
"configuration": "Debug"
},
{
"name": "x64-linux-release",
"displayName": "Release",
"configurePreset": "x64-linux",
"configuration": "Release"
},
{
"name": "x86-linux-debug",
"displayName": "Debug",
"configurePreset": "x86-linux",
"configuration": "Debug"
},
{
"name": "x86-linux-release",
"displayName": "Release",
"configurePreset": "x86-linux",
"configuration": "Release"
},
{
"name": "x64-windows-debug",
"displayName": "Debug",
"configurePreset": "x64-windows",
"configuration": "Debug"
},
{
"name": "x64-windows-release",
"displayName": "Release",
"configurePreset": "x64-windows",
"configuration": "Release"
},
{
"name": "x86-windows-debug",
"displayName": "Debug",
"configurePreset": "x86-windows",
"configuration": "Debug"
},
{
"name": "x86-windows-release",
"displayName": "Release",
"configurePreset": "x86-windows",
"configuration": "Release"
}
]
}
30 changes: 0 additions & 30 deletions Clean_All.bat

This file was deleted.

2 changes: 2 additions & 0 deletions Tools/Build_All_Debug.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@ECHO OFF
CALL ./Util/Build_All.bat -debug
2 changes: 2 additions & 0 deletions Tools/Build_All_Release.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@ECHO OFF
CALL ./Util/Build_All.bat
30 changes: 16 additions & 14 deletions buildArmaMod.ps1 → Tools/Build_ArmaMod.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -58,30 +58,32 @@ function Get-Arma3ToolsPath()

###################################################################################################

Push-Location
Push-Location ..

"Ensure directories.."
New-Item "_build/@filext" -ItemType Directory -Force
New-Item "_build/@filext/storage" -ItemType Directory -Force
New-Item "build/@filext" -ItemType Directory -Force
New-Item "build/@filext/storage" -ItemType Directory -Force

"Copy extra files.."

Copy-Item "Arma mod/mod.cpp" "_build/@filext"
Copy-Item "Arma mod/mod.cpp" "build/@filext"

if($debug) {
Write-Host "Copy DLLs... (debug)"
Copy-Item "Build_Win64/Debug/filext.dll" "_build/@filext/filext_x64.dll"
Copy-Item "Build_Win32/Debug/filext.dll" "_build/@filext/filext.dll"
Copy-Item "Build_Linux/libFileXT.so" "_build/@filext/filext_x64.so"
Copy-Item "bin/Debug/filext.dll" "build/@filext/filext_x64.dll"
Copy-Item "bin/Debug/filext.dll" "build/@filext/filext.dll"
Copy-Item "bin/Debug/filext_x64.so" "build/@filext/filext_x64.so"
Copy-Item "bin/Debug/filext.so" "build/@filext/filext.so"

Copy-Item "Build_Win64/Debug/filext.pdb" "_build/@filext/filext_x64.pdb"
Copy-Item "Build_Win32/Debug/filext.pdb" "_build/@filext/filext.pdb"
Copy-Item "bin/Debug/filext.pdb" "build/@filext/filext_x64.pdb"
Copy-Item "bin/Debug/filext.pdb" "build/@filext/filext.pdb"
}
else {
Write-Host "Copy DLLs... (release)"
Copy-Item "Build_Win64/Release/filext.dll" "_build/@filext/filext_x64.dll"
Copy-Item "Build_Win32/Release/filext.dll" "_build/@filext/filext.dll"
Copy-Item "Build_Linux/libFileXT.so" "_build/@filext/filext_x64.so"
Copy-Item "bin/Release/filext_x64.dll" "build/@filext/filext_x64.dll"
Copy-Item "bin/Release/filext.dll" "build/@filext/filext.dll"
Copy-Item "bin/Release/filext_x64.so" "build/@filext/filext_x64.so"
Copy-Item "bin/Release/filext.so" "build/@filext/filext.so"
}

"Build pbos..."
Expand All @@ -90,9 +92,9 @@ else {
# Specific Arma 3 Tools
[string]$addonBuilderPath = "$arma3ToolsPath/AddonBuilder/AddonBuilder.exe"

[string]$thisLoc = $PSScriptRoot.Replace("\", "/")
[string]$thisLoc = Get-Location
[string]$addonPath = "$thisLoc/Arma mod/addons/filext"
[string]$builtPath = "$thisLoc/_build/@filext/addons"
[string]$builtPath = "$thisLoc/build/@filext/addons"

[string[]]$addonBuilderArgs=@(
"`"$addonPath`"",
Expand Down
39 changes: 39 additions & 0 deletions Tools/Clean_All.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
@ECHO OFF
ECHO Clean All

PUSHD ..

REM delete files individually as to not delete any save files (if we are using this directory for mods locally)
IF EXIST ".\build\@filext\filext.dll" ( DEL ".\build\@filext\filext.dll" )
IF EXIST ".\build\@filext\filext_x64.dll" ( DEL ".\build\@filext\filext_x64.dll" )
IF EXIST ".\build\@filext\filext.so" ( DEL ".\build\@filext\filext.so" )
IF EXIST ".\build\@filext\filext_x64.so" ( DEL ".\build\@filext\filext_x64.so" )
IF EXIST ".\build\@filext\filext_x64.pdb" ( DEL ".\build\@filext\filext_x64.pdb" )
IF EXIST ".\build\@filext\filext.pdb" ( DEL ".\build\@filext\filext.pdb" )
IF EXIST ".\build\@filext\mod.cpp" ( DEL ".\build\@filext\mod.cpp" )

IF EXIST ".\bin" (
RD /s /q ".\bin"
)

IF EXIST ".\build\@filext\addons" (
RD /s /q ".\build\@filext\addons"
)

IF EXIST ".\build\x86-linux" (
wsl rm -r build/x86-linux
)

IF EXIST ".\build\x64-linux" (
wsl rm -r build/x64-linux
)

IF EXIST ".\build\x86-windows" (
RD /s /q "build\x86-windows"
)

IF EXIST ".\build\x64-windows" (
RD /s /q "build\x64-windows"
)

POPD
Loading