Skip to content

Commit

Permalink
copy default config in cmake if not present
Browse files Browse the repository at this point in the history
  • Loading branch information
franziskuskiefer committed Nov 30, 2022
1 parent 0b8ce90 commit 649ed38
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,14 @@ set(hacl_VERSION_TWEAK "")
# This file must be generated before running cmake with ./mach.py --configure
# If the build is invoked through ./mach.py, a separate configuration is not
# needed.
include(build/config.cmake)
# If the file is not present, i.e. cmake was invoked directly, we copy the default
# config from config/default_config.cmake
if(NOT EXISTS ${PROJECT_SOURCE_DIR}/build/config.cmake)
configure_file(${PROJECT_SOURCE_DIR}/config/default_config.cmake ${PROJECT_SOURCE_DIR}/build/config.cmake COPYONLY)
endif()

# Now include the config.
include(${PROJECT_SOURCE_DIR}/build/config.cmake)

# Constants used throughout hacl and the build.
include(config/constants.cmake)
Expand Down

0 comments on commit 649ed38

Please sign in to comment.