Skip to content

Commit

Permalink
Rebased to new repo structure
Browse files Browse the repository at this point in the history
  • Loading branch information
frankkopp committed Jan 28, 2023
1 parent 393e58e commit 2ad0886
Show file tree
Hide file tree
Showing 85 changed files with 125 additions and 4,371 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@
# explicit exclusions
/.env
node_modules/
obj/
target/
obj/
cmake-build*/
*.tgz
*.wasm

Expand Down
30 changes: 25 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,28 @@
cmake_minimum_required(VERSION 3.19)

project(flybywire-a32nx)
set(FBW_ROOT ${CMAKE_SOURCE_DIR})

add_subdirectory(src/fadec)
add_subdirectory(src/fbw_a320)
add_subdirectory(src/fbw_a380)
add_subdirectory(src/extra-backend)
# Distinction between running on Windows for your IDE and Other for the docker container
# This is not meant to be used to build on windows - it is just for the IDE (Clion) to understand the code
if (WIN32)
message("OS: Windows")
set(MSFS_SDK "C:\\MSFS SDK")
set(CMAKE_C_COMPILER "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/Llvm/x64/bin/clang.exe")
set(CMAKE_CXX_COMPILER "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/Llvm/x64/bin/clang++.exe")
set(CMAKE_GENERATOR "Ninja")
else ()
message("OS: Other")
set(MSFS_SDK "/workdir/MSFS_SDK")
set(CMAKE_C_COMPILER "clang")
set(CMAKE_CXX_COMPILER "clang++")
set(CMAKE_GENERATOR "Ninja")
endif ()

project(flybywire-wasm)

add_subdirectory(fbw-a32nx/src/wasm/fadec_a320)
add_subdirectory(fbw-a380x/src/wasm/fadec_a380)
add_subdirectory(fbw-a32nx/src/wasm/fbw_a320)
add_subdirectory(fbw-a380x/src/wasm/fbw_a380)

add_subdirectory(fbw-a32nx/src/wasm/extra-backend)
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@ cmake_minimum_required(VERSION 3.19)

set(CMAKE_CXX_STANDARD 17)

# Configure the build as required
set(AIRCRAFT "A32NX")
set(EXAMPLES "NO_EXAMPLES") # EXAMPLES, NO_EXAMPLES
# ZERO_LVL=0 CRITICAL_LVL=1 ERROR_LVL=2 WARN_LVL=3 INFO_LVL=4 DEBUG_LVL=5 VERBOSE=6 TRACE_LVL=7
set(LOG_LEVEL 4)
set(LOGGING "LOG_LEVEL=${LOG_LEVEL}")

# Distinction between running on Windows for your IDE and Other for the docker container
# This is not meant to be used to build on windows - it is just for the IDE (Clion) to understand the code
if (WIN32)
message("OS: Windows")
set(MSFS_SDK "C:\\MSFS SDK")
Expand All @@ -25,6 +16,13 @@ else ()
set(CMAKE_GENERATOR "Ninja")
endif ()

# Configure the build as required
set(AIRCRAFT "A32NX")
set(EXAMPLES "NO_EXAMPLES") # EXAMPLES, NO_EXAMPLES
# ZERO_LVL=0 CRITICAL_LVL=1 ERROR_LVL=2 WARN_LVL=3 INFO_LVL=4 DEBUG_LVL=5 VERBOSE=6 TRACE_LVL=7
set(LOG_LEVEL 4)
set(LOGGING "LOG_LEVEL=${LOG_LEVEL}")

# Prepare the compiler flags
set(CMAKE_CXX_FLAGS "-c -std=c++17")
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
Expand All @@ -42,7 +40,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D${AIRCRAFT} -D${LOGGING} -D${EXAMPLES}
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_MSFS_WASM=1 -D__wasi__ -D_LIBCC_NO_EXCEPTIONS -D_LIBCPP_HAS_NO_THREADS -D_WINDLL -D_MBCS")

