Skip to content

Commit

Permalink
Merge pull request microsoft#72 from bkueng/fix_linux_build
Browse files Browse the repository at this point in the history
Fix linux build
  • Loading branch information
lovettchris authored Mar 2, 2017
2 parents 96b2cdd + b4a0ab9 commit d8eff5b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
11 changes: 7 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,14 @@ make -j8 AirLib MavLinkCom
popd &>/dev/null


cp -p AirLib/deps/rpclib/lib/x64/Debug/librpc.a AirLib/deps/rpclib/lib
cp -p $build_dir/AirLib/lib/libAirLib.a AirLib/lib


mkdir -p AirLib/deps/MavLinkCom AirLib/deps/rpclib/lib AirLib/lib || true
cp -p $build_dir/output/lib/libAirSim-rpclib.a AirLib/deps/rpclib/lib
cp -p $build_dir/output/lib/libAirLib.a AirLib/lib
cp -rp MavLinkCom/include AirLib/deps/MavLinkCom
cp -rp $build_dir/MavLinkCom/lib AirLib/deps/MavLinkCom
cp -rp $build_dir/output/lib/libMavLinkCom.a AirLib/deps/MavLinkCom/lib
cp -rp AirLib Unreal/Plugins/AirSim/Source
rm -rf Unreal/Plugins/AirSim/Source/AirLib/deps/rpclib/rpclib

echo ""
echo "============================================================"
Expand All @@ -95,4 +97,5 @@ echo " (<unreal project_root> contains a file named <project>.uproject)"
echo "============================================================"
echo "And do (required for building the Unreal plugin):"
echo "export BOOST_ROOT=\"$BOOST_ROOT\""
echo "export EIGEN_ROOT=\"$EIGEN_ROOT\""

13 changes: 10 additions & 3 deletions cmake/cmake-modules/CommonSetup.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Common setup instructions shared by all AirSim CMakeLists.

macro(CommonSetup)

find_package(Threads REQUIRED)

message(STATUS "Running CommonSetup...")

find_path(AIRSIM_ROOT NAMES AirSim.sln PATHS ".." "../.." "../../.." "../../../.." "../../../../.." "../../../../../..")
Expand All @@ -21,7 +24,13 @@ macro(CommonSetup)
else ()
##TODO: Werror removed temporarily. It should be added back after Linux build is stable
set(CMAKE_CXX_FLAGS "-std=c++14 -ggdb -lpthread -Wall -Wextra -Wstrict-aliasing -fmax-errors=2 -Wunreachable-code -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wmissing-include-dirs -Wnoexcept -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wstrict-null-sentinel -Wstrict-overflow=5 -Wswitch-default -Wundef -Wno-unused -Wno-variadic-macros -Wno-parentheses -fdiagnostics-show-option ${MAVLINK_OVERRIDES} ${BOOST_OVERRIDES} ${RPC_LIB_DEFINES} -ldl ${CMAKE_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ")

if (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
# make sure to match the compiler flags with which the Unreal
# Engine is built with
set(CMAKE_CXX_FLAGS "-stdlib=libc++ ${CMAKE_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++ -lc++ -lc++abi")
endif ()
endif ()
set(BUILD_PLATFORM "x64")
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
Expand All @@ -31,8 +40,6 @@ macro(CommonSetup)
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NXCOMPAT /DYNAMICBASE /INCREMENTAL:NO ")
ENDIF()

find_package(Threads REQUIRED)

## common boost settings to make sure we are all on the same page
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
Expand Down

0 comments on commit d8eff5b

Please sign in to comment.