Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ jobs:

- name: Build
shell: cmd
run: build.bat x64
run: build.bat

build-windows-arm64:
needs: fetch-ftdi-windows-arm64
Expand Down Expand Up @@ -169,4 +169,4 @@ jobs:

- name: Build
shell: cmd
run: build.bat ARM64
run: build.bat
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,10 @@ git clone https://github.com/qualcomm/qcom-test-automation-controller.git

### Build & Usage

Execute `build.bat` to generate executables:
Execute `build.bat` to generate executables. The build targets the host architecture automatically (x64 on an x64 host, ARM64 on an ARM64 host):

```cmd
build.bat (x64, default)
build.bat ARM64 (ARM64)
build.bat
```

**Build output**:
Expand Down
28 changes: 7 additions & 21 deletions build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,18 @@
@echo off

@REM ---------------------------------------------------------------------------
@REM Detect target architecture
@REM Detect host architecture (native build only)
@REM ---------------------------------------------------------------------------
set ARCH=%1
if "%ARCH%"=="" (
if "%PROCESSOR_ARCHITECTURE%"=="ARM64" (
set ARCH=ARM64
) else (
set ARCH=x64
)
)

if /i "%ARCH%"=="x64" (
set EXPECTED_QT_PATH=msvc2022_64
set VCVARS_SCRIPT=vcvars64.bat
set VS_COMPONENT=Desktop development with C++
) else if /i "%ARCH%"=="ARM64" (
if /i "%PROCESSOR_ARCHITECTURE%"=="ARM64" (
set ARCH=ARM64
set EXPECTED_QT_PATH=msvc2022_arm64
set VCVARS_SCRIPT=vcvarsarm64.bat
set VS_COMPONENT=MSVC v143 - VS 2022 C++ ARM64 build tools
) else (
echo ERROR: Unsupported architecture '%ARCH%'.
echo Usage:
echo build.bat - auto-detect from host machine ^(current: %PROCESSOR_ARCHITECTURE%^)
echo build.bat x64 - build for x64
echo build.bat ARM64 - build for ARM64
exit /b 1
set ARCH=x64
set EXPECTED_QT_PATH=msvc2022_64
set VCVARS_SCRIPT=vcvars64.bat
set VS_COMPONENT=Desktop development with C++
)

echo Architecture : %ARCH%
Expand Down
2 changes: 1 addition & 1 deletion examples/MCP/sse/setup.bat
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ if /i "%ARCH%"=="ARM64" (
set BUILD_DIR=%REPO_ROOT%\__Builds
if not exist "%BUILD_DIR%" (
echo [1/3] Build not found. Running root build...
call "%REPO_ROOT%\build.bat" %ARCH%
call "%REPO_ROOT%\build.bat"
if errorlevel 1 exit /b 1
) else (
echo [1/3] Build found at %BUILD_DIR%, skipping recompile.
Expand Down
2 changes: 1 addition & 1 deletion examples/MCP/stdio/setup.bat
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ if /i "%ARCH%"=="ARM64" (
set BUILD_DIR=%REPO_ROOT%\__Builds
if not exist "%BUILD_DIR%" (
echo [1/3] Build not found. Running root build...
call "%REPO_ROOT%\build.bat" %ARCH%
call "%REPO_ROOT%\build.bat"
if errorlevel 1 exit /b 1
) else (
echo [1/3] Build found at %BUILD_DIR%, skipping recompile.
Expand Down
32 changes: 1 addition & 31 deletions third-party/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ endif()

file(REMOVE_RECURSE "${TEMP_DIR}")
file(MAKE_DIRECTORY "${TEMP_DIR}")
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf "${ARCHIVE_PATH}" WORKING_DIRECTORY "${TEMP_DIR}")
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf "${ARCHIVE_PATH}" WORKING_DIRECTORY "${TEMP_DIR}")

if(WIN32)
file(MAKE_DIRECTORY "${CMAKE_SOURCE_DIR}/__Builds/${FTDI_WIN_ARCH}/Debug/lib")
Expand Down Expand Up @@ -141,36 +141,6 @@ else()
)
endif()

if(WIN32 AND DEFINED ENV{QTBIN})
set(QT_BIN_DIR "$ENV{QTBIN}")
set(QT_PLUGINS_DIR "$ENV{QTBIN}/../plugins")
set(DEBUG_BIN_DIR "${CMAKE_SOURCE_DIR}/__Builds/${FTDI_WIN_ARCH}/Debug/bin")
set(RELEASE_BIN_DIR "${CMAKE_SOURCE_DIR}/__Builds/${FTDI_WIN_ARCH}/Release/bin")

set(QT_DLLS Qt6Core Qt6Gui Qt6Widgets Qt6SerialPort Qt6Concurrent Qt6Network Qt6Xml Qt6Multimedia Qt6MultimediaWidgets)

file(MAKE_DIRECTORY "${DEBUG_BIN_DIR}")
file(MAKE_DIRECTORY "${RELEASE_BIN_DIR}")
file(MAKE_DIRECTORY "${DEBUG_BIN_DIR}/platforms")
file(MAKE_DIRECTORY "${RELEASE_BIN_DIR}/platforms")

foreach(QT_DLL ${QT_DLLS})
if(EXISTS "${QT_BIN_DIR}/${QT_DLL}d.dll")
file(COPY "${QT_BIN_DIR}/${QT_DLL}d.dll" DESTINATION "${DEBUG_BIN_DIR}")
endif()
if(EXISTS "${QT_BIN_DIR}/${QT_DLL}.dll")
file(COPY "${QT_BIN_DIR}/${QT_DLL}.dll" DESTINATION "${RELEASE_BIN_DIR}")
endif()
endforeach()

if(EXISTS "${QT_PLUGINS_DIR}/platforms/qwindowsd.dll")
file(COPY "${QT_PLUGINS_DIR}/platforms/qwindowsd.dll" DESTINATION "${DEBUG_BIN_DIR}/platforms")
endif()
if(EXISTS "${QT_PLUGINS_DIR}/platforms/qwindows.dll")
file(COPY "${QT_PLUGINS_DIR}/platforms/qwindows.dll" DESTINATION "${RELEASE_BIN_DIR}/platforms")
endif()
endif()

function(link_ftd2xx target_name)
if(WIN32)
target_link_libraries(${target_name} PRIVATE $<$<CONFIG:Debug>:ftd2xx_debug> $<$<CONFIG:Release>:ftd2xx_release>)
Expand Down
Loading