Skip to content

Commit 8d8dc04

Browse files
committed
Added CMake sandbox to test C runtime buildability
1 parent e4e3ed4 commit 8d8dc04

3 files changed

Lines changed: 23 additions & 0 deletions

File tree

Laboratory/C/cmake/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.vs
2+
build
3+
*.bak
4+
*.lnk

Laboratory/C/cmake/CMakeLists.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
cmake_minimum_required (VERSION 3.20)
2+
set(RUNTIME_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../Runtime/C/src")
3+
project(sandbox LANGUAGES C)
4+
set(CMAKE_C_STANDARD 11)
5+
set(CMAKE_C_STANDARD_REQUIRED ON)
6+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /experimental:c11atomics")
7+
add_executable(sandbox
8+
sandbox.c
9+
${RUNTIME_SOURCE_DIR}/bebop.h
10+
${RUNTIME_SOURCE_DIR}/bebop.c
11+
)
12+
target_include_directories(sandbox PRIVATE ${RUNTIME_SOURCE_DIR})
13+
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT sandbox)

Laboratory/C/cmake/sandbox.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#include "bebop.h"
2+
3+
int main()
4+
{
5+
return 0;
6+
}

0 commit comments

Comments
 (0)