Skip to content

Commit 3d24e0a

Browse files
committed
Swift: enable VSCode to build extractor via CMake
The `-arch=x86_64` from `swift/rules.bzl` turns out to be unnecessary, even on Arm-based Macs.
1 parent 28b7f08 commit 3d24e0a

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

.vscode/settings.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
{
2-
"omnisharp.autoStart": false
2+
"omnisharp.autoStart": false,
3+
"cmake.sourceDirectory": "${workspaceFolder}/swift",
4+
"cmake.buildDirectory": "${workspaceFolder}/bazel-cmake-build"
35
}

swift/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ set(CMAKE_CXX_EXTENSIONS OFF)
99
set(CMAKE_C_COMPILER clang)
1010
set(CMAKE_CXX_COMPILER clang++)
1111

12+
if(APPLE)
13+
set(CMAKE_OSX_ARCHITECTURES x86_64) # temporary until we can build a Universal Binary
14+
endif()
15+
1216
project(codeql)
1317

1418
include(../misc/bazel/cmake/setup.cmake)

swift/rules.bzl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@ def _wrap_cc(rule, kwargs):
55
_add_args(kwargs, "copts", [
66
# Required by LLVM/Swift
77
"-fno-rtti",
8-
] + select({
9-
# temporary, before we do universal merging and have an arm prebuilt package, we make arm build x86
10-
"@platforms//os:macos": ["-arch=x86_64"],
11-
"//conditions:default": [],
12-
}))
8+
])
139
_add_args(kwargs, "features", [
1410
# temporary, before we do universal merging
1511
"-universal_binaries",

0 commit comments

Comments
 (0)