Skip to content

Commit 060c66a

Browse files
committed
chore: add build output policy and disable coro routes temporarily
- Add .cursor/rules/build-outputs.mdc to enforce .temp/ directory for all build artifacts - Disable coroutine route handlers in example server with #if 0 (was #ifdef BOOST_BEAST2_HAS_CORO)
1 parent 465a732 commit 060c66a

2 files changed

Lines changed: 52 additions & 2 deletions

File tree

.cursor/rules/build-outputs.mdc

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
description: Build outputs must go in .temp directory
3+
globs:
4+
alwaysApply: true
5+
---
6+
7+
# Build Output Directory Policy
8+
9+
**All build artifacts, intermediate files, and temporary outputs MUST go in the `.temp/` directory.**
10+
11+
## Required Directory Structure
12+
13+
- `.temp/build-msvc/` - MSVC/Visual Studio builds
14+
- `.temp/build-gcc/` - GCC builds (via MSYS2)
15+
- `.temp/build-clang/` - Clang builds
16+
- `.temp/build-ninja/` - Ninja builds
17+
- `.temp/` - Any other temporary or generated files
18+
19+
## Rules
20+
21+
1. **Never create executables, object files, or build artifacts in source directories**
22+
2. **Never commit anything from `.temp/`** - it is in `.gitignore`
23+
3. When configuring CMake, always use `-B .temp/build-<compiler>`
24+
4. When running direct compiler commands, output to `.temp/build-<compiler>/`
25+
26+
## Example Commands
27+
28+
### CMake (MSVC)
29+
```powershell
30+
cmake -B .temp/build-msvc -G "Visual Studio 18 2026" -A x64
31+
cmake --build .temp/build-msvc --config Release
32+
```
33+
34+
### CMake (GCC via MSYS2)
35+
```bash
36+
cmake -B .temp/build-gcc -G "Unix Makefiles"
37+
cmake --build .temp/build-gcc
38+
```
39+
40+
### Direct GCC compilation
41+
```bash
42+
mkdir -p .temp/build-gcc
43+
g++ -std=c++20 -O3 src/main.cpp -o .temp/build-gcc/main.exe
44+
```
45+
46+
### Direct MSVC compilation
47+
```powershell
48+
New-Item -ItemType Directory -Force -Path .temp/build-msvc
49+
cl /std:c++20 /O2 src/main.cpp /Fe:.temp/build-msvc/main.exe
50+
```

example/server/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ struct do_json_rpc
124124

125125
};
126126

127-
#ifdef BOOST_BEAST2_HAS_CORO
127+
#if 0
128128
auto
129129
my_coro(
130130
http::route_params& rp) ->
@@ -193,7 +193,7 @@ int server_main( int argc, char* argv[] )
193193
http::cors(opts),
194194
do_json_rpc()
195195
);
196-
#ifdef BOOST_BEAST2_HAS_CORO
196+
#if 0
197197
srv.wwwroot.use(
198198
"/spawn",
199199
http::co_route(my_coro));

0 commit comments

Comments
 (0)