Skip to content

Commit f7a6bc1

Browse files
committed
Fix build on macOS/Darwin
* `<sstream>` needs to be explicitly included when using libc++ STL * `-ffat-lto-objects` only works for ELF binaries Signed-off-by: Alex Forster <[email protected]>
1 parent 9e86110 commit f7a6bc1

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,11 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR
126126
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
127127
set(COMMON_FLAGS -Wall -Wfatal-errors -DSIZEOF_VOID_P=8 -DSIZEOF_LONG=8)
128128

129-
set(RELEASE_FLAGS -O2 -flto=auto -ffat-lto-objects)
129+
if (NOT WIN32 AND NOT APPLE)
130+
set(RELEASE_FLAGS -O2 -flto=auto -ffat-lto-objects)
131+
else ()
132+
set(RELEASE_FLAGS -O2 -flto=auto)
133+
endif ()
130134

131135
set(DEBUG_FLAGS -O0 -g3 -fno-omit-frame-pointer)
132136

src/asm_files.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <map>
55
#include <set>
66
#include <string>
7+
#include <sstream>
78
#include <sys/stat.h>
89
#include <vector>
910

0 commit comments

Comments
 (0)