From 88b49210ee65e48d7741ebb9fd253c3f1c742ef4 Mon Sep 17 00:00:00 2001 From: Erin Catto Date: Tue, 26 Dec 2023 19:46:48 -0800 Subject: [PATCH] CI fix? --- CMakeLists.txt | 28 ++++++++++++++------------ samples/collection/sample_joints.cpp | 4 ++-- samples/collection/sample_ray_cast.cpp | 4 ++-- src/CMakeLists.txt | 7 ------- 4 files changed, 19 insertions(+), 24 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5176fbe0..a8b24237 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,21 @@ message(STATUS "CMake system name: ${CMAKE_SYSTEM_NAME}") set(BOX2D_LENGTH_UNIT_PER_METER "1.0" CACHE STRING "Length units per meter") set(BOX2D_MAX_POLYGON_VERTICES "8" CACHE STRING "Maximum number of polygon vertices (affects performance)") +set(CMAKE_C_STANDARD 17) +set(CMAKE_C_STANDARD_REQUIRED YES) +set(CMAKE_C_EXTENSIONS YES) +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_COMPILE_WARNING_AS_ERROR ON) +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) +set_property(GLOBAL PROPERTY USE_FOLDERS ON) +set(CMAKE_VERBOSE_MAKEFILE ON) + +# Hide internal functions +# todo need to investigate this more +# https://gcc.gnu.org/wiki/Visibility +# set(CMAKE_C_VISIBILITY_PRESET hidden) +# set(CMAKE_VISIBILITY_INLINES_HIDDEN ON) + # The Box2D library uses simde https://github.com/simd-everywhere/simde add_subdirectory(extern/simde) add_subdirectory(src) @@ -29,19 +44,6 @@ if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) option(BOX2D_DOCS "Build the Box2D documentation" OFF) option(BOX2D_PROFILE "Enable profiling with Tracy" OFF) - # Hide internal functions - # todo not sure if this matters in C - # https://gcc.gnu.org/wiki/Visibility - # set(CMAKE_C_VISIBILITY_PRESET hidden) - # set(CMAKE_VISIBILITY_INLINES_HIDDEN ON) - - set(CMAKE_EXPORT_COMPILE_COMMANDS ON) - set_property(GLOBAL PROPERTY USE_FOLDERS ON) - set(CMAKE_VERBOSE_MAKEFILE ON) - - set(CMAKE_COMPILE_WARNING_AS_ERROR ON) - set(CMAKE_CXX_STANDARD 17) - if (MSVC AND WIN32) # Enable edit and continue only in debug due to perf hit in release # add_link_options($<$:/INCREMENTAL>) diff --git a/samples/collection/sample_joints.cpp b/samples/collection/sample_joints.cpp index 56cd9913..5e3a2220 100644 --- a/samples/collection/sample_joints.cpp +++ b/samples/collection/sample_joints.cpp @@ -247,7 +247,7 @@ class MotorJoint : public Sample m_jointId = b2CreateMotorJoint(m_worldId, &jointDef); } - m_go = false; + m_go = true; m_time = 0.0f; } @@ -589,7 +589,7 @@ class WheelJoint : public Sample b2BodyId groundId = b2CreateBody(m_worldId, &b2_defaultBodyDef); m_enableLimit = true; - m_enableMotor = false; + m_enableMotor = true; m_motorSpeed = 2.0f; m_motorTorque = 5.0f; diff --git a/samples/collection/sample_ray_cast.cpp b/samples/collection/sample_ray_cast.cpp index 6e14aef9..b033588e 100644 --- a/samples/collection/sample_ray_cast.cpp +++ b/samples/collection/sample_ray_cast.cpp @@ -80,8 +80,8 @@ class RayCast : public Sample ImGui::Separator(); ImGui::Text("mouse btn 1: ray cast"); - ImGui::Text("mouse btn 1 + shft: rotate"); - ImGui::Text("mouse btn 1 + ctrl: translate"); + ImGui::Text("mouse btn 1 + shft: translate"); + ImGui::Text("mouse btn 1 + ctrl: rotate"); ImGui::End(); } diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0c56a4e6..eabdeffd 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -92,13 +92,6 @@ target_include_directories(box2d target_link_libraries(box2d PRIVATE simde) -# box2d uses C17 -set_target_properties(box2d PROPERTIES - C_STANDARD 17 - C_STANDARD_REQUIRED YES - C_EXTENSIONS YES -) - if (MSVC) if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") # target_compile_options(box2d PRIVATE /W4 /WX)