forked from skyrim-multiplayer/skymp
-
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.
internal: solve CMakeLists.txt conflicts forever (skyrim-multiplayer#…
- Loading branch information
Showing
14 changed files
with
132 additions
and
75 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,2 @@ | ||
list(APPEND CMAKEPROJ_PROJECTS client-deps) | ||
set(CMAKEPROJ_PRIORITY_client-deps 2) |
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,2 @@ | ||
list(APPEND CMAKEPROJ_PROJECTS libespm) | ||
set(CMAKEPROJ_PRIORITY_libespm 1) |
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,2 @@ | ||
list(APPEND CMAKEPROJ_PROJECTS papyrus-vm) | ||
set(CMAKEPROJ_PRIORITY_papyrus-vm 1) |
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,2 @@ | ||
list(APPEND CMAKEPROJ_PROJECTS savefile) | ||
set(CMAKEPROJ_PRIORITY_savefile 1) |
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,2 @@ | ||
list(APPEND CMAKEPROJ_PROJECTS skymp5-client) | ||
set(CMAKEPROJ_PRIORITY_skymp5-client 2) |
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,2 @@ | ||
list(APPEND CMAKEPROJ_PROJECTS skymp5-front) | ||
set(CMAKEPROJ_PRIORITY_skymp5-front 2) |
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,2 @@ | ||
list(APPEND CMAKEPROJ_PROJECTS skymp5-functions-lib) | ||
set(CMAKEPROJ_PRIORITY_skymp5-functions-lib 2) |
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,2 @@ | ||
list(APPEND CMAKEPROJ_PROJECTS skymp5-scripts) | ||
set(CMAKEPROJ_PRIORITY_skymp5-scripts 2) |
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,2 @@ | ||
list(APPEND CMAKEPROJ_PROJECTS skymp5-server) | ||
set(CMAKEPROJ_PRIORITY_skymp5-server 3) |
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,2 @@ | ||
list(APPEND CMAKEPROJ_PROJECTS skyrim-platform) | ||
set(CMAKEPROJ_PRIORITY_skyrim-platform 2) |
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,81 +1,86 @@ | ||
include(${CMAKE_SOURCE_DIR}/cmake/add_papyrus_library_ck.cmake) | ||
# TODO: enable for Emscripten once stabilize | ||
if(BUILD_UNIT_TESTS AND NOT EMSCRIPTEN) | ||
|
||
# | ||
# papyrus_test_files | ||
# | ||
include(${CMAKE_SOURCE_DIR}/cmake/add_papyrus_library_ck.cmake) | ||
include(${CMAKE_SOURCE_DIR}/cmake/apply_default_settings.cmake) | ||
|
||
add_papyrus_library_ck( | ||
NAME papyrus_test_files | ||
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/papyrus_test_files | ||
OUTPUT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/papyrus_test_files/pex | ||
COMPILER_EXECUTABLE_PATH "${SKYRIM_DIR}/Papyrus compiler/PapyrusCompiler.exe" | ||
) | ||
# | ||
# papyrus_test_files | ||
# | ||
|
||
# | ||
# unit executable | ||
# | ||
add_papyrus_library_ck( | ||
NAME papyrus_test_files | ||
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/papyrus_test_files | ||
OUTPUT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/papyrus_test_files/pex | ||
COMPILER_EXECUTABLE_PATH "${SKYRIM_DIR}/Papyrus compiler/PapyrusCompiler.exe" | ||
) | ||
|
||
file(GLOB src "${CMAKE_CURRENT_SOURCE_DIR}/*") | ||
list(APPEND src "${CMAKE_SOURCE_DIR}/.clang-format") | ||
if(TARGET platform_lib) | ||
file(GLOB src_windows "${CMAKE_CURRENT_SOURCE_DIR}/platform_lib_tests/*") | ||
list(APPEND src ${src_windows}) | ||
endif() | ||
# | ||
# unit executable | ||
# | ||
|
||
add_executable(unit ${src}) | ||
file(GLOB src "${CMAKE_CURRENT_SOURCE_DIR}/*") | ||
list(APPEND src "${CMAKE_SOURCE_DIR}/.clang-format") | ||
if(TARGET platform_lib) | ||
file(GLOB src_windows "${CMAKE_CURRENT_SOURCE_DIR}/platform_lib_tests/*") | ||
list(APPEND src ${src_windows}) | ||
endif() | ||
|
||
find_package(Catch2 CONFIG REQUIRED) | ||
target_link_libraries(unit PRIVATE Catch2::Catch2) | ||
add_executable(unit ${src}) | ||
|
||
target_link_libraries(unit PUBLIC server_guest_lib espm) | ||
if(TARGET platform_lib) | ||
target_link_libraries(unit PUBLIC platform_lib) | ||
endif() | ||
apply_default_settings(TARGETS unit) | ||
list(APPEND VCPKG_DEPENDENT unit) | ||
find_package(Catch2 CONFIG REQUIRED) | ||
target_link_libraries(unit PRIVATE Catch2::Catch2) | ||
|
||
if(SKYRIM_SE) | ||
target_compile_definitions(unit PRIVATE SKYRIM_SE=1) | ||
endif() | ||
target_link_libraries(unit PUBLIC server_guest_lib espm) | ||
if(TARGET platform_lib) | ||
target_link_libraries(unit PUBLIC platform_lib) | ||
endif() | ||
apply_default_settings(TARGETS unit) | ||
list(APPEND VCPKG_DEPENDENT unit) | ||
|
||
target_compile_definitions(unit PRIVATE | ||
TEST_PEX_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}/papyrus_test_files/standard_scripts\" | ||
BUILT_PEX_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}/papyrus_test_files/pex\" | ||
SKYRIM_DIR=\"${SKYRIM_DIR}\" | ||
UNIT_DATA_DIR=\"${UNIT_DATA_DIR}\" | ||
DIST_DIR=\"${CMAKE_BINARY_DIR}/dist\" | ||
) | ||
if(SKYRIM_SE) | ||
target_compile_definitions(unit PRIVATE SKYRIM_SE=1) | ||
endif() | ||
|
||
if(WIN32) | ||
target_compile_options(unit PRIVATE "/bigobj") | ||
target_link_libraries(unit PUBLIC Dbghelp.lib) | ||
endif() | ||
target_compile_definitions(unit PRIVATE | ||
TEST_PEX_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}/papyrus_test_files/standard_scripts\" | ||
BUILT_PEX_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}/papyrus_test_files/pex\" | ||
SKYRIM_DIR=\"${SKYRIM_DIR}\" | ||
UNIT_DATA_DIR=\"${UNIT_DATA_DIR}\" | ||
DIST_DIR=\"${CMAKE_BINARY_DIR}/dist\" | ||
) | ||
|
||
# | ||
# ctest tests | ||
# | ||
if(WIN32) | ||
target_compile_options(unit PRIVATE "/bigobj") | ||
target_link_libraries(unit PUBLIC Dbghelp.lib) | ||
endif() | ||
|
||
# run without coverage but with dumps | ||
add_test( | ||
NAME test_unit | ||
COMMAND ${CMAKE_COMMAND} | ||
-DEXE_PATH=$<TARGET_FILE:unit> | ||
-DCOVERAGE_HTML_OUT_DIR=${CMAKE_BINARY_DIR}/__coverage | ||
-DCPPCOV=OFF | ||
-DCPPCOV_PATH=${CPPCOV_PATH} | ||
-DUNIT_WORKING_DIRECTORY=${CMAKE_BINARY_DIR} | ||
-P ${CMAKE_SOURCE_DIR}/cmake/run_test_unit.cmake | ||
) | ||
# | ||
# ctest tests | ||
# | ||
|
||
# run with coverage but without dumps | ||
if(CPPCOV_PATH) | ||
# run without coverage but with dumps | ||
add_test( | ||
NAME test_unit_coverage | ||
NAME test_unit | ||
COMMAND ${CMAKE_COMMAND} | ||
-DEXE_PATH=$<TARGET_FILE:unit> | ||
-DCOVERAGE_HTML_OUT_DIR=${CMAKE_BINARY_DIR}/__coverage | ||
-DCPPCOV=ON | ||
-DCPPCOV=OFF | ||
-DCPPCOV_PATH=${CPPCOV_PATH} | ||
-DUNIT_WORKING_DIRECTORY=${CMAKE_BINARY_DIR} | ||
-P ${CMAKE_SOURCE_DIR}/cmake/run_test_unit.cmake | ||
) | ||
|
||
# run with coverage but without dumps | ||
if(CPPCOV_PATH) | ||
add_test( | ||
NAME test_unit_coverage | ||
COMMAND ${CMAKE_COMMAND} | ||
-DEXE_PATH=$<TARGET_FILE:unit> | ||
-DCOVERAGE_HTML_OUT_DIR=${CMAKE_BINARY_DIR}/__coverage | ||
-DCPPCOV=ON | ||
-DCPPCOV_PATH=${CPPCOV_PATH} | ||
-P ${CMAKE_SOURCE_DIR}/cmake/run_test_unit.cmake | ||
) | ||
endif() | ||
endif() |
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,2 @@ | ||
list(APPEND CMAKEPROJ_PROJECTS unit) | ||
set(CMAKEPROJ_PRIORITY_unit 4) |
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,2 @@ | ||
list(APPEND CMAKEPROJ_PROJECTS viet) | ||
set(CMAKEPROJ_PRIORITY_viet 0) |