Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
dc965fe
Fix int to bool compare warning
Rainyan Nov 25, 2025
29e7f97
Fix narrowing conversions
Rainyan Dec 3, 2025
7f95d88
Fix unused variables
Rainyan Dec 3, 2025
8560447
Fix use of incorrect assert format macro
Rainyan Dec 3, 2025
03383c0
Remove min/max macros
Rainyan Dec 3, 2025
475cd38
Fix MSVC false positive warning
Rainyan Dec 3, 2025
b989af6
Fix missing includes
Rainyan Dec 3, 2025
6774ea8
Fix CMake MSVC EH flags
Rainyan Dec 3, 2025
4ceb060
Fix usage of str literal without args
Rainyan Dec 3, 2025
67a23fa
Fix stray token after endif
Rainyan Dec 3, 2025
f8fbb63
suppress -Wstringop-truncation from SDK base func
Rainyan Dec 3, 2025
99666bf
Fix buffer underflow for 0 len inputs
Rainyan Dec 4, 2025
b20f046
Fix CMake warning for C code
Rainyan Dec 4, 2025
ceebca5
Remove redundant casts
Rainyan Dec 13, 2025
a0bf2cf
Remove unused helper macro
Rainyan Dec 13, 2025
a40ae2b
appease gcc
Rainyan Dec 13, 2025
3b4b3fb
fix ub
Rainyan Dec 13, 2025
4731168
-Wmaybe-uninitialized
Rainyan Dec 13, 2025
42fd10a
fix array index overflow
Rainyan Dec 13, 2025
9da156a
Exclude compiler opts unused by MSVC
Rainyan Dec 13, 2025
cdf4e10
Fix MSVC compiler options warning
Rainyan Dec 13, 2025
cab53b0
Simplify MSVC optimization flags
Rainyan Dec 13, 2025
092d115
Set initial default branch name
Rainyan Dec 13, 2025
423c184
Remove redundant ninja install
Rainyan Dec 13, 2025
d3406b8
Error on missing files for upload-artifact action
Rainyan Dec 13, 2025
3a3583c
Fix comment url
Rainyan Dec 13, 2025
d0b81ad
Cleanup unused variable
Rainyan Dec 13, 2025
b399c7d
Treat warnings as errors
Rainyan Dec 13, 2025
e223b0a
Add "nwae" option
Rainyan Dec 14, 2025
ef761bf
Update documentation
Rainyan Dec 14, 2025
540aa50
Unsuppress -Waddress and -Wstrict-aliasing
Rainyan Dec 14, 2025
cb021b6
Fix incorrect logic in IsKeypad
Rainyan Dec 14, 2025
da64760
Fix overflow check
Rainyan Dec 14, 2025
e8cc354
Fix Clang 14 warning
Rainyan Dec 14, 2025
3e7486f
Fix warnings compatibility with Clang
Rainyan Dec 14, 2025
0dfbb53
Fix strict aliasing rule violations
Rainyan Dec 15, 2025
595750f
[[maybe_unused]] on members only used for Clang
Rainyan Dec 15, 2025
4286b63
Fix ambiguous whitespace
Rainyan Dec 16, 2025
05793b8
Fix Clang ambiguous GCC/MSVC preprocessor defines
Rainyan Dec 16, 2025
6bb9d46
Fix warning: unused-private-field
Rainyan Dec 16, 2025
69b9cb4
Fix redundant assignment warning
Rainyan Dec 17, 2025
eb4ff8f
Fix EHANDLE operator== ambiguity
Rainyan Dec 17, 2025
6a152d0
Fix nullptr indirection
Rainyan Dec 17, 2025
85162c2
Suppress thisptr null check warning
Rainyan Dec 17, 2025
7961779
wip: undefined-bool-conversion
Rainyan Dec 17, 2025
c412352
Qualify crash trap as volatile
Rainyan Dec 17, 2025
fc95641
Fix operator precedence bug
Rainyan Dec 17, 2025
90695af
Fix tautological ptr compare
Rainyan Dec 17, 2025
85d0d8a
Fix incorrect arguments for BuildWorldRenderLists
Rainyan Dec 17, 2025
ec4a072
Refactor neo_root_serverbrowser
Rainyan Dec 27, 2025
be4a179
Qualify ->~T for nonvirtual CUtlVector<T> cleanup
Rainyan Dec 17, 2025
91efd1a
fixup: qualify nonvirtual dtor calls
Rainyan Dec 17, 2025
ae8523a
Fix operator typo
Rainyan Dec 17, 2025
c2d1434
Fix incorrect input args
Rainyan Dec 17, 2025
61917e6
Fix implicit-const-int-float-conversion
Rainyan Dec 17, 2025
eef1b7b
Fix: tautological-undefined-compare
Rainyan Dec 17, 2025
b24088a
Fix ambiguous operator==
Rainyan Dec 17, 2025
48dd343
Fix warning about implicit float->bool conversion
Rainyan Dec 17, 2025
7a0692a
Fix bug with incorrect color rgba input args type
Rainyan Dec 17, 2025
6c5c38d
Fix operator bug with bitflag check
Rainyan Dec 17, 2025
386e837
Fix bad ptr compare
Rainyan Dec 17, 2025
066fafd
fix self-assign warning
Rainyan Dec 17, 2025
8e37a74
wip: incorrect color rgba input args
Rainyan Dec 17, 2025
5449dc9
Fix bad float->int conversion
Rainyan Dec 17, 2025
d16cdfc
Clean redundant lambda capture
Rainyan Dec 17, 2025
d6c776b
Fix operator precedence
Rainyan Dec 17, 2025
64db0bd
Suppress VMT overwrite warning
Rainyan Dec 17, 2025
7c0a003
Fix literal to nullptr comparison warning
Rainyan Dec 20, 2025
e7b800f
Fix linker error
Rainyan Dec 18, 2025
63de850
Use crash intrinsics
Rainyan Dec 20, 2025
9066f36
Clang 19 warning suppression compat
Rainyan Dec 20, 2025
240c29d
Check for nullptr from GetPlayerNetInfo
Rainyan Dec 20, 2025
81feaf9
Fix threadtools regression
Rainyan Dec 20, 2025
3f56c38
Don't memset nontrivially copyable types
Rainyan Dec 24, 2025
523ab7c
Use std::swap for V_swap
Rainyan Dec 24, 2025
c719b42
Avoid dangling pointer from reference
Rainyan Dec 23, 2025
25d3f04
Fix backslash-newline at end of file
Rainyan Dec 24, 2025
63bb5cb
suppress array index warning
Rainyan Dec 24, 2025
234916f
Fix uninitialized struct bug
Rainyan Dec 24, 2025
bdf84c6
wip: array mismatched bound
Rainyan Dec 24, 2025
33ab096
non-const ref can't bind to bit-field
Rainyan Dec 24, 2025
de017f6
Fix unused member vars
Rainyan Dec 25, 2025
6a65090
Check getcwd return value for errors
Rainyan Dec 25, 2025
917b7ab
Check system call retvals for errors
Rainyan Dec 25, 2025
0b38f5a
Fix SHA1 algorithm compile
Rainyan Dec 25, 2025
f92bce7
Windows runner image from latest -> 2025
Rainyan Dec 26, 2025
78a88f0
wip: gcc steamrt3 stringop-truncation
Rainyan Dec 26, 2025
8890b97
Add tests for bit_cast
Rainyan Dec 26, 2025
4d0ed08
Fix CMakeLists compiler options for steamrt3 Clang 11
Rainyan Dec 27, 2025
be611d9
Cleanup bit_cast
Rainyan Dec 27, 2025
908c7c6
Cleanup
Rainyan Dec 27, 2025
7219451
Improve memory pun debug
Rainyan Dec 28, 2025
924756b
Fix type pun size ambiguity
Rainyan Dec 28, 2025
5519f55
Fix nontrivial SIMD copy
Rainyan Dec 28, 2025
22f8982
wip: fix nontrivial check typo
Rainyan Dec 28, 2025
996d40e
Fix nontrivial constructor memcpy
Rainyan Dec 28, 2025
74708a5
wip
Rainyan Dec 28, 2025
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
26 changes: 17 additions & 9 deletions .github/workflows/cibuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ jobs:
image: 'registry.gitlab.steamos.cloud/steamrt/sniper/sdk:latest'

