Skip to content

Commit

Permalink
cmake: reformat CMakeLists files
Browse files Browse the repository at this point in the history
My IDE (clion) wants to do this automatically and I agree with its
choices w.r.t removing hard tabs and adding some more consistent
whitespace.
  • Loading branch information
cpu committed Jul 29, 2024
1 parent 93bcb88 commit 31aed7a
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 42 deletions.
28 changes: 14 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ include(ExternalProject)
set_directory_properties(PROPERTIES EP_PREFIX ${CMAKE_BINARY_DIR}/rust)

ExternalProject_Add(
rustls-ffi
DOWNLOAD_COMMAND ""
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
COMMAND cargo build --locked "$<IF:$<CONFIG:Release>,--release,-->"
# Rely on cargo checking timestamps, rather than tell CMake where every
# output is.
BUILD_ALWAYS true
INSTALL_COMMAND ""
# Run cargo test with --quiet because msbuild will treat the presence
# of "error" in stdout as an error, and we have some test functions that
# end in "_error". Quiet mode suppresses test names, so this is a
# sufficient workaround.
TEST_COMMAND cargo test --locked "$<IF:$<CONFIG:Release>,--release,-->" --quiet
rustls-ffi
DOWNLOAD_COMMAND ""
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
COMMAND cargo build --locked "$<IF:$<CONFIG:Release>,--release,-->"
# Rely on cargo checking timestamps, rather than tell CMake where every
# output is.
BUILD_ALWAYS true
INSTALL_COMMAND ""
# Run cargo test with --quiet because msbuild will treat the presence
# of "error" in stdout as an error, and we have some test functions that
# end in "_error". Quiet mode suppresses test names, so this is a
# sufficient workaround.
TEST_COMMAND cargo test --locked "$<IF:$<CONFIG:Release>,--release,-->" --quiet
)
56 changes: 28 additions & 28 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
IF(WIN32)
add_compile_definitions(
_WIN32_WINNT=0x601
_CRT_SECURE_NO_WARNINGS
_CRT_NONSTDC_NO_WARNINGS
ssize_t=int
)
ENDIF(WIN32)
IF (WIN32)
add_compile_definitions(
_WIN32_WINNT=0x601
_CRT_SECURE_NO_WARNINGS
_CRT_NONSTDC_NO_WARNINGS
ssize_t=int
)
ENDIF (WIN32)

add_executable(client client.c common.c)
add_dependencies(client rustls-ffi)
target_include_directories(client PUBLIC ${CMAKE_SOURCE_DIR}/src)
IF(WIN32)
IF (WIN32)
target_link_libraries(
client
debug "${CMAKE_SOURCE_DIR}/target/debug/rustls_ffi.lib"
optimized "${CMAKE_SOURCE_DIR}/target/release/rustls_ffi.lib"
advapi32.lib bcrypt.lib crypt32.lib cryptnet.lib kernel32.lib ncrypt.lib bcrypt.lib advapi32.lib legacy_stdio_definitions.lib kernel32.lib advapi32.lib kernel32.lib ntdll.lib userenv.lib ws2_32.lib synchronization.lib kernel32.lib ws2_32.lib kernel32.lib msvcrt.lib
client
debug "${CMAKE_SOURCE_DIR}/target/debug/rustls_ffi.lib"
optimized "${CMAKE_SOURCE_DIR}/target/release/rustls_ffi.lib"
advapi32.lib bcrypt.lib crypt32.lib cryptnet.lib kernel32.lib ncrypt.lib bcrypt.lib advapi32.lib legacy_stdio_definitions.lib kernel32.lib advapi32.lib kernel32.lib ntdll.lib userenv.lib ws2_32.lib synchronization.lib kernel32.lib ws2_32.lib kernel32.lib msvcrt.lib
)
set_property(TARGET client PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreadedDLL")
ENDIF(WIN32)
IF(UNIX)
ENDIF (WIN32)
IF (UNIX)
# TODO
ENDIF(UNIX)
IF(APPLE)
ENDIF (UNIX)
IF (APPLE)
# TODO
ENDIF(APPLE)
ENDIF (APPLE)

add_executable(server server.c common.c)
add_dependencies(server rustls-ffi)
target_include_directories(server PUBLIC ${CMAKE_SOURCE_DIR}/src)
IF(WIN32)
IF (WIN32)
target_link_libraries(
server
debug "${CMAKE_SOURCE_DIR}/target/debug/rustls_ffi.lib"
optimized "${CMAKE_SOURCE_DIR}/target/release/rustls_ffi.lib"
advapi32.lib bcrypt.lib crypt32.lib cryptnet.lib kernel32.lib ncrypt.lib bcrypt.lib advapi32.lib legacy_stdio_definitions.lib kernel32.lib advapi32.lib kernel32.lib ntdll.lib userenv.lib ws2_32.lib synchronization.lib kernel32.lib ws2_32.lib kernel32.lib msvcrt.lib
server
debug "${CMAKE_SOURCE_DIR}/target/debug/rustls_ffi.lib"
optimized "${CMAKE_SOURCE_DIR}/target/release/rustls_ffi.lib"
advapi32.lib bcrypt.lib crypt32.lib cryptnet.lib kernel32.lib ncrypt.lib bcrypt.lib advapi32.lib legacy_stdio_definitions.lib kernel32.lib advapi32.lib kernel32.lib ntdll.lib userenv.lib ws2_32.lib synchronization.lib kernel32.lib ws2_32.lib kernel32.lib msvcrt.lib
)
set_property(TARGET server PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreadedDLL")
ENDIF(WIN32)
IF(UNIX)
ENDIF (WIN32)
IF (UNIX)
# TODO
ENDIF(UNIX)
IF(APPLE)
ENDIF (UNIX)
IF (APPLE)
# TODO
ENDIF(APPLE)
ENDIF (APPLE)

0 comments on commit 31aed7a

Please sign in to comment.