Skip to content

Commit

Permalink
chore: add customized CMakeLists for each variants
Browse files Browse the repository at this point in the history
  • Loading branch information
masterrob94 committed Jan 16, 2024
1 parent 510981d commit 75e8f93
Show file tree
Hide file tree
Showing 5 changed files with 225 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Cargo.toml
!jest.config.js
!/jest/**

!CMakeLists.txt
!CMakeLists*.txt

!/branding/*

Expand Down
56 changes: 56 additions & 0 deletions CMakeLists-A21N.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
cmake_minimum_required(VERSION 3.18)
project(flybywire-aircraft C CXX)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_VERBOSE_MAKEFILE OFF)
set(FBW_ROOT ${CMAKE_CURRENT_SOURCE_DIR})
set(FBW_COMMON ${FBW_ROOT}/fbw-common/src/wasm)

# cmake helper scripts
include("${FBW_COMMON}/cpp-msfs-framework/cmake/TargetDefinition.cmake")

# compiler refinement
set(COMPILER_FLAGS "-Wall -Wextra -Wno-unused-function -Wno-unused-command-line-argument -Wno-ignored-attributes -Wno-macro-redefined -target wasm32-unknown-wasi --sysroot \"${MSFS_SDK}/WASM/wasi-sysroot\" -mthread-model single -fno-exceptions -fms-extensions -fvisibility=hidden -ffunction-sections -fdata-sections -fno-stack-protector")

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMPILER_FLAGS}")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -flto -O2 -DNDEBUG")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -DDEBUG")

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMPILER_FLAGS}")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -flto -O2 -DNDEBUG")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -DDEBUG")

message("MSFS_SDK: " ${MSFS_SDK})

# add the include paths
include_directories(
"${MSFS_SDK}/WASM/include"
"${MSFS_SDK}/WASM/wasi-sysroot/include"
"${MSFS_SDK}/WASM/wasi-sysroot/include/c++/v1"
"${MSFS_SDK}/SimConnect SDK/include"
"${FBW_COMMON}/cpp-msfs-framework/lib"
"${FBW_COMMON}/cpp-msfs-framework/MsfsHandler"
"${FBW_COMMON}/cpp-msfs-framework/MsfsHandler/DataTypes"
)

# add compiler definitions
add_definitions(
-D_MSFS_WASM=1
-D__wasi__
-D_LIBC_NO_EXCEPTIONS
-D_LIBCPP_HAS_NO_THREADS
-D_WINDLL
-D_MBCS
# ZERO_LVL=0 CRITICAL_LVL=1 ERROR_LVL=2 WARN_LVL=3 INFO_LVL=4 DEBUG_LVL=5 VERBOSE=6 TRACE_LVL=7
-DLOG_LEVEL=4
# EXAMPLES | NO_EXAMPLES
-DNO_EXAMPLES
#PROFILING | NO_PROFILING - for logging of profiling information of pre-, post-, update() calls
-DNO_PROFILING
)

# add the common components
add_subdirectory(fbw-common/src/wasm)

# add the A321 components
add_subdirectory(build-a321neo/src/wasm)
56 changes: 56 additions & 0 deletions CMakeLists-A318.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
cmake_minimum_required(VERSION 3.18)
project(flybywire-aircraft C CXX)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_VERBOSE_MAKEFILE OFF)
set(FBW_ROOT ${CMAKE_CURRENT_SOURCE_DIR})
set(FBW_COMMON ${FBW_ROOT}/fbw-common/src/wasm)

# cmake helper scripts
include("${FBW_COMMON}/cpp-msfs-framework/cmake/TargetDefinition.cmake")

# compiler refinement
set(COMPILER_FLAGS "-Wall -Wextra -Wno-unused-function -Wno-unused-command-line-argument -Wno-ignored-attributes -Wno-macro-redefined -target wasm32-unknown-wasi --sysroot \"${MSFS_SDK}/WASM/wasi-sysroot\" -mthread-model single -fno-exceptions -fms-extensions -fvisibility=hidden -ffunction-sections -fdata-sections -fno-stack-protector")

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMPILER_FLAGS}")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -flto -O2 -DNDEBUG")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -DDEBUG")

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMPILER_FLAGS}")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -flto -O2 -DNDEBUG")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -DDEBUG")

message("MSFS_SDK: " ${MSFS_SDK})

# add the include paths
include_directories(
"${MSFS_SDK}/WASM/include"
"${MSFS_SDK}/WASM/wasi-sysroot/include"
"${MSFS_SDK}/WASM/wasi-sysroot/include/c++/v1"
"${MSFS_SDK}/SimConnect SDK/include"
"${FBW_COMMON}/cpp-msfs-framework/lib"
"${FBW_COMMON}/cpp-msfs-framework/MsfsHandler"
"${FBW_COMMON}/cpp-msfs-framework/MsfsHandler/DataTypes"
)

# add compiler definitions
add_definitions(
-D_MSFS_WASM=1
-D__wasi__
-D_LIBC_NO_EXCEPTIONS
-D_LIBCPP_HAS_NO_THREADS
-D_WINDLL
-D_MBCS
# ZERO_LVL=0 CRITICAL_LVL=1 ERROR_LVL=2 WARN_LVL=3 INFO_LVL=4 DEBUG_LVL=5 VERBOSE=6 TRACE_LVL=7
-DLOG_LEVEL=4
# EXAMPLES | NO_EXAMPLES
-DNO_EXAMPLES
#PROFILING | NO_PROFILING - for logging of profiling information of pre-, post-, update() calls
-DNO_PROFILING
)

# add the common components
add_subdirectory(fbw-common/src/wasm)

# add the A318 components
add_subdirectory(build-a318ceo/src/wasm)
56 changes: 56 additions & 0 deletions CMakeLists-A319.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
cmake_minimum_required(VERSION 3.18)
project(flybywire-aircraft C CXX)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_VERBOSE_MAKEFILE OFF)
set(FBW_ROOT ${CMAKE_CURRENT_SOURCE_DIR})
set(FBW_COMMON ${FBW_ROOT}/fbw-common/src/wasm)

# cmake helper scripts
include("${FBW_COMMON}/cpp-msfs-framework/cmake/TargetDefinition.cmake")

# compiler refinement
set(COMPILER_FLAGS "-Wall -Wextra -Wno-unused-function -Wno-unused-command-line-argument -Wno-ignored-attributes -Wno-macro-redefined -target wasm32-unknown-wasi --sysroot \"${MSFS_SDK}/WASM/wasi-sysroot\" -mthread-model single -fno-exceptions -fms-extensions -fvisibility=hidden -ffunction-sections -fdata-sections -fno-stack-protector")

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMPILER_FLAGS}")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -flto -O2 -DNDEBUG")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -DDEBUG")

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMPILER_FLAGS}")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -flto -O2 -DNDEBUG")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -DDEBUG")

message("MSFS_SDK: " ${MSFS_SDK})

# add the include paths
include_directories(
"${MSFS_SDK}/WASM/include"
"${MSFS_SDK}/WASM/wasi-sysroot/include"
"${MSFS_SDK}/WASM/wasi-sysroot/include/c++/v1"
"${MSFS_SDK}/SimConnect SDK/include"
"${FBW_COMMON}/cpp-msfs-framework/lib"
"${FBW_COMMON}/cpp-msfs-framework/MsfsHandler"
"${FBW_COMMON}/cpp-msfs-framework/MsfsHandler/DataTypes"
)

# add compiler definitions
add_definitions(
-D_MSFS_WASM=1
-D__wasi__
-D_LIBC_NO_EXCEPTIONS
-D_LIBCPP_HAS_NO_THREADS
-D_WINDLL
-D_MBCS
# ZERO_LVL=0 CRITICAL_LVL=1 ERROR_LVL=2 WARN_LVL=3 INFO_LVL=4 DEBUG_LVL=5 VERBOSE=6 TRACE_LVL=7
-DLOG_LEVEL=4
# EXAMPLES | NO_EXAMPLES
-DNO_EXAMPLES
#PROFILING | NO_PROFILING - for logging of profiling information of pre-, post-, update() calls
-DNO_PROFILING
)

# add the common components
add_subdirectory(fbw-common/src/wasm)

# add the A319 components
add_subdirectory(build-a319ceo/src/wasm)
56 changes: 56 additions & 0 deletions CMakeLists-A320.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
cmake_minimum_required(VERSION 3.18)
project(flybywire-aircraft C CXX)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_VERBOSE_MAKEFILE OFF)
set(FBW_ROOT ${CMAKE_CURRENT_SOURCE_DIR})
set(FBW_COMMON ${FBW_ROOT}/fbw-common/src/wasm)

# cmake helper scripts
include("${FBW_COMMON}/cpp-msfs-framework/cmake/TargetDefinition.cmake")

# compiler refinement
set(COMPILER_FLAGS "-Wall -Wextra -Wno-unused-function -Wno-unused-command-line-argument -Wno-ignored-attributes -Wno-macro-redefined -target wasm32-unknown-wasi --sysroot \"${MSFS_SDK}/WASM/wasi-sysroot\" -mthread-model single -fno-exceptions -fms-extensions -fvisibility=hidden -ffunction-sections -fdata-sections -fno-stack-protector")

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMPILER_FLAGS}")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -flto -O2 -DNDEBUG")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -DDEBUG")

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMPILER_FLAGS}")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -flto -O2 -DNDEBUG")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -DDEBUG")

message("MSFS_SDK: " ${MSFS_SDK})

# add the include paths
include_directories(
"${MSFS_SDK}/WASM/include"
"${MSFS_SDK}/WASM/wasi-sysroot/include"
"${MSFS_SDK}/WASM/wasi-sysroot/include/c++/v1"
"${MSFS_SDK}/SimConnect SDK/include"
"${FBW_COMMON}/cpp-msfs-framework/lib"
"${FBW_COMMON}/cpp-msfs-framework/MsfsHandler"
"${FBW_COMMON}/cpp-msfs-framework/MsfsHandler/DataTypes"
)

# add compiler definitions
add_definitions(
-D_MSFS_WASM=1
-D__wasi__
-D_LIBC_NO_EXCEPTIONS
-D_LIBCPP_HAS_NO_THREADS
-D_WINDLL
-D_MBCS
# ZERO_LVL=0 CRITICAL_LVL=1 ERROR_LVL=2 WARN_LVL=3 INFO_LVL=4 DEBUG_LVL=5 VERBOSE=6 TRACE_LVL=7
-DLOG_LEVEL=4
# EXAMPLES | NO_EXAMPLES
-DNO_EXAMPLES
#PROFILING | NO_PROFILING - for logging of profiling information of pre-, post-, update() calls
-DNO_PROFILING
)

# add the common components
add_subdirectory(fbw-common/src/wasm)

# add the A320 components
add_subdirectory(build-a320ceo/src/wasm)

0 comments on commit 75e8f93

Please sign in to comment.