Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CMake Presets #1209

Merged
merged 10 commits into from
Oct 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@ jobs:
env:
CXXFLAGS: -O2
run: |
mkdir build
cd build
cmake -DBOOST_ROOT=/usr -DQL_ENABLE_SESSIONS=ON -DQL_ENABLE_THREAD_SAFE_OBSERVER_PATTERN=ON -DQL_HIGH_RESOLUTION_DATE=ON -DQL_USE_INDEXED_COUPON=ON -DQL_USE_STD_CLASSES=ON -DCMAKE_CXX_STANDARD=17 ..
make -j 2
cmake --preset linux-ci-build-with-nonstandard-options
cmake --build --preset linux-ci-build-with-nonstandard-options -j2
- name: Test
run: |
cd build
Expand Down Expand Up @@ -75,10 +73,8 @@ jobs:
env:
BOOST_ROOT: C:\local\boost-1.75.0
run: |
mkdir build
cd build
cmake -DQL_ENABLE_SESSIONS=ON -DQL_ENABLE_THREAD_SAFE_OBSERVER_PATTERN=ON -DQL_HIGH_RESOLUTION_DATE=ON -DQL_USE_INDEXED_COUPON=ON -DQL_USE_STD_CLASSES=ON -DCMAKE_CXX_STANDARD=17 ..
cmake --build . --config Release
cmake --preset windows-ci-build-with-nonstandard-options
cmake --build --preset windows-ci-build-with-nonstandard-options
- name: Test
run: |
cd build
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ quantlib.elc
quantlib.pc
QuantLib.spec
CMakeCache.txt
CMakeUserPresets.txt
Docs/.time-stamp
Docs/.time-stamp-html
Docs/.time-stamp-online
Expand Down
164 changes: 164 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
{
"version": 2,
"configurePresets": [
{
"name": "linux-clang-debug",
"binaryDir": "${sourceDir}/build",
"generator": "Unix Makefiles",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_CXX_COMPILER": "clang++"
}
},
{
"name": "linux-clang-release",
"binaryDir": "${sourceDir}/build",
"generator": "Unix Makefiles",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_CXX_COMPILER": "clang++"
}
},
{
"name": "linux-gcc-debug",
"binaryDir": "${sourceDir}/build",
"generator": "Unix Makefiles",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_CXX_COMPILER": "g++"
}
},
{
"name": "linux-gcc-release",
"binaryDir": "${sourceDir}/build",
"generator": "Unix Makefiles",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_CXX_COMPILER": "g++"
}
},
{
"name": "windows-clang-x64",
"binaryDir": "${sourceDir}/build",
"generator": "Visual Studio 16 2019",
"toolset": "ClangCL",
"architecture": {
"value": "x64",
"strategy": "external"
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": {
"intelliSenseMode": "windows-clang-x64",
"hostOS": [
"Windows"
]
}
}
},
{
"name": "windows-msvc-x64",
"binaryDir": "${sourceDir}/build",
"generator": "Visual Studio 16 2019",
"architecture": {
"value": "x64",
"strategy": "external"
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": {
"intelliSenseMode": "windows-msvc-x64",
"hostOS": [
"Windows"
]
}
}
},
{
"name": "linux-ci-build-with-nonstandard-options",
"binaryDir": "${sourceDir}/build",
"generator": "Unix Makefiles",
"cacheVariables": {
"BOOST_ROOT": "/usr",
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_CXX_COMPILER": "g++",
"CMAKE_CXX_STANDARD": "17",
"QL_ENABLE_SESSIONS": "ON",
"QL_ENABLE_THREAD_SAFE_OBSERVER_PATTERN": "ON",
"QL_HIGH_RESOLUTION_DATE": "ON",
"QL_USE_INDEXED_COUPON": "ON",
"QL_USE_STD_CLASSES": "ON"
}
},
{
"name": "windows-ci-build-with-nonstandard-options",
"binaryDir": "${sourceDir}/build",
"generator": "Visual Studio 16 2019",
"architecture": {
"value": "x64",
"strategy": "external"
},
"cacheVariables": {
"CMAKE_CXX_STANDARD": "17",
"QL_ENABLE_SESSIONS": "ON",
"QL_ENABLE_THREAD_SAFE_OBSERVER_PATTERN": "ON",
"QL_HIGH_RESOLUTION_DATE": "ON",
"QL_USE_INDEXED_COUPON": "ON",
"QL_USE_STD_CLASSES": "ON"
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": {
"intelliSenseMode": "windows-msvc-x64",
"hostOS": [
"Windows"
]
}
}
}
],
"buildPresets": [
{
"name": "linux-clang-debug",
"configurePreset": "linux-clang-debug"
},
{
"name": "linux-clang-release",
"configurePreset": "linux-clang-release"
},
{
"name": "linux-gcc-debug",
"configurePreset": "linux-gcc-debug"
},
{
"name": "linux-gcc-release",
"configurePreset": "linux-gcc-release"
},
{
"name": "windows-clang-x64-debug",
"configurePreset": "windows-clang-x64",
"configuration": "Debug"
},
{
"name": "windows-clang-x64-release",
"configurePreset": "windows-clang-x64",
"configuration": "Release"
},
{
"name": "windows-msvc-x64-debug",
"configurePreset": "windows-msvc-x64",
"configuration": "Debug"
},
{
"name": "windows-msvc-x64-release",
"configurePreset": "windows-msvc-x64",
"configuration": "Release"
},
{
"name": "linux-ci-build-with-nonstandard-options",
"configurePreset": "linux-ci-build-with-nonstandard-options"
},
{
"name": "windows-ci-build-with-nonstandard-options",
"configurePreset": "windows-ci-build-with-nonstandard-options",
"configuration": "Release"
}
]
}