Skip to content

Commit

Permalink
Rename src directory to annotate
Browse files Browse the repository at this point in the history
  • Loading branch information
Cryolite committed Oct 2, 2021
1 parent f72967b commit 0f95cdf
Show file tree
Hide file tree
Showing 19 changed files with 32 additions and 29 deletions.
11 changes: 6 additions & 5 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.dockerignore
/.git/
Dockerfile
/prerequisites/
/.local/
/.git
/.local
/kanachan.egg-info
/.dockerignore
/prerequisites
/annotate/Dockerfile
36 changes: 18 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.20.5)
project(IsMajsoulFair)
project(kanachan)

enable_testing()

Expand All @@ -8,7 +8,7 @@ message("CMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}")

set(CMAKE_CXX_STANDARD 20)

include_directories(src)
include_directories(annotate)

if (("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang"))
add_compile_options(-Werror)
Expand All @@ -17,57 +17,57 @@ endif()
message("CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")

if (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(IS_MAJSOUL_FAIR_ENABLE_ASSERT ON CACHE BOOL "Enable assertions.")
set(KANACHAN_ENABLE_ASSERT ON CACHE BOOL "Enable assertions.")
endif()
if (IS_MAJSOUL_FAIR_ENABLE_ASSERT)
add_compile_definitions(IS_MAJSOUL_FAIR_ENABLE_ASSERT)
if (KANACHAN_ENABLE_ASSERT)
add_compile_definitions(KANACHAN_ENABLE_ASSERT)
endif()
message("IS_MAJSOUL_FAIR_ENABLE_ASSERT=${IS_MAJSOUL_FAIR_ENABLE_ASSERT}")
message("KANACHAN_ENABLE_ASSERT=${KANACHAN_ENABLE_ASSERT}")

if (CMAKE_BUILD_TYPE STREQUAL "Debug")
if (("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang"))
add_compile_definitions(_GLIBCXX_DEBUG _GLIBCXX_DEBUG_PEDANTIC)
endif()
endif()

if (IS_MAJSOUL_FAIR_WITH_COVERAGE)
add_compile_definitions(IS_MAJSOUL_FAIR_WITH_COVERAGE)
if (KANACHAN_WITH_COVERAGE)
add_compile_definitions(KANACHAN_WITH_COVERAGE)
add_compile_options("-coverage")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -coverage")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -coverage")
endif()
message("IS_MAJSOUL_FAIR_WITH_COVERAGE=${IS_MAJSOUL_FAIR_WITH_COVERAGE}")
message("KANACHAN_WITH_COVERAGE=${KANACHAN_WITH_COVERAGE}")

if (CMAKE_BUILD_TYPE STREQUAL "Debug")
if (("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang"))
set(IS_MAJSOUL_FAIR_WITH_ASAN ON CACHE BOOL "With AddressSanitizer.")
set(KANACHAN_WITH_ASAN ON CACHE BOOL "With AddressSanitizer.")
endif()
endif()
if (IS_MAJSOUL_FAIR_WITH_ASAN)
if (KANACHAN_WITH_ASAN)
add_compile_options(-fsanitize=address)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=address")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
endif()
message("IS_MAJSOUL_FAIR_WITH_ASAN=${IS_MAJSOUL_FAIR_WITH_ASAN}")
message("KANACHAN_WITH_ASAN=${KANACHAN_WITH_ASAN}")

if (CMAKE_BUILD_TYPE STREQUAL "Debug")
if (("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang"))
set(IS_MAJSOUL_FAIR_WITH_UBSAN ON CACHE BOOL "With UndefinedBehaviorSanitizer.")
set(KANACHAN_WITH_UBSAN ON CACHE BOOL "With UndefinedBehaviorSanitizer.")
endif()
endif()
if (IS_MAJSOUL_FAIR_WITH_UBSAN)
if (KANACHAN_WITH_UBSAN)
add_compile_options(-fsanitize=undefined)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=undefined")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=undefined")
endif()
message("IS_MAJSOUL_FAIR_WITH_UBSAN=${IS_MAJSOUL_FAIR_WITH_UBSAN}")
message("KANACHAN_WITH_UBSAN=${KANACHAN_WITH_UBSAN}")

if (IS_MAJSOUL_FAIR_WITH_TSAN)
if (KANACHAN_WITH_TSAN)
add_compile_options(-fsanitize=thread)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=thread")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=thread")
endif()
message("IS_MAJSOUL_FAIR_WITH_TSAN=${IS_MAJSOUL_FAIR_WITH_TSAN}")
message("KANACHAN_WITH_TSAN=${KANACHAN_WITH_TSAN}")

add_compile_options(-pthread)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pthread")
Expand All @@ -89,4 +89,4 @@ find_package(Boost
REQUIRED
COMPONENTS stacktrace_backtrace)

add_subdirectory(src)
add_subdirectory(annotate)
6 changes: 3 additions & 3 deletions src/CMakeLists.txt → annotate/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ target_link_libraries(kanachan
Boost::stacktrace_backtrace
Boost::headers)

add_executable(convert
convert.cpp)
target_link_libraries(convert
add_executable(annotate
main.cpp)
target_link_libraries(annotate
PRIVATE kanachan)
8 changes: 5 additions & 3 deletions Dockerfile → annotate/Dockerfile
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
FROM kanachan-prerequisites
FROM cryolite/kanachan.prerequisites

ARG CMAKE_BUILD_TYPE=Debug
ARG CMAKE_BUILD_TYPE=Release

COPY --chown=ubuntu . /opt/kanachan

USER ubuntu

WORKDIR /opt/kanachan

RUN (cd src && protoc -I. --cpp_out=. mahjongsoul.proto) && \
RUN (cd annotate && protoc -I. --cpp_out=. mahjongsoul.proto) && \
mkdir build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
-DCMAKE_C_COMPILER=/usr/local/bin/gcc \
-DCMAKE_CXX_COMPILER=/usr/local/bin/g++ \
.. && \
VERBOSE=1 make

ENTRYPOINT ["build/annotate/annotate", "/data"]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file modified prerequisites/Dockerfile
100755 → 100644
Empty file.

0 comments on commit 0f95cdf

Please sign in to comment.