Skip to content

Commit afc2a99

Browse files
committed
updated build system
1 parent a377618 commit afc2a99

File tree

8 files changed

+65
-14
lines changed

8 files changed

+65
-14
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/.claude/
2+
/.cache/
13
/build/
24
/buildtools/bin/
35
/buildtools/downloads/

.vscode/ltex.dictionary.en-US.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ Backlinks
22
bigz
33
buildtools
44
cesiumlang
5+
CPACK
56
darkgray
67
Darkmode
78
Deallocation

CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.22)
2-
project(cesium VERSION 0.1.0 LANGUAGES CXX)
2+
project(cesium VERSION 0.1.0 LANGUAGES C CXX)
33

44
# Set C standard to C17
55
set(CMAKE_C_STANDARD 17)
@@ -56,3 +56,10 @@ set_target_properties(cesium PROPERTIES
5656

5757
# Installation rules
5858
install(TARGETS cesium RUNTIME DESTINATION bin)
59+
60+
include(CTest)
61+
enable_testing()
62+
63+
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
64+
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
65+
include(CPack)

CMakePresets.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"version": 8,
3+
"configurePresets": [
4+
{
5+
"name": "clang-21.1.0-x86_64-pc-windows-msvc",
6+
"displayName": "Clang (llvm-21.1.0, WinSDK libs) Win x64",
7+
"description": "Using WinSDK libs and compilers: C = llvm-21.1.0\\bin\\clang.exe, CXX = llvm-21.1.0\\bin\\clang++.exe",
8+
"generator": "Ninja",
9+
"binaryDir": "${sourceDir}/build",
10+
"cacheVariables": {
11+
"CMAKE_BUILD_TYPE": "Debug",
12+
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
13+
"CMAKE_C_COMPILER": "c:/cesium/cesiumlang.org/cesium-src/buildtools/llvm-21.1.0/bin/clang.exe",
14+
"CMAKE_CXX_COMPILER": "c:/cesium/cesiumlang.org/cesium-src/buildtools/llvm-21.1.0/bin/clang++.exe"
15+
}
16+
},
17+
{
18+
"name": "clang-21.1.0-x86_64-pc-windows-mingw",
19+
"inherits": "clang-21.1.0-x86_64-pc-windows-msvc",
20+
"displayName": "Clang (llvm-21.1.0, mingw libs) Win x64",
21+
"description": "Using mingw libs and compilers: C = llvm-21.1.0\\bin\\clang.exe, CXX = llvm-21.1.0\\bin\\clang++.exe",
22+
"generator": "Ninja",
23+
"binaryDir": "${sourceDir}/build",
24+
"cacheVariables": {
25+
"CMAKE_C_COMPILER_TARGET": "x86_64-w64-mingw32",
26+
"CMAKE_CXX_COMPILER_TARGET": "x86_64-w64-mingw32",
27+
"_comment_CMAKE_CXX_COMPILER_TARGET": {
28+
"value": "This forces clang++ to link with MinGW libraries and not MSVC",
29+
"type": "UNINITIALIZED"
30+
}
31+
}
32+
}
33+
]
34+
}

buildtools

cesium.code-workspace

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
},
1515
"files.exclude": {
1616
"**/node_modules/**": true,
17+
"**/.cache/**": true,
1718
},
1819
"editor.wrappingIndent": "indent",
1920
// "markdown.styles": ["custom-tag-style.css"]
@@ -33,14 +34,16 @@
3334
// "foam.files.newNotePath": "currentDir",
3435
// "foam.completion.useAlias": "whenPathDiffersFromTitle",
3536
// "foam.preview.embedNoteType": "content-inline",
36-
// "cmake.environment": {
37-
// "PATH": "${workspaceFolder}/buildtools/bin:${workspaceFolder}/buildtools/llvm-21.1.0/bin:${env:PATH}"
38-
// },
39-
// "cmake.additionalCompilerSearchDirs": [
40-
// "./buildtools/bin",
41-
// "./buildtools/llvm-21.1.0/bin",
42-
// ],
37+
"cmake.environment": {
38+
"PATH": "${workspaceFolder}/buildtools/bin;${workspaceFolder}/buildtools/llvm-21.1.0/bin;${env:PATH}"
39+
},
40+
"cmake.additionalCompilerSearchDirs": [
41+
"${workspaceFolder:cesium-src}/buildtools/bin",
42+
"${workspaceFolder:cesium-src}/buildtools/llvm-21.1.0/bin",
43+
],
4344
"cmake.cmakePath": "${workspaceFolder}/buildtools/bin/cmake-4.1.1/bin/cmake",
45+
"clangd.path": "${workspaceFolder}/buildtools/llvm-21.1.0/bin/clangd.exe",
46+
// "cmake.configureOnOpen": false,
4447
},
4548
"extensions": {
4649
// See http://go.microsoft.com/fwlink/?LinkId=827846
@@ -67,7 +70,7 @@
6770
"type": "lldb",
6871
"request": "launch",
6972
"name": "Launch",
70-
"program": "${workspaceFolder}/build/bin/cesium.exe",
73+
"program": "${workspaceFolder}/build/bin/cesium.exe", //build/clang-21.1.0-x86_64-pc-windows-msvc/bin/cesium.exe
7174
"args": [],
7275
"cwd": "${workspaceFolder}"
7376
}

readme.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,7 @@ void = main() {
3535
printf("Hello, Cesium!\n");
3636
}
3737
```
38+
39+
## Building
40+
41+
To build on Windows, you will need to install the [Windows SDK](https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/). The current default builds use Clang, which can be installed via the script in [buildtools](https://github.com/cesiumlang/cesium-buildtools).

src/main.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#include <cstdio>
1+
#include <iostream>
22

3-
int main(int argc, char** argv) {
4-
printf("Hello, World!\n");
5-
return 0;
3+
int main(int argc, char** argv){
4+
std::cout << "Hello, from cesium!\n";
5+
return 0;
66
}

0 commit comments

Comments
 (0)