Skip to content

Instantly share code, notes, and snippets.

@matschaffer
Last active November 13, 2022 11:02
Show Gist options
  • Save matschaffer/87220798c79a5d0ace1eaa9afb729d28 to your computer and use it in GitHub Desktop.
Save matschaffer/87220798c79a5d0ace1eaa9afb729d28 to your computer and use it in GitHub Desktop.
Floating Sandbox macos build
#!/usr/bin/env bash
set -euxo pipefail
rm -rf Floating-Sandbox
rm -rf DevIL
rm -rf SFML
# rm -rf wxWidgets
rm -rf fs_libs
rm -rf git
rm -rf dist
#!/usr/bin/env bash
set -euxo pipefail
WORKSPACE="$(pwd)"
FS_LIBS="$(pwd)/fs_libs"
DIST="$(pwd)/dist"
mkdir -p "${FS_LIBS}"
# Should come with xcode CLI tools during homebrew install
gcc --version
g++ --version
brew install cmake
cmake --version
git clone https://github.com/GabrieleGiuseppini/Floating-Sandbox.git
echo "Building Floating-Sandbox rev: " $(cd Floating-Sandbox && git rev-parse HEAD)
git clone https://github.com/DentonW/DevIL
(
cd DevIL
git checkout v1.8.0
git apply ../Floating-Sandbox/devil-issue-95.patch
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DIL_NO_TIF=1 -DIL_NO_JP2=1 -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX="${FS_LIBS}/DevIL" ../DevIL
make install
)
# Hack to install SFML dependencies
brew install sfml; brew uninstall sfml
git clone https://github.com/SFML/SFML.git
(
cd SFML
git checkout 2.5.1
mkdir build
cd build
# Got a vorbis resolution warning here, but was able to just ignore it.
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=FALSE -DSFML_BUILD_WINDOW=FALSE -DSFML_BUILD_GRAPHICS=FALSE -DSFML_BUILD_DOC=FALSE -DSFML_BUILD_EXAMPLES=FALSE -DCMAKE_INSTALL_PREFIX="${FS_LIBS}/SFML" -DSFML_DEPENDENCIES_INSTALL_PREFIX="${FS_LIBS}/SFML" ..
make install
)
brew install wxwidgets
# brew install gtk+3
# git clone --recurse-submodules https://github.com/wxWidgets/wxWidgets.git
# (
# cd wxWidgets
# git checkout v3.1.4
# mkdir my_wx_build
# cd my_wx_build
# ../configure --disable-shared --with-gtk=3 --with-libpng --with-libxpm --with-libjpeg --without-libtiff --without-expat --disable-pnm --disable-gif --disable-pcx --disable-iff --with-opengl --prefix=${HOME}/fs_libs/wxWidgets --exec_prefix="${FS_LIBS}/wxWidgets" --disable-tests --disable-rpath
# make install
# )
mkdir git
(
cd git
git clone https://github.com/kazuho/picojson.git
cd picojson
git checkout v1.3.0
)
(
cd git
git clone https://github.com/google/googletest.git
cd googletest
git checkout release-1.12.1
)
(
cd Floating-Sandbox
cp UserSettings.example-linux.cmake UserSettings.cmake
sed -i '' "s|/home/gg|${WORKSPACE}|g" UserSettings.cmake
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DFS_BUILD_BENCHMARKS=OFF -DFS_USE_STATIC_LIBS=ON -DwxWidgets_USE_DEBUG=OFF -DwxWidgets_USE_UNICODE=ON -DwxWidgets_USE_STATIC=ON -DFS_INSTALL_DIRECTORY="${DIST}" ..
make install
)
cd "${DIST}"
xattr -r -d com.apple.quarantine ./FloatingSandbox
echo "To start the game run: cd ${DIST}; ./FloatingSandbox"
@GabrieleGiuseppini
Copy link

GabrieleGiuseppini commented Oct 8, 2022

Hey, I've pushed a (possible) fix for the Colors.cpp build break to master. Would you mind trying that out?

@matschaffer
Copy link
Author

matschaffer commented Oct 19, 2022

Script updated to work from a clean directory and use GabrieleGiuseppini/Floating-Sandbox#75 for the pthread issue.

Current make install failure on GabrieleGiuseppini/Floating-Sandbox@07ce042 as follows (click dropdown for full make install log):

