Skip to content

Commit f178d97

Browse files
committed
linker error fixed.
1 parent 1d4fb56 commit f178d97

File tree

2 files changed

+33
-8
lines changed

2 files changed

+33
-8
lines changed

RTLBenchmarkApp/CMakeLists.txt

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,33 +30,31 @@ endif()
3030
# ===============================
3131
set(RTL_INCLUDE_DIRS
3232
inc
33-
"${CMAKE_SOURCE_DIR}/CxxTestUtils/inc"
34-
"${CMAKE_SOURCE_DIR}/CxxRTLTypeRegistration/inc"
3533
"${CMAKE_SOURCE_DIR}/ReflectionTemplateLib/common"
3634
"${CMAKE_SOURCE_DIR}/ReflectionTemplateLib/detail/inc"
3735
"${CMAKE_SOURCE_DIR}/ReflectionTemplateLib/access/inc"
3836
"${CMAKE_SOURCE_DIR}/ReflectionTemplateLib/builder/inc"
3937
)
4038

4139
# ===============================
42-
# Benchmarks (only target)
40+
# Test Executable
4341
# ===============================
42+
set(CXX_EXE_NAME RTLBenchmarkApp)
43+
4444
# ===============================
4545
# Benchmarks (only target)
4646
# ===============================
47-
add_executable(RTLBenchmarkApp
47+
add_executable(${CXX_EXE_NAME}
4848
src/main.cpp
4949
src/BenchMark.cpp # <-- added
5050
src/BenchMark.h # <-- optional (for IDE visibility)
5151
)
5252

5353

54-
target_include_directories(RTLBenchmarkApp PRIVATE ${RTL_INCLUDE_DIRS})
54+
target_include_directories(${CXX_EXE_NAME} PRIVATE ${RTL_INCLUDE_DIRS})
5555

56-
target_link_libraries(RTLBenchmarkApp
56+
target_link_libraries(${CXX_EXE_NAME}
5757
PRIVATE
5858
benchmark
59-
CxxTestUtils
6059
ReflectionTemplateLib
61-
CxxRTLTypeRegistration
6260
)
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#pragma once
2+
// #include <iostream>
3+
4+
#ifdef RTL_DEBUG
5+
6+
// Runs arbitrary code safely in Debug builds (single-statement safe)
7+
#define RTL_DEBUG_ONLY(code) do { code } while(0)
8+
9+
// Simple debug log
10+
// #define RTL_LOG(msg) do { std::cout << "[RTL-DEBUG] " << msg << '\n'; } while(0)
11+
12+
// Exception-free assert: if condition fails, prints message and returns error code
13+
// #define RTL_ASSERT(cond, err_code) do { \
14+
// if (!(cond)) { \
15+
// std::cerr << "[RTL-ASSERT] " #cond " failed!\n"; \
16+
// return err_code; \
17+
// } \
18+
// } while(0)
19+
20+
#else
21+
22+
// Release builds: completely stripped out
23+
#define RTL_DEBUG_ONLY(code) do {} while(0)
24+
// #define RTL_LOG(msg) do {} while(0)
25+
// #define RTL_ASSERT(cond, err_code) do {} while(0)
26+
27+
#endif

0 commit comments

Comments
 (0)