Skip to content

Commit

Permalink
fix: revert and fix some changes in (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
gottyduke committed Sep 9, 2023
1 parent a0e9bb5 commit 3ee4ce6
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 43 deletions.
90 changes: 54 additions & 36 deletions CommonLibSF/CMakePresets.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": 6,
"version": 3,
"cmakeMinimumRequired": {
"major": 3,
"minor": 26,
Expand All @@ -10,7 +10,6 @@
"name": "common",
"hidden": true,
"cacheVariables": {
"CMAKE_MSVC_RUNTIME_LIBRARY": "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL",
"CMAKE_CXX_FLAGS": "$env{PROJECT_PLATFORM_FLAGS} $env{PROJECT_TEXT_FLAGS} $env{PROJECT_COMPILER_FLAGS} $penv{CXXFLAGS}"
},
"vendor": {
Expand All @@ -25,47 +24,35 @@
"name": "packaging-vcpkg",
"hidden": true,
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
"CMAKE_TOOLCHAIN_FILE": {
"type": "STRING",
"value": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
},
"VCPKG_TARGET_TRIPLET": "x64-windows-static-md"
}
},
{
"name": "buildtype-debug-clang",
"name": "buildtype-debug",
"hidden": true,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "buildtype-release-clang",
"name": "buildtype-release",
"hidden": true,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "buildtype-debug-msvc",
"hidden": true,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_CXX_FLAGS_DEBUG": "/Od /MDd",
"CMAKE_SHARED_LINKER_FLAGS_DEBUG": "/DEBUG:FULL /LTCG:INCREMENTAL /DEBUGTYPE:FIXUP"
}
},
{
"name": "buildtype-release-msvc",
"name": "x64",
"hidden": true,
"architecture": "x64",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_CXX_FLAGS_RELEASE": "/fp:fast /GL /GR- /Gw /O2 /Ob3 /Qpar",
"CMAKE_SHARED_LINKER_FLAGS_RELEASE": "/OPT:REF,ICF=4"
"CMAKE_MSVC_RUNTIME_LIBRARY": "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL"
}
},
{
"name": "x64",
"hidden": true,
"architecture": "x64"
},
{
"name": "generator-msvc",
"hidden": true,
Expand All @@ -81,9 +68,8 @@
"name": "compiler-msvc",
"hidden": true,
"environment": {
"PROJECT_COMPILER": "msvc",
"PROJECT_COMPILER_FLAGS": "/cgthreads8 /diagnostics:caret /EHsc /fp:contract /fp:except- /guard:cf- /MP /permissive- /sdl /W4 /Zc:__cplusplus /Zc:enumTypes /Zc:lambda /Zc:preprocessor /Zc:referenceBinding /Zc:rvalueCast /Zc:templateScope /Zc:ternary /bigobj",
"CMAKE_SHARED_LINKER_FLAGS": "/CGTHREADS:8 /MACHINE:x64 /LTCG:INCREMENTAL"
"PROJECT_COMPILER_FLAGS": "/cgthreads8 /diagnostics:caret /fp:contract /fp:except- /guard:cf- /permissive- /Zc:__cplusplus /Zc:enumTypes /Zc:lambda /Zc:preprocessor /Zc:referenceBinding /Zc:rvalueCast /Zc:templateScope /Zc:ternary /Zc:preprocessor /EHsc /MP /W4 /WX /external:anglebrackets /external:W0",
"PROJECT_COMPILER": "msvc"
}
},
{
Expand Down Expand Up @@ -122,7 +108,7 @@
"inherits": [
"common",
"packaging-vcpkg",
"buildtype-debug-msvc",
"buildtype-debug",
"generator-msvc",
"compiler-msvc"
]
Expand All @@ -132,27 +118,38 @@
"inherits": [
"common",
"packaging-vcpkg",
"buildtype-debug-msvc",
"buildtype-debug",
"generator-ninja",
"compiler-msvc"
]
},
{
"name": "build-debug-clang-cl-ninja",
"name": "build-debug-clang-cl-msvc",
"toolset": "ClangCL",
"inherits": [
"common",
"packaging-vcpkg",
"buildtype-debug-clang",
"buildtype-debug",
"generator-msvc",
"compiler-clang-cl"
]
},
{
"name": "build-debug-clang-cl-ninja",
"inherits": [
"common",
"packaging-vcpkg",
"buildtype-debug",
"generator-ninja",
"compiler-clang-cl"
]
},
{
"name": "build-release-msvc-msvc",
"inherits": [
"common",
"packaging-vcpkg",
"buildtype-release-msvc",
"buildtype-release",
"generator-msvc",
"compiler-msvc"
]
Expand All @@ -162,17 +159,28 @@
"inherits": [
"common",
"packaging-vcpkg",
"buildtype-release-msvc",
"buildtype-release",
"generator-ninja",
"compiler-msvc"
]
},
{
"name": "build-release-clang-cl-msvc",
"toolset": "ClangCL",
"inherits": [
"common",
"packaging-vcpkg",
"buildtype-release",
"generator-msvc",
"compiler-clang-cl"
]
},
{
"name": "build-release-clang-cl-ninja",
"inherits": [
"common",
"packaging-vcpkg",
"buildtype-release-clang",
"buildtype-release",
"generator-ninja",
"compiler-clang-cl"
]
Expand Down Expand Up @@ -200,14 +208,24 @@
"displayName": "4. (Release) MSVC - MSVC"
},
{
"name": "debug-clang-cl",
"name": "debug-clang-cl-ninja",
"configurePreset": "build-debug-clang-cl-ninja",
"displayName": "5. (Debug) Clang - Ninja"
},
{
"name": "release-clang-cl",
"name": "release-clang-cl-ninja",
"configurePreset": "build-release-clang-cl-ninja",
"displayName": "6. (Release) Clang - Ninja"
},
{
"name": "debug-clang-cl-msvc",
"configurePreset": "build-debug-clang-cl-msvc",
"displayName": "7. (Debug) Clang - MSVC"
},
{
"name": "release-clang-cl-msvc",
"configurePreset": "build-release-clang-cl-msvc",
"displayName": "8. (Release) Clang - MSVC"
}
]
}
}
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