# Print some info to be able to check which compiler has been picked
message("Current source dir: " ${CMAKE_CURRENT_SOURCE_DIR})
message("Current source dir: " .)
message("Current build dir: " ${CMAKE_CURRENT_BINARY_DIR})
message("MSFS SDK: " ${MSFS_SDK})
message("Build type: " ${CMAKE_BUILD_TYPE})
Expand Down Expand Up @@ -103,7 +101,7 @@ set(WASM_LD_FULL_CMD "${WASM_LD_CMD} ${WASM_LD_OUTPUT_FLAG} ${WASM_LD_ARGS} ${WA
# wasm-opt command to optimize the wasm file
set(WASM_OPT_CMD "wasm-opt")
set(WASM_OPT_FLAGS "-O1 -o")
set(OUT_PATH "\"${CMAKE_CURRENT_SOURCE_DIR}/../../flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/panel/${PROJECT_NAME}.wasm\"")
set(OUT_PATH "\"${CMAKE_CURRENT_SOURCE_DIR}/../../../../fbw-a32nx/out/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/panel/${PROJECT_NAME}.wasm\"")
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(WASM_OPT_FULL_CMD "cp ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.wasm ${OUT_PATH} ")
else ()
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
A lightweight framework to abstract the most common aspects when developing
C++ WASM modules using the MSFS SDK and SimConnect.

See [GUIDELINES.md](GUIDELINES.md) for more information on how to write good
See [GUIDELINES.md](fbw-a32nx/src/wasm/extra-backend/GUIDELINES.md) for more information on how to write good
C++ code for FlyByWire Simulations.

## Purpose
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 9 additions & 7 deletions fbw-a32nx/src/wasm/fadec_a320/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# This CMakeLists.txt file is used only for syntax highlighting and navigating
# through the code in an IDE. It is not used for building the project.

cmake_minimum_required(VERSION 3.19)

project(flybywire-a32nx-fadec)

set(CMAKE_CXX_STANDARD 17)
set(MSFS_SDK "C:\\MSFS SDK")

set(CMAKE_CXX_FLAGS "-c -g -DDEBUG -Wno-unused-command-line-argument -Wno-ignored-attributes -Wno-macro-redefined --sysroot \"${MSFS_SDK}/WASM/wasi-sysroot\" -target wasm32-unknown-wasi -flto -D_MSFS_WASM=1 -D__wasi__ -D_LIBCPP_HAS_NO_THREADS -D_WINDLL -D_MBCS -mthread-model single -fno-exceptions -fms-extensions")

Expand All @@ -11,12 +14,11 @@ include_directories("${MSFS_SDK}/WASM/wasi-sysroot/include")
include_directories("${MSFS_SDK}/SimConnect SDK/include")

include_directories(
common
fadec/a320_fadec/src
fadec/a380_fadec/src
./src
${FBW_ROOT}/fbw-common/src/wasm/fadec_common/src
${FBW_ROOT}/fbw-common/src/wasm/fbw_common/src
)

add_executable(flybywire-a32nx-fadec
a320_fadec/src/FadecGauge.cpp
a380_fadec/src/FadecGauge.cpp
)
./src/FadecGauge.cpp
)
133 changes: 69 additions & 64 deletions fbw-a32nx/src/wasm/fbw_a320/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,76 +1,81 @@
# This CMakeLists.txt file is used only for syntax highlighting and navigating
# through the code in an IDE. It is not used for building the project.

cmake_minimum_required(VERSION 3.19)

project(flybywire-a32nx-fbw)

set(CMAKE_CXX_STANDARD 17)
set(MSFS_SDK "C:\\MSFS SDK")

set(CMAKE_CXX_FLAGS "-c -g -DDEBUG -Wno-unused-command-line-argument -Wno-ignored-attributes -Wno-macro-redefined --sysroot \"${MSFS_SDK}/WASM/wasi-sysroot\" -target wasm32-unknown-wasi -flto -D_MSFS_WASM=1 -D__wasi__ -D_LIBCPP_HAS_NO_THREADS -D_WINDLL -D_MBCS -mthread-model single -fno-exceptions -fms-extensions")

include_directories("${MSFS_SDK}/WASM/include")
include_directories("${MSFS_SDK}/WASM/wasi-sysroot/include")
include_directories("${MSFS_SDK}/SimConnect SDK/include")

include_directories(src)
include_directories(src/inih)
include_directories(src/busStructures)
include_directories(src/elac)
include_directories(src/fac)
include_directories(src/failures)
include_directories(src/fcdc)
include_directories(src/interface)
include_directories(src/model)
include_directories(src/sec)
include_directories(src/utils)
include_directories(../fbw_common/src/inih)
include_directories(../fbw_common/src/zlib)
include_directories(../fbw_common/src)

