File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,18 +3,18 @@ name: Clang
33on :
44 push :
55 branches :
6- - master # Trigger on push
6+ - master # Trigger on push
77 pull_request :
88 branches :
9- - master # Trigger on pull
9+ - master # Trigger on pull
1010
1111jobs :
1212 build :
1313 runs-on : ubuntu-latest # Use Ubuntu environment for the build
1414
1515 steps :
1616 - name : Checkout code
17- uses : actions/checkout@v2 # Checkout the repository code
17+ uses : actions/checkout@v4 # Checkout the repository code
1818
1919 - name : Configure CMake with Clang
2020 run : cmake -S . -B build -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ # Configure CMake with Clang as the compiler
Original file line number Diff line number Diff line change @@ -3,21 +3,21 @@ name: Ubuntu
33on :
44 push :
55 branches :
6- - master # Trigger on push
6+ - master # Trigger on push
77 pull_request :
88 branches :
9- - master # Trigger on pull
9+ - master # Trigger on pull
1010
1111jobs :
1212 build :
1313 runs-on : ubuntu-latest # Use Ubuntu environment for the build
1414
1515 steps :
1616 - name : Checkout code
17- uses : actions/checkout@v2 # Checkout the repository code
17+ uses : actions/checkout@v4 # Checkout the repository code
1818
1919 - name : Configure CMake
20- run : cmake -S . -B build # Configure CMake to generate build files in 'build' directory
20+ run : cmake -S . -B build # Configure CMake to generate build files in 'build' directory
2121
2222 - name : Build
2323 run : cmake --build build # Build the project using CMake
Original file line number Diff line number Diff line change @@ -3,24 +3,24 @@ name: Windows
33on :
44 push :
55 branches :
6- - master # Trigger on push
6+ - master # Trigger on push
77 pull_request :
88 branches :
9- - master # Trigger on pull
9+ - master # Trigger on pull
1010
1111jobs :
1212 build :
1313 runs-on : windows-latest # Use Windows environment for the build
1414
1515 steps :
1616 - name : Checkout code
17- uses : actions/checkout@v2 # Checkout the repository code
17+ uses : actions/checkout@v4 # Checkout the repository code
1818
1919 - name : Set up Visual Studio
20- uses : microsoft/setup-msbuild@v1.1 # Set up Visual Studio environment (MSBuild)
20+ uses : microsoft/setup-msbuild@v2 # Set up Visual Studio environment (MSBuild)
2121
2222 - name : Configure CMake
23- run : cmake -S . -B build -G "Visual Studio 17 2022" # Configure CMake for Visual Studio
23+ run : cmake -S . -B build -G "Visual Studio 17 2022" # Configure CMake for Visual Studio
2424
2525 - name : Build
2626 run : cmake --build build --config Release # Build the project using CMake with Release configuration
Original file line number Diff line number Diff line change @@ -12,11 +12,24 @@ cmake_minimum_required(VERSION 3.10)
1212# Project name and language (C or C++)
1313project (StdWorkerThread VERSION 1.0 LANGUAGES CXX )
1414
15+ # Require C++17 for std::optional and std::chrono features
16+ set (CMAKE_CXX_STANDARD 17)
17+ set (CMAKE_CXX_STANDARD_REQUIRED ON )
18+
1519# Collect all .cpp source files in the current directory
1620file (GLOB SOURCES "${CMAKE_SOURCE_DIR } /*.cpp" "${CMAKE_SOURCE_DIR } /*.h" )
1721
1822# Add an executable target
1923add_executable (StdWorkerThreadApp ${SOURCES} )
2024
25+ # Set StdWorkerThreadApp as the default startup project in Visual Studio
26+ set_property (DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR } PROPERTY VS_STARTUP_PROJECT StdWorkerThreadApp)
27+
28+ # Link pthreads on Linux for thread naming support
29+ if (UNIX )
30+ target_link_libraries (StdWorkerThreadApp PRIVATE pthread )
31+ endif ()
32+
33+
2134
2235
Load diff Large diffs are not rendered by default.
You can’t perform that action at this time.
0 commit comments