steps:
# Silence a git warning emitted from actions/checkout.
# For context: https://git-scm.com/docs/git-init#Documentation/git-init.txt---initial-branchbranch-name
- name: Set initial default branch name
run: git config --global init.defaultBranch master

- uses: actions/checkout@v4
with:
fetch-depth: 0
Expand Down Expand Up @@ -111,31 +116,36 @@ jobs:
with:
name: ${{ env.libraries }}
path: ${{ env.install_dir }}/${{ env.libraries }}
if-no-files-found: error

- name: Upload libraries debug information
uses: actions/upload-artifact@v4
with:
name: ${{ env.libraries_debuginfo }}
path: ${{ env.install_dir }}/${{ env.libraries_debuginfo }}
if-no-files-found: error

- name: Upload dedicated library
uses: actions/upload-artifact@v4
with:
name: ${{ env.dedicated }}
path: ${{ env.install_dir }}/${{ env.dedicated }}
if-no-files-found: error

- name: Upload dedicated library debug information
uses: actions/upload-artifact@v4
with:
name: ${{ env.dedicated_debuginfo }}
path: ${{ env.install_dir }}/${{ env.dedicated_debuginfo }}
if-no-files-found: error

- name: Upload SourceMod gamedata
if: ${{ matrix.preset_build_type.name == 'release' }}
uses: actions/upload-artifact@v4
with:
name: ${{ env.gamedata }}
path: ${{ env.install_dir }}/${{ env.gamedata }}
if-no-files-found: error

