diff --git a/cmake/AXBuildHelpers.cmake b/cmake/AXBuildHelpers.cmake index 19826c69d7..1433858e71 100644 --- a/cmake/AXBuildHelpers.cmake +++ b/cmake/AXBuildHelpers.cmake @@ -449,7 +449,6 @@ macro (ax_setup_wasm_app_config app_name) "-sEXPORTED_FUNCTIONS=[_main]" "-sEXPORTED_RUNTIME_METHODS=[ccall,cwrap]" ) - message(STATUS "===== wasm app ${app_name} ${_APP_SOURCE_DIR}/index.html ... ") set(EMSCRIPTEN_LINK_FLAGS "-lidbfs.js -s MIN_WEBGL_VERSION=2 -s MAX_WEBGL_VERSION=2 -s STACK_SIZE=4mb -s INITIAL_MEMORY=512MB --shell-file ${_APP_SOURCE_DIR}/index.html --use-preload-cache") # Disable wasm, generate js build? # string(APPEND EMSCRIPTEN_LINK_FLAGS " -s WASM=0") diff --git a/tests/cpp-tests/CMakeLists.txt b/tests/cpp-tests/CMakeLists.txt index f04ef27f9e..56ced5f042 100644 --- a/tests/cpp-tests/CMakeLists.txt +++ b/tests/cpp-tests/CMakeLists.txt @@ -404,7 +404,7 @@ list(APPEND GAME_SOURCE Source/Box2DTest/Box2dTest.cpp ) -if((WINDOWS OR MACOSX OR LINUX) AND (NOT WINRT)) +if((WINDOWS OR MACOSX OR LINUX OR WASM) AND (NOT WINRT)) list(APPEND GAME_HEADER Source/Box2DTestBed/tests/test.h Source/Box2DTestBed/tests/settings.h @@ -493,42 +493,37 @@ list(APPEND GAME_SOURCE Source/ChipmunkTest/ChipmunkTest.cpp ) -if(WINDOWS OR MACOSX OR LINUX) +if(WINDOWS OR MACOSX OR LINUX OR WASM) list(APPEND GAME_HEADER Source/ChipmunkTestBed/demo/ChipmunkDemo.h Source/ChipmunkTestBed/ChipmunkTestBed.h ) set (TESTBED_C_SORUCES - Source/ChipmunkTestBed/demo/Bench.c - Source/ChipmunkTestBed/demo/Chains.c - Source/ChipmunkTestBed/demo/Convex.c - Source/ChipmunkTestBed/demo/Crane.c - Source/ChipmunkTestBed/demo/Joints.c - Source/ChipmunkTestBed/demo/LogoSmash.c - Source/ChipmunkTestBed/demo/OneWay.c - Source/ChipmunkTestBed/demo/Planet.c - Source/ChipmunkTestBed/demo/Player.c - Source/ChipmunkTestBed/demo/Plink.c - Source/ChipmunkTestBed/demo/Pump.c - Source/ChipmunkTestBed/demo/PyramidStack.c - Source/ChipmunkTestBed/demo/PyramidTopple.c - Source/ChipmunkTestBed/demo/Shatter.c - Source/ChipmunkTestBed/demo/Springies.c - Source/ChipmunkTestBed/demo/Sticky.c - Source/ChipmunkTestBed/demo/Tank.c - Source/ChipmunkTestBed/demo/TheoJansen.c - Source/ChipmunkTestBed/demo/Buoyancy.c - Source/ChipmunkTestBed/demo/ContactGraph.c - Source/ChipmunkTestBed/demo/Example.c - Source/ChipmunkTestBed/demo/Query.c - Source/ChipmunkTestBed/demo/Slice.c - Source/ChipmunkTestBed/demo/Unicycle.c - Source/ChipmunkTestBed/demo/Tumble.c) - if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") - set_source_files_properties(${TESTBED_C_SORUCES} PROPERTIES COMPILE_FLAGS "/TP") - else() - set_source_files_properties(${TESTBED_C_SORUCES} PROPERTIES LANGUAGE CXX) - endif() + Source/ChipmunkTestBed/demo/Bench.cpp + Source/ChipmunkTestBed/demo/Chains.cpp + Source/ChipmunkTestBed/demo/Convex.cpp + Source/ChipmunkTestBed/demo/Crane.cpp + Source/ChipmunkTestBed/demo/Joints.cpp + Source/ChipmunkTestBed/demo/LogoSmash.cpp + Source/ChipmunkTestBed/demo/OneWay.cpp + Source/ChipmunkTestBed/demo/Planet.cpp + Source/ChipmunkTestBed/demo/Player.cpp + Source/ChipmunkTestBed/demo/Plink.cpp + Source/ChipmunkTestBed/demo/Pump.cpp + Source/ChipmunkTestBed/demo/PyramidStack.cpp + Source/ChipmunkTestBed/demo/PyramidTopple.cpp + Source/ChipmunkTestBed/demo/Shatter.cpp + Source/ChipmunkTestBed/demo/Springies.cpp + Source/ChipmunkTestBed/demo/Sticky.cpp + Source/ChipmunkTestBed/demo/Tank.cpp + Source/ChipmunkTestBed/demo/TheoJansen.cpp + Source/ChipmunkTestBed/demo/Buoyancy.cpp + Source/ChipmunkTestBed/demo/ContactGraph.cpp + Source/ChipmunkTestBed/demo/Example.cpp + Source/ChipmunkTestBed/demo/Query.cpp + Source/ChipmunkTestBed/demo/Slice.cpp + Source/ChipmunkTestBed/demo/Unicycle.cpp + Source/ChipmunkTestBed/demo/Tumble.cpp) list(APPEND GAME_SOURCE ${TESTBED_C_SORUCES} Source/ChipmunkTestBed/ChipmunkTestBed.cpp diff --git a/tests/cpp-tests/Source/ChipmunkTestBed/demo/Bench.c b/tests/cpp-tests/Source/ChipmunkTestBed/demo/Bench.cpp similarity index 100% rename from tests/cpp-tests/Source/ChipmunkTestBed/demo/Bench.c rename to tests/cpp-tests/Source/ChipmunkTestBed/demo/Bench.cpp diff --git a/tests/cpp-tests/Source/ChipmunkTestBed/demo/Buoyancy.c b/tests/cpp-tests/Source/ChipmunkTestBed/demo/Buoyancy.cpp similarity index 100% rename from tests/cpp-tests/Source/ChipmunkTestBed/demo/Buoyancy.c rename to tests/cpp-tests/Source/ChipmunkTestBed/demo/Buoyancy.cpp diff --git a/tests/cpp-tests/Source/ChipmunkTestBed/demo/Chains.c b/tests/cpp-tests/Source/ChipmunkTestBed/demo/Chains.cpp similarity index 100% rename from tests/cpp-tests/Source/ChipmunkTestBed/demo/Chains.c rename to tests/cpp-tests/Source/ChipmunkTestBed/demo/Chains.cpp diff --git a/tests/cpp-tests/Source/ChipmunkTestBed/demo/ContactGraph.c b/tests/cpp-tests/Source/ChipmunkTestBed/demo/ContactGraph.cpp similarity index 100% rename from tests/cpp-tests/Source/ChipmunkTestBed/demo/ContactGraph.c rename to tests/cpp-tests/Source/ChipmunkTestBed/demo/ContactGraph.cpp diff --git a/tests/cpp-tests/Source/ChipmunkTestBed/demo/Convex.c b/tests/cpp-tests/Source/ChipmunkTestBed/demo/Convex.cpp similarity index 100% rename from tests/cpp-tests/Source/ChipmunkTestBed/demo/Convex.c rename to tests/cpp-tests/Source/ChipmunkTestBed/demo/Convex.cpp diff --git a/tests/cpp-tests/Source/ChipmunkTestBed/demo/Crane.c b/tests/cpp-tests/Source/ChipmunkTestBed/demo/Crane.cpp similarity index 100% rename from tests/cpp-tests/Source/ChipmunkTestBed/demo/Crane.c rename to tests/cpp-tests/Source/ChipmunkTestBed/demo/Crane.cpp diff --git a/tests/cpp-tests/Source/ChipmunkTestBed/demo/Example.c b/tests/cpp-tests/Source/ChipmunkTestBed/demo/Example.cpp similarity index 100% rename from tests/cpp-tests/Source/ChipmunkTestBed/demo/Example.c rename to tests/cpp-tests/Source/ChipmunkTestBed/demo/Example.cpp diff --git a/tests/cpp-tests/Source/ChipmunkTestBed/demo/Joints.c b/tests/cpp-tests/Source/ChipmunkTestBed/demo/Joints.cpp similarity index 100% rename from tests/cpp-tests/Source/ChipmunkTestBed/demo/Joints.c rename to tests/cpp-tests/Source/ChipmunkTestBed/demo/Joints.cpp diff --git a/tests/cpp-tests/Source/ChipmunkTestBed/demo/LogoSmash.c b/tests/cpp-tests/Source/ChipmunkTestBed/demo/LogoSmash.cpp similarity index 100% rename from tests/cpp-tests/Source/ChipmunkTestBed/demo/LogoSmash.c rename to tests/cpp-tests/Source/ChipmunkTestBed/demo/LogoSmash.cpp diff --git a/tests/cpp-tests/Source/ChipmunkTestBed/demo/OneWay.c b/tests/cpp-tests/Source/ChipmunkTestBed/demo/OneWay.cpp similarity index 100% rename from tests/cpp-tests/Source/ChipmunkTestBed/demo/OneWay.c rename to tests/cpp-tests/Source/ChipmunkTestBed/demo/OneWay.cpp diff --git a/tests/cpp-tests/Source/ChipmunkTestBed/demo/Planet.c b/tests/cpp-tests/Source/ChipmunkTestBed/demo/Planet.cpp similarity index 100% rename from tests/cpp-tests/Source/ChipmunkTestBed/demo/Planet.c rename to tests/cpp-tests/Source/ChipmunkTestBed/demo/Planet.cpp diff --git a/tests/cpp-tests/Source/ChipmunkTestBed/demo/Player.c b/tests/cpp-tests/Source/ChipmunkTestBed/demo/Player.cpp similarity index 100% rename from tests/cpp-tests/Source/ChipmunkTestBed/demo/Player.c rename to tests/cpp-tests/Source/ChipmunkTestBed/demo/Player.cpp diff --git a/tests/cpp-tests/Source/ChipmunkTestBed/demo/Plink.c b/tests/cpp-tests/Source/ChipmunkTestBed/demo/Plink.cpp similarity index 100% rename from tests/cpp-tests/Source/ChipmunkTestBed/demo/Plink.c rename to tests/cpp-tests/Source/ChipmunkTestBed/demo/Plink.cpp diff --git a/tests/cpp-tests/Source/ChipmunkTestBed/demo/Pump.c b/tests/cpp-tests/Source/ChipmunkTestBed/demo/Pump.cpp similarity index 100% rename from tests/cpp-tests/Source/ChipmunkTestBed/demo/Pump.c rename to tests/cpp-tests/Source/ChipmunkTestBed/demo/Pump.cpp diff --git a/tests/cpp-tests/Source/ChipmunkTestBed/demo/PyramidStack.c b/tests/cpp-tests/Source/ChipmunkTestBed/demo/PyramidStack.cpp similarity index 100% rename from tests/cpp-tests/Source/ChipmunkTestBed/demo/PyramidStack.c rename to tests/cpp-tests/Source/ChipmunkTestBed/demo/PyramidStack.cpp diff --git a/tests/cpp-tests/Source/ChipmunkTestBed/demo/PyramidTopple.c b/tests/cpp-tests/Source/ChipmunkTestBed/demo/PyramidTopple.cpp similarity index 100% rename from tests/cpp-tests/Source/ChipmunkTestBed/demo/PyramidTopple.c rename to tests/cpp-tests/Source/ChipmunkTestBed/demo/PyramidTopple.cpp diff --git a/tests/cpp-tests/Source/ChipmunkTestBed/demo/Query.c b/tests/cpp-tests/Source/ChipmunkTestBed/demo/Query.cpp similarity index 100% rename from tests/cpp-tests/Source/ChipmunkTestBed/demo/Query.c rename to tests/cpp-tests/Source/ChipmunkTestBed/demo/Query.cpp diff --git a/tests/cpp-tests/Source/ChipmunkTestBed/demo/Shatter.c b/tests/cpp-tests/Source/ChipmunkTestBed/demo/Shatter.cpp similarity index 100% rename from tests/cpp-tests/Source/ChipmunkTestBed/demo/Shatter.c rename to tests/cpp-tests/Source/ChipmunkTestBed/demo/Shatter.cpp diff --git a/tests/cpp-tests/Source/ChipmunkTestBed/demo/Slice.c b/tests/cpp-tests/Source/ChipmunkTestBed/demo/Slice.cpp similarity index 100% rename from tests/cpp-tests/Source/ChipmunkTestBed/demo/Slice.c rename to tests/cpp-tests/Source/ChipmunkTestBed/demo/Slice.cpp diff --git a/tests/cpp-tests/Source/ChipmunkTestBed/demo/Springies.c b/tests/cpp-tests/Source/ChipmunkTestBed/demo/Springies.cpp similarity index 100% rename from tests/cpp-tests/Source/ChipmunkTestBed/demo/Springies.c rename to tests/cpp-tests/Source/ChipmunkTestBed/demo/Springies.cpp diff --git a/tests/cpp-tests/Source/ChipmunkTestBed/demo/Sticky.c b/tests/cpp-tests/Source/ChipmunkTestBed/demo/Sticky.cpp similarity index 100% rename from tests/cpp-tests/Source/ChipmunkTestBed/demo/Sticky.c rename to tests/cpp-tests/Source/ChipmunkTestBed/demo/Sticky.cpp diff --git a/tests/cpp-tests/Source/ChipmunkTestBed/demo/Tank.c b/tests/cpp-tests/Source/ChipmunkTestBed/demo/Tank.cpp similarity index 100% rename from tests/cpp-tests/Source/ChipmunkTestBed/demo/Tank.c rename to tests/cpp-tests/Source/ChipmunkTestBed/demo/Tank.cpp diff --git a/tests/cpp-tests/Source/ChipmunkTestBed/demo/TheoJansen.c b/tests/cpp-tests/Source/ChipmunkTestBed/demo/TheoJansen.cpp similarity index 100% rename from tests/cpp-tests/Source/ChipmunkTestBed/demo/TheoJansen.c rename to tests/cpp-tests/Source/ChipmunkTestBed/demo/TheoJansen.cpp diff --git a/tests/cpp-tests/Source/ChipmunkTestBed/demo/Tumble.c b/tests/cpp-tests/Source/ChipmunkTestBed/demo/Tumble.cpp similarity index 100% rename from tests/cpp-tests/Source/ChipmunkTestBed/demo/Tumble.c rename to tests/cpp-tests/Source/ChipmunkTestBed/demo/Tumble.cpp diff --git a/tests/cpp-tests/Source/ChipmunkTestBed/demo/Unicycle.c b/tests/cpp-tests/Source/ChipmunkTestBed/demo/Unicycle.cpp similarity index 100% rename from tests/cpp-tests/Source/ChipmunkTestBed/demo/Unicycle.c rename to tests/cpp-tests/Source/ChipmunkTestBed/demo/Unicycle.cpp diff --git a/tests/cpp-tests/Source/controller.cpp b/tests/cpp-tests/Source/controller.cpp index 17234adcd5..e249f4b55c 100644 --- a/tests/cpp-tests/Source/controller.cpp +++ b/tests/cpp-tests/Source/controller.cpp @@ -60,18 +60,18 @@ public: addTest("Audio - NewAudioEngine", []() { return new AudioEngineTests(); }); addTest("Box2D - Basic", []() { return new Box2DTests(); }); -#if defined(AX_PLATFORM_PC) +#if defined(AX_PLATFORM_PC) || defined(__EMSCRIPTEN__) addTest("Box2D - TestBed", []() { return new Box2DTestBedTests(); }); #endif addTest("Chipmunk2D - Basic", []() { return new ChipmunkTests(); }); -#if defined(AX_PLATFORM_PC) +#if defined(AX_PLATFORM_PC) || defined(__EMSCRIPTEN__) addTest("Chipmunk2D - TestBed", []() { return new ChipmunkTestBedTests(); }); #endif addTest("Bugs", []() { return new BugsTests(); }); addTest("Click and Move", []() { return new ClickAndMoveTest(); }); addTest("Configuration", []() { return new ConfigurationTests(); }); addTest("Console", []() { return new ConsoleTests(); }); -#if !defined(AX_PLATFORM_WASM) +#if !defined(__EMSCRIPTEN__) addTest("Curl", []() { return new CurlTests(); }); #endif addTest("Current Language", []() { return new CurrentLanguageTests(); }); diff --git a/tests/cpp-tests/Source/tests.h b/tests/cpp-tests/Source/tests.h index cfeaf1684d..3672aa3556 100644 --- a/tests/cpp-tests/Source/tests.h +++ b/tests/cpp-tests/Source/tests.h @@ -29,7 +29,7 @@ #include "Box2DTestBed/Box2DTestBed.h" #include "ChipmunkTest/ChipmunkTest.h" -#if defined(AX_PLATFORM_PC) +#if defined(AX_PLATFORM_PC) || defined(__EMSCRIPTEN__) # include "ChipmunkTestBed/ChipmunkTestBed.h" #endif