Skip to content

Commit

Permalink
Build: move to CMake instead of VS/Xcode/make project files
Browse files Browse the repository at this point in the history
  • Loading branch information
aras-p committed Sep 23, 2024
1 parent 4b52c16 commit e552532
Show file tree
Hide file tree
Showing 11 changed files with 96 additions and 867 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ xcuserdata
*.vcxproj.user
projects/visualstudio2015/build
*-got.spirv
/out/
28 changes: 28 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
cmake_minimum_required (VERSION 3.8)

project ("smol-v-test")

add_executable (smol-v-test)
target_compile_definitions(smol-v-test PRIVATE _CRT_SECURE_NO_WARNINGS)
target_sources(smol-v-test PRIVATE
source/smolv.cpp
source/smolv.h
testing/testmain.cpp
testing/external/glslang/SPIRV/doc.cpp
testing/external/glslang/SPIRV/SPVRemapper.cpp
testing/external/lz4/lz4.c
testing/external/lz4/lz4hc.c
testing/external/miniz/miniz.c
testing/external/zstd/common/entropy_common.c
testing/external/zstd/common/fse_decompress.c
testing/external/zstd/common/xxhash.c
testing/external/zstd/common/zstd_common.c
testing/external/zstd/compress/fse_compress.c
testing/external/zstd/compress/huf_compress.c
testing/external/zstd/compress/zbuff_compress.c
testing/external/zstd/compress/zstd_compress.c
)
target_include_directories(smol-v-test PRIVATE
testing/external/zstd
testing/external/zstd/common
)
50 changes: 50 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"version": 3,
"configurePresets": [
{
"name": "windows-base",
"hidden": true,
"generator": "Ninja",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"installDir": "${sourceDir}/out/install/${presetName}",
"cacheVariables": {
"CMAKE_C_COMPILER": "cl.exe",
"CMAKE_CXX_COMPILER": "cl.exe"
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
},
{
"name": "x64-debug",
"displayName": "x64 Debug",
"inherits": "windows-base",
"architecture": {
"value": "x64",
"strategy": "external"
},
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "x64-release",
"displayName": "x64 Release",
"inherits": "x64-debug",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
}
},
{
"name": "x64-release-clang",
"displayName": "x64 Release Clang",
"inherits": "x64-release",
"cacheVariables": {
"CMAKE_C_COMPILER": "clang-cl",
"CMAKE_CXX_COMPILER": "clang-cl"
}
}
]
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ used for SMOL-V testing". Details on them:

## Results

As of 2020 May 25 29, results on 372 shaders (under `tests/spirv-dumps`) are:
As of 2024 Sep 23, results on 372 shaders (under `tests/spirv-dumps`) are:

```
Compressed with <none>:
Expand Down Expand Up @@ -116,7 +116,7 @@ Remapper 599.1KB 11.5%
SmolV 419.7KB 8.1%
```

Decoding these 372 shaders from SMOL-V back into SPIR-V takes 10.2ms (VS2017, x64 Release, AMD ThreadRipper 1950X 3.4GHz, one thread).
Decoding these 372 shaders from SMOL-V back into SPIR-V takes 9.0ms (VS2022, x64 Release, AMD Ryzen 5950X, one thread).

* "Raw" is just raw SPIR-V, with no extra processing.
* "Remapper" is spirv-remap from glslang, with debug info stripping.
Expand Down
15 changes: 15 additions & 0 deletions launch.vs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"version": "0.2.1",
"defaults": {},
"configurations": [
{
"type": "default",
"project": "CMakeLists.txt",
"projectTarget": "smol-v-test.exe",
"name": "smol-v-test.exe",
"currentDir": "${workspaceRoot}",
"args": [
]
}
]
}
41 changes: 0 additions & 41 deletions projects/Makefile

This file was deleted.

Loading

0 comments on commit e552532

Please sign in to comment.