❯ make install
[  0%] Building CXX object GameCore/CMakeFiles/GameCoreLib.dir/BootSettings.cpp.o
[  1%] Building CXX object GameCore/CMakeFiles/GameCoreLib.dir/Colors.cpp.o
/Users/matschaffer/code/fsbxbuild/Floating-Sandbox/GameCore/Colors.cpp:89:24: error: invalid operands to binary expression ('std::istream' and '__iom_t4')
        ss >> std::hex >> std::setfill('0') >> std::setw(2) >> components[c];
        ~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/cstddef:153:3: note: candidate function template not viable: no known conversion from 'std::istream' to 'std::byte' for 1st argument
  operator>> (byte  __lhs, _Integer __shift) noexcept
  ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/istream:618:1: note: candidate function template not viable: no known conversion from '__iom_t4<char>' to 'unsigned char *' for 2nd argument
operator>>(basic_istream<char, _Traits>& __is, unsigned char* __s)
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/istream:626:1: note: candidate function template not viable: no known conversion from '__iom_t4<char>' to 'signed char *' for 2nd argument
operator>>(basic_istream<char, _Traits>& __is, signed char* __s)
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/istream:670:1: note: candidate function template not viable: no known conversion from '__iom_t4<char>' to 'unsigned char &' for 2nd argument
operator>>(basic_istream<char, _Traits>& __is, unsigned char& __c)
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/istream:678:1: note: candidate function template not viable: no known conversion from '__iom_t4<char>' to 'signed char &' for 2nd argument
operator>>(basic_istream<char, _Traits>& __is, signed char& __c)
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/istream:635:1: note: candidate template ignored: deduced conflicting types for parameter '_CharT' ('char' vs. 'std::__iom_t4<char>')
operator>>(basic_istream<_CharT, _Traits>& __is, _CharT& __c)
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/__random/uniform_int_distribution.h:295:1: note: candidate template ignored: could not match 'uniform_int_distribution' against '__iom_t4'
operator>>(basic_istream<_CharT, _Traits>& __is,
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/istream:607:1: note: candidate template ignored: could not match '_CharT *' against '__iom_t4<char>'
operator>>(basic_istream<_CharT, _Traits>& __is, _CharT* __s)
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/istream:1444:1: note: candidate template ignored: could not match 'basic_string' against '__iom_t4'
operator>>(basic_istream<_CharT, _Traits>& __is,
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/istream:1580:1: note: candidate template ignored: could not match 'bitset' against '__iom_t4'
operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Size>& __x)
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/istream:1384:11: note: candidate template ignored: requirement 'integral_constant<bool, false>::value' was not satisfied [with _Stream = std::istream &, _Tp = std::__iom_t4<char>]
_Stream&& operator>>(_Stream&& __is, _Tp&& __x)
          ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/iomanip:302:1: note: candidate template ignored: could not match '__iom_t7' against '__iom_t4'
operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t7<_MoneyT>& __x)
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/iomanip:421:1: note: candidate template ignored: could not match '__iom_t9' against '__iom_t4'
operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t9<_CharT>& __x)
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/iomanip:602:33: note: candidate template ignored: could not match '__quoted_proxy' against '__iom_t4'
basic_istream<_CharT, _Traits>& operator>>(
                                ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/istream:217:20: note: candidate function not viable: no known conversion from '__iom_t4<char>' to 'std::istream &(*)(std::istream &)' for 1st argument
    basic_istream& operator>>(basic_istream& (*__pf)(basic_istream&))
                   ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/istream:221:20: note: candidate function not viable: no known conversion from '__iom_t4<char>' to 'basic_ios<std::basic_istream<char>::char_type, std::basic_istream<char>::traits_type> &(*)(basic_ios<std::basic_istream<char>::char_type, std::basic_istream<char>::traits_type> &)' (aka 'basic_ios<char, std::char_traits<char>> &(*)(basic_ios<char, std::char_traits<char>> &)') for 1st argument
    basic_istream& operator>>(basic_ios<char_type, traits_type>&
                   ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/istream:226:20: note: candidate function not viable: no known conversion from '__iom_t4<char>' to 'std::ios_base &(*)(std::ios_base &)' for 1st argument
    basic_istream& operator>>(ios_base& (*__pf)(ios_base&))
                   ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/istream:229:20: note: candidate function not viable: no known conversion from '__iom_t4<char>' to 'basic_streambuf<std::basic_istream<char>::char_type, std::basic_istream<char>::traits_type> *' (aka 'basic_streambuf<char, std::char_traits<char>> *') for 1st argument
    basic_istream& operator>>(basic_streambuf<char_type, traits_type>* __sb);
                   ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/istream:230:20: note: candidate function not viable: no known conversion from '__iom_t4<char>' to 'bool &' for 1st argument
    basic_istream& operator>>(bool& __n);
                   ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/istream:231:20: note: candidate function not viable: no known conversion from '__iom_t4<char>' to 'short &' for 1st argument
    basic_istream& operator>>(short& __n);
                   ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/istream:232:20: note: candidate function not viable: no known conversion from '__iom_t4<char>' to 'unsigned short &' for 1st argument
    basic_istream& operator>>(unsigned short& __n);
                   ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/istream:233:20: note: candidate function not viable: no known conversion from '__iom_t4<char>' to 'int &' for 1st argument
    basic_istream& operator>>(int& __n);
                   ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/istream:234:20: note: candidate function not viable: no known conversion from '__iom_t4<char>' to 'unsigned int &' for 1st argument
    basic_istream& operator>>(unsigned int& __n);
                   ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/istream:235:20: note: candidate function not viable: no known conversion from '__iom_t4<char>' to 'long &' for 1st argument
    basic_istream& operator>>(long& __n);
                   ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/istream:236:20: note: candidate function not viable: no known conversion from '__iom_t4<char>' to 'unsigned long &' for 1st argument
    basic_istream& operator>>(unsigned long& __n);
                   ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/istream:237:20: note: candidate function not viable: no known conversion from '__iom_t4<char>' to 'long long &' for 1st argument
    basic_istream& operator>>(long long& __n);
                   ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/istream:238:20: note: candidate function not viable: no known conversion from '__iom_t4<char>' to 'unsigned long long &' for 1st argument
    basic_istream& operator>>(unsigned long long& __n);
                   ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/istream:239:20: note: candidate function not viable: no known conversion from '__iom_t4<char>' to 'float &' for 1st argument
    basic_istream& operator>>(float& __f);
                   ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/istream:240:20: note: candidate function not viable: no known conversion from '__iom_t4<char>' to 'double &' for 1st argument
    basic_istream& operator>>(double& __f);
                   ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/istream:241:20: note: candidate function not viable: no known conversion from '__iom_t4<char>' to 'long double &' for 1st argument
    basic_istream& operator>>(long double& __f);
                   ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/istream:242:20: note: candidate function not viable: no known conversion from '__iom_t4<char>' to 'void *&' for 1st argument
    basic_istream& operator>>(void*& __p);
                   ^
1 error generated.
make[2]: *** [GameCore/CMakeFiles/GameCoreLib.dir/Colors.cpp.o] Error 1
make[1]: *** [GameCore/CMakeFiles/GameCoreLib.dir/all] Error 2
make: *** [all] Error 2

@matschaffer
Copy link
Author

Ah, I see. It's the same fix as GabrieleGiuseppini/Floating-Sandbox@2e47925 just on another part of the file.

Trying this:

diff --git a/GameCore/Colors.cpp b/GameCore/Colors.cpp
index 503f9c86..d87fdb0c 100644
--- a/GameCore/Colors.cpp
+++ b/GameCore/Colors.cpp
@@ -85,8 +85,9 @@ rgbaColor rgbaColor::fromString(std::string const & str)
             ++iEnd;
         }

-        std::stringstream ss(str.substr(iStart, iEnd - iStart));
-        ss >> std::hex >> std::setfill('0') >> std::setw(2) >> components[c];
+        std::stringstream ss;
+        ss << std::hex << str.substr(iStart, iEnd - iStart);
+        ss >> components[c];

         iStart = iEnd;
     }
