-
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.
- Loading branch information
Showing
8 changed files
with
90 additions
and
65 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,55 @@ | ||
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) | ||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | ||
set(CMAKE_CXX_EXTENSIONS OFF) | ||
|
||
add_library(modulefiles) | ||
set(CMAKE_CXX_STANDARD 20) | ||
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin) | ||
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin) | ||
link_directories("${PROJECT_SOURCE_DIR}/bin") | ||
|
||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror") | ||
|
||
#add_subdirectory(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(unittest testmodulefiles language) | ||
|
||
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} | ||
) | ||
add_subdirectory("cmake_third_party/googletest") | ||
include_directories("cmake_third_party/googletest/googletest/include") | ||
|
||
file(GLOB_RECURSE CPPMSOURCES "*.cppm") | ||
file(GLOB_RECURSE CPP_SOURCES "src/*.cpp") | ||
add_executable(Trc ${CPP_SOURCES}) | ||
|
||
target_link_libraries(Trc modulefiles language) | ||
message(${CPP_SOURCES}) | ||
|
||
add_compile_definitions("UNITTEST") | ||
file(GLOB_RECURSE TEST_SOURCES "tests/unittest/*.cpp") | ||
file(GLOB_RECURSE TEST_MODULE_SOURCES "tests/unittest/*.cppm") | ||
add_library(testmodulefiles) | ||
add_library(foo) | ||
|
||
target_sources(testmodulefiles | ||
target_sources(foo | ||
PUBLIC | ||
FILE_SET CXX_MODULES FILES | ||
${SOURCES} | ||
${LANGUAGE_SOURCES} | ||
${TEST_MODULE_SOURCES} | ||
${CPPMSOURCES} | ||
) | ||
|
||
add_executable(unittest | ||
${CPP_SOURCES} | ||
${TEST_SOURCES} | ||
) | ||
target_link_libraries(Trc testmodulefiles language) | ||
add_executable(Trc ${CPP_SOURCES}) | ||
|
||
add_subdirectory("cmake_third_party/googletest") | ||
include_directories("cmake_third_party/googletest/googletest/include") | ||
target_link_libraries(Trc foo) | ||
target_link_libraries(Trc "language") |
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,24 +1,20 @@ | ||
add_library(languagemodule) | ||
file(GLOB_RECURSE LANGUAGE_SOURCES "*.cppm") | ||
|
||
target_sources(languagemodule | ||
add_library(language_module) | ||
target_sources(language_module | ||
PUBLIC | ||
FILE_SET CXX_MODULES FILES | ||
${LANGUAGE_SOURCES} | ||
) | ||
|
||
add_library(Chinese SHARED | ||
chinese.cpp | ||
) | ||
message("${LANGUAGE_SOURCES}") | ||
|
||
add_library(English SHARED | ||
english.cpp | ||
) | ||
add_library(Chinese chinese.cpp) | ||
|
||
add_library(language SHARED | ||
english.cpp | ||
) | ||
add_library(English english.cpp) | ||
|
||
add_library(language english.cpp) | ||
|
||
target_link_libraries(Chinese languagemodule) | ||
target_link_libraries(English languagemodule) | ||
target_link_libraries(language languagemodule) | ||
target_link_libraries(Chinese language_module) | ||
target_link_libraries(English language_module) | ||
target_link_libraries(language language_module) |
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