Skip to content

Commit

Permalink
Enable compilation of part that depend on sdformat and dartsim on Win…
Browse files Browse the repository at this point in the history
…dows (#12)

Co-authored-by: Tobias Fischer <info@tobiasfischer.info>
Co-authored-by: conda-forge-linter <github-actions@email.com>
  • Loading branch information
3 people committed Mar 27, 2021
1 parent bc87c7e commit c586d76
Show file tree
Hide file tree
Showing 16 changed files with 294 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .azure-pipelines/azure-pipelines-win.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions .ci_support/win_64_.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
c_compiler:
- vs2019
channel_sources:
- conda-forge,defaults
channel_targets:
- conda-forge main
cxx_compiler:
- vs2019
target_platform:
- win-64
vc:
- '14'
2 changes: 1 addition & 1 deletion .github/CODEOWNERS

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 19 additions & 3 deletions .scripts/build_steps.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions .scripts/logging_utils.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .scripts/run_docker_build.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 16 additions & 18 deletions .scripts/run_osx_build.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion LICENSE.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions conda-forge.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
azure:
settings_win:
pool:
vmImage: windows-2019
conda_forge_output_validation: true
provider: {linux_aarch64: default, linux_ppc64le: default}
152 changes: 152 additions & 0 deletions recipe/148.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
From 5c97660320a8a365c82d62279b76b8f5682c5258 Mon Sep 17 00:00:00 2001
From: Steve Peters <scpeters@openrobotics.org>
Date: Wed, 7 Oct 2020 12:25:25 -0700
Subject: [PATCH 1/2] dartsim-plugin windows build fixes

* Build dartsim and test plugins with /permissive- with MSVC
due to https://github.com/dartsim/dart/issues/753

* Disable C4250 compiler warnings.

* Create unversioned dartsim plugin by copy rather than
symlink, since symlinks require extra permissions on
Windows. This copies the TPE approach.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
---
dartsim/CMakeLists.txt | 16 ++++++++++++----
test/plugins/CMakeLists.txt | 6 ++++++
tpe/plugin/CMakeLists.txt | 2 +-
3 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/dartsim/CMakeLists.txt b/dartsim/CMakeLists.txt
index 22bad22a..ca8a11cf 100644
--- a/dartsim/CMakeLists.txt
+++ b/dartsim/CMakeLists.txt
@@ -7,6 +7,10 @@ ign_add_component(dartsim INTERFACE

target_link_libraries(${features} INTERFACE ${DART_LIBRARIES})
target_include_directories(${features} SYSTEM INTERFACE ${DART_INCLUDE_DIRS})
+if (MSVC)
+ # needed by DART, see https://github.com/dartsim/dart/issues/753
+ target_compile_options(${features} INTERFACE "/permissive-")
+endif()

install(
DIRECTORY include/
@@ -42,11 +46,15 @@ install(TARGETS ${dartsim_plugin} DESTINATION ${IGNITION_PHYSICS_ENGINE_INSTALL_
set(versioned ${CMAKE_SHARED_LIBRARY_PREFIX}${dartsim_plugin}${CMAKE_SHARED_LIBRARY_SUFFIX})
set(unversioned ${CMAKE_SHARED_LIBRARY_PREFIX}${PROJECT_NAME_NO_VERSION_LOWER}-${engine_name}${CMAKE_SHARED_LIBRARY_SUFFIX})
if (WIN32)
- # create_symlink requires cmake 3.13 on windows
- cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
+ # disable MSVC inherit via dominance warning
+ target_compile_options(${dartsim_plugin} PUBLIC "/wd4250")
+ INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy
+ ${IGNITION_PHYSICS_ENGINE_INSTALL_DIR}\/${versioned}
+ ${IGNITION_PHYSICS_ENGINE_INSTALL_DIR}\/${unversioned})")
+else()
+ EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink ${versioned} ${unversioned})
+ INSTALL(FILES ${PROJECT_BINARY_DIR}/${unversioned} DESTINATION ${IGNITION_PHYSICS_ENGINE_INSTALL_DIR})
endif()
-EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink ${versioned} ${unversioned})
-INSTALL(FILES ${PROJECT_BINARY_DIR}/${unversioned} DESTINATION ${IGNITION_PHYSICS_ENGINE_INSTALL_DIR})

# Testing
ign_build_tests(
diff --git a/test/plugins/CMakeLists.txt b/test/plugins/CMakeLists.txt
index fa1a58a6..2358746d 100644
--- a/test/plugins/CMakeLists.txt
+++ b/test/plugins/CMakeLists.txt
@@ -24,4 +24,10 @@ if (DART_FOUND)
target_link_libraries(MockDoublePendulum PUBLIC ${DART_LIBRARIES})
target_compile_definitions(MockDoublePendulum PRIVATE
"IGNITION_PHYSICS_RESOURCE_DIR=\"${IGNITION_PHYSICS_RESOURCE_DIR}\"")
+ if (MSVC)
+ # needed by DART, see https://github.com/dartsim/dart/issues/753
+ target_compile_options(MockDoublePendulum PUBLIC "/permissive-")
+ # disable MSVC inherit via dominance warning
+ target_compile_options(MockDoublePendulum PUBLIC "/wd4250")
+ endif()
endif()
diff --git a/tpe/plugin/CMakeLists.txt b/tpe/plugin/CMakeLists.txt
index 9aebeb84..b4bdf790 100644
--- a/tpe/plugin/CMakeLists.txt
+++ b/tpe/plugin/CMakeLists.txt
@@ -43,7 +43,7 @@ if (WIN32)
# disable MSVC inherit via dominance warning
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4250")
INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy
- ${IGNITION_PHYSICS_ENGINE_INSTALL_DIR}\/${versioned}
+ ${IGNITION_PHYSICS_ENGINE_INSTALL_DIR}\/${versioned}
${IGNITION_PHYSICS_ENGINE_INSTALL_DIR}\/${unversioned})")
else()
EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink ${versioned} ${unversioned})

From 7482167d1d21d549a08ec0ab0ef1dc0a13dd9508 Mon Sep 17 00:00:00 2001
From: Steve Peters <scpeters@openrobotics.org>
Date: Thu, 15 Oct 2020 16:52:46 -0700
Subject: [PATCH 2/2] check_test_ran.py: windows compatibility

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
---
tools/check_test_ran.py | 32 --------------------------------
1 file changed, 32 deletions(-)

diff --git a/tools/check_test_ran.py b/tools/check_test_ran.py
index a6d87e6c..48169343 100755
--- a/tools/check_test_ran.py
+++ b/tools/check_test_ran.py
@@ -44,7 +44,6 @@

import os
import sys
-import subprocess

def usage():
print("""Usage:
@@ -53,29 +52,6 @@ def usage():
print(sys.argv)
sys.exit(getattr(os, 'EX_USAGE', 1))

-def run_grep(filename, arg):
- process = subprocess.Popen(['grep', arg, filename], stdout=subprocess.PIPE)
- stdout, stderr = process.communicate()
- return stdout, stderr
-
-def run_xsltproc(stylesheet, document):
- try:
- process = subprocess.Popen(['xsltproc', stylesheet, document], stdout=subprocess.PIPE)
- stdout, stderr = process.communicate()
- # Overwrite same document
- open(document, 'w').write(stdout)
- except OSError as err:
- test_name = os.path.basename(document)
- f = open(document, 'w')
- d = {'test': test_name, 'test_file': document, 'test_no_xml': test_name.replace('.xml', '')}
- f.write("""<?xml version="1.0" encoding="UTF-8"?>
-<testsuite tests="1" failures="1" time="1" errors="0" name="%(test)s">
- <testcase name="test_ran" status="run" time="1" classname="%(test_no_xml)s">
- <failure message="Unable to find xsltproc. Can not parse output test for QTest suite." type=""/>
- </testcase>
-</testsuite>"""%d)
- sys.exit(getattr(os, 'EX_USAGE', 1))
-
def check_main():
if len(sys.argv) < 2:
usage()
@@ -98,14 +74,6 @@ def check_main():
<failure message="Unable to find test results for %(test)s, test did not run.\nExpected results in %(test_file)s" type=""/>
</testcase>
</testsuite>"""%d)
- sys.exit(getattr(os, 'EX_USAGE', 1))
-
- # Checking if test is a QTest file
- stdout, stderr = run_grep(test_file, "QtVersion")
- if (stdout):
- print("Detect QTest xml file. Converting to JUNIT ...")
- stylesheet = os.path.dirname(os.path.abspath(__file__)) + "/qtest_to_junit.xslt"
- run_xsltproc(stylesheet, test_file)

if __name__ == '__main__':
check_main()
Loading

0 comments on commit c586d76

Please sign in to comment.