diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2025-05-31 06:34:48 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2025-05-31 06:34:48 +1000 |
commit | d9481850f365b4fe0424d299480d3cb114b1c446 (patch) | |
tree | 826680e32713b6c21c6589b780ac7b7138e7e133 /source | |
parent | c8aea48d84a1da84759a6a15b95212ca43082581 (diff) |
default to GCC on Linux for now, move to optional Clang build action
Diffstat (limited to 'source')
-rw-r--r-- | source/CMakePresets.json | 18 | ||||
-rw-r--r-- | source/core/StarColor.cpp | 4 |
2 files changed, 20 insertions, 2 deletions
diff --git a/source/CMakePresets.json b/source/CMakePresets.json index defd840..d8ec968 100644 --- a/source/CMakePresets.json +++ b/source/CMakePresets.json @@ -53,8 +53,6 @@ "binaryDir": "${sourceParentDir}/build/linux-release", "cacheVariables": { "CMAKE_BUILD_TYPE": "RelWithDebInfo", - "CMAKE_C_COMPILER": "clang", - "CMAKE_CXX_COMPILER": "clang++", "VCPKG_TARGET_TRIPLET": "x64-linux-mixed", "CMAKE_INCLUDE_PATH": "${sourceParentDir}/lib/linux/include", "CMAKE_LIBRARY_PATH": "${sourceParentDir}/lib/linux", @@ -68,6 +66,18 @@ } }, { + "inherits": "linux-release", + "name": "linux-release-clang", + "displayName": "Linux Clang x64", + "binaryDir": "${sourceParentDir}/build/linux-release-clang", + "cacheVariables": { + "CMAKE_C_COMPILER": "clang", + "CMAKE_CXX_COMPILER": "clang++", + "VCPKG_TARGET_TRIPLET": "x64-linux-mixed-clang", + "STAR_USE_JEMALLOC": true + } + }, + { "inherits": "base", "name": "macos-release", "displayName": "macOS x64", @@ -122,6 +132,10 @@ "configurePreset": "linux-release" }, { + "name": "linux-release-clang", + "configurePreset": "linux-release-clang" + }, + { "name": "macos-release", "configurePreset": "macos-release" }, diff --git a/source/core/StarColor.cpp b/source/core/StarColor.cpp index 4eb726c..cab4b4f 100644 --- a/source/core/StarColor.cpp +++ b/source/core/StarColor.cpp @@ -322,8 +322,10 @@ Vec3F Color::toRgbF() const { return Vec3F(redF(), greenF(), blueF()); } +#ifdef __GNUC__ #pragma GCC push_options #pragma GCC optimize("-fno-fast-math") +#endif Vec4F Color::toHsva() const { float h, s, v; @@ -367,7 +369,9 @@ Vec4F Color::toHsva() const { return Vec4F(h, s, v, alphaF()); } +#ifdef __GNUC__ #pragma GCC pop_options +#endif String Color::toHex() const { auto rgba = toRgba(); |