diff options
author | Steph Enders <smenders@gmail.com> | 2022-06-27 17:45:44 -0400 |
---|---|---|
committer | Steph Enders <smenders@gmail.com> | 2022-06-27 17:45:44 -0400 |
commit | 38d46b2dda0243cfa60bc6945859ebd587e0a851 (patch) | |
tree | 3af0286199c6075ad50c36f2218c1c303f9fa921 /CMakeLists.txt | |
parent | 734ee0f6352fdb6077c142d90f191c11c32f98d2 (diff) |
Update MacOS to compile w/ Boost
MacOS seems to rely on an older/different C++ stdlib than Windows or
Linux. So replacing those with Boost equivalents.
Mostly contained to the Resources thankfully!
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index acf9809..2445f08 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,9 @@ set(CMAKE_CXX_STANDARD 20) if (WIN32) set(CMAKE_CXX_FLAGS -static) endif () +if (APPLE) + set(CMAKE_CXX_FLAGS -std=c++11) # why? Because apparently we can't modernize +endif () set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-${PROJECT_VERSION}) set(CMAKE_SUPPRESS_DEVELOPER_WARNINGS ON) @@ -56,8 +59,17 @@ target_link_libraries(lauxlib lua) set(LUA_LIBRARIES lua lualib lauxlib) include_directories(${PROJECT_SOURCE_DIR}/thirdparty/lua) +# setup boost and other MacOS Libs +set(MACOS_LIBS "") +if (APPLE) + set(DNG_BOOST_DIR ${CMAKE_SOURCE_DIR}/thirdparty/boost) + set(BOOST_ROOT ${DNG_BOOST_DIR}/tools/cmake/include/) + add_subdirectory(${DNG_BOOST_DIR} EXCLUDE_FROM_ALL) + set(MACOS_LIBS ${MACOS_LIBS} Boost::filesystem Boost::optional) +endif () + # System specific includes -if (UNIX AND NOT APPLE) +if (UNIX AND NOT APPLE) set(RES_LIB src/resources/Resources.cpp src/resources/Resources.h src/resources/linux/LinuxResources.cpp src/resources/linux/LinuxResources.h) elseif (WIN32) set(RES_LIB src/resources/Resources.cpp src/resources/Resources.h src/resources/windows/WindowsResources.cpp src/resources/windows/WindowsResources.h) @@ -66,7 +78,6 @@ elseif (APPLE) endif () add_executable(${PROJECT_NAME} src/main.cpp src/Level.cpp src/Level.h src/CApi.h src/Scene.h src/LuaApi.h src/MessageBox.h ${RES_LIB}) -target_link_libraries(${PROJECT_NAME} PUBLIC ${LUA_LIBRARIES}) # configure and link SFML set(BUILD_SHARED_LIBS FALSE) @@ -77,11 +88,10 @@ if (WIN32) endif () set(SFML_USE_SYSTEM_DEPS ON) add_subdirectory(${PROJECT_SOURCE_DIR}/thirdparty/SFML EXCLUDE_FROM_ALL) -target_link_libraries(${PROJECT_NAME} PUBLIC ${SFML_LIBRARIES} ${LUA_LIBRARIES}) +target_link_libraries(${PROJECT_NAME} PUBLIC ${SFML_LIBRARIES} ${LUA_LIBRARIES} ${MACOS_LIBS}) # Install Directives - if (UNIX) set(SFML_INSTALL_PKGCONFIG_FILES FALSE) endif () |