add_executable(flybywire-a380x-fbw
../fbw_common/src/zlib/zfstream.cc
../fbw_common/src/LocalVariable.cpp
../fbw_common/src/ThrottleAxisMapping.cpp
../fbw_common/src/InterpolatingLookupTable.cpp
src/interface/SimConnectInterface.cpp
# src/elac/Elac.cpp
src/sec/Sec.cpp
# src/fcdc/Fcdc.cpp
src/fac/Fac.cpp
src/failures/FailuresConsumer.cpp
src/utils/ConfirmNode.cpp
src/utils/SRFlipFLop.cpp
src/utils/PulseNode.cpp
src/utils/HysteresisNode.cpp
src/model/AutopilotLaws_data.cpp
src/model/AutopilotLaws.cpp
src/model/AutopilotStateMachine_data.cpp
src/model/AutopilotStateMachine.cpp
src/model/Autothrust_data.cpp
src/model/Autothrust.cpp
src/model/Double2MultiWord.cpp
# src/model/ElacComputer_data.cpp
# src/model/ElacComputer.cpp
# src/model/SecComputer_data.cpp
# src/model/SecComputer.cpp
# src/model/PitchNormalLaw.cpp
# src/model/PitchAlternateLaw.cpp
# src/model/PitchDirectLaw.cpp
# src/model/LateralNormalLaw.cpp
# src/model/LateralDirectLaw.cpp
src/model/FacComputer_data.cpp
src/model/FacComputer.cpp
src/model/look1_binlxpw.cpp
src/model/look2_binlcpw.cpp
src/model/look2_binlxpw.cpp
src/model/mod_mvZvttxs.cpp
src/model/MultiWordIor.cpp
src/model/rt_modd.cpp
src/model/rt_remd.cpp
src/model/uMultiWord2Double.cpp
src/FlyByWireInterface.cpp
src/FlightDataRecorder.cpp
../fbw_a320/src/Arinc429.cpp
src/Arinc429Utils.cpp
src/SpoilersHandler.cpp
src/CalculatedRadioReceiver.cpp
src/main.cpp
include_directories(
./src
./src/inih
./src/busStructures
./src/elac
./src/fac
./src/failures
./src/fcdc
./src/interface
./src/model
./src/sec
./src/utils
${FBW_ROOT}/fbw-common/src/wasm/fadec_common/src/zlib
${FBW_ROOT}/fbw-common/src/wasm/fbw_common/src/inih
${FBW_ROOT}/fbw-common/src/wasm/fbw-common/src
)

add_executable(flybywire-a32nx-fbw
${FBW_ROOT}/fbw-common/src/wasm/fbw_common/src/zlib/zfstream.cc
${FBW_ROOT}/fbw-common/src/wasm/fbw_common/src/LocalVariable.cpp
${FBW_ROOT}/fbw-common/src/wasm/fbw_common/src/ThrottleAxisMapping.cpp
${FBW_ROOT}/fbw-common/src/wasm/fbw_common/src/InterpolatingLookupTable.cpp
src/interface/SimConnectInterface.cpp
src/elac/Elac.cpp
src/sec/Sec.cpp
src/fcdc/Fcdc.cpp
src/fac/Fac.cpp
src/failures/FailuresConsumer.cpp
src/utils/ConfirmNode.cpp
src/utils/SRFlipFLop.cpp
src/utils/PulseNode.cpp
src/utils/HysteresisNode.cpp
src/model/AutopilotLaws_data.cpp
src/model/AutopilotLaws.cpp
src/model/AutopilotStateMachine_data.cpp
src/model/AutopilotStateMachine.cpp
src/model/Autothrust_data.cpp
src/model/Autothrust.cpp
src/model/Double2MultiWord.cpp
src/model/ElacComputer_data.cpp
src/model/ElacComputer.cpp
src/model/SecComputer_data.cpp
src/model/SecComputer.cpp
src/model/PitchNormalLaw.cpp
src/model/PitchAlternateLaw.cpp
src/model/PitchDirectLaw.cpp
src/model/LateralNormalLaw.cpp
src/model/LateralDirectLaw.cpp
src/model/FacComputer_data.cpp
src/model/FacComputer.cpp
src/model/look1_binlxpw.cpp
src/model/look2_binlcpw.cpp
src/model/look2_binlxpw.cpp
src/model/mod_mvZvttxs.cpp
src/model/MultiWordIor.cpp
src/model/rt_modd.cpp
src/model/rt_remd.cpp
src/model/uMultiWord2Double.cpp
src/FlyByWireInterface.cpp
src/FlightDataRecorder.cpp
src/Arinc429.cpp
src/Arinc429Utils.cpp
src/SpoilersHandler.cpp
src/CalculatedRadioReceiver.cpp
src/main.cpp
)
27 changes: 0 additions & 27 deletions fbw-a32nx/src/wasm/flypad-backend/CMakeLists.txt

This file was deleted.

72 changes: 0 additions & 72 deletions fbw-a32nx/src/wasm/flypad-backend/build.sh

This file was deleted.

Loading

0 comments on commit 2ad0886

Please sign in to comment.