@@ -109,4 +110,4 @@ std::string rgbaColor::toString() const
         << std::setw(2) << static_cast<unsigned int>(a);

     return ss.str();
-}
\ No newline at end of file
+}

which seems to be building so far (25% and counting...)

@matschaffer
Copy link
Author

matschaffer commented Oct 19, 2022

Next is a set of these sort of errors:

/Users/matschaffer/code/fsbxbuild/Floating-Sandbox/ShipBuilderLib/Tools/FloodTool.cpp:89:56: error: missing 'template' keyword prior to dependent template name 'CloneExistingLayer'
    auto layerClone = mController.GetModelController().CloneExistingLayer<TLayer>();
                                                       ^                 ~~~~~~~~

Trying to add some template keywords.

@matschaffer
Copy link
Author

with GabrieleGiuseppini/Floating-Sandbox#76 I get as far as this:

In file included from /Users/matschaffer/code/fsbxbuild/git/googletest/googlemock/src/gmock-all.cc:39:
In file included from /Users/matschaffer/code/fsbxbuild/git/googletest/googlemock/include/gmock/gmock.h:59:
/Users/matschaffer/code/fsbxbuild/git/googletest/googlemock/include/gmock/gmock-actions.h:455:3: error: definition of implicit copy constructor for 'PolymorphicAction' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
  GTEST_DISALLOW_ASSIGN_(PolymorphicAction);
  ^
