Skip to content

Commit

Permalink
Xcode build with C++11
Browse files Browse the repository at this point in the history
  • Loading branch information
devernay committed Jun 9, 2021
1 parent f718e6b commit 83d8f07
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
18 changes: 11 additions & 7 deletions INSTALL_MACOS.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Install the required packages:

```Shell
sudo port -v -N install opencolorio -quartz -python27
sudo port -v -N install qt4-mac boost cairo expat
sudo port -v -N install qt4-mac cairo expat
sudo port -v -N install gsed gawk coreutils findutils
sudo port -v -N install cmake keychain
sudo port -v -N install py27-pyside py39-sphinx py39-sphinx_rtd_theme
Expand Down Expand Up @@ -350,13 +350,17 @@ config.pri:
```Shell
# copy and paste the following in a terminal
cat > config.pri << EOF
boost: INCLUDEPATH += /opt/local/include
boost: LIBS += -L/opt/local/lib -lboost_serialization-mt
boost {
BOOST_VERSION = \$\$system("grep 'default boost.version' /opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/_resources/port1.0/group/boost-1.0.tcl |awk '{ print \$3 }'")
message("found boost \$\$BOOST_VERSION")
INCLUDEPATH += /opt/local/libexec/boost/\$\$BOOST_VERSION/include
LIBS += -L/opt/local/libexec/boost/\$\$BOOST_VERSION/lib -lboost_serialization-mt
}
macx:openmp {
QMAKE_CC=/opt/local/bin/clang-mp-9.0
QMAKE_CXX=/opt/local/bin/clang++-mp-9.0
QMAKE_OBJECTIVE_CC=$$QMAKE_CC -stdlib=libc++
QMAKE_LINK=$$QMAKE_CXX
QMAKE_OBJECTIVE_CC=\$\$QMAKE_CC -stdlib=libc++
QMAKE_LINK=\$\$QMAKE_CXX
INCLUDEPATH += /opt/local/include/libomp
LIBS += -L/opt/local/lib/libomp -liomp5
Expand Down Expand Up @@ -394,8 +398,8 @@ expat: LIBS += -L/usr/local/opt/expat/lib -lexpat
macx:openmp {
QMAKE_CC=/usr/local/opt/llvm/bin/clang
QMAKE_CXX=/usr/local/opt/llvm/bin/clang++
QMAKE_OBJECTIVE_CC=$$QMAKE_CC -stdlib=libc++
QMAKE_LINK=$$QMAKE_CXX
QMAKE_OBJECTIVE_CC=\$\$QMAKE_CC -stdlib=libc++
QMAKE_LINK=\$\$QMAKE_CXX
LIBS += -L/usr/local/opt/llvm/lib -lomp
cc_setting.name = CC
Expand Down
1 change: 0 additions & 1 deletion Project.pro
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ OTHER_FILES += \
config.pri

include(global.pri)
include(config.pri)
include(libs.pri)

isEmpty(CONFIG_SET) {
Expand Down
3 changes: 3 additions & 0 deletions global.pri
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,9 @@ unix {
QMAKE_MAC_XCODE_SETTINGS += symbols_hidden_by_default
c++11 {
lessThan(QT_GCC_MAJOR_VERSION, 5): QMAKE_CXXFLAGS += -std=c++11
enable_cxx11.name = CLANG_CXX_LANGUAGE_STANDARD
enable_cxx11.value = c++0x
QMAKE_MAC_XCODE_SETTINGS += enable_cxx11
}
}

Expand Down

0 comments on commit 83d8f07

Please sign in to comment.