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

fix!: remove /FI (#22) and revert some changes in #19 #23

Merged
merged 4 commits into from
Sep 9, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
1 change: 0 additions & 1 deletion CommonLibSF/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ if (MSVC)
/wd5053 # support for 'explicit(<expr>)' in C++17 and earlier is a vendor extension
/wd5204 # 'type-name': class has virtual functions, but its trivial destructor is not virtual; instances of objects derived from this class may not be destructed correctly
/wd5220 # 'member': a non-static data member with a volatile qualified type no longer implies that compiler generated copy / move constructors and copy / move assignment operators are not trivial
/FI${CMAKE_CURRENT_SOURCE_DIR}/include/SFSE/Impl/PCH.h
)
endif()

Expand Down
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,
gottyduke marked this conversation as resolved.
Show resolved Hide resolved
"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"
}
]
}
}
2 changes: 1 addition & 1 deletion CommonLibSF/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
"name": "commonlibsf",
"version-date": "2023-09-08",
"version-date": "2023-09-09",
"port-version": 0,
"description": "A collaborative reverse-engineered library for Starfield.",
"homepage": "https://github.com/Starfield-Reverse-Engineering/CommonLibSF",
Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![C++23](https://img.shields.io/static/v1?label=standard&message=c%2B%2B23&color=blue&logo=c%2B%2B&&logoColor=red&style=flat)](https://en.cppreference.com/w/cpp/compiler_support)
![Platform](https://img.shields.io/static/v1?label=platform&message=windows&color=dimgray&style=flat&logo=windows)
[![Game version](https://img.shields.io/badge/game%20version-1.7.23-orange)](#Developing-with-CommonLibSF)
[![VCPKG_VER](https://img.shields.io/static/v1?label=vcpkg%20registry&message=2023-09-08&color=green&style=flat)](https://github.com/Starfield-Reverse-Engineering/Starfield-RE-vcpkg)
[![VCPKG_VER](https://img.shields.io/static/v1?label=vcpkg%20registry&message=2023-09-09&color=green&style=flat)](https://github.com/Starfield-Reverse-Engineering/Starfield-RE-vcpkg)
[![Main CI](https://img.shields.io/github/actions/workflow/status/Starfield-Reverse-Engineering/CommonLibSF/main_ci.yml)](https://github.com/Starfield-Reverse-Engineering/CommonLibSF/actions/workflows/main_ci.yml)

## Build Dependencies
Expand All @@ -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