Skip to content

Commit 8a0f72d

Browse files
authored
PR realsenseai#11915 from Eran: Linux collaterals in single build dir
2 parents cb1aae5 + 538a31e commit 8a0f72d

File tree

8 files changed

+29
-39
lines changed

8 files changed

+29
-39
lines changed

.github/workflows/buildsCI.yaml

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,6 @@ jobs:
141141
mkdir ${{env.WIN_BUILD_DIR}}
142142
143143
- name: Configure CMake
144-
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
145-
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
146144
shell: bash
147145
run: |
148146
LRS_SRC_DIR=$(pwd)
@@ -193,8 +191,6 @@ jobs:
193191
mkdir ${{env.WIN_BUILD_DIR}}
194192
195193
- name: Configure CMake
196-
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
197-
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
198194
shell: bash
199195
run: |
200196
LRS_SRC_DIR=$(pwd)
@@ -234,21 +230,21 @@ jobs:
234230
235231
- name: Build
236232
shell: bash
237-
run: |
233+
run: |
238234
cd build
239-
cmake .. -DBUILD_SHARED_LIBS=false -DBUILD_EXAMPLES=true -DBUILD_TOOLS=true -DCHECK_FOR_UPDATES=true -DBUILD_LEGACY_LIVE_TEST=true -DBUILD_PYTHON_BINDINGS=true -DPYTHON_EXECUTABLE=$(which python3)
240-
cmake --build . --config ${{env.LRS_RUN_CONFIG}} -- -j4
235+
cmake .. -DCMAKE_BUILD_TYPE=${{env.LRS_RUN_CONFIG}} -DBUILD_SHARED_LIBS=false -DBUILD_EXAMPLES=true -DBUILD_TOOLS=true -DCHECK_FOR_UPDATES=true -DBUILD_LEGACY_LIVE_TEST=true -DBUILD_PYTHON_BINDINGS=true -DPYTHON_EXECUTABLE=$(which python3)
236+
cmake --build . -- -j4
241237
242238
- name: Test
243239
shell: bash
244240
id: test-step
245241
# We set continue-on-error: true as a workaround for not skipping the upload log step on failure,
246242
# The final step will check the return value from the test step and decide if to fail/pass the job
247243
continue-on-error: true
248-
run: |
244+
run: |
249245
export LRS_LOG_LEVEL="DEBUG";
250-
cd build
251-
./unit-tests/live-test -d yes -i [software-device]
246+
cd build/${{env.LRS_RUN_CONFIG}}/
247+
./live-test -d yes -i [software-device]
252248
253249
- name: Upload RS log artifact
254250
uses: actions/upload-artifact@v3
@@ -300,8 +296,8 @@ jobs:
300296
shell: bash
301297
run: |
302298
cd build
303-
cmake .. -DBUILD_SHARED_LIBS=true -DBUILD_EXAMPLES=false -DBUILD_TOOLS=true -DBUILD_UNIT_TESTS=true -DCHECK_FOR_UPDATES=false -DBUILD_WITH_DDS=false -DBUILD_PYTHON_BINDINGS=true -DPYTHON_EXECUTABLE=$(which python3)
304-
cmake --build . --config ${{env.LRS_RUN_CONFIG}} -- -j4
299+
cmake .. -DCMAKE_BUILD_TYPE=${{env.LRS_RUN_CONFIG}} -DBUILD_SHARED_LIBS=true -DBUILD_EXAMPLES=false -DBUILD_TOOLS=true -DBUILD_UNIT_TESTS=true -DCHECK_FOR_UPDATES=false -DBUILD_WITH_DDS=false -DBUILD_PYTHON_BINDINGS=true -DPYTHON_EXECUTABLE=$(which python3)
300+
cmake --build . -- -j4
305301
306302
- name: LibCI
307303
# Note: requires BUILD_UNIT_TESTS or the executable C++ unit-tests won't run (and it won't complain)
@@ -343,8 +339,8 @@ jobs:
343339
shell: bash
344340
run: |
345341
cd build
346-
cmake .. -DBUILD_SHARED_LIBS=false -DBUILD_EXAMPLES=false -DBUILD_TOOLS=true -DBUILD_UNIT_TESTS=false -DCHECK_FOR_UPDATES=false -DBUILD_WITH_DDS=true -DBUILD_PYTHON_BINDINGS=true -DPYTHON_EXECUTABLE=$(which python3)
347-
cmake --build . --config ${{env.LRS_RUN_CONFIG}} -- -j4
342+
cmake .. -DCMAKE_BUILD_TYPE=${{env.LRS_RUN_CONFIG}} -DBUILD_SHARED_LIBS=false -DBUILD_EXAMPLES=false -DBUILD_TOOLS=true -DBUILD_UNIT_TESTS=false -DCHECK_FOR_UPDATES=false -DBUILD_WITH_DDS=true -DBUILD_PYTHON_BINDINGS=true -DPYTHON_EXECUTABLE=$(which python3)
343+
cmake --build . -- -j4
348344
349345
- name: LibCI
350346
# Note: we specifically disable BUILD_UNIT_TESTS so the executable C++ unit-tests won't run
@@ -390,8 +386,8 @@ jobs:
390386
shell: bash
391387
run: |
392388
cd build
393-
cmake .. -DBUILD_SHARED_LIBS=true -DBUILD_EXAMPLES=false -DBUILD_TOOLS=false -DCHECK_FOR_UPDATES=false -DFORCE_RSUSB_BACKEND=true -DBUILD_LEGACY_LIVE_TEST=true
394-
cmake --build . --config $LRS_BUILD_CONFIG -- -j4
389+
cmake .. -DCMAKE_BUILD_TYPE=${{env.LRS_BUILD_CONFIG}} -DBUILD_SHARED_LIBS=true -DBUILD_EXAMPLES=false -DBUILD_TOOLS=false -DCHECK_FOR_UPDATES=false -DFORCE_RSUSB_BACKEND=true -DBUILD_LEGACY_LIVE_TEST=true
390+
cmake --build . -- -j4
395391
396392
- name: Test
397393
shell: bash
@@ -401,12 +397,12 @@ jobs:
401397
continue-on-error: true
402398
run: |
403399
export LRS_LOG_LEVEL="DEBUG";
404-
cd build
405-
./unit-tests/live-test -d yes -i [software-device]
400+
cd build/${{env.LRS_BUILD_CONFIG}}/
401+
./live-test -d yes -i [software-device]
406402
407403
- name: Upload RS log artifact
408404
uses: actions/upload-artifact@v3
409-
with:
405+
with:
410406
name: Log file - U20_SH_RSUSB_LiveTest
411407
path: build/*.log
412408

@@ -451,8 +447,8 @@ jobs:
451447
# We use "greadlink -f" which is mac-os parallel command to "readlink -f" from Linux (-f to convert relative link to absolute link)
452448
export OPENSSL_ROOT_DIR=`greadlink -f /usr/local/opt/openssl@1.1`
453449
echo "OPENSSL_ROOT_DIR = ${OPENSSL_ROOT_DIR}"
454-
cmake .. -DBUILD_EXAMPLES=true -DBUILD_WITH_OPENMP=false -DHWM_OVER_XU=false -DCHECK_FOR_UPDATES=true
455-
cmake --build . --config ${{env.LRS_BUILD_CONFIG}} -- -j4
450+
cmake .. -DCMAKE_BUILD_TYPE=${{env.LRS_BUILD_CONFIG}} -DBUILD_EXAMPLES=true -DBUILD_WITH_OPENMP=false -DHWM_OVER_XU=false -DCHECK_FOR_UPDATES=true
451+
cmake --build . -- -j4
456452
ls
457453
458454
@@ -489,7 +485,7 @@ jobs:
489485
- name: Build
490486
run: |
491487
cd build
492-
cmake .. -DCMAKE_TOOLCHAIN_FILE=../android-ndk-r20b/build/cmake/android.toolchain.cmake -DFORCE_RSUSB_BACKEND=true
493-
cmake --build . --config ${{env.LRS_BUILD_CONFIG}} -- -j4
488+
cmake .. -DCMAKE_BUILD_TYPE=${{env.LRS_BUILD_CONFIG}} -DCMAKE_TOOLCHAIN_FILE=../android-ndk-r20b/build/cmake/android.toolchain.cmake -DFORCE_RSUSB_BACKEND=true
489+
cmake --build . -- -j4
494490
ls
495491

CMake/unix_config.cmake

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@ macro(os_set_flags)
44

55
# Put all the collaterals together, so we can find when trying to run examples/tests
66
# Note: this puts the outputs under <binary>/<build-type>
7-
# NOTE: do not uncomment -- this ruins our CI procedures -- otherwise it mirrors Windows, simplifies
8-
# scripts, makes things easier to find... c'est la vie!
9-
#set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE})
10-
#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE})
7+
if( "${CMAKE_BUILD_TYPE}" STREQUAL "" )
8+
# This can happen according to the docs -- and in GHA...
9+
message( STATUS "No output directory set; using ${CMAKE_BINARY_DIR}/Release/" )
10+
set( CMAKE_BUILD_TYPE "Release" )
11+
endif()
12+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE})
13+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE})
1114

1215
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
1316
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -g -D_DEFAULT_SOURCE")

common/processing-block-model.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// License: Apache 2.0. See LICENSE file in root directory.
22
// Copyright(c) 2023 Intel Corporation. All Rights Reserved.
33

4-
#pragma once
5-
64
#include <librealsense2/rs.hpp>
75
#include <string>
86
#include "subdevice-model.h"

src/gl/align-gl.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include <iostream>
2121

2222
#include <chrono>
23-
#include <strstream>
2423

2524
#include "synthetic-stream-gl.h"
2625

@@ -269,4 +268,4 @@ align_gl::~align_gl()
269268
{
270269
cleanup_gpu_resources();
271270
}, []{});
272-
}
271+
}

src/gl/colorizer-gl.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
#include <iostream>
2121
#include <chrono>
22-
#include <strstream>
2322

2423
static const char* fragment_shader_text =
2524
"#version 110\n"
@@ -357,4 +356,4 @@ namespace librealsense
357356
return res;
358357
}
359358
}
360-
}
359+
}

src/gl/upload.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include <iostream>
2222

2323
#include <chrono>
24-
#include <strstream>
2524

2625
#include "synthetic-stream-gl.h"
2726

src/gl/yuy2rgb-gl.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include <iostream>
1919

2020
#include <chrono>
21-
#include <strstream>
2221

2322
#include "synthetic-stream-gl.h"
2423

unit-tests/run-unit-tests.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,7 @@ def find_build_dir( dir ):
196196
log.d( 'found python libraries in:', pyd_dirs )
197197
if not exe_dir:
198198
build_dir = find_build_dir( pyrs_path )
199-
if linux:
200-
exe_dir = build_dir
201-
else:
202-
exe_dir = pyrs_path
199+
exe_dir = pyrs_path
203200

204201
# Try to assume exe directory from inside build directory. Only works if there is only one location with tests
205202
if not exe_dir and build_dir:

0 commit comments

Comments
 (0)