-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
box2d: add new version 3.0.0 #24946
Merged
Merged
box2d: add new version 3.0.0 #24946
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
08b0b30
box2d: add version 3.0.0
toge 1b3ebfe
downgrade cmake/3.21
toge 81cb7ba
require cmake in test_package
toge c911deb
check c17 support
toge 6988e10
fix validation
toge 07e63a4
drop support msvc 193 in 3.0.0
toge c1f86ff
Update recipes/box2d/all/conanfile.py
AbrilRBS f1dbbf0
Version 3.x is pure-C
uilianries 01e363a
Define dll define for shared
uilianries 4ccfe9c
Update recipes/box2d/all/conanfile.py
AbrilRBS File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt | ||
index 5078d14..7ec17bc 100644 | ||
--- a/src/CMakeLists.txt | ||
+++ b/src/CMakeLists.txt | ||
@@ -180,4 +180,11 @@ endif() | ||
source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "src" FILES ${BOX2D_SOURCE_FILES}) | ||
source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}/../include" PREFIX "include" FILES ${BOX2D_API_FILES}) | ||
|
||
-install(TARGETS box2d) | ||
+include(GNUInstallDirs) | ||
+ | ||
+install(TARGETS box2d | ||
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} | ||
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
+) | ||
+install(FILES ${BOX2D_API_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/box2d) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 8c1390e..d6590d7 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -53,7 +53,7 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON) | ||
set(CMAKE_VERBOSE_MAKEFILE ON) | ||
|
||
# The Box2D library uses simde https://github.com/simd-everywhere/simde | ||
-add_subdirectory(extern/simde) | ||
+# add_subdirectory(extern/simde) | ||
add_subdirectory(src) | ||
|
||
# This hides samples, test, and doxygen from apps that use box2d via FetchContent | ||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt | ||
index 5078d14..7ec17bc 100644 | ||
--- a/src/CMakeLists.txt | ||
+++ b/src/CMakeLists.txt | ||
@@ -78,7 +78,7 @@ add_library(box2d ${BOX2D_SOURCE_FILES} ${BOX2D_API_FILES}) | ||
# turned this off to make Box2D easier to use without cmake | ||
# include(GenerateExportHeader) | ||
# generate_export_header(box2d) | ||
- | ||
+find_package(simde REQUIRED CONFIG) | ||
target_include_directories(box2d | ||
PUBLIC | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include> | ||
@@ -89,7 +89,7 @@ target_include_directories(box2d | ||
) | ||
|
||
# SIMDE is used to support SIMD math on multiple platforms | ||
-target_link_libraries(box2d PRIVATE simde) | ||
+target_link_libraries(box2d PRIVATE simde::simde) | ||
|
||
# Box2D uses C17 | ||
set_target_properties(box2d PROPERTIES | ||
diff --git a/src/contact_solver.c b/src/contact_solver.c | ||
index b190501..c61e250 100644 | ||
--- a/src/contact_solver.c | ||
+++ b/src/contact_solver.c | ||
@@ -9,8 +9,8 @@ | ||
#include "core.h" | ||
#include "solver_set.h" | ||
#include "world.h" | ||
-#include "x86/avx2.h" | ||
-#include "x86/fma.h" | ||
+#include "simde/x86/avx2.h" | ||
+#include "simde/x86/fma.h" | ||
|
||
// Soft contact constraints with sub-stepping support | ||
// http://mmacklin.com/smallsteps.pdf | ||
diff --git a/src/contact_solver.h b/src/contact_solver.h | ||
index e265e93..dcdc1fb 100644 | ||
--- a/src/contact_solver.h | ||
+++ b/src/contact_solver.h | ||
@@ -4,7 +4,7 @@ | ||
#pragma once | ||
|
||
#include "solver.h" | ||
-#include "x86/avx.h" | ||
+#include "simde/x86/avx.h" | ||
|
||
typedef struct b2ContactSim b2ContactSim; | ||
|
||
diff --git a/src/solver.c b/src/solver.c | ||
index d83a471..a115417 100644 | ||
--- a/src/solver.c | ||
+++ b/src/solver.c | ||
@@ -17,7 +17,7 @@ | ||
#include "world.h" | ||
|
||
// for mm_pause | ||
-#include "x86/sse2.h" | ||
+#include "simde/x86/sse2.h" | ||
|
||
#include <limits.h> | ||
#include <stdatomic.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
cmake_minimum_required(VERSION 3.1) | ||
project(test_package LANGUAGES CXX) | ||
cmake_minimum_required(VERSION 3.21) | ||
project(test_package LANGUAGES C CXX) | ||
|
||
find_package(box2d REQUIRED CONFIG) | ||
|
||
add_executable(${PROJECT_NAME} test_package.cpp) | ||
if(box2d_VERSION VERSION_LESS "3.0.0") | ||
add_executable(${PROJECT_NAME} test_package.cpp) | ||
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) | ||
else() | ||
add_executable(${PROJECT_NAME} test_package3.c) | ||
target_compile_features(${PROJECT_NAME} PRIVATE c_std_17) | ||
endif() | ||
target_link_libraries(${PROJECT_NAME} PRIVATE box2d::box2d) | ||
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#include "box2d/box2d.h" | ||
|
||
int main() { | ||
b2WorldDef worldDef = b2DefaultWorldDef(); | ||
|
||
worldDef.gravity = (b2Vec2){0.0f, -10.0f}; | ||
b2WorldId worldId = b2CreateWorld(&worldDef); | ||
|
||
b2BodyDef groundBodyDef = b2DefaultBodyDef(); | ||
groundBodyDef.position = (b2Vec2){0.0f, -10.0f}; | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
versions: | ||
"3.0.0": | ||
folder: "all" | ||
"2.4.2": | ||
folder: "all" | ||
"2.4.1": | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that once we drop Conan 1 support, Conan 2 added support for
compiler.cstd
, which could be useful for C projects like this, see https://docs.conan.io/2/reference/tools/build.html#cstd