Improve newton

pull/1428/head
SirLynix 3 years ago
parent 3ad939374d
commit 6874e2a96c
  1. 92
      packages/n/newtondynamics4/patches/v4.01/cmake.patch
  2. 24
      packages/n/newtondynamics4/xmake.lua

@ -33,3 +33,95 @@ index c7f63370f..466bc9f72 100644
if(${CMAKE_VS_PLATFORM_NAME} STREQUAL "x64")
message ("build 64 bit")
elseif(${CMAKE_VS_PLATFORM_NAME} STREQUAL "Win32")
diff --git a/newton-4.00/applications/ndSandbox/CMakeLists.txt b/newton-4.00/applications/ndSandbox/CMakeLists.txt
index f399754d6..dbfb7d4ab 100644
--- a/newton-4.00/applications/ndSandbox/CMakeLists.txt
+++ b/newton-4.00/applications/ndSandbox/CMakeLists.txt
@@ -96,8 +96,6 @@ if(MSVC OR MINGW)
target_link_libraries (${projectName} glu32 opengl32)
- target_link_options(${projectName} PUBLIC "/DEBUG")
-
if(CMAKE_VS_MSBUILD_COMMAND OR CMAKE_VS_DEVENV_COMMAND)
set_target_properties(${projectName} PROPERTIES COMPILE_FLAGS "/YundSandboxStdafx.h")
set_source_files_properties(ndSandboxStdafx.cpp PROPERTIES COMPILE_FLAGS "/YcndSandboxStdafx.h")
diff --git a/newton-4.00/sdk/CMakeLists.txt b/newton-4.00/sdk/CMakeLists.txt
index a2d501408..76ea3b175 100644
--- a/newton-4.00/sdk/CMakeLists.txt
+++ b/newton-4.00/sdk/CMakeLists.txt
@@ -112,11 +112,6 @@ else()
if (NEWTON_ENABLE_OPENCL_SOLVER)
target_link_libraries (${projectName} ndSolverOpenCL)
endif()
-
- if(MSVC OR MINGW)
- target_link_options(${projectName} PUBLIC "/DEBUG")
- endif()
-
else()
add_library(${projectName} STATIC ${CPP_SOURCE})
endif()
diff --git a/newton-4.00/sdk/dCollision/CMakeLists.txt b/newton-4.00/sdk/dCollision/CMakeLists.txt
index 78903dd0a..2e1d5be89 100644
--- a/newton-4.00/sdk/dCollision/CMakeLists.txt
+++ b/newton-4.00/sdk/dCollision/CMakeLists.txt
@@ -31,10 +31,6 @@ endif(MSVC)
if(NEWTON_BUILD_SHARED_LIBS)
add_definitions(-D_D_COLLISION_EXPORT_DLL)
add_library(${projectName} SHARED ${CPP_SOURCE})
-
- if(MSVC OR MINGW)
- target_link_options(${projectName} PUBLIC "/DEBUG")
- endif()
else()
add_library(${projectName} STATIC ${CPP_SOURCE})
endif()
diff --git a/newton-4.00/sdk/dCore/CMakeLists.txt b/newton-4.00/sdk/dCore/CMakeLists.txt
index 2786e5838..7fc55b76b 100644
--- a/newton-4.00/sdk/dCore/CMakeLists.txt
+++ b/newton-4.00/sdk/dCore/CMakeLists.txt
@@ -25,11 +25,6 @@ source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}/" FILES ${CPP_SOURCE})
if(NEWTON_BUILD_SHARED_LIBS STREQUAL "ON")
add_definitions(-D_D_CORE_EXPORT_DLL)
add_library(${projectName} SHARED ${CPP_SOURCE})
-
- if(MSVC OR MINGW)
- target_link_options(${projectName} PUBLIC "/DEBUG")
- endif()
-
else()
add_library(${projectName} STATIC ${CPP_SOURCE})
endif()
diff --git a/newton-4.00/sdk/dExtensions/dAvx2/CMakeLists.txt b/newton-4.00/sdk/dExtensions/dAvx2/CMakeLists.txt
index eb6fc4bd5..97a366b77 100644
--- a/newton-4.00/sdk/dExtensions/dAvx2/CMakeLists.txt
+++ b/newton-4.00/sdk/dExtensions/dAvx2/CMakeLists.txt
@@ -51,10 +51,6 @@ if(UNIX)
add_library(${projectName} SHARED ${CPP_SOURCE})
endif()
-if(MSVC OR MINGW)
- target_link_options(${projectName} PUBLIC "/DEBUG")
-endif()
-
install(TARGETS ${projectName}
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
diff --git a/newton-4.00/sdk/dNewton/CMakeLists.txt b/newton-4.00/sdk/dNewton/CMakeLists.txt
index 86ca89aca..6e2875b11 100644
--- a/newton-4.00/sdk/dNewton/CMakeLists.txt
+++ b/newton-4.00/sdk/dNewton/CMakeLists.txt
@@ -82,12 +82,6 @@ endif()
if(NEWTON_BUILD_SHARED_LIBS)
add_definitions(-D_D_NEWTON_EXPORT_DLL)
add_library(${projectName} SHARED ${CPP_SOURCE})
-
-
- if(MSVC OR MINGW)
- target_link_options(${projectName} PUBLIC "/DEBUG")
- endif()
-
else()
add_library(${projectName} STATIC ${CPP_SOURCE})
endif()

@ -7,12 +7,16 @@ package("newtondynamics4")
"https://github.com/MADEAPPS/newton-dynamics.git")
add_versions("v4.01", "c92b64f33488c4774debc110418cbc713fd8e07f37b15e4917b92a7a8d5e785a")
add_patches("v4.01", path.join(os.scriptdir(), "patches", "v4.01", "cmake.patch"), "005a86d0a97cbc35bb3e4905afe4e6fdc7d8024484d50a8b41dbade601f98149")
add_patches("v4.01", path.join(os.scriptdir(), "patches", "v4.01", "cmake.patch"), "a189d6282640b6d46c5f9d0926930bbc2d7bb4f242383fae3521b6b211f569e7")
add_configs("symbols", {description = "Enable debug symbols in release", default = false, type = "boolean"})
add_includedirs("include", "include/ndCore", "include/ndCollision", "include/ndNewton")
add_deps("cmake")
add_links("ndNewton")
if is_plat("linux", "android") then
add_syslinks("dl", "pthread")
end
@ -28,11 +32,25 @@ package("newtondynamics4")
on_install("windows", "linux", "macosx", "mingw", function (package)
os.cd("newton-4.00")
local configs = {"-DNEWTON_BUILD_SANDBOX_DEMOS=OFF", "-DNEWTON_BUILD_TEST=OFF", "-DNEWTON_BUILD_CREATE_SUB_PROJECTS=OFF"}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
local configs = {
"-DNEWTON_BUILD_SANDBOX_DEMOS=OFF",
"-DNEWTON_BUILD_TEST=OFF",
"-DNEWTON_BUILD_CREATE_SUB_PROJECTS=OFF",
"-DNEWTON_ENABLE_AVX2_SOLVER=OFF"
}
if package:config("shared") then
table.insert(configs, "-DBUILD_SHARED_LIBS=ON")
table.insert(configs, "-DNEWTON_BUILD_SHARED_LIBS=ON")
else
table.insert(configs, "-DBUILD_SHARED_LIBS=OFF")
table.insert(configs, "-DNEWTON_BUILD_SHARED_LIBS=OFF")
end
if package:debug() then
table.insert(configs, "-DCMAKE_BUILD_TYPE=Debug")
elseif package:config("symbols") then
table.insert(configs, "-DCMAKE_BUILD_TYPE=RelWithDebInfo")
else
table.insert(configs, "-DCMAKE_BUILD_TYPE=Release")
end
import("package.tools.cmake").install(package, configs)
end)

Loading…
Cancel
Save