diff --git a/Makefile b/Makefile index ab05431..c6a1d09 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -# Copyright 2017 The Procyon Authors +# Copyright 2020 The Procyon Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,12 +12,26 @@ # See the License for the specific language governing permissions and # limitations under the License. -include out/cur/args.gn -NINJA=build/lib/bin/ninja -C out/cur - -.PHONY: all all: - @$(NINJA) + +OUT ?= out/cur +PROCYON ?= . +EXT ?= ext +GMOCK ?= $(EXT)/gmock +MKDIR_P ?= mkdir -p + +-include $(OUT)/config.mk + +CPPFLAGS += -MMD -MP +CFLAGS += -Wall +CXXFLAGS += -std=c++11 -Wall + +include ext/gmock/build/targets.mk +include build/targets.mk + +all: lib bin +lib: $(LIBPROCYON) $(LIBPROCYON_CPP) $(PROCYON_CPP_TEST) +bin: $(LIBPROCYON_BIN) $(PN2JSON) $(PNDUMP) $(PNFMT) $(PNPARSE) $(PNTOK) .PHONY: test test: test-python @@ -33,12 +47,12 @@ test-vim: misc/vim/test/syntax.vroom .PHONY: test-cpp -test-cpp: - out/cur/procyon-cpp-test +test-cpp: $(PROCYON_CPP_TEST) + $< .PHONY: test-wine -test-wine: - xvfb-run wine64 out/cur/procyon-cpp-test.exe +test-wine: $(PROCYON_CPP_TEST) + xvfb-run wine64 $< .PHONY: regen regen: @@ -48,15 +62,15 @@ regen: .PHONY: clean clean: - @$(NINJA) -t clean + $(RM) -r $(OUT)/ .PHONY: distclean distclean: - rm -Rf out/ + $(RM) -r out .PHONY: friends friends: - @echo "Sure! You can email me at sfiera@sfzmail.com." + @echo "Sure! You can email me at sfiera@twotaled.com." .PHONY: love love: diff --git a/build/lib b/build/lib index e945ff4..8f11b9a 160000 --- a/build/lib +++ b/build/lib @@ -1 +1 @@ -Subproject commit e945ff4af8ae64e148977e951b7793934a3b75f5 +Subproject commit 8f11b9a0ae0e535f5e1491f65f0146b2953725e8 diff --git a/build/libprocyon-bin.mk b/build/libprocyon-bin.mk new file mode 100644 index 0000000..49af828 --- /dev/null +++ b/build/libprocyon-bin.mk @@ -0,0 +1,28 @@ +# Copyright 2020 The Procyon Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +LIBPROCYON_BIN := $(OUT)/libprocyon-bin.a +LIBPROCYON_BIN_SRCS := \ + $(PROCYON)/src/bin/src/lex.cpp \ + $(PROCYON)/src/bin/src/parse.cpp +LIBPROCYON_BIN_OBJS := $(LIBPROCYON_BIN_SRCS:%=$(OUT)/%.o) + +$(LIBPROCYON_BIN): $(LIBPROCYON_BIN_OBJS) + $(AR) rcs $@ $+ + +$(LIBPROCYON_BIN_OBJS): $(OUT)/%.cpp.o: %.cpp + @$(MKDIR_P) $(dir $@) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LIBPROCYON_CPPFLAGS) -c $< -o $@ + +-include $(LIBPROCYON_BIN_OBJS:.o=.d) diff --git a/build/libprocyon-cpp.mk b/build/libprocyon-cpp.mk new file mode 100644 index 0000000..cfb3a8f --- /dev/null +++ b/build/libprocyon-cpp.mk @@ -0,0 +1,32 @@ +# Copyright 2020 The Procyon Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +LIBPROCYON_CPP := $(OUT)/libprocyon-cpp.a +LIBPROCYON_CPP_SRCS := \ + $(PROCYON)/src/cpp/src/array.cpp \ + $(PROCYON)/src/cpp/src/data.cpp \ + $(PROCYON)/src/cpp/src/file.cpp \ + $(PROCYON)/src/cpp/src/map.cpp \ + $(PROCYON)/src/cpp/src/string.cpp \ + $(PROCYON)/src/cpp/src/value.cpp +LIBPROCYON_CPP_OBJS := $(LIBPROCYON_CPP_SRCS:%=$(OUT)/%.o) + +$(LIBPROCYON_CPP): $(LIBPROCYON_CPP_OBJS) + $(AR) rcs $@ $+ + +$(LIBPROCYON_CPP_OBJS): $(OUT)/%.cpp.o: %.cpp + @$(MKDIR_P) $(dir $@) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LIBPROCYON_CPPFLAGS) -c $< -o $@ + +-include $(LIBPROCYON_CPP_OBJS:.o=.d) diff --git a/build/libprocyon.mk b/build/libprocyon.mk new file mode 100644 index 0000000..b5dea45 --- /dev/null +++ b/build/libprocyon.mk @@ -0,0 +1,42 @@ +# Copyright 2020 The Procyon Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +LIBPROCYON_CPPFLAGS=-I $(PROCYON)/include +LIBPROCYON_LDFLAGS=-lm -lpthread + +LIBPROCYON := $(OUT)/libprocyon.a +LIBPROCYON_SRCS := \ + $(PROCYON)/src/c/src/common.c \ + $(PROCYON)/src/c/src/dtoa.c \ + $(PROCYON)/src/c/src/dump.c \ + $(PROCYON)/src/c/src/error.c \ + $(PROCYON)/src/c/src/file.c \ + $(PROCYON)/src/c/src/format.c \ + $(PROCYON)/src/c/src/gen_table.c \ + $(PROCYON)/src/c/src/io.c \ + $(PROCYON)/src/c/src/lex.c \ + $(PROCYON)/src/c/src/numeric.c \ + $(PROCYON)/src/c/src/parse.c \ + $(PROCYON)/src/c/src/procyon.c \ + $(PROCYON)/src/c/src/utf8.c +LIBPROCYON_OBJS := $(LIBPROCYON_SRCS:%=$(OUT)/%.o) + +$(LIBPROCYON): $(LIBPROCYON_OBJS) + $(AR) rcs $@ $+ + +$(LIBPROCYON_OBJS): $(OUT)/%.c.o: %.c + @$(MKDIR_P) $(dir $@) + $(CC) $(CPPFLAGS) $(CFLAGS) $(LIBPROCYON_CPPFLAGS) -c $< -o $@ + +-include $(LIBPROCYON_OBJS:.o=.d) diff --git a/build/pn2json.mk b/build/pn2json.mk new file mode 100644 index 0000000..019af03 --- /dev/null +++ b/build/pn2json.mk @@ -0,0 +1,26 @@ +# Copyright 2020 The Procyon Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +PN2JSON := $(OUT)/pn2json$(EXE_SUFFIX) +PN2JSON_SRCS := $(PROCYON)/src/bin/src/pn2json.cpp +PN2JSON_OBJS := $(PN2JSON_SRCS:%=$(OUT)/%.o) + +$(PN2JSON): $(PN2JSON_OBJS) $(LIBPROCYON_BIN) $(LIBPROCYON) $(LIBPROCYON_CPP) + $(CXX) $+ -o $@ $(LDFLAGS) $(LIBPROCYON_LDFLAGS) + +$(PN2JSON_OBJS): $(OUT)/%.cpp.o: %.cpp + @$(MKDIR_P) $(dir $@) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LIBPROCYON_CPPFLAGS) -c $< -o $@ + +-include $(PN2JSON_OBJS:.o=.d) diff --git a/build/pndump.mk b/build/pndump.mk new file mode 100644 index 0000000..9161410 --- /dev/null +++ b/build/pndump.mk @@ -0,0 +1,26 @@ +# Copyright 2020 The Procyon Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +PNDUMP := $(OUT)/pndump$(EXE_SUFFIX) +PNDUMP_SRCS := $(PROCYON)/src/bin/src/pndump.cpp +PNDUMP_OBJS := $(PNDUMP_SRCS:%=$(OUT)/%.o) + +$(PNDUMP): $(PNDUMP_OBJS) $(LIBPROCYON_BIN) $(LIBPROCYON_CPP) $(LIBPROCYON) + $(CXX) $+ -o $@ $(LDFLAGS) $(LIBPROCYON_LDFLAGS) + +$(PNDUMP_OBJS): $(OUT)/%.cpp.o: %.cpp + @$(MKDIR_P) $(dir $@) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LIBPROCYON_CPPFLAGS) -c $< -o $@ + +-include $(PNDUMP_OBJS:.o=.d) diff --git a/build/pnfmt.mk b/build/pnfmt.mk new file mode 100644 index 0000000..6b5bf93 --- /dev/null +++ b/build/pnfmt.mk @@ -0,0 +1,26 @@ +# Copyright 2020 The Procyon Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +PNFMT := $(OUT)/pnfmt$(EXE_SUFFIX) +PNFMT_SRCS := $(PROCYON)/src/bin/src/pnfmt.cpp +PNFMT_OBJS := $(PNFMT_SRCS:%=$(OUT)/%.o) + +$(PNFMT): $(PNFMT_OBJS) $(LIBPROCYON_BIN) $(LIBPROCYON_CPP) $(LIBPROCYON) + $(CXX) $+ -o $@ $(LDFLAGS) $(LIBPROCYON_LDFLAGS) + +$(PNFMT_OBJS): $(OUT)/%.cpp.o: %.cpp + @$(MKDIR_P) $(dir $@) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LIBPROCYON_CPPFLAGS) -c $< -o $@ + +-include $(PNFMT_OBJS:.o=.d) diff --git a/build/pnparse.mk b/build/pnparse.mk new file mode 100644 index 0000000..d6fc221 --- /dev/null +++ b/build/pnparse.mk @@ -0,0 +1,26 @@ +# Copyright 2020 The Procyon Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +PNPARSE := $(OUT)/pnparse$(EXE_SUFFIX) +PNPARSE_SRCS := $(PROCYON)/src/bin/src/pnparse.c +PNPARSE_OBJS := $(PNPARSE_SRCS:%=$(OUT)/%.o) + +$(PNPARSE): $(PNPARSE_OBJS) $(LIBPROCYON) + $(CC) $+ -o $@ $(LDFLAGS) $(LIBPROCYON_LDFLAGS) + +$(PNPARSE_OBJS): $(OUT)/%.c.o: %.c + @$(MKDIR_P) $(dir $@) + $(CC) $(CPPFLAGS) $(CFLAGS) $(LIBPROCYON_CPPFLAGS) -c $< -o $@ + +-include $(PNPARSE_OBJS:.o=.d) diff --git a/build/pntok.mk b/build/pntok.mk new file mode 100644 index 0000000..2f89fd9 --- /dev/null +++ b/build/pntok.mk @@ -0,0 +1,28 @@ +# Copyright 2020 The Procyon Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +PNTOK := $(OUT)/pntok +PNTOK_SRCS := $(PROCYON)/src/bin/src/pntok.c +PNTOK_OBJS := $(PNTOK_SRCS:%=$(OUT)/%.o) + +$(PNTOK): $(PNTOK_OBJS) $(LIBPROCYON) + $(CC) $+ -o $@ $(LDFLAGS) $(LIBPROCYON_LDFLAGS) + +PNTOK_CFLAGS := -Wno-initializer-overrides + +$(PNTOK_OBJS): $(OUT)/%.c.o: %.c + @$(MKDIR_P) $(dir $@) + $(CC) $(CPPFLAGS) $(CFLAGS) $(LIBPROCYON_CPPFLAGS) $(PNTOK_CFLAGS) -c $< -o $@ + +-include $(PNTOK_OBJS:.o=.d) diff --git a/build/procyon-cpp-test.mk b/build/procyon-cpp-test.mk new file mode 100644 index 0000000..80d06b6 --- /dev/null +++ b/build/procyon-cpp-test.mk @@ -0,0 +1,43 @@ +# Copyright 2020 The Procyon Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +PROCYON_CPP_TEST := $(OUT)/procyon-cpp-test$(EXE_SUFFIX) +PROCYON_CPP_TEST_SRCS := \ + $(PROCYON)/src/cpp/test/data.test.cpp \ + $(PROCYON)/src/cpp/test/dump.test.cpp \ + $(PROCYON)/src/cpp/test/float.test.cpp \ + $(PROCYON)/src/cpp/test/format.test.cpp \ + $(PROCYON)/src/cpp/test/io.test.cpp \ + $(PROCYON)/src/cpp/test/lex.test.cpp \ + $(PROCYON)/src/cpp/test/matchers.cpp \ + $(PROCYON)/src/cpp/test/parse.test.cpp \ + $(PROCYON)/src/cpp/test/string.test.cpp \ + $(PROCYON)/src/cpp/test/utf8.test.cpp \ + $(PROCYON)/src/cpp/test/value.test.cpp \ + $(PROCYON)/src/cpp/test/valuepp.test.cpp +PROCYON_CPP_TEST_OBJS := $(PROCYON_CPP_TEST_SRCS:%=$(OUT)/%.o) + +$(PROCYON_CPP_TEST): $(PROCYON_CPP_TEST_OBJS) $(LIBPROCYON_CPP) $(LIBPROCYON) $(LIBGMOCK_MAIN) + $(CXX) $+ -o $@ $(LDFLAGS) $(LIBPROCYON_LDFLAGS) + +PROCYON_CPP_TEST_CPPFLAGS := \ + $(LIBPROCYON_CPPFLAGS) \ + $(LIBGMOCK_CPPFLAGS) \ + -I src/c/src + +$(PROCYON_CPP_TEST_OBJS): $(OUT)/%.cpp.o: %.cpp + @$(MKDIR_P) $(dir $@) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(PROCYON_CPP_TEST_CPPFLAGS) -c $< -o $@ + +-include $(PROCYON_CPP_TEST_OBJS:.o=.d) diff --git a/build/targets.mk b/build/targets.mk new file mode 100644 index 0000000..703c5a0 --- /dev/null +++ b/build/targets.mk @@ -0,0 +1,23 @@ +# Copyright 2020 The Procyon Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +include build/libprocyon.mk +include build/libprocyon-cpp.mk +include build/libprocyon-bin.mk +include build/procyon-cpp-test.mk +include build/pnfmt.mk +include build/pn2json.mk +include build/pndump.mk +include build/pntok.mk +include build/pnparse.mk diff --git a/configure b/configure index d86ebea..865cb59 100755 --- a/configure +++ b/configure @@ -14,8 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import division, print_function, unicode_literals - import argparse import collections import glob @@ -30,38 +28,84 @@ try: except ImportError: pass -str = type("") # For Python2 +MODES = { + "dbg": ["-g", "-O0"], + "dev": ["-O0"], + "opt": ["-O3"], +} +SANITIZERS = { + "": [], + "memory": ["-fsanitize=memory", "-fsanitize-memory-track-origins"], + "address": ["-fsanitize=address", "-fno-omit-frame-pointer"], + "undefined": ["-fsanitize=undefined", "-fno-sanitize-recover=undefined"], +} + +PLATFORMS = { + ("mac", "mac"): { + "cc": "clang", + "cxx": "clang++", + "ar": "ar", + }, + ("linux", "linux"): { + "cc": "clang", + "cxx": "clang++", + "ar": "ar", + }, + ("linux", "win"): { + "cc": "clang -target x86_64-w64-mingw32 -static", + "cxx": "clang++ -target x86_64-w64-mingw32 -static", + "ar": "x86_64-w64-mingw32-ar", + }, +} def main(): os.chdir(os.path.dirname(sys.argv[0])) progname = sys.argv[0] parser = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter) - parser.add_argument("-m", "--mode", metavar="MODE", - type=str, choices="dbg dev opt".split(), default="opt", + parser.add_argument("-m", + "--mode", + metavar="MODE", + type=str, + choices="dbg dev opt".split(), + default="opt", help="set build configuration:\n" " - opt: compile for fast binaries (default)\n" " - dev: compile for fast builds\n" " - dbg: add debugging symbols") - parser.add_argument("-o", "--target-os", metavar="OS", + parser.add_argument("--host-os", + metavar="OS", + type=str, + default=cfg.host_os(), + help="host os (default: host os)") + parser.add_argument("-o", + "--target-os", + metavar="OS", type=str, help="target os (default: host os)") - parser.add_argument("--prefix", type=str, default="/usr/local", + parser.add_argument("--prefix", + type=str, + default="/usr/local", help="installation prefix (default: /usr/local)") - parser.add_argument("--sanitizer", choices="memory address undefined".split(), default="", + parser.add_argument("--sanitizer", + choices="memory address undefined".split(), + default="", help="run sanitizer (memory, address, or undefined)") args = parser.parse_args() check_submodules() - check_host() + check_host(args) check_target(args) with cfg.step("configure mode") as msg: msg(args.mode, color="green") - cfg.gn(mode=args.mode, - target_os=args.target_os, - prefix=args.prefix, - sanitizer=args.sanitizer) + cfg.configure(os.path.join("out", args.target_os, args.mode), + cflags=MODES[args.mode] + SANITIZERS[args.sanitizer], + cxxflags=MODES[args.mode] + SANITIZERS[args.sanitizer], + prefix=args.prefix, + host_os=args.host_os, + target_os=args.target_os, + **PLATFORMS[args.host_os, args.target_os]) print("make(1) it so!") @@ -69,7 +113,7 @@ def main(): def check_submodules(): REQUIRED_SUBMODULES = [ "build/lib/BUILD.gn", - "ext/gmock", + "ext/gmock/Makefile", ] missing = False for module in REQUIRED_SUBMODULES: @@ -83,12 +127,12 @@ def check_submodules(): sys.exit(1) -def check_host(): +def check_host(args): with cfg.step("checking host os") as msg: - if cfg.host_os() in ["mac", "linux"]: - msg(cfg.host_os(), color="green") + if args.host_os in ["mac", "linux"]: + msg(args.host_os, color="green") else: - msg(cfg.host_os(), color="red") + msg(args.host_os, color="red") print("\nSorry! procyon requires Mac OS X or Linux") sys.exit(1) @@ -96,13 +140,12 @@ def check_host(): def check_target(args): with cfg.step("checking target os") as msg: if args.target_os is None: - args.target_os = cfg.host_os() + args.target_os = args.host_os checker = { ("mac", "mac"): check_mac, ("linux", "linux"): check_linux_native, - ("linux", "mac"): check_mac_on_linux, ("linux", "win"): check_win_on_linux, - }.get((cfg.host_os(), args.target_os)) + }.get((args.host_os, args.target_os)) if checker is None: msg(args.target_os, color="red") sys.exit(1) @@ -122,18 +165,14 @@ def check_mac(args): missing = collections.OrderedDict() if not (check_clang() and check_libcxx()): - missing["xcode"] = ( - "* Xcode can be installed via the App Store:\n" - " https://itunes.apple.com/en/app/xcode/id497799835\n" - " After installing, open it and accept the license agreement\n") + missing["xcode"] = ("* Xcode can be installed via the App Store:\n" + " https://itunes.apple.com/en/app/xcode/id497799835\n" + " After installing, open it and accept the license agreement\n") if missing: print("\nmissing dependencies: %s\n" % " ".join(missing.keys())) for step in missing.values(): sys.stdout.write(step) - if any("Homebrew" in v for v in missing.values()): - print("* Homebrew can be installed like so:") - print(' $ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"') sys.exit(1) @@ -177,22 +216,6 @@ def check_linux_native(args): sys.exit(1) -def check_mac_on_linux(args): - missing = collections.OrderedDict() - if not (check_clang("x86_64-apple-darwin15-clang++") and - check_libcxx("x86_64-apple-darwin15-clang++")): - missing["osxcross"] = ( - "* OSXCross can be found here:\n" - " https://github.com/tpoechtrager/osxcross\n" - " Download and build it, and ensure target/bin is in your $PATH\n") - - if missing: - print("\nmissing dependencies: %s\n" % " ".join(missing.keys())) - for step in missing.values(): - sys.stdout.write(step) - sys.exit(1) - - def check_win_on_linux(args): with cfg.step("checking Linux distro") as msg: distro = linux_distribution() @@ -227,19 +250,18 @@ def check_win_on_linux(args): def check_clang(executable=""): """Compile a basic C++11 binary.""" executable = executable or "clang++" - return cfg.check_bin( - ("%s -x c++ -std=c++11 - -o /dev/null" % executable).split(), - what="clang", - input="int main() { return 1; }") + return cfg.check_bin(("%s -x c++ -std=c++11 - -o /dev/null" % executable).split(), + what="clang", + input="int main() { return 1; }") def check_libcxx(executable=""): """Compile a basic C++11, libc++ binary.""" executable = executable or "clang++" return cfg.check_bin( - ("%s -x c++ -std=c++11 -stdlib=libc++ - -o /dev/null" % executable).split(), - what="libc++", - input="#include \n\nint main() { return std::chrono::seconds(1).count(); }") + ("%s -x c++ -std=c++11 -stdlib=libc++ - -o /dev/null" % executable).split(), + what="libc++", + input="#include \n\nint main() { return std::chrono::seconds(1).count(); }") if __name__ == "__main__": diff --git a/ext/gmock b/ext/gmock index da42ce8..6aadad6 160000 --- a/ext/gmock +++ b/ext/gmock @@ -1 +1 @@ -Subproject commit da42ce8a92d376f85ba5b83daf6929bb3ddcf068 +Subproject commit 6aadad67e84b95a856a17fca3f421f60cca256ff