mirror of
https://github.com/QingdaoU/Judger.git
synced 2024-12-28 16:01:41 +00:00
add makefile
This commit is contained in:
parent
1a7aadef82
commit
0ec206bb4b
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,7 +3,6 @@ build/
|
||||
a.out
|
||||
limit
|
||||
runner
|
||||
CMakeLists.txt
|
||||
main
|
||||
demo
|
||||
.DS_Store
|
||||
|
10
.travis.yml
10
.travis.yml
@ -1,10 +0,0 @@
|
||||
language: python
|
||||
python:
|
||||
- "2.7"
|
||||
sudo: required
|
||||
before_install:
|
||||
- sudo apt-get -qq update
|
||||
- sudo apt-get install libseccomp-dev
|
||||
install:
|
||||
- sudo python setup.py install
|
||||
script: cd tests && sudo python test.py
|
29
CMakeLists.txt
Normal file
29
CMakeLists.txt
Normal file
@ -0,0 +1,29 @@
|
||||
cmake_minimum_required(VERSION 2.5)
|
||||
project(judger C)
|
||||
|
||||
#set(CMAKE_VERBOSE_MAKEFILE ON)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/output/lib)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/output/bin)
|
||||
|
||||
set(BASE_CMAKE_C_FLAGS "-Wall -Werror -O3 -std=c99")
|
||||
set(CMAKE_C_FLAGS "${BASE_CMAKE_C_FLAGS}")
|
||||
|
||||
|
||||
# make judger lib
|
||||
file(GLOB SOURCE "src/*.c")
|
||||
add_library(judger SHARED ${SOURCE})
|
||||
target_link_libraries(judger pthread dl)
|
||||
|
||||
|
||||
# make language seccomp rules
|
||||
file(GLOB RULE_SOURCE src/rules/*)
|
||||
foreach(lang_rule_path ${RULE_SOURCE})
|
||||
file(RELATIVE_PATH lang_name ${CMAKE_CURRENT_SOURCE_DIR}/src/rules ${lang_rule_path})
|
||||
add_library("rule_${lang_name}" SHARED "${lang_rule_path}/rule.c")
|
||||
target_link_libraries("rule_${lang_name}" seccomp)
|
||||
endforeach(lang_rule_path src/rules)
|
||||
|
||||
|
||||
# make tests
|
||||
add_executable(run_test test/main.c ${SOURCE})
|
||||
target_link_libraries(run_test pthread dl seccomp)
|
Loading…
Reference in New Issue
Block a user