/Users/matschaffer/code/fsbxbuild/git/googletest/googletest/include/gtest/internal/gtest-port.h:682:8: note: expanded from macro 'GTEST_DISALLOW_ASSIGN_'
  void operator=(type const &) = delete
       ^
/Users/matschaffer/code/fsbxbuild/git/googletest/googlemock/include/gmock/gmock-actions.h:1011:10: note: in implicit copy constructor for 'testing::PolymorphicAction<testing::internal::ReturnNullAction>' first required here
  return MakePolymorphicAction(internal::ReturnNullAction());
         ^
/Users/matschaffer/code/fsbxbuild/git/googletest/googlemock/include/gmock/gmock-actions.h:455:3: error: definition of implicit copy constructor for 'PolymorphicAction<testing::internal::ReturnVoidAction>' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
  GTEST_DISALLOW_ASSIGN_(PolymorphicAction);
  ^
/Users/matschaffer/code/fsbxbuild/git/googletest/googletest/include/gtest/internal/gtest-port.h:682:8: note: expanded from macro 'GTEST_DISALLOW_ASSIGN_'
  void operator=(type const &) = delete
       ^
/Users/matschaffer/code/fsbxbuild/git/googletest/googlemock/include/gmock/gmock-actions.h:1016:10: note: in implicit copy constructor for 'testing::PolymorphicAction<testing::internal::ReturnVoidAction>' first required here
  return MakePolymorphicAction(internal::ReturnVoidAction());
         ^
In file included from /Users/matschaffer/code/fsbxbuild/git/googletest/googlemock/src/gmock-all.cc:39:
In file included from /Users/matschaffer/code/fsbxbuild/git/googletest/googlemock/include/gmock/gmock.h:61:
In file included from /Users/matschaffer/code/fsbxbuild/git/googletest/googlemock/include/gmock/gmock-function-mocker.h:39:
In file included from /Users/matschaffer/code/fsbxbuild/git/googletest/googlemock/include/gmock/gmock-generated-function-mockers.h:47:
In file included from /Users/matschaffer/code/fsbxbuild/git/googletest/googlemock/include/gmock/gmock-spec-builders.h:75:
/Users/matschaffer/code/fsbxbuild/git/googletest/googlemock/include/gmock/gmock-matchers.h:1506:3: error: definition of implicit copy constructor for 'FloatingEqMatcher<double>' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
  GTEST_DISALLOW_ASSIGN_(FloatingEqMatcher);
  ^
/Users/matschaffer/code/fsbxbuild/git/googletest/googletest/include/gtest/internal/gtest-port.h:682:8: note: expanded from macro 'GTEST_DISALLOW_ASSIGN_'
  void operator=(type const &) = delete
       ^
/Users/matschaffer/code/fsbxbuild/git/googletest/googlemock/include/gmock/gmock-matchers.h:3632:10: note: in implicit copy constructor for 'testing::internal::FloatingEqMatcher<double>' first required here
  return internal::FloatingEqMatcher<double>(rhs, false);
         ^
/Users/matschaffer/code/fsbxbuild/git/googletest/googlemock/include/gmock/gmock-matchers.h:1506:3: error: definition of implicit copy constructor for 'FloatingEqMatcher<float>' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
  GTEST_DISALLOW_ASSIGN_(FloatingEqMatcher);
  ^
/Users/matschaffer/code/fsbxbuild/git/googletest/googletest/include/gtest/internal/gtest-port.h:682:8: note: expanded from macro 'GTEST_DISALLOW_ASSIGN_'
  void operator=(type const &) = delete
       ^
