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
cmake_minimum_required(VERSION 3.22) | |
project(cmake-issue-demo CXX) | |
add_executable(exec main.cpp) | |
set(ARGS ARG1 "value1" ARG2 "$<$<CONFIG:Debug>:value2>" ARG3 "value3") | |
add_custom_command( | |
TARGET exec POST_BUILD | |
COMMAND "${CMAKE_COMMAND}" | |
-D "ARGS=${ARGS}" | |
-P "${CMAKE_CURRENT_SOURCE_DIR}/helper.cmake" | |
VERBATIM |
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
cmake_minimum_required(VERSION 3.10) | |
project(dynamic-library-example CXX) | |
add_library(lib SHARED lib.cpp) | |
add_executable(app app.cpp) | |
target_link_libraries(app lib) | |
# cmake -B build-dir | |
# cmake --build build-dir |
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
#include <iostream> | |
struct node { | |
int value; // Данные в узле | |
int prev = -1; // Номер предыдущего узла в массиве | |
int next = -1; // Номер следующего узла в массиве | |
}; | |
node nodes[1'000'000]; // Завели себе миллион нод | |
int main() { |
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
#include <stdio.h> | |
#include "lib.h" | |
double f0(void) { | |
return 123; | |
} | |
double f2(double a, double b) { | |
return a + b; | |
} |
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
cmake_minimum_required(VERSION 3.10) | |
project(gcc-include-demo CXX) | |
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") | |
# Make sure it's specified before add_executable. | |
# Includes pre-main.inc.cpp in all translation units in all projects. | |
# Use target_compile_options to include it in all translation units for a specific target only. | |
add_compile_options(-include pre-main.inc.cpp) | |
else() |
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
#!/bin/bash | |
em++ --bind cpp-code.cpp --post-js js-code.js -o output.js | |
node output.js |
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
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
void make_good() { | |
} | |
// #define vector<int> vi | |
using vi = std::vector<int>; |
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
Request URL: https://notify.travis-ci.org | |
Request method: POST | |
content-type: application/x-www-form-urlencoded | |
Expect: | |
User-Agent: GitHub-Hookshot/730b3b3 | |
X-GitHub-Delivery: 4ff8db00-33f3-11ea-9683-718fa20b1245 | |
X-GitHub-Event: pull_request |
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
case class Context(canRead: Boolean) | |
val pages = Map( | |
1 -> "Hello", | |
2 -> "World" | |
) | |
def getPage(id: Int)(implicit context: Context): Option[String] = | |
if (context.canRead) | |
pages.get(id) |
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
workspace(name = "my_test") | |
local_repository( | |
name = "tf_serving", | |
path = "serving", | |
) | |
local_repository( | |
name = "org_tensorflow", | |
path = "serving/tensorflow", |
NewerOlder