windows-build:
name: ${{ matrix.platform.display_name }} ${{ matrix.preset_build_type.display_name }}
Expand All @@ -151,7 +161,7 @@ jobs:

matrix:
platform:
- { display_name: 'Windows Native Libraries', os: windows-latest, preset_os: windows }
- { display_name: 'Windows Native Libraries', os: windows-2025, preset_os: windows }

preset_build_type:
- { display_name: 'Debug', name: debug }
Expand All @@ -174,10 +184,6 @@ jobs:
echo "install_dir=$install_dir" >> "$GITHUB_ENV"
echo "preset_name=$preset_name" >> "$GITHUB_ENV"


- name: Install packages
run: choco install -y ninja

- uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
Expand Down Expand Up @@ -244,29 +250,33 @@ jobs:
with:
name: ${{ env.libraries }}
path: ${{ env.install_dir }}/${{ env.libraries }}
if-no-files-found: error

- name: Upload libraries debug information
uses: actions/upload-artifact@v4
with:
name: ${{ env.libraries_debuginfo }}
path: ${{ env.install_dir }}/${{ env.libraries_debuginfo }}
if-no-files-found: error

- name: Upload dedicated library
uses: actions/upload-artifact@v4
with:
name: ${{ env.dedicated }}
path: ${{ env.install_dir }}/${{ env.dedicated }}
if-no-files-found: error

- name: Upload dedicated library debug information
uses: actions/upload-artifact@v4
with:
name: ${{ env.dedicated_debuginfo }}
path: ${{ env.install_dir }}/${{ env.dedicated_debuginfo }}
if-no-files-found: error

pack-resources:
name: Windows Native Resources

runs-on: windows-latest
runs-on: windows-2025

defaults:
run:
Expand All @@ -290,9 +300,6 @@ jobs:
- name: Git fetch tags
run: git fetch origin --tags --force

- name: Install packages
run: choco install -y ninja

- uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
Expand Down Expand Up @@ -322,6 +329,7 @@ jobs:
with:
name: ${{ env.resources }}
path: ${{ env.install_dir }}/${{ env.resources }}
if-no-files-found: error