/Users/matschaffer/code/fsbxbuild/git/googletest/googlemock/include/gmock/gmock-matchers.h:3660:10: note: in implicit copy constructor for 'testing::internal::FloatingEqMatcher<float>' first required here
  return internal::FloatingEqMatcher<float>(rhs, false);
         ^
/Users/matschaffer/code/fsbxbuild/git/googletest/googlemock/include/gmock/gmock-matchers.h:721:3: error: definition of implicit copy constructor for 'StrEqualityMatcher<std::string>' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
  GTEST_DISALLOW_ASSIGN_(StrEqualityMatcher);
  ^
/Users/matschaffer/code/fsbxbuild/git/googletest/googletest/include/gtest/internal/gtest-port.h:682:8: note: expanded from macro 'GTEST_DISALLOW_ASSIGN_'
  void operator=(type const &) = delete
       ^
/Users/matschaffer/code/fsbxbuild/git/googletest/googletest/include/gtest/gtest-matchers.h:454:7: note: in implicit copy constructor for 'testing::internal::StrEqualityMatcher<std::string>' first required here
class PolymorphicMatcher {
      ^
/Users/matschaffer/code/fsbxbuild/git/googletest/googlemock/include/gmock/gmock-matchers.h:3813:10: note: in implicit move constructor for 'testing::PolymorphicMatcher<testing::internal::StrEqualityMatcher<std::string>>' first required here
  return MakePolymorphicMatcher(
         ^
/Users/matschaffer/code/fsbxbuild/git/googletest/googlemock/include/gmock/gmock-matchers.h:778:3: error: definition of implicit copy constructor for 'HasSubstrMatcher<std::string>' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
  GTEST_DISALLOW_ASSIGN_(HasSubstrMatcher);
  ^
/Users/matschaffer/code/fsbxbuild/git/googletest/googletest/include/gtest/internal/gtest-port.h:682:8: note: expanded from macro 'GTEST_DISALLOW_ASSIGN_'
  void operator=(type const &) = delete
       ^
/Users/matschaffer/code/fsbxbuild/git/googletest/googletest/include/gtest/gtest-matchers.h:454:7: note: in implicit copy constructor for 'testing::internal::HasSubstrMatcher<std::string>' first required here
class PolymorphicMatcher {
      ^
/Users/matschaffer/code/fsbxbuild/git/googletest/googlemock/include/gmock/gmock-matchers.h:3842:10: note: in implicit move constructor for 'testing::PolymorphicMatcher<testing::internal::HasSubstrMatcher<std::string>>' first required here
  return MakePolymorphicMatcher(
         ^
/Users/matschaffer/code/fsbxbuild/git/googletest/googlemock/include/gmock/gmock-matchers.h:835:3: error: definition of implicit copy constructor for 'StartsWithMatcher<std::string>' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
  GTEST_DISALLOW_ASSIGN_(StartsWithMatcher);
  ^
/Users/matschaffer/code/fsbxbuild/git/googletest/googletest/include/gtest/internal/gtest-port.h:682:8: note: expanded from macro 'GTEST_DISALLOW_ASSIGN_'
  void operator=(type const &) = delete
       ^
/Users/matschaffer/code/fsbxbuild/git/googletest/googletest/include/gtest/gtest-matchers.h:454:7: note: in implicit copy constructor for 'testing::internal::StartsWithMatcher<std::string>' first required here
class PolymorphicMatcher {
      ^
/Users/matschaffer/code/fsbxbuild/git/googletest/googlemock/include/gmock/gmock-matchers.h:3849:10: note: in implicit move constructor for 'testing::PolymorphicMatcher<testing::internal::StartsWithMatcher<std::string>>' first required here
  return MakePolymorphicMatcher(
         ^
/Users/matschaffer/code/fsbxbuild/git/googletest/googlemock/include/gmock/gmock-matchers.h:891:3: error: definition of implicit copy constructor for 'EndsWithMatcher<std::string>' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
  GTEST_DISALLOW_ASSIGN_(EndsWithMatcher);
  ^
/Users/matschaffer/code/fsbxbuild/git/googletest/googletest/include/gtest/internal/gtest-port.h:682:8: note: expanded from macro 'GTEST_DISALLOW_ASSIGN_'
  void operator=(type const &) = delete
       ^
/Users/matschaffer/code/fsbxbuild/git/googletest/googletest/include/gtest/gtest-matchers.h:454:7: note: in implicit copy constructor for 'testing::internal::EndsWithMatcher<std::string>' first required here
class PolymorphicMatcher {
      ^
/Users/matschaffer/code/fsbxbuild/git/googletest/googlemock/include/gmock/gmock-matchers.h:3856:10: note: in implicit move constructor for 'testing::PolymorphicMatcher<testing::internal::EndsWithMatcher<std::string>>' first required here
  return MakePolymorphicMatcher(internal::EndsWithMatcher<std::string>(suffix));
         ^
/Users/matschaffer/code/fsbxbuild/git/googletest/googlemock/include/gmock/gmock-matchers.h:721:3: error: definition of implicit copy constructor for 'StrEqualityMatcher<std::wstring>' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
  GTEST_DISALLOW_ASSIGN_(StrEqualityMatcher);
  ^
/Users/matschaffer/code/fsbxbuild/git/googletest/googletest/include/gtest/internal/gtest-port.h:682:8: note: expanded from macro 'GTEST_DISALLOW_ASSIGN_'
  void operator=(type const &) = delete
       ^
/Users/matschaffer/code/fsbxbuild/git/googletest/googletest/include/gtest/gtest-matchers.h:454:7: note: in implicit copy constructor for 'testing::internal::StrEqualityMatcher<std::wstring>' first required here
class PolymorphicMatcher {
      ^
/Users/matschaffer/code/fsbxbuild/git/googletest/googlemock/include/gmock/gmock-matchers.h:3865:10: note: in implicit move constructor for 'testing::PolymorphicMatcher<testing::internal::StrEqualityMatcher<std::wstring>>' first required here
  return MakePolymorphicMatcher(
         ^
/Users/matschaffer/code/fsbxbuild/git/googletest/googlemock/include/gmock/gmock-matchers.h:778:3: error: definition of implicit copy constructor for 'HasSubstrMatcher<std::wstring>' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
  GTEST_DISALLOW_ASSIGN_(HasSubstrMatcher);
  ^
/Users/matschaffer/code/fsbxbuild/git/googletest/googletest/include/gtest/internal/gtest-port.h:682:8: note: expanded from macro 'GTEST_DISALLOW_ASSIGN_'
  void operator=(type const &) = delete
       ^
/Users/matschaffer/code/fsbxbuild/git/googletest/googletest/include/gtest/gtest-matchers.h:454:7: note: in implicit copy constructor for 'testing::internal::HasSubstrMatcher<std::wstring>' first required here
class PolymorphicMatcher {
      ^
/Users/matschaffer/code/fsbxbuild/git/googletest/googlemock/include/gmock/gmock-matchers.h:3894:10: note: in implicit move constructor for 'testing::PolymorphicMatcher<testing::internal::HasSubstrMatcher<std::wstring>>' first required here
  return MakePolymorphicMatcher(
         ^
/Users/matschaffer/code/fsbxbuild/git/googletest/googlemock/include/gmock/gmock-matchers.h:835:3: error: definition of implicit copy constructor for 'StartsWithMatcher<std::wstring>' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
  GTEST_DISALLOW_ASSIGN_(StartsWithMatcher);
  ^
/Users/matschaffer/code/fsbxbuild/git/googletest/googletest/include/gtest/internal/gtest-port.h:682:8: note: expanded from macro 'GTEST_DISALLOW_ASSIGN_'
  void operator=(type const &) = delete
       ^
/Users/matschaffer/code/fsbxbuild/git/googletest/googletest/include/gtest/gtest-matchers.h:454:7: note: in implicit copy constructor for 'testing::internal::StartsWithMatcher<std::wstring>' first required here
class PolymorphicMatcher {
      ^
/Users/matschaffer/code/fsbxbuild/git/googletest/googlemock/include/gmock/gmock-matchers.h:3901:10: note: in implicit move constructor for 'testing::PolymorphicMatcher<testing::internal::StartsWithMatcher<std::wstring>>' first required here
  return MakePolymorphicMatcher(
         ^
/Users/matschaffer/code/fsbxbuild/git/googletest/googlemock/include/gmock/gmock-matchers.h:891:3: error: definition of implicit copy constructor for 'EndsWithMatcher<std::wstring>' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
  GTEST_DISALLOW_ASSIGN_(EndsWithMatcher);
  ^
/Users/matschaffer/code/fsbxbuild/git/googletest/googletest/include/gtest/internal/gtest-port.h:682:8: note: expanded from macro 'GTEST_DISALLOW_ASSIGN_'
  void operator=(type const &) = delete
       ^
/Users/matschaffer/code/fsbxbuild/git/googletest/googletest/include/gtest/gtest-matchers.h:454:7: note: in implicit copy constructor for 'testing::internal::EndsWithMatcher<std::wstring>' first required here
class PolymorphicMatcher {
      ^
/Users/matschaffer/code/fsbxbuild/git/googletest/googlemock/include/gmock/gmock-matchers.h:3908:10: note: in implicit move constructor for 'testing::PolymorphicMatcher<testing::internal::EndsWithMatcher<std::wstring>>' first required here
  return MakePolymorphicMatcher(
         ^
12 errors generated.
make[2]: *** [gtest/googlemock/CMakeFiles/gmock.dir/src/gmock-all.cc.o] Error 1
make[1]: *** [gtest/googlemock/CMakeFiles/gmock.dir/all] Error 2
make: *** [all] Error 2

This looks related to https://stackoverflow.com/questions/51863588/warning-definition-of-implicit-copy-constructor-is-deprecated but I'm not familiar with c++ or googletest enough to know what to change here.

@matschaffer
Copy link
Author

Oh! On a whim I switched googletest to release-1.12.1 and make install completed!

@matschaffer
Copy link
Author

It wouldn't run though since it's attempting to load some of the SFML frameworks I'd downloaded separately that aren't signed:

❯ ./FloatingSandbox                                                                              
dyld[11258]: Library not loaded: '@rpath/../Frameworks/vorbisfile.framework/Versions/A/vorbisfile'
  Referenced from: '/Users/matschaffer/code/fsbxbuild/dist/FloatingSandbox'
  Reason: tried: '/Library/Frameworks/vorbisfile.framework/Versions/A/vorbisfile' (code signature in <2A582B4F-7FFF-3822-B80A-56344FA1835B> '/Library/Frameworks/vorbisfile.framework/Versions/A/vorbisfile' not valid for use in process: library load disallowed by system policy), '/System/Library/Frameworks/vorbisfile.framework/Versions/A/vorbisfile' (no such file)
zsh: abort      ./FloatingSandbox

I guess it's not statically linking the ones in fs_lib for some reason so I'll try to figure that out.

@matschaffer
Copy link
Author

Removing the libraries, installing, then uninstalling sfml via homebrew then rebuilding SFML seems to have resolved the issue with attempting to load the unsigned dependencies in /Frameworks

@GabrieleGiuseppini
Copy link

This is fantastic news, Mat!!!! Finally got a Mac build!

Hey, do you have a Discord account? I'd like to chat slightly more interactively wrt the Mac build :-) I'd like to make an official readme for the build and I'd need you to drive me through the steps for building this.

Also, on a separate note: how familiar are you with the whole "packaging" topic on Mac?

@GabrieleGiuseppini
Copy link

GabrieleGiuseppini commented Oct 22, 2022

I guess it's not statically linking the ones in fs_lib for some reason so I'll try to figure that out.

Could this be because of line 129 in CMakeLists.txt?

@matschaffer
Copy link
Author

Hey, do you have a Discord account?

Yep, but I haven't used it much yet. I see my name as "matschaffer#7918" - maybe you can DM from that?

how familiar are you with the whole "packaging" topic on Mac?

Basically not at all 😆

One catch is that due to a job change I might lose the mac I'm on next week, but I have some older ones as well as an M1 for the new job I can probably try building on.

@GabrieleGiuseppini
Copy link

Hey Matt, sorry it took me forever - I've sent you a friend request on Discord. Let's see if we can catch up there!

@matschaffer
Copy link
Author

No worries :) Got your ping. I'm mostly moved onto some new laptops (old personal i7 and new work M1), so I'll retry the build process from the latest master and let you know if it works out.

@matschaffer
Copy link
Author

Gist has been updated after a build from master on a new mac. I'd be happy to post the binary somewhere, but I'm not entirely sure if it'll run without the build steps or not. Could be some dynamic linking afoot still.

Maybe a good next step would be to PR a page like https://github.com/GabrieleGiuseppini/Floating-Sandbox/blob/master/BUILD-Ubuntu.md that has this script broken down piece by piece so others can build and maybe contribute as well.

@GabrieleGiuseppini
Copy link

Indeed, that's exactly one of the two things that I'd like to achieve - a new document with build instructions for Mac. So let me get this straight: these two shell scripts successfully build a Floating Sandbox from current master? 'cause if that's the case I can try to write the build instructions myself.

As for the binary, any chance you could try ldd and see which dynamic libs it needs?

I'll try to get ahold of you on Discord now that we're connected. I only get online there once a week ;-)

Thanks so much Matt, by the way, for sharing your progress so far!!!

@matschaffer
Copy link
Author

matschaffer commented Nov 12, 2022

So let me get this straight: these two shell scripts successfully build a Floating Sandbox from current master?

That's what macos.sh does. Assuming you have at least homebrew installed. clean.sh just removes all the assets so I can re-run build fresh.

As for the binary, any chance you could try ldd and see which dynamic libs it needs?

It seems like maybe ldd isn't available on mac. I found https://stackoverflow.com/a/67818942 which recommends otool, so I tried that:

❯ otool -L FloatingSandbox
FloatingSandbox:
	/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
	/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
	/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 165.0.0)
	/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 23.0.0)
	/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore (compatibility version 1.2.0, current version 1.11.0)
	/System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox (compatibility version 1.0.0, current version 1000.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.100.3)
	/usr/local/opt/wxwidgets/lib/libwx_baseu-3.2.dylib (compatibility version 2.0.0, current version 2.0.0)
	/usr/local/opt/wxwidgets/lib/libwx_osx_cocoau_core-3.2.dylib (compatibility version 2.0.0, current version 2.0.0)
	/usr/local/opt/wxwidgets/lib/libwx_osx_cocoau_gl-3.2.dylib (compatibility version 2.0.0, current version 2.0.0)
	/usr/local/opt/wxwidgets/lib/libwx_osx_cocoau_html-3.2.dylib (compatibility version 2.0.0, current version 2.0.0)
	/usr/local/opt/wxwidgets/lib/libwx_osx_cocoau_propgrid-3.2.dylib (compatibility version 2.0.0, current version 2.0.0)
	/usr/local/opt/wxwidgets/lib/libwx_osx_cocoau_ribbon-3.2.dylib (compatibility version 2.0.0, current version 2.0.0)
	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
	/usr/local/opt/jpeg-turbo/lib/libjpeg.8.dylib (compatibility version 8.0.0, current version 8.2.2)
	/usr/local/opt/libpng/lib/libpng16.16.dylib (compatibility version 55.0.0, current version 55.0.0)
	/System/Library/Frameworks/OpenAL.framework/Versions/A/OpenAL (compatibility version 1.0.0, current version 1.0.0)
	/usr/local/opt/libvorbis/lib/libvorbisfile.3.dylib (compatibility version 7.0.0, current version 7.8.0)
	/usr/local/opt/libvorbis/lib/libvorbisenc.2.dylib (compatibility version 3.0.0, current version 3.12.0)
	/usr/local/opt/libvorbis/lib/libvorbis.0.dylib (compatibility version 5.0.0, current version 5.9.0)
	/usr/local/opt/libogg/lib/libogg.0.dylib (compatibility version 9.0.0, current version 9.5.0)
	/usr/local/opt/flac/lib/libFLAC.12.dylib (compatibility version 13.0.0, current version 13.0.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.23.0)

Most of it looks like system-provided stuff, but these are homebrew assets flac, jpeg-turbo, libogg, libpng, libvorbis, wxwidgets so I suspect this binary will only work on another mac which has them installed.

@GabrieleGiuseppini
Copy link

Thank you Matt. Darn, I wasn't expecting wxWidgets there, that's a setback. The other dynamic libraries are quite general and one could easily say they are requirements, but wxWidgets is not, and the Ubuntu instructions were geared towards building wxWidgets as static libs, and linking them statically in Floating Sandbox.

I see your shell script install wxWidgets instead of building it (statically) - the build step is commented out. Were you having problems with building them?

@matschaffer
Copy link
Author

Yeah, I could give it another shot though.

If I recall correctly it was a similar case to SFML where getting all the dependencies was tricky. Maybe the same hack of install/uninstall would do the trick there as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment