Fixed make error
This commit is contained in:
1 parent
684e05109d
commit
37bd700564
6 files changed
+27
-34
No files matched your search
@@ -33,6 +33,9 @@ SET(SRCS_telegrams
|
|||||||
training_area_telegrams.h
|
training_area_telegrams.h
|
||||||
)
|
)
|
||||||
NGL_ADD_LIBRARY(AAR SV WS HLA tabTelegrams STATIC ${SRCS_telegrams})
|
NGL_ADD_LIBRARY(AAR SV WS HLA tabTelegrams STATIC ${SRCS_telegrams})
|
||||||
|
|
||||||
|
# tabTelegrams is a STATIC lib linked into shared/MODULE targets
|
||||||
|
SET_TARGET_PROPERTIES(tabTelegrams PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||||
NGL_TARGET_INCLUDE_DIRECTORIES(tabTelegrams
|
NGL_TARGET_INCLUDE_DIRECTORIES(tabTelegrams
|
||||||
PUBLIC
|
PUBLIC
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/..
|
${CMAKE_CURRENT_SOURCE_DIR}/..
|
||||||
@@ -78,8 +81,6 @@ LIST(APPEND SRCS_common
|
|||||||
# Create target only if component flags allow
|
# Create target only if component flags allow
|
||||||
NGL_ADD_LIBRARY2(AAR SV WS HLA svcTabCommon SHARED ${SRCS_common})
|
NGL_ADD_LIBRARY2(AAR SV WS HLA svcTabCommon SHARED ${SRCS_common})
|
||||||
|
|
||||||
# Generate export header ALWAYS (needed for logger.h even if target not built)
|
|
||||||
# Use custom command to create minimal export header if target wasn't created
|
|
||||||
IF(NOT TARGET svcTabCommon)
|
IF(NOT TARGET svcTabCommon)
|
||||||
# Create a dummy static library just for export header generation
|
# Create a dummy static library just for export header generation
|
||||||
ADD_LIBRARY(svcTabCommon STATIC ${SRCS_common})
|
ADD_LIBRARY(svcTabCommon STATIC ${SRCS_common})
|
||||||
|
|||||||
@@ -103,6 +103,22 @@ docker run --rm -it -v /path/to/pipeline-root:/workspace legatus-qt6:1.0 \
|
|||||||
&& make -j8'
|
&& make -j8'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Run an executable directly
|
||||||
|
|
||||||
|
To run a built executable interactively — e.g. the GUI apps under
|
||||||
|
`build4/bin/` (`LogView`, `PrtCnv`) against your local display — start a
|
||||||
|
shell inside the container with X11 forwarding:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker run --rm -it \
|
||||||
|
-e DISPLAY \
|
||||||
|
-e LC_ALL=C.UTF-8 \
|
||||||
|
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
||||||
|
-v /path/to/pipeline-root:/workspace \
|
||||||
|
legatus-qt6:1.0 \
|
||||||
|
bash -c 'cd /workspace/qt-migration-legatus/qt6-after/qt6-migrated-legatus/build4 && exec bash'
|
||||||
|
```
|
||||||
|
|
||||||
## Step 3 — Run the tests
|
## Step 3 — Run the tests
|
||||||
|
|
||||||
### 3.1 ctest (automatic)
|
### 3.1 ctest (automatic)
|
||||||
@@ -258,7 +274,7 @@ ones:
|
|||||||
|
|
||||||
| Option | Default | Purpose |
|
| Option | Default | Purpose |
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
| `--docker-image IMAGE` | `legatus-qt6-prebuilt:latest` | image to use/build/delete |
|
| `--docker-image IMAGE` | `legatus-qt6:1.0` | image to use/build/delete |
|
||||||
| `--build-prebuilt-image` | — | build the image from `./Dockerfile` and exit |
|
| `--build-prebuilt-image` | — | build the image from `./Dockerfile` and exit |
|
||||||
| `--delete-prebuilt-image` | — | delete the image and exit |
|
| `--delete-prebuilt-image` | — | delete the image and exit |
|
||||||
| `--run-jenkins-builder` | off | produce the DEB packages (Step 4) |
|
| `--run-jenkins-builder` | off | produce the DEB packages (Step 4) |
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ NGL_TARGET_LINK_LIBRARIES(LogViewLogger
|
|||||||
NGLLogger
|
NGLLogger
|
||||||
)
|
)
|
||||||
|
|
||||||
|
SET_TARGET_PROPERTIES(LogViewLogger PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||||
|
|
||||||
SET(my_SRCS
|
SET(my_SRCS
|
||||||
IntegerCalculator.cpp
|
IntegerCalculator.cpp
|
||||||
IntegerCalculator.hpp
|
IntegerCalculator.hpp
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
def project = 'guez'
|
def project = 'guez'
|
||||||
def legatusRoot = 'qt-migration-legatus/qt6-after/qt6-migrated-legatus'
|
def legatusRoot = 'qt-migration-legatus/qt6-after/qt6-migrated-legatus'
|
||||||
def imageName = 'legatus-qt6-prebuilt:latest'
|
def imageName = 'legatus-qt6:1.0'
|
||||||
|
|
||||||
properties([
|
properties([
|
||||||
disableConcurrentBuilds(),
|
disableConcurrentBuilds(),
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ export GUEZ_MODE="${GUEZ_MODE:-ON}"
|
|||||||
export BUILD_NUMBER="${BUILD_NUMBER:-$(date +%Y%m%d-%H%M%S)}"
|
export BUILD_NUMBER="${BUILD_NUMBER:-$(date +%Y%m%d-%H%M%S)}"
|
||||||
export BUILD_TAG="${BUILD_TAG:-release-qt6-first}"
|
export BUILD_TAG="${BUILD_TAG:-release-qt6-first}"
|
||||||
|
|
||||||
DOCKER_IMAGE="${DOCKER_IMAGE:-legatus-qt6-prebuilt:latest}"
|
DOCKER_IMAGE="${DOCKER_IMAGE:-legatus-qt6:1.0}"
|
||||||
|
|
||||||
log_info() {
|
log_info() {
|
||||||
printf 'INFO: %s\n' "$*"
|
printf 'INFO: %s\n' "$*"
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ Builds the release validation scope inside the prebuilt Docker image:
|
|||||||
|
|
||||||
Options:
|
Options:
|
||||||
--docker-image IMAGE Docker image name to use/build/delete
|
--docker-image IMAGE Docker image name to use/build/delete
|
||||||
(default: legatus-qt6-prebuilt:latest)
|
(default: legatus-qt6:1.0)
|
||||||
--build-prebuilt-image Build the prebuilt Docker image (from ./Dockerfile)
|
--build-prebuilt-image Build the prebuilt Docker image (from ./Dockerfile)
|
||||||
and exit. To run the build with it, run the script
|
and exit. To run the build with it, run the script
|
||||||
again with --docker-image
|
again with --docker-image
|
||||||
@@ -276,20 +276,12 @@ build_prebuilt_image() {
|
|||||||
|
|
||||||
require_command docker
|
require_command docker
|
||||||
|
|
||||||
# MIGRATE_PIPELINE_ROOT resolution (highest precedence first):
|
|
||||||
# 1. exported environment variable (e.g. from a Jenkinsfile)
|
|
||||||
# 2. .envrc in this directory (if present)
|
|
||||||
# 3. derived from this script's location - the script always lives at
|
|
||||||
# <root>/qt-migration-legatus/qt6-after/qt6-migrated-legatus, so the
|
|
||||||
# pipeline root is three levels up. This makes the script work in a
|
|
||||||
# fresh Jenkins checkout with no environment setup at all.
|
|
||||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
MIGRATE_PIPELINE_ROOT_DEFAULT="$(cd "${SCRIPT_DIR}/../../.." && pwd)"
|
MIGRATE_PIPELINE_ROOT_DEFAULT="$(cd "${SCRIPT_DIR}/../../.." && pwd)"
|
||||||
PIPELINE_ROOT_EXPORTED="${MIGRATE_PIPELINE_ROOT:-}"
|
PIPELINE_ROOT_EXPORTED="${MIGRATE_PIPELINE_ROOT:-}"
|
||||||
|
|
||||||
if [[ -f ".envrc" ]]; then
|
if [[ -f ".envrc" ]]; then
|
||||||
set -a
|
set -a
|
||||||
# shellcheck disable=SC1091
|
|
||||||
source ".envrc"
|
source ".envrc"
|
||||||
set +a
|
set +a
|
||||||
fi
|
fi
|
||||||
@@ -394,7 +386,7 @@ if [[ "${RUN_COVERAGE}" == "ON" && "${RUN_JENKINS_BUILDER}" == "ON" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Default for the Docker image name
|
# Default for the Docker image name
|
||||||
DOCKER_IMAGE="${DOCKER_IMAGE:-legatus-qt6-prebuilt:latest}"
|
DOCKER_IMAGE="${DOCKER_IMAGE:-legatus-qt6:1.0}"
|
||||||
|
|
||||||
# Export variables for Docker container
|
# Export variables for Docker container
|
||||||
export RELEASE_BUILD RUN_CTEST BUILD_PREBUILT_IMAGE DELETE_PREBUILT_IMAGE DOCKER_IMAGE RUN_JENKINS_BUILDER PACKAGE_OUTPUT_DIR RUN_COVERAGE COVERAGE_OUTPUT_DIR LTS_VERSION PROJECT GUEZ_MODE BUILD_NUMBER BUILD_TAG
|
export RELEASE_BUILD RUN_CTEST BUILD_PREBUILT_IMAGE DELETE_PREBUILT_IMAGE DOCKER_IMAGE RUN_JENKINS_BUILDER PACKAGE_OUTPUT_DIR RUN_COVERAGE COVERAGE_OUTPUT_DIR LTS_VERSION PROJECT GUEZ_MODE BUILD_NUMBER BUILD_TAG
|
||||||
@@ -488,17 +480,8 @@ rm -rf build4
|
|||||||
mkdir -p build4
|
mkdir -p build4
|
||||||
cd build4
|
cd build4
|
||||||
|
|
||||||
# RELEASE_BUILD=ON selects the release scope (TetraIF, Z/src, Lts/Common +
|
|
||||||
# TrainingAreaBase); all other BUILD_* flags are left at their CMake defaults.
|
|
||||||
COV_CMAKE_ARGS=()
|
COV_CMAKE_ARGS=()
|
||||||
if [[ "${RUN_COVERAGE}" == "ON" ]]; then
|
if [[ "${RUN_COVERAGE}" == "ON" ]]; then
|
||||||
# Instrument the Release build with gcov. CMAKE_<LANG>_FLAGS_RELEASE replaces
|
|
||||||
# the default "-O3 -DNDEBUG" entirely, so -O0/--coverage must be carried
|
|
||||||
# there (plain CMAKE_<LANG>_FLAGS would come first on the command line and
|
|
||||||
# lose to -O3); -DNDEBUG is kept so behavior matches the standard build.
|
|
||||||
# -fPIC: plain static libs (e.g. tabTelegrams) are not PIC by default and
|
|
||||||
# are linked into shared libraries - at -O0 the non-PIC relocations show up
|
|
||||||
# at link time. Never add USE_IPO/USE_UNITY_BUILD here - LTO breaks gcov.
|
|
||||||
COV_CMAKE_ARGS=(
|
COV_CMAKE_ARGS=(
|
||||||
"-DCMAKE_C_FLAGS_RELEASE=-O0 -g --coverage -DNDEBUG -fPIC"
|
"-DCMAKE_C_FLAGS_RELEASE=-O0 -g --coverage -DNDEBUG -fPIC"
|
||||||
"-DCMAKE_CXX_FLAGS_RELEASE=-O0 -g --coverage -DNDEBUG -fPIC"
|
"-DCMAKE_CXX_FLAGS_RELEASE=-O0 -g --coverage -DNDEBUG -fPIC"
|
||||||
@@ -529,21 +512,12 @@ else
|
|||||||
log_info "Skipping CTest"
|
log_info "Skipping CTest"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Code coverage (lcov): capture, filter to the release scope and generate the
|
|
||||||
# HTML report. Runs only in --run-coverage mode, after ctest (so the .gcda
|
|
||||||
# data files exist). cwd is build4, so --directory . is the build tree; all
|
|
||||||
# artifacts are written via absolute paths.
|
|
||||||
if [[ "${RUN_COVERAGE}" == "ON" ]]; then
|
if [[ "${RUN_COVERAGE}" == "ON" ]]; then
|
||||||
log_info "=== Code coverage (lcov) ==="
|
log_info "=== Code coverage (lcov) ==="
|
||||||
COVOUT=/workspace/coverage-out
|
COVOUT=/workspace/coverage-out
|
||||||
SRCROOT=/workspace/qt-migration-legatus/qt6-after/qt6-migrated-legatus
|
SRCROOT=/workspace/qt-migration-legatus/qt6-after/qt6-migrated-legatus
|
||||||
mkdir -p "${COVOUT}"
|
mkdir -p "${COVOUT}"
|
||||||
|
|
||||||
# GCC 15 + lcov 2.x: the branch data (libstdc++, Qt headers and some of
|
|
||||||
# our sources) trips lcov's consistency checks (mismatch / inconsistent),
|
|
||||||
# and a filter pattern that matches no file is an "unused" error. The
|
|
||||||
# extract step below keeps only the release scope, so these quirks do not
|
|
||||||
# affect the report - ignore those error classes on every step.
|
|
||||||
COV_IGNORE=(--ignore-errors mismatch,inconsistent,unused)
|
COV_IGNORE=(--ignore-errors mismatch,inconsistent,unused)
|
||||||
lcov --capture --directory . --external "${COV_IGNORE[@]}" \
|
lcov --capture --directory . --external "${COV_IGNORE[@]}" \
|
||||||
--rc branch_coverage=1 \
|
--rc branch_coverage=1 \
|
||||||
|
|||||||
Reference in new issue
Block a user