Skip to content

Commit f0ac9f0

Browse files
committed
Add some documentation for the CMakeLists instructions
1 parent 5f51ce6 commit f0ac9f0

File tree

4 files changed

+7
-14
lines changed

4 files changed

+7
-14
lines changed

cpp_api/CMakeLists.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
2-
1+
# This step builds a binary driving the API (to be used for testing)
32
add_executable(api_bin call_bmc.cpp api.cpp)
3+
target_link_libraries(bmc_api goto-programs util langapi ansi-c)
44

5+
# This step builds the API in the form of a statically linked library (libbmc_api.a)
56
add_library(bmc_api api.cpp)
6-
7-
target_link_libraries(bmc_api goto-programs util langapi ansi-c)
87
target_link_libraries(api_bin goto-programs util langapi ansi-c)
98

109
install(TARGETS bmc_api RUNTIME DESTINATION lib)

cpp_api/api.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
api_depst api_deps;
1515
extern configt config;
1616

17-
void initialize_api() {
17+
void initialize() {
1818
// Initialise a null-message handler (we don't print anything in the API)
1919
api_deps.msg_handler = new null_message_handlert();
2020
// Initialise default options

cpp_api/api.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ struct api_depst {
1313
};
1414

1515
/// Initialise API dependencies
16-
void initialize_api();
16+
void initialize();
1717

1818
/// Load a goto_model from a given vector of filenames.
1919
/// \param files: A vector<string> containing the filenames to be loaded

cpp_api/call_bmc.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,8 @@ int main(int argc, char *argv[])
2525
// Convert argv to vector of strings for initialize_goto_model
2626
std::vector<std::string> arguments(argv + 1, argv + argc);
2727

28-
// Needed to initialise the language options correctly
29-
cmdlinet cmdline;
30-
31-
// config is global in config.cpp
32-
config.set(cmdline);
33-
34-
// Initialise C language mode
35-
register_language(new_ansi_c_language);
28+
// Initialise API dependencies and global configuration in one step.
29+
initialize();
3630

3731
auto model = load_model_from_files(arguments, *api_deps.opts);
3832

0 commit comments

Comments
 (0)