Set fmt defines in CMake

This commit is contained in:
Luke Street 2021-04-06 17:53:16 -04:00
parent fc3e9a51d2
commit a87e8bb39f
3 changed files with 6 additions and 8 deletions

View File

@ -6,4 +6,10 @@ add_subdirectory(zlib)
add_subdirectory(yaml)
if(NOT TARGET fmt)
add_subdirectory(fmt)
target_compile_definitions(fmt PUBLIC
FMT_STRING_ALIAS=1
FMT_ARM_ABI_COMPATIBILITY=1
FMT_EXCEPTIONS=0)
target_compile_definitions(fmt INTERFACE
FMT_ENFORCE_COMPILE_STRING=1)
endif()

View File

@ -3,8 +3,6 @@
#include <ostream>
#include "athena/Types.hpp"
#define FMT_STRING_ALIAS 1
#define FMT_ENFORCE_COMPILE_STRING 1
#include <fmt/format.h>
#ifdef _MSC_VER

View File

@ -1,13 +1,7 @@
#include "athena/Global.hpp"
#include "athena/Utility.hpp"
#include <cstdio>
#include <cstdlib>
#include <iostream>
#define FMT_STRING_ALIAS 1
#define FMT_ENFORCE_COMPILE_STRING 1
#include <fmt/format.h>
std::ostream& operator<<(std::ostream& os, const athena::SeekOrigin& origin) {
switch (origin) {
case athena::SeekOrigin::Begin: