mirror of https://github.com/CrowCpp/Crow.git
fixed multiple definition problem and added test to make sure it doesn't
happen again
This commit is contained in:
parent
603cf00b6b
commit
37940d2cc0
|
@ -107,7 +107,7 @@ namespace crow
|
|||
// should not add an item below this line: used for array count
|
||||
};
|
||||
|
||||
const char* method_strings[] =
|
||||
constexpr const char* method_strings[] =
|
||||
{
|
||||
"DELETE",
|
||||
"GET",
|
||||
|
|
|
@ -17,6 +17,7 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
|||
endif()
|
||||
|
||||
add_subdirectory(template)
|
||||
add_subdirectory(multi_file)
|
||||
if (CROW_ENABLE_SSL)
|
||||
add_subdirectory(ssl)
|
||||
endif()
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
project(test_multi_file)
|
||||
|
||||
file (GLOB_RECURSE SRC ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
|
||||
add_executable(${PROJECT_NAME} ${SRC})
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(${PROJECT_NAME} PUBLIC Crow::Crow)
|
|
@ -0,0 +1,15 @@
|
|||
// Test of a project containing more than 1 source file which includes Crow headers.
|
||||
// The test succeeds if the project is linked successfully.
|
||||
#include "crow.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
crow::SimpleApp app;
|
||||
|
||||
CROW_ROUTE(app, "/")
|
||||
([]() {
|
||||
return "Hello, world!";
|
||||
});
|
||||
|
||||
app.port(18080).run();
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
#include <crow.h>
|
Loading…
Reference in New Issue