diff options
author | FormerLurker <hochgebe@gmail.com> | 2021-01-03 23:18:02 +0300 |
---|---|---|
committer | FormerLurker <hochgebe@gmail.com> | 2021-01-03 23:18:02 +0300 |
commit | d4852e3e537ab891309f4a6c6d25cae4954c9225 (patch) | |
tree | 1969a95f3bcc01d06f19f63370fc33c15587c8cc /ArcWelder | |
parent | b0ffde1402a0fe3b1fd448bd00f0a18a0050d678 (diff) |
Add static linking for windows exe. Remove mingw build. Add copyright notices for fpconv to exe output.
Diffstat (limited to 'ArcWelder')
-rw-r--r-- | ArcWelder/CMakeLists.txt | 8 | ||||
-rw-r--r-- | ArcWelder/segmented_shape.cpp | 6 |
2 files changed, 10 insertions, 4 deletions
diff --git a/ArcWelder/CMakeLists.txt b/ArcWelder/CMakeLists.txt index a03c9fc..5a1569b 100644 --- a/ArcWelder/CMakeLists.txt +++ b/ArcWelder/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION "3.13") +cmake_minimum_required (VERSION "3.15") project(ArcWelder C CXX) @@ -17,6 +17,12 @@ include(sourcelist.cmake) # Add a library using our ArcWelderSources variable from our sourcelist file add_library(${PROJECT_NAME} STATIC ${ArcWelderSources}) + +if(MSVC) + # link to the msvc runtime statically, keeping debug info if we are in debug config + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>") +endif() + install( TARGETS ${PROJECT_NAME} ARCHIVE DESTINATION lib diff --git a/ArcWelder/segmented_shape.cpp b/ArcWelder/segmented_shape.cpp index 83142e2..6fc83df 100644 --- a/ArcWelder/segmented_shape.cpp +++ b/ArcWelder/segmented_shape.cpp @@ -684,12 +684,12 @@ bool arc::ray_intersects_segment(const point rayOrigin, const point rayDirection vector v2 = point2 - point1; vector v3 = vector(-rayDirection.y, rayDirection.x, 0); - float dot = dot(v2, v3); + double dot = dot(v2, v3); if (std::fabs(dot) < 0.000001) return false; - float t1 = vector::cross_product_magnitude(v2, v1) / dot; - float t2 = dot(v1,v3) / dot; + double t1 = vector::cross_product_magnitude(v2, v1) / dot; + double t2 = dot(v1,v3) / dot; if (t1 >= 0.0 && (t2 >= 0.0 && t2 <= 1.0)) return true; |