Files
itgmania212121/extern/CMakeProject-cppformat.cmake
T
TatshandColby Klein d395028bd4 Mac fixes (#1776)
* macOS build fixes (#1773)

* macOS build fixes

Add missing headers
Threads_Pthreads: do not call pthread_setname_np() on macOS as it does not do
the same as on Linux
DebugStr() -> os_log()

* Make the project build with Makefiles on macOS

* Fix getting modifier key state on Mac (#1774)

We really need to clean up all Carbon calls here (many will go away when the
project switches to SDL2 for all platforms)

* Fix Xcode build; bump minimum version of macOS (#1775)

* Build fixes for the "Unix Makefiles" generator
Pass CMAKE_BUILD_TYPE to the external projects
* Fix indent
2018-12-31 19:28:59 -08:00

40 lines
1.1 KiB
CMake

if (NOT IS_DIRECTORY "${SM_EXTERN_DIR}/cppformat")
message(ERROR "Submodule for cppformat missing. Run git submodule init && git submodule update first.")
return()
endif()
list(APPEND CPPFORMAT_SRC
"cppformat/fmt/format.cc"
)
list(APPEND CPPFORMAT_HPP
"cppformat/fmt/format.h"
)
source_group("" FILES ${CPPFORMAT_SRC} ${CPPFORMAT_HPP})
add_library("cppformat" ${CPPFORMAT_SRC} ${CPPFORMAT_HPP})
set_property(TARGET "cppformat" PROPERTY FOLDER "External Libraries")
disable_project_warnings("cppformat")
target_include_directories("cppformat" PUBLIC "cppformat")
if (MSVC)
sm_add_compile_definition("cppformat" _CRT_SECURE_NO_WARNINGS)
elseif(APPLE)
set_target_properties("cppformat" PROPERTIES
XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "${SM_CPP_STANDARD}"
XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++"
)
sm_add_compile_flag("cppformat" "-std=${SM_CPP_STANDARD}")
sm_add_compile_flag("cppformat" "-stdlib=libc++")
else() # Unix
sm_add_compile_flag("cppformat" "-std=${SM_CPP_STANDARD}")
if (CMAKE_CXX_COMPILER MATCHES "clang")
sm_add_compile_flag("cppformat" "-stdlib=libc++")
endif()
endif()