Skip to content

Commit 1fce69a

Browse files
committed
Update to latest delegate library source
1 parent 0c3d698 commit 1fce69a

28 files changed

+2971
-3297
lines changed

.github/workflows/cmake_clang.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Clang
2+
3+
on:
4+
push:
5+
branches:
6+
- main # Trigger on push
7+
pull_request:
8+
branches:
9+
- main # Trigger on pull
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest # Use Ubuntu environment for the build
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v2 # Checkout the repository code
18+
19+
- name: Configure CMake with Clang
20+
run: cmake -S . -B build -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ # Configure CMake with Clang as the compiler
21+
22+
- name: Build
23+
run: cmake --build build # Build the project using CMake
24+
25+
- name: Run DelegateApp
26+
run: ./build/DelegateApp # Run the built executable

.github/workflows/cmake_ubuntu.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Ubuntu
2+
3+
on:
4+
push:
5+
branches:
6+
- main # Trigger on push
7+
pull_request:
8+
branches:
9+
- main # Trigger on pull
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest # Use Ubuntu environment for the build
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v2 # Checkout the repository code
18+
19+
- name: Configure CMake
20+
run: cmake -S . -B build # Configure CMake to generate build files in 'build' directory
21+
22+
- name: Build
23+
run: cmake --build build # Build the project using CMake
24+
25+
- name: Run DelegateApp
26+
run: ./build/DelegateApp # Run the built executable

.github/workflows/cmake_windows.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Windows
2+
3+
on:
4+
push:
5+
branches:
6+
- main # Trigger on push
7+
pull_request:
8+
branches:
9+
- main # Trigger on pull
10+
11+
jobs:
12+
build:
13+
runs-on: windows-latest # Use Windows environment for the build
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v2 # Checkout the repository code
18+
19+
- name: Set up Visual Studio
20+
uses: microsoft/[email protected] # Set up Visual Studio environment (MSBuild)
21+
22+
- name: Configure CMake
23+
run: cmake -S . -B build -G "Visual Studio 17 2022" # Configure CMake for Visual Studio
24+
25+
- name: Build
26+
run: cmake --build build --config Release # Build the project using CMake with Release configuration
27+
28+
- name: Run DelegateApp
29+
run: .\build\Release\DelegateApp.exe # Run the built executable (adjust path for MSBuild)

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
*.userprefs
1414

1515
# Build results
16+
Build
1617
[Dd]ebug/
1718
[Dd]ebugPublic/
1819
[Rr]elease/

CMakeLists.txt

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
# Example CMake command line to create project build files:
22
#
33
# *** Windows ***
4-
# cmake -G "Visual Studio 17 2022" -A Win32 -B ../StateMachineWithModernDelegatesBuild -S .
5-
# cmake -G "Visual Studio 17 2022" -A x64 -B ../StateMachineWithModernDelegatesBuild -S .
6-
# cmake -G "Visual Studio 17 2022" -A x64 -B ../StateMachineWithModernDelegatesBuild -S . -DENABLE_UNIT_TESTS=ON
4+
# cmake -G "Visual Studio 17 2022" -A Win32 -B Build -S .
5+
# cmake -G "Visual Studio 17 2022" -A x64 -B Build -S .
76
#
87
# *** Linux ***
9-
# cmake -G "Unix Makefiles" -B ../StateMachineWithModernDelegatesBuild -S .
10-
# cmake -G "Unix Makefiles" -B ../StateMachineWithModernDelegatesBuild -S . -DENABLE_UNIT_TESTS=ON
8+
# cmake -G "Unix Makefiles" -B Build -S .
9+
# cmake -G "Unix Makefiles" -B Build -S . -DENABLE_UNIT_TESTS=ON
1110

1211
# Specify the minimum CMake version required
1312
cmake_minimum_required(VERSION 3.10)
@@ -22,6 +21,12 @@ set(CMAKE_CXX_STANDARD_REQUIRED True)
2221
# Collect all .cpp and *.h source files in the current directory
2322
file(GLOB SOURCES "${CMAKE_SOURCE_DIR}/*.cpp" "${CMAKE_SOURCE_DIR}/*.h")
2423

24+
# Collect all header files in the Delegate directory
25+
file(GLOB Delegate_HEADERS "${CMAKE_SOURCE_DIR}/Delegate/*.h")
26+
27+
# Organize Delegate headers into a "Delegate Files" folder in Visual Studio
28+
source_group("Delegate Files" FILES ${Delegate_HEADERS})
29+
2530
# Add subdirectories to include path
2631
include_directories(
2732
${CMAKE_SOURCE_DIR}/Delegate
@@ -31,21 +36,19 @@ include_directories(
3136
)
3237

3338
# Add an executable target
34-
add_executable(DelegateApp ${SOURCES})
39+
add_executable(DelegateApp ${SOURCES} ${Delegate_HEADERS})
3540

3641
# Define the DELEGATE_UNIT_TEST macro for the DelegateApp target
3742
if (ENABLE_UNIT_TESTS)
3843
add_compile_definitions(DELEGATE_UNIT_TESTS)
3944
endif()
4045

4146
# Add subdirectories to build
42-
add_subdirectory(Delegate)
4347
add_subdirectory(SelfTest)
4448
add_subdirectory(StateMachine)
4549
add_subdirectory(Port)
4650

4751
target_link_libraries(DelegateApp PRIVATE
48-
DelegateLib
4952
SelfTestLib
5053
StateMachineLib
5154
PortLib

Delegate/CMakeLists.txt

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)