Allow linking against system libraries for almost everything (#1790)

This commit is contained in:
Tatsh
2019-02-16 11:32:52 -05:00
committed by Colby Klein
parent 021d494157
commit b8a79cd0f6
78 changed files with 4870 additions and 4776 deletions
+14 -15
View File
@@ -1,15 +1,14 @@
if (NOT IS_DIRECTORY "${SM_EXTERN_DIR}/cppformat")
message(ERROR "Submodule for cppformat missing. Run git submodule init && git submodule update first.")
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_SRC "cppformat/fmt/format.cc")
list(APPEND CPPFORMAT_HPP
"cppformat/fmt/format.h"
)
list(APPEND CPPFORMAT_HPP "cppformat/fmt/format.h")
source_group("" FILES ${CPPFORMAT_SRC} ${CPPFORMAT_HPP})
@@ -21,19 +20,19 @@ disable_project_warnings("cppformat")
target_include_directories("cppformat" PUBLIC "cppformat")
if (MSVC)
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++"
)
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")
if(CMAKE_CXX_COMPILER MATCHES "clang")
sm_add_compile_flag("cppformat" "-stdlib=libc++")
endif()
endif()