Skip to content
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

get OSS build to pass, add VS Studio Code support #4

Closed
wants to merge 12 commits into from
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
.vscode
*.a
*.dylib
.DS_Store
Expand Down
21 changes: 21 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"configurations": [
{
"name": "WSL2",
"includePath": [
"${workspaceFolder}/**",
"${workspaceFolder}/_build/deps/**"
],
"defines": [
"_DEBUG",
"__linux__",
"__x86_64__"
],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c17",
"cppStandard": "gnu++17",
"intelliSenseMode": "${default}"
}
],
"version": 4
}
12 changes: 12 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"cmake.configureOnOpen": false,
"cmake.configureOnEdit": false,
"cmake.automaticReconfigure": false,
"cmake.buildBeforeRun": false,
"cmake.buildTask": false,
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
"C_Cpp.default.compilerPath": "/usr/bin/g++-13",
"C_Cpp.intelliSenseEngine": "Tag Parser",
"cmake.deleteBuildDirOnCleanConfigure": false,
"testMate.cpp.test.executables": "{build,Build,BUILD,out,Out,OUT,moxygen}/**/*{test,Test,TEST}*"
}
45 changes: 45 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "Run build script",
"command": "sudo ./build.sh",
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"type": "shell",
"label": "Run MoQTests",
"command": "./moxygen/test/MoQTests",
"options": {
"cwd": "${workspaceFolder}"
},
"group": {
"kind": "test",
"isDefault": true
},
"problemMatcher": []
},
{
"type": "shell",
"label": "Run MoQSessionTest",
"command": "./moxygen/test/MoQSessionTests",
"options": {
"cwd": "${workspaceFolder}"
},
"group": {
"kind": "test",
"isDefault": true
}
}
]
}
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ find_package(folly REQUIRED)
find_package(wangle REQUIRED)
find_package(mvfst REQUIRED)
find_package(proxygen REQUIRED)
# We can NOT use Glog latest version, is NOT compatible with moxygen
find_package(glog REQUIRED)
find_package(gflags REQUIRED)
find_package(Zstd REQUIRED)

list(APPEND
Expand Down
33 changes: 31 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ function install_dependencies_linux() {
libgoogle-glog-dev \
libdouble-conversion-dev \
libboost-all-dev \
gperf \
libfast-float-dev
gperf
}

function install_dependencies_mac() {
Expand All @@ -59,6 +58,7 @@ function install_dependencies_mac() {
m4 \
boost \
double-conversion \
fast_float \
gflags \
glog \
gperf \
Expand Down Expand Up @@ -113,6 +113,34 @@ function synch_dependency_to_commit() {
popd
}

function setup_fast_float() {
FASTFLOAT_DIR=$DEPS_DIR/fast_float
FASTFLOAT_BUILD_DIR=$DEPS_DIR/fast_float/build/
FASTFLOAT_TAG=$(grep "subdir = " ../build/fbcode_builder/manifests/fast_float | cut -d "-" -f 2,3)
if [ ! -d "$FASTFLOAT_DIR" ] ; then
echo -e "${COLOR_GREEN}[ INFO ] Cloning fast_float repo ${COLOR_OFF}"
git clone https://github.com/fastfloat/fast_float.git "$FASTFLOAT_DIR"
fi
cd "$FASTFLOAT_DIR"
git fetch --tags
git checkout "v${FASTFLOAT_TAG}"
echo -e "${COLOR_GREEN}Building fast_float ${COLOR_OFF}"
mkdir -p "$FASTFLOAT_BUILD_DIR"
cd "$FASTFLOAT_BUILD_DIR" || exit

cmake \
-DCMAKE_PREFIX_PATH="$DEPS_DIR" \
-DCMAKE_INSTALL_PREFIX="$DEPS_DIR" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DFASTFLOAT_TEST=OFF \
-DFASTFLOAT_SANITIZE=OFF \
..
make -j "$JOBS"
make install
echo -e "${COLOR_GREEN}fast_float is installed ${COLOR_OFF}"
cd "$BWD" || exit
}

function setup_fmt() {
FMT_DIR=$DEPS_DIR/fmt
FMT_BUILD_DIR=$DEPS_DIR/fmt/build/
Expand Down Expand Up @@ -458,6 +486,7 @@ mkdir -p "$DEPS_DIR"
cd "$(dirname "$0")"

if [ "$INSTALL_LIBRARIES" == true ] ; then
setup_fast_float
setup_fmt
setup_googletest
setup_zstd
Expand Down
17 changes: 17 additions & 0 deletions moxygen.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"folders": [
{
"path": "."
}
],
"settings": {
"cmake.options.statusBarVisibility": "hidden",
"remote.WSL.debug": true
},
"extensions": {
"recommendations": [
"ms-vscode.cpptools",
"ms-vscode-remote.remote-wsl"
]
}
}