-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
261 additions
and
165 deletions.
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
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,41 +1,60 @@ | ||
cmake_minimum_required (VERSION 2.8) | ||
project(Checker) | ||
|
||
include(CheckCXXCompilerFlag) | ||
CHECK_CXX_COMPILER_FLAG("-std=c++17" HAS_CXX17) | ||
if(NOT HAS_CXX17) | ||
message(FATAL_ERROR "Unsupported c++ complier") | ||
endif(NOT HAS_CXX17) | ||
|
||
find_program(HAS_WGET wget) | ||
|
||
if(NOT HAS_WGET) | ||
message(FATAL_ERROR "No wget") | ||
endif(NOT HAS_WGET) | ||
|
||
find_program(HAS_UNZIP unzip) | ||
|
||
if(NOT HAS_UNZIP) | ||
message(FATAL_ERROR "No unzip") | ||
endif(NOT HAS_UNZIP) | ||
|
||
set (CHECKER_VERSION_MAJOR 2) | ||
set (CHECKER_VERSION_MINOR 8) | ||
set (CHECKER_VERSION_PATCH 1) | ||
set (CHECKER_VERSION_PATCH 2) | ||
set (CHECKER_SRC_DIR "${PROJECT_SOURCE_DIR}") | ||
|
||
option(BZOJ_JUDGER "bzoj-judger" ON) | ||
option(LOJ_JUDGER "loj-judger" ON) | ||
option(USE_SYZOJTOOLS "syzoj-tools for loj" OFF) | ||
|
||
add_definitions(-O2 -std=c++17 -lstdc++fs -Wall -Wextra) | ||
|
||
set (SHAREDSRC Adapters/DefaultJudger.cpp Checker.cpp Common.cpp | ||
Judger.cpp OJAdapter.cpp OJAPI.cpp PerfAnalyzer.cpp RunnerShared.cpp | ||
Scanner.cpp Timer.cpp) | ||
|
||
set (ADAPTERSRC ) | ||
|
||
if (BZOJ_JUDGER) | ||
set (ADAPTERSRC ${ADAPTERSRC} Adapters/BZOJJudger.cpp) | ||
endif (BZOJ_JUDGER) | ||
|
||
if (LOJ_JUDGER) | ||
set (ADAPTERSRC ${ADAPTERSRC} Adapters/LOJJudger.cpp) | ||
endif (LOJ_JUDGER) | ||
configure_file ( | ||
"${PROJECT_SOURCE_DIR}/CheckerConfig.hpp.in" | ||
"${PROJECT_BINARY_DIR}/CheckerConfig.hpp" | ||
) | ||
|
||
include_directories(${PROJECT_BINARY_DIR}) | ||
set(CMAKE_CXX_FLAGS "-O2 -std=c++17 -Wall -Wextra ${CMAKE_CXX_FLAGS}") | ||
if (WIN32) | ||
add_definitions(-D__WIN32 -DUNICODE -D_UNICODE) | ||
set (PLATFORMSRC Platforms/PlatformWindows.cpp RunnerWindows.cpp) | ||
set(CMAKE_CXX_FLAGS "-D__WIN32 -DUNICODE -D_UNICODE ${CMAKE_CXX_FLAGS}") | ||
aux_source_directory(Platforms/Windows PlatformSrc) | ||
elseif (UNIX) | ||
set (PLATFORMSRC Platforms/PlatformLinux.cpp RunnerLinux.cpp) | ||
aux_source_directory(Platforms/Linux PlatformSrc) | ||
else () | ||
message(FATAL_ERROR "Unsupported system") | ||
endif (WIN32) | ||
|
||
configure_file ( | ||
"${PROJECT_SOURCE_DIR}/CheckerConfig.hpp.in" | ||
"${PROJECT_BINARY_DIR}/CheckerConfig.hpp" | ||
) | ||
set (JudgerSrc Adapters/DefaultJudger.cpp) | ||
if(BZOJ_JUDGER) | ||
set (JudgerSrc ${JudgerSrc} Adapters/BZOJJudger.cpp) | ||
endif(BZOJ_JUDGER) | ||
|
||
if(LOJ_JUDGER) | ||
set (JudgerSrc ${JudgerSrc} Adapters/LOJJudger.cpp) | ||
endif(LOJ_JUDGER) | ||
|
||
set (SharedSrc Checker.cpp Common.cpp Judger.cpp OJAdapter.cpp OJAPI.cpp | ||
RunnerShared.cpp Scanner.cpp Timer.cpp) | ||
|
||
add_executable(Checker ${SHAREDSRC} ${PLATFORMSRC} ${ADAPTERSRC}) | ||
link_libraries(stdc++fs) | ||
add_executable(Checker ${SharedSrc} ${JudgerSrc} ${PlatformSrc}) |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
#define VERSION "@CHECKER_VERSION_MAJOR@.@CHECKER_VERSION_MINOR@.@CHECKER_VERSION_PATCH@" | ||
#cmakedefine USE_SYZOJTOOLS | ||
#define SOURCE_DIR "@CHECKER_SRC_DIR@" |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#pragma once | ||
#include "CheckerConfig.hpp" | ||
#include <any> | ||
#include <charconv> | ||
#include <cstdint> | ||
|
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
2 changes: 1 addition & 1 deletion
2
Checker/PerfAnalyzer.cpp → Checker/Platforms/Linux/PerfAnalyzer.cpp
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
2 changes: 1 addition & 1 deletion
2
Checker/PerfAnalyzer.hpp → Checker/Platforms/Linux/PerfAnalyzer.hpp
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
2 changes: 1 addition & 1 deletion
2
Checker/Platforms/PlatformLinux.hpp → Checker/Platforms/Linux/PlatformLinux.hpp
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,3 +1,3 @@ | ||
#pragma once | ||
#include "../Common.hpp" | ||
#include "../../Common.hpp" | ||
std::string getCallName(long callid); |
4 changes: 2 additions & 2 deletions
4
Checker/RunnerLinux.cpp → Checker/Platforms/Linux/RunnerLinux.cpp
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
Oops, something went wrong.