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

Fixes build for windows with MSVC compiler #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
build
*.log
*.tlog
19 changes: 15 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,28 @@ target_include_directories(dubins
PUBLIC
include)

target_link_libraries(dubins
PUBLIC
m)
target_link_libraries(dubins PRIVATE --coverage)
if (MSVC)
target_link_libraries(dubins
PUBLIC )
else()
target_link_libraries(dubins
PUBLIC
m)
target_link_libraries(dubins PRIVATE --coverage)
endif(MSVC)
# target_link_libraries(dubins PRIVATE --coverage)

if (MSVC)
target_compile_options(dubins PRIVATE /W3)
else()
target_compile_options(dubins PRIVATE -Wall -Wextra -Wpedantic -std=gnu89)
endif()

add_executable(demo
examples/demo.c)
target_link_libraries(demo
dubins)

enable_testing()

add_executable(unittest_dubins
Expand Down
4 changes: 4 additions & 0 deletions tests/stableapi_tests.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
extern "C" {
#include "dubins.h"
}

#ifdef WIN32
#define _USE_MATH_DEFINES
#endif
#include <math.h>
#include "gtest/gtest.h"

Expand Down