[See how to use CommonLibSF with vcpkg in your project.](https://github.com/Starfield-Reverse-Engineering/Starfield-RE-vcpkg)

---

#### git submodule

`cd` into your project directory and run:
Expand All @@ -39,9 +41,11 @@ Then add the following to your `CMakeLists.txt`:

```cmake
add_subdirectory(extern/CommonLibSF)
target_link_libraries(${PROJECT_NAME}
PRIVATE
CommonLibSF::CommonLibSF)
target_link_libraries(
${PROJECT_NAME}
PRIVATE
CommonLibSF::CommonLibSF
)
```

## End-User Dependencies
Expand Down
2 changes: 1 addition & 1 deletion build-clang-cl.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
echo off
rd /s /q "build"
cmake -B "%cd%/build" -S "%cd%/CommonLibSF" --preset=build-release-clang-cl
cmake -B "%cd%/build" -S "%cd%/CommonLibSF" --preset=build-release-clang-cl-ninja
cmake --build "%cd%/build" --config Release
2 changes: 1 addition & 1 deletion build-msvc.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
echo off
rd /s /q "build"
cmake -B "%cd%/build" -S "%cd%/CommonLibSF" --preset=build-release-msvc
cmake -B "%cd%/build" -S "%cd%/CommonLibSF" --preset=build-release-msvc-ninja
cmake --build "%cd%/build" --config Release
2 changes: 1 addition & 1 deletion make-sln-clang-cl.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
echo off
rd /s /q "build"
cmake -B "%cd%/build" -S "%cd%/CommonLibSF" --preset=solution-clang-cl
cmake -B "%cd%/build" -S "%cd%/CommonLibSF" --preset=build-debug-clang-cl-msvc
2 changes: 1 addition & 1 deletion make-sln-msvc.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
echo off
rd /s /q "build"
cmake -B "%cd%/build" -S "%cd%/CommonLibSF" --preset=solution-msvc
cmake -B "%cd%/build" -S "%cd%/CommonLibSF" --preset=build-debug-msvc-msvc

0 comments on commit 3ee4ce6

Please sign in to comment.