diff --git a/3rd/box2d/CMakeLists.txt b/3rd/box2d/CMakeLists.txt index eddff030..16dd561c 100644 --- a/3rd/box2d/CMakeLists.txt +++ b/3rd/box2d/CMakeLists.txt @@ -16,8 +16,6 @@ aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/src BOX2D_BINDINGS_SRC) set(CMAKE_CXX_FLAGS_RELEASE "-O2") -set(CMAKE_POSITION_INDEPENDENT_CODE ON) - add_library( box2d STATIC diff --git a/CMakeLists.txt b/CMakeLists.txt index da08891b..1eddf04b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,17 +21,14 @@ if(MSVC) add_compile_options("/utf-8") endif() -if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE Release) -endif() - set(CMAKE_CXX_FLAGS_RELEASE "-O2") include_directories(${CMAKE_CURRENT_LIST_DIR}/include) aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/src POCKETPY_SRC) -option(PK_USE_BOX2D "Use Box2D" ON) +option(PK_USE_BOX2D "Use Box2D" OFF) + if(PK_USE_BOX2D) add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/3rd/box2d) include_directories(${CMAKE_CURRENT_LIST_DIR}/3rd/box2d/include) diff --git a/docs/modules/box2d.md b/docs/modules/box2d.md index eaf78fac..86bcf13e 100644 --- a/docs/modules/box2d.md +++ b/docs/modules/box2d.md @@ -7,12 +7,9 @@ label: box2d ## Setup -`box2d` module will be enabled **by default** for CMake users. +You can set option `PK_USE_BOX2D` to `ON` in CMakeLists.txt to enable `box2d` module. All platforms are supported, including desktop, mobile and web. -You can set option `PK_USE_BOX2D` to `OFF` in CMakeLists.txt -if you don't want to use it. - ## Overview The `box2d` module in pkpy provides a high-level, also simplified, interface to Box2D engine, which is suitable for most use cases.