upload-latest-build:
name: Upload Latest Build
Expand Down
57 changes: 51 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,58 @@ This project uses the [CMake](https://cmake.org/) build system to generate ninja
### Preprocessor definitions
In shared code, clientside code can be differentiated with CLIENT_DLL, vs. serverside's GAME_DLL. In more general engine files, Neotokyo specific code can be marked with a NEO ifdef.

### Code style
## Supported compilers

Only the x64 (64-bit) architecture is supported.

### Windows
* MSVC v143 - VS 2022 C++ x64/x86 build tools (Latest)
* MSVC version used by the latest `windows-2025` [runner image](https://github.com/actions/runner-images/blob/main/images/windows/Windows2025-Readme.md) (Microsoft.VisualStudio.Component.VC.Tools.x86.x64)

No big restrictions on general code format, just try to more or less match the other SDK code style.
### Linux
* GCC 10 [steamrt3 'sniper'](https://gitlab.steamos.cloud/steamrt/sniper/sdk)
* GCC 14 [steamrt3 'sniper'](https://gitlab.steamos.cloud/steamrt/sniper/sdk)
* GCC 14 [steamrt4](https://gitlab.steamos.cloud/steamrt/steamrt4/sdk)
* Clang 19 [steamrt4](https://gitlab.steamos.cloud/steamrt/steamrt4/sdk)

### Code style

* C++20 within GCC 10+ and MSVC v143+ support.
* STL generally shouldn't be included in as it may conflicts with existing similar functions.
* Valve likes to ( space ) their arguments, especially with macros, but it's not necessary to strictly follow everywhere.
* C++20, within the [supported compilers'](#supported-compilers) capabilities.
* Formatting:
* No big restrictions on general format, but try to more or less match the surrounding SDK code style for consistency.
* Warnings are treated as errors.
* You may choose to suppress a warning with compiler-specific preprocessing directives if it is a false positive, but **please do not suppress valid warnings**; instead resolve it by fixing the underlying issue.
* For local development, you may disable warnings-as-errors by modifying your `CMAKE_COMPILE_WARNING_AS_ERROR` option, eg. by modifying the entry in your `CMakeCache.txt` file.
* For the CI runners, the following cases are exempt from the *warnings-as-errors* rule:
* Tagged release builds (`v<major>.<minor>`...)
* Branch name or its latest commit message containing the phrase `nwae` (acronym for: *"no warnings as errors"*)
* The `nwae` phrase also works locally, but you may need to refresh the CMake cache for it to take effect.
* Please note that the above methods of disabling warnings-as-errors are intended as temporary workarounds to allow devs to resolve exceptional situations (eg. the un-pinned MSVC compiler version changes unexpectedly changing warnings behaviour), and it should *not* be regularly relied upon to dodge warnings. The preferred long-term solution is almost always to properly fix the warning!
* STL and platform-specific headers may be used when needed, but generally the SDK libraries should be preferred. If you do use such includes, be careful with not bringing in conflicting macro definitions or performance-costly code.
* The `min` and `max` from the SDK macros have been disabled, because they were polluting namespaces and making things like like `::max` awkward to use. You may use the templated `Min` and `Max` functions from `basetypes.h` instead.
* Some nonstandard casting helpers are available:
* `assert_cast`:
* The preferred cast for pointer conversion where an incompatible cast may occur by accident
* If you know for a fact it is always a safe cast, you can use `static_cast` instead
* For debug builds, will runtime-validate the cast with `ptr == dynamic_cast<T>(ptr)`
* For release builds, it is identical to `static_cast`
* `narrow_cast`:
* The preferred cast for narrowing conversions where loss of information may occur
* Use to mark narrowing conversions where the input could overflow
* If you know for a fact it is always a safe cast, you can use `static_cast` instead
* For debug builds, will runtime-validate narrowing conversions for:
* Roundtrip equality: `value v of type A equals itself after A->B->A type conversion`
* Signed/unsigned conversion overflow
* For release builds, it is identical to `static_cast`
* `neo::bit_cast`:
* Well-formed type punning helper. Mostly used to avoid UB in the SDK code.
* Wrapper for `std::bit_cast` when it's available, else will fall back to `memcpy` based conversions (for example on the steamrt3 default GCC compiler).
* For debug builds, a runtime assertion test is available as an additional parameter:
* `auto output = neo::bit_cast<T>(BC_TEST(input, expectedOutput));`
* When replacing ill-formed type puns, this test syntax can be used to ensure the output of `neo::bit_cast<T>(input)` remains identical to `expectedOutput`
* For release builds, the above test optimizes away, into:
* `auto output = neo::bit_cast<T>(input);`
* Valve likes to `( space )` indent their parentheses, especially with macros, but it's not necessary to strictly follow everywhere.
* Tabs are preferred for indentation, to be consistent with the SDK code.
* When using a TODO/FIXME/HACK... style comment, use the format "// NEO TODO (Your-username): Example comment." to make it easier to search NEO specific todos/fixmes (opposed to Valve ones), and at a glance figure out who has written them.
* When using a TODO/FIXME/HACK... style comment, use the format `// NEO TODO (Your-username): Example comment.` to make it easier to search for `NEO` specific todos/fixmes (opposed to Valve ones of the original SDK), and at a glance figure out who has written them.
* For classes running on both client and server, you should generally follow Valve's <i>C_Thing</i> (client) -- <i>CThing</i> (server) convention. On shared files, this might mean #defining serverclass for client, or vice versa. There's plenty of examples of this pattern in Valve's classes for reference, [for example here](https://github.com/NeotokyoRebuild/neo/blob/f749c07a4701d285bbb463686d5a5a50c20b9528/mp/src/game/shared/hl2mp/weapon_357.cpp#L20).
73 changes: 46 additions & 27 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ if(NOT OS_WINDOWS AND NOT OS_LINUX AND NOT OS_MACOS)
message(FATAL_ERROR "Unknown OS")
endif()

option(CMAKE_COMPILE_WARNING_AS_ERROR "Treat compile warnings as errors" ${DEFAULT_WARN_AS_ERR})
option(NEO_CI_BUILD "CI build mode" OFF)
option(NEO_USE_CCACHE "Use ccache" ${OS_LINUX})
option(NEO_STAGING_ONLY "Staging mode (STAGING_ONLY)" OFF)
Expand Down Expand Up @@ -49,6 +50,7 @@ option(NEO_ENABLE_CPACK "Enable CPack" OFF)
option(NEO_USE_MEM_DEBUG "Enable USE_MEM_DEBUG defines" OFF)
option(NEO_GENERATE_GAMEDATA "Generate SourceMod gamedata" ${NEO_DEDICATED})

message(STATUS "Treat compile warnings as errors: ${CMAKE_COMPILE_WARNING_AS_ERROR}")
message(STATUS "CI build mode: ${NEO_CI_BUILD}")
message(STATUS "Use ccache: ${NEO_USE_CCACHE}")
message(STATUS "Staging (STAGING_ONLY): ${NEO_STAGING_ONLY}")
Expand Down Expand Up @@ -107,14 +109,22 @@ elseif(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "RelWith
NDEBUG
)

add_compile_options(
#-fno-strict-aliasing
-ffast-math
-fno-omit-frame-pointer
-ftree-vectorize
)
if (NOT COMPILER_MSVC)
add_compile_options(
#-fno-strict-aliasing
-ffast-math
-fno-omit-frame-pointer
-ftree-vectorize
)
endif()
endif()

add_compile_definitions(
# Whether to validate narrowing conversions done with narrow_cast<T>(...)
# If not, will simply alias narrow_cast to static_cast
$<$<CONFIG:Debug>:PARANOID_NARROWING>
)

if(NEO_RAD_TELEMETRY_DISABLED)
add_compile_definitions(RAD_TELEMETRY_DISABLED)
endif()
Expand Down Expand Up @@ -142,6 +152,10 @@ add_compile_definitions(
# NEO NOTE (nullsystem): New defines since 2025-02-18 TF2 SDK Update
PLATFORM_64BITS
INCLUDED_STEAM2_USERID_STRUCTS

# NEO NOTE (Rain): Needed to remove platform specific min/max C macro pollution;
# instead you can use the Min/Max templated functions from basetypes.h.
NOMINMAX
)

if(OS_WINDOWS)
Expand Down Expand Up @@ -215,7 +229,6 @@ if(OS_WINDOWS)
/Zc:forScope
/Zc:inline
/Zc:forScope
/Oy-
/MTd
)

Expand All @@ -235,17 +248,16 @@ if(OS_WINDOWS)
add_compile_options(
#/Z7 # DebugInformationFormat - C7 Compatible
#/Wp64 # Detect64bitPortabilityIssues
#/O2 # Optimization - Maximize Speed
/Ob2 # InlineFunctionExpansion - Any Suitable
/Oi # EnableIntrinsicFunctions
/Ot # FavorSizeOrSpeed - Favor Fast Code
/GF # EnableStringPooling
/Gy # EnableFunctionLevelLinking
/O2 # Optimization - Maximize Speed
#/Zo
/Oy-
/MT
)

if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
# In x64 compilers, /Oy and /Oy- are not available.
add_compile_options(/Oy-)
endif()

add_link_options(
/NODEFAULTLIB:libcmtd
/NODEFAULTLIB:libcpmtd
Expand Down Expand Up @@ -300,14 +312,15 @@ if(OS_LINUX OR OS_MACOS)
#-Wextra # if STEAM_BRANCH
#-Wshadow # if STEAM_BRANCH

$<$<CXX_COMPILER_ID:GNU>:-mfpmath=sse>
# Required for SourceMod gamedata generation
$<$<COMPILE_LANGUAGE:CXX>:-Wno-invalid-offsetof>

$<$<CXX_COMPILER_ID:GNU>:-mfpmath=sse>
$<$<COMPILE_LANGUAGE:CXX>:-Wno-overloaded-virtual>
$<$<COMPILE_LANGUAGE:CXX>:-Wno-reorder>
-Wno-multichar
-Wno-write-strings
-Wno-unused-variable
-Wno-unused-but-set-variable
-Wno-unused-function
-Wno-unknown-pragmas
-Wno-unused-parameter
Expand All @@ -317,8 +330,12 @@ if(OS_LINUX OR OS_MACOS)
-Wno-float-equal
-Wno-unused-local-typedefs
-Wno-switch
-Wno-strict-aliasing
-Wno-address
#-Wno-strict-aliasing
#-Wno-address
$<$<CXX_COMPILER_ID:Clang>:-Wno-inconsistent-missing-override>

# Unsupported by the steamrt3 Clang compiler
$<$<NOT:$<AND:$<COMPILE_LANG_AND_ID:CXX,Clang>,$<CXX_COMPILER_VERSION:11.0.1>>>:-Wno-unused-but-set-variable>

-Werror=return-type
-fdiagnostics-show-option
Expand All @@ -329,30 +346,27 @@ if(OS_LINUX OR OS_MACOS)
-Ustrncpy

# Fix for non-clickable vgui buttons when using -O2
-fno-devirtualize-speculatively
$<$<CXX_COMPILER_ID:GNU>:-fno-devirtualize-speculatively>

# Fix for non-clickable vgui buttons when using -O3
-fno-ipa-cp-clone
$<$<CXX_COMPILER_ID:GNU>:-fno-ipa-cp-clone>

# Fix for "error: cast from pointer to smaller type 'unsigned int' loses information"
#-fms-extensions

# Required for SourceMod gamedata generation
-Wno-invalid-offsetof
)

# Disable option for older compiler in docker
if(NOT CMAKE_CXX_COMPILER_VERSION STREQUAL "4.8.4")
add_compile_options(
$<$<COMPILE_LANG_AND_ID:CXX,GNU>:-fabi-compat-version=2>
$<$<COMPILE_LANGUAGE:CXX>:-Wno-class-memaccess>
$<$<COMPILE_LANGUAGE:CXX>:-Wno-template-id-cdtor>
-Wno-nonnull-compare
$<$<COMPILE_LANG_AND_ID:CXX,GNU>:-Wno-class-memaccess>
$<$<COMPILE_LANG_AND_ID:CXX,GNU>:-Wno-template-id-cdtor>
$<$<CXX_COMPILER_ID:GNU>:-Wno-nonnull-compare>
)
endif()

# We should always specify -Wl,--build-id, as documented at:
# http://linux.die.net/man/1/ld and http://fedoraproject.org/wiki/Releases/FeatureBuildId.http://fedoraproject.org/wiki/Releases/FeatureBuildId
# http://linux.die.net/man/1/ld and http://fedoraproject.org/wiki/Releases/FeatureBuildId
add_link_options(
-Wl,--build-id
-static-libgcc
Expand All @@ -374,10 +388,15 @@ if(OS_LINUX)
)
endif()

# Clang may define GCC or MSVC values as some kind of a compatibility thing,
# but this can break code that relies on accurately identifying the used compiler.
# The "ACTUALLY_..." defs here can be used for succintly determining the compiler for real.
if(COMPILER_MSVC)
add_compile_definitions(COMPILER_MSVC)
add_compile_definitions(ACTUALLY_COMPILER_MSVC)
elseif(COMPILER_GCC)
add_compile_definitions(COMPILER_GCC)
add_compile_definitions(ACTUALLY_COMPILER_GCC)
elseif(COMPILER_CLANG)
add_compile_definitions(COMPILER_CLANG)
endif()
Expand Down
Loading