-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add cmake support
- Loading branch information
Showing
16 changed files
with
138 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
cmake_minimum_required(VERSION 3.28) | ||
project(Trc CXX) | ||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | ||
|
||
set(CMAKE_CXX_STANDARD 20) | ||
set(CMAKE_C_STANDARD 17) | ||
|
||
add_library(modulefiles) | ||
|
||
file(GLOB_RECURSE SOURCES "src/*.cppm") | ||
file(GLOB_RECURSE LANGUAGE_SOURCES "language/*.cppm") | ||
add_subdirectory("language") | ||
target_sources(modulefiles | ||
PUBLIC | ||
FILE_SET CXX_MODULES FILES | ||
${SOURCES} | ||
${LANGUAGE_SOURCES} | ||
) | ||
|
||
file(GLOB_RECURSE CPP_SOURCES "src/*.cpp") | ||
add_executable(Trc ${CPP_SOURCES}) | ||
|
||
target_link_libraries(Trc modulefiles language) | ||
|
||
add_compile_definitions("UNITTEST") | ||
file(GLOB_RECURSE TEST_SOURCES "tests/unittest/*.cpp") | ||
file(GLOB_RECURSE TEST_MODULE_SOURCES "tests/unittest/*.cppm") | ||
add_library(testmodulefiles) | ||
|
||
target_sources(testmodulefiles | ||
PUBLIC | ||
FILE_SET CXX_MODULES FILES | ||
${SOURCES} | ||
${LANGUAGE_SOURCES} | ||
${TEST_MODULE_SOURCES} | ||
) | ||
|
||
add_executable(unittest | ||
${CPP_SOURCES} | ||
${TEST_SOURCES} | ||
) | ||
target_link_libraries(Trc testmodulefiles language) | ||
|
||
add_subdirectory("cmake_third_party/googletest") | ||
include_directories("cmake_third_party/googletest/googletest/include") |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
add_library(languagemodule) | ||
file(GLOB_RECURSE LANGUAGE_SOURCES "*.cppm") | ||
|
||
target_sources(languagemodule | ||
PUBLIC | ||
FILE_SET CXX_MODULES FILES | ||
${LANGUAGE_SOURCES} | ||
) | ||
|
||
add_library(Chinese SHARED | ||
chinese.cpp | ||
) | ||
|
||
add_library(English SHARED | ||
english.cpp | ||
) | ||
|
||
add_library(language SHARED | ||
english.cpp | ||
) | ||
|
||
target_link_libraries(Chinese languagemodule) | ||
target_link_libraries(English languagemodule) | ||
target_link_libraries(language languagemodule) |
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
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
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
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