Skip to content

Commit

Permalink
Swift: enable VSCode to build extractor via CMake
Browse files Browse the repository at this point in the history
The `-arch=x86_64` from `swift/rules.bzl` turns out to be unnecessary,
even on Arm-based Macs.
  • Loading branch information
d10c committed Nov 3, 2022
1 parent 28b7f08 commit 3d24e0a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"omnisharp.autoStart": false
"omnisharp.autoStart": false,
"cmake.sourceDirectory": "${workspaceFolder}/swift",
"cmake.buildDirectory": "${workspaceFolder}/bazel-cmake-build"
}
4 changes: 4 additions & 0 deletions swift/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_C_COMPILER clang)
set(CMAKE_CXX_COMPILER clang++)

if(APPLE)
set(CMAKE_OSX_ARCHITECTURES x86_64) # temporary until we can build a Universal Binary
endif()

project(codeql)

include(../misc/bazel/cmake/setup.cmake)
Expand Down
6 changes: 1 addition & 5 deletions swift/rules.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ def _wrap_cc(rule, kwargs):
_add_args(kwargs, "copts", [
# Required by LLVM/Swift
"-fno-rtti",
] + select({
# temporary, before we do universal merging and have an arm prebuilt package, we make arm build x86
"@platforms//os:macos": ["-arch=x86_64"],
"//conditions:default": [],
}))
])
_add_args(kwargs, "features", [
# temporary, before we do universal merging
"-universal_binaries",
Expand Down

0 comments on commit 3d24e0a

Please sign in to comment.