Skip to content

Commit

Permalink
Fix CMakeLists for Utils.cpp, Semaphore ifdefs
Browse files Browse the repository at this point in the history
  • Loading branch information
sytelus committed Jul 20, 2017
1 parent 8ba2551 commit 9418af2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 28 deletions.
12 changes: 4 additions & 8 deletions MavLinkCom/src/Semaphore.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

#ifdef _WIN32
#include <Windows.h>

#include "Semaphore.hpp"
#include "Utils.hpp"

using namespace mavlink_utils;

#ifdef __APPLE__
#include <signal.h> //SIGALRM
#include <semaphore.h>
#endif
#ifdef _WIN32
#include <Windows.h>

class Semaphore::semaphore_impl
{
Expand Down Expand Up @@ -72,7 +67,8 @@ class Semaphore::semaphore_impl
};

#elif defined(__APPLE__)

#include <signal.h> //SIGALRM
#include <semaphore.h>
#include <mach/mach.h>
#include <mach/task.h>
#include <mach/semaphore.h>
Expand Down
1 change: 1 addition & 0 deletions clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
pushd "$SCRIPT_DIR"

set -e
set +x

rm -rf build_debug
rm -rf build_release
Expand Down
1 change: 0 additions & 1 deletion cmake/MavLinkCom/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ include_directories(
)


LIST(APPEND MAVLINK_SOURCES "${AIRSIM_ROOT}/MavLinkCom/common_utils/Utils.cpp")
LIST(APPEND MAVLINK_SOURCES "${AIRSIM_ROOT}/MavLinkCom/common_utils/FileSystem.cpp")
LIST(APPEND MAVLINK_SOURCES "${AIRSIM_ROOT}/MavLinkCom/common_utils/ThreadUtils.cpp")
LIST(APPEND MAVLINK_SOURCES "${AIRSIM_ROOT}/MavLinkCom/src/MavLinkConnection.cpp")
Expand Down
24 changes: 5 additions & 19 deletions cmake/MavLinkCom/MavLinkTest/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,34 +1,20 @@
cmake_minimum_required(VERSION 3.2.2)
project(MavLinkTest)

LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../../cmake-modules")
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../cmake-modules")
INCLUDE("${CMAKE_CURRENT_LIST_DIR}/../../cmake-modules/CommonSetup.cmake")
CommonSetup()

IF(UNIX)
ELSE()
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D_CONSOLE ")
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:CONSOLE ")
ENDIF()
SetupConsoleBuild()

###########
## Build ##
###########

## Specify additional locations of header files
## Your package locations should be listed before other locations
# include_directories(include)
include_directories(
${AIRSIM_ROOT}/MavLinkCom/MavLinkTest
${AIRSIM_ROOT}/MavLinkCom/include
${AIRSIM_ROOT}/MavLinkCom/common_utils
)

## Declare the executable
add_executable(MavLinkTest
${AIRSIM_ROOT}/MavLinkCom/MavLinkTest/Commands.cpp
${AIRSIM_ROOT}/MavLinkCom/MavLinkTest/UnitTests.cpp
${AIRSIM_ROOT}/MavLinkCom/MavLinkTest/main.cpp
)
set(PROJECT_CPP ${PROJECT_NAME}_sources)
file(GLOB_RECURSE PROJECT_CPP "${AIRSIM_ROOT}/MavLinkCom/${PROJECT_NAME}/*.cpp")
add_executable(${PROJECT_NAME} ${PROJECT_CPP})

target_link_libraries(${PROJECT_NAME} ${CMAKE_THREAD_LIBS_INIT} MavLinkCom c++abi ${CXX_EXP_LIB})

0 comments on commit 9418af2

Please sign in to comment.