Skip to content

Start passing libtool path to CMake #14374

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions utils/swift_build_support/swift_build_support/cmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ def common_options(self):
else:
define("CMAKE_C_COMPILER:PATH", toolchain.cc)
define("CMAKE_CXX_COMPILER:PATH", toolchain.cxx)
define("CMAKE_LIBTOOL:PATH", toolchain.libtool)

if args.cmake_generator == 'Xcode':
define("CMAKE_CONFIGURATION_TYPES",
Expand Down
15 changes: 15 additions & 0 deletions utils/swift_build_support/tests/test_cmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def default_args(self):
"""
return Namespace(host_cc="/path/to/clang",
host_cxx="/path/to/clang++",
host_libtool="/path/to/libtool",
enable_asan=False,
enable_ubsan=False,
enable_tsan=False,
Expand Down Expand Up @@ -58,6 +59,7 @@ def cmake(self, args):
toolchain = host_toolchain()
toolchain.cc = args.host_cc
toolchain.cxx = args.host_cxx
toolchain.libtool = args.host_libtool
if args.distcc:
toolchain.distcc = self.mock_distcc_path()
toolchain.ninja = self.which_ninja(args)
Expand All @@ -71,6 +73,7 @@ def test_common_options_defaults(self):
["-G", "Ninja",
"-DCMAKE_C_COMPILER:PATH=/path/to/clang",
"-DCMAKE_CXX_COMPILER:PATH=/path/to/clang++",
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
"-DCMAKE_MAKE_PROGRAM=" + self.which_ninja(args)])

def test_common_options_asan(self):
Expand All @@ -83,6 +86,7 @@ def test_common_options_asan(self):
"-DLLVM_USE_SANITIZER=Address",
"-DCMAKE_C_COMPILER:PATH=/path/to/clang",
"-DCMAKE_CXX_COMPILER:PATH=/path/to/clang++",
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
"-DCMAKE_MAKE_PROGRAM=" + self.which_ninja(args)])

def test_common_options_ubsan(self):
Expand All @@ -95,6 +99,7 @@ def test_common_options_ubsan(self):
"-DLLVM_USE_SANITIZER=Undefined",
"-DCMAKE_C_COMPILER:PATH=/path/to/clang",
"-DCMAKE_CXX_COMPILER:PATH=/path/to/clang++",
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
"-DCMAKE_MAKE_PROGRAM=" + self.which_ninja(args)])

def test_common_options_tsan(self):
Expand All @@ -107,6 +112,7 @@ def test_common_options_tsan(self):
"-DLLVM_USE_SANITIZER=Thread",
"-DCMAKE_C_COMPILER:PATH=/path/to/clang",
"-DCMAKE_CXX_COMPILER:PATH=/path/to/clang++",
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
"-DCMAKE_MAKE_PROGRAM=" + self.which_ninja(args)])

def test_common_options_asan_ubsan(self):
Expand All @@ -120,6 +126,7 @@ def test_common_options_asan_ubsan(self):
"-DLLVM_USE_SANITIZER=Address;Undefined",
"-DCMAKE_C_COMPILER:PATH=/path/to/clang",
"-DCMAKE_CXX_COMPILER:PATH=/path/to/clang++",
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
"-DCMAKE_MAKE_PROGRAM=" + self.which_ninja(args)])

def test_common_options_ubsan_tsan(self):
Expand All @@ -133,6 +140,7 @@ def test_common_options_ubsan_tsan(self):
"-DLLVM_USE_SANITIZER=Undefined;Thread",
"-DCMAKE_C_COMPILER:PATH=/path/to/clang",
"-DCMAKE_CXX_COMPILER:PATH=/path/to/clang++",
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
"-DCMAKE_MAKE_PROGRAM=" + self.which_ninja(args)])

def test_common_options_asan_ubsan_tsan(self):
Expand All @@ -147,6 +155,7 @@ def test_common_options_asan_ubsan_tsan(self):
"-DLLVM_USE_SANITIZER=Address;Undefined;Thread",
"-DCMAKE_C_COMPILER:PATH=/path/to/clang",
"-DCMAKE_CXX_COMPILER:PATH=/path/to/clang++",
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
"-DCMAKE_MAKE_PROGRAM=" + self.which_ninja(args)])

def test_common_options_lsan(self):
Expand All @@ -159,6 +168,7 @@ def test_common_options_lsan(self):
"-DLLVM_USE_SANITIZER=Leaks",
"-DCMAKE_C_COMPILER:PATH=/path/to/clang",
"-DCMAKE_CXX_COMPILER:PATH=/path/to/clang++",
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
"-DCMAKE_MAKE_PROGRAM=" + self.which_ninja(args)])

def test_common_options_export_compile_commands(self):
Expand All @@ -171,6 +181,7 @@ def test_common_options_export_compile_commands(self):
"-DCMAKE_EXPORT_COMPILE_COMMANDS=ON",
"-DCMAKE_C_COMPILER:PATH=/path/to/clang",
"-DCMAKE_CXX_COMPILER:PATH=/path/to/clang++",
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
"-DCMAKE_MAKE_PROGRAM=" + self.which_ninja(args)])

def test_common_options_distcc(self):
Expand All @@ -195,6 +206,7 @@ def test_common_options_xcode(self):
["-G", "Xcode",
"-DCMAKE_C_COMPILER:PATH=/path/to/clang",
"-DCMAKE_CXX_COMPILER:PATH=/path/to/clang++",
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
"-DCMAKE_CONFIGURATION_TYPES=" +
"Debug;Release;MinSizeRel;RelWithDebInfo"])

Expand All @@ -209,6 +221,7 @@ def test_common_options_clang_compiler_version(self):
["-G", "Ninja",
"-DCMAKE_C_COMPILER:PATH=/path/to/clang",
"-DCMAKE_CXX_COMPILER:PATH=/path/to/clang++",
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
"-DCMAKE_MAKE_PROGRAM=" + self.which_ninja(args)])

def test_common_options_clang_user_visible_version(self):
Expand All @@ -222,6 +235,7 @@ def test_common_options_clang_user_visible_version(self):
["-G", "Ninja",
"-DCMAKE_C_COMPILER:PATH=/path/to/clang",
"-DCMAKE_CXX_COMPILER:PATH=/path/to/clang++",
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
"-DLLVM_VERSION_MAJOR:STRING=9",
"-DLLVM_VERSION_MINOR:STRING=0",
"-DLLVM_VERSION_PATCH:STRING=0",
Expand All @@ -239,6 +253,7 @@ def test_common_options_build_ninja(self):
["-G", "Ninja",
"-DCMAKE_C_COMPILER:PATH=/path/to/clang",
"-DCMAKE_CXX_COMPILER:PATH=/path/to/clang++",
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
"-DCMAKE_MAKE_PROGRAM=" + self.which_ninja(args)])

def test_common_options_full(self):
Expand Down