Skip to content

Commit

Permalink
Macro fix for newer compiler on Linux (#10)
Browse files Browse the repository at this point in the history
* Macro fix for newer compiler on Linux

* clang-tidy warnings on macOS
  • Loading branch information
PerMalmberg authored Aug 22, 2024
1 parent b02663c commit 6fe70b3
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 4 deletions.
21 changes: 20 additions & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"build-type-release"
],
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"type": "equals",
"rhs": "Linux"
},
"cacheVariables": {
Expand Down Expand Up @@ -58,6 +58,25 @@
}
}
},
{
"name": "x86-linux-static-dev",
"inherits": [
"base-default",
"base-linux",
"base-dev",
"build-type-debug"
],
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Linux"
},
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": "x86-linux-static",
"CMAKE_CXX_FLAGS": "-m32",
"CMAKE_C_FLAGS": "-m32"
}
},
{
"name": "osx-static",
"inherits": [
Expand Down
3 changes: 1 addition & 2 deletions src/LoutLogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include "Lout.h"
#include "item/ILogItem.h"
#include "item/StringItem.h"
#include <climits>
#include <cstdint>
#include <ctime>
#include <limits>
Expand Down Expand Up @@ -132,7 +131,7 @@ namespace lout
//
//
//////////////////////////////////////////////////////////////////////////
#if ULONG_MAX == (0xFFFFFFFFUL) || __APPLE__
#if !__x86_64__ || __APPLE__
// Don't compile this on 64 bit platforms since it is the same as uint64_t
LoutLogger& LoutLogger::operator<<(unsigned long value)
{
Expand Down
2 changes: 1 addition & 1 deletion src/LoutLogger.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ namespace lout

LoutLogger& operator<<(uint64_t value);

#if ULONG_MAX == (0xFFFFFFFFUL) || __APPLE__
#if !__x86_64__ || __APPLE__
// Don't compile this on 64 bit platforms since it is the same as uint64_t
LoutLogger& operator<<(unsigned long value);
#endif
Expand Down
1 change: 1 addition & 0 deletions src/output/IOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "loglevel/ILogLevel.h"
#include "output/IOutput.h"
#include <string>
#include <ostream>

namespace lout::output
{
Expand Down
5 changes: 5 additions & 0 deletions vcpkg_triplets/x64-linux-static.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE static)
set(VCPKG_LIBRARY_LINKAGE static)

set(VCPKG_CMAKE_SYSTEM_NAME Linux)
6 changes: 6 additions & 0 deletions vcpkg_triplets/x86-linux-static.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
set(VCPKG_TARGET_ARCHITECTURE x86)
set(VCPKG_CRT_LINKAGE static)
set(VCPKG_LIBRARY_LINKAGE static)

set(VCPKG_CMAKE_SYSTEM_NAME Linux)

0 comments on commit 6fe70b3

Please sign in to comment.