Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SST compile fix on MacOS #338

Merged
merged 4 commits into from
Nov 2, 2023
Merged
Changes from all commits
Commits
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
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,13 @@ option(SIMENG_OPTIMIZE "Enable Extra Compiler Optimizatoins" OFF)
option(SIMENG_ENABLE_SST "Compile SimEng SST Wrapper" OFF)
option(SIMENG_ENABLE_SST_TESTS "Enable testing for SST" OFF)

# Set CXX flag for Apple Mac so that `binary_function` and `unary_function` types that are used in SST can be recognised.
# They were deprecated in C++11 and removed in C++17, and Apple Clang v15 no longer supports these types without the following flag
# TODO: Remove once SST integration has updated to SST version 13 or later - the use of unary and binary functions are removed in later versions.
if(APPLE)
add_compile_definitions(_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION)
endif()

if (SIMENG_OPTIMIZE)
# Turn on link time optimization for all targets.
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
Expand Down