最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

CMake

2023-03-04 08:47 作者:小粉絲8  | 我要投稿

// src/CMakeLists.txt

cmake_minimum_required(VERSION 3.18)

project(MyProject VERSION 1.0)

set(CMAKE_BUILD_RPATH_USE_ORIGIN TRUE)

set(CMAKE_INSTALL_RPATH $ORIGIN/../lib)

if (CMAKE_BUILD_TYPE STREQUAL Debug)

? add_link_options(-fsanitize=address)

endif()

#link_libraries(foo)

#link_directories(../foo)

#include_directories(../foo)

#add_compile_definitions(VAR) # VAR=value

add_compile_options(-std=c11) # .cpp

#set(CMAKE_C_COMPILER gcc) # .cpp

#file(GLOB SOURCES *.c) # .cpp

#add_executable(main ${SOURCES})

#add_library(foo SHARED ${SOURCES})

#set_target_properties(foo PROPERTIES VERSION 1.2.3 SOVERSION 1)

add_subdirectory(./foo)

add_subdirectory(./main)

# make -C build DESTDIR=~/foo install

install(TARGETS main foo)

#file(GLOB LIBRARIES ../lib/*.so*)

#install(FILES ${LIBRARIES} DESTINATION lib)

# cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug # Release

# cmake --build build -v # verbose

# make -C build DESTDIR=~/foo install


---


// src/main/CMakeLists.txt

cmake_minimum_required(VERSION 3.18)

project(MyProject VERSION 1.0)

set(CMAKE_BUILD_RPATH_USE_ORIGIN TRUE)

set(CMAKE_INSTALL_RPATH $ORIGIN/../lib)

if (CMAKE_BUILD_TYPE STREQUAL Debug)

? add_link_options(-fsanitize=address)

endif()

link_libraries(foo)

link_directories(../foo)

include_directories(../foo)

#add_compile_definitions(VAR) # VAR=value

add_compile_options(-std=c11) # .cpp

#set(CMAKE_C_COMPILER gcc) # .cpp

file(GLOB SOURCES *.c) # .cpp

add_executable(main ${SOURCES})

#add_library(foo SHARED ${SOURCES})

#set_target_properties(foo PROPERTIES VERSION 1.2.3 SOVERSION 1)

#add_subdirectory(../foo)

# make -C build DESTDIR=~/foo install

#install(TARGETS main foo)

#file(GLOB LIBRARIES ../lib/*.so*)

#install(FILES ${LIBRARIES} DESTINATION lib)

# cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug # Release

# cmake --build build -v # verbose

# make -C build DESTDIR=~/foo install


---


// src/foo/CMakeLists.txt

cmake_minimum_required(VERSION 3.18)

project(MyProject VERSION 1.0)

set(CMAKE_BUILD_RPATH_USE_ORIGIN TRUE)

set(CMAKE_INSTALL_RPATH $ORIGIN/../lib)

if (CMAKE_BUILD_TYPE STREQUAL Debug)

? add_link_options(-fsanitize=address)

endif()

#link_libraries(bar)

#link_directories(../bar)

#include_directories(../bar)

#add_compile_definitions(VAR) # VAR=value

add_compile_options(-std=c11) # .cpp

#set(CMAKE_C_COMPILER gcc) # .cpp

file(GLOB SOURCES *.c) # .cpp

#add_executable(main ${SOURCES})

add_library(foo SHARED ${SOURCES})

set_target_properties(foo PROPERTIES VERSION 1.2.3 SOVERSION 1)

#add_subdirectory(./foo)

# make -C build DESTDIR=~/foo install

#install(TARGETS main) # foo

#file(GLOB LIBRARIES ../lib/*.so*)

#install(FILES ${LIBRARIES} DESTINATION lib)

# cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug # Release

# cmake --build build -v # verbose

# make -C build DESTDIR=~/foo install


---


// src/main/main.c

#include <stdio.h>

#include <signal.h>

#include <sanitizer/lsan_interface.h>

#include "foo.h"

void handlerCont(int signum) {

? printf("SIGCONT %d\n", signum);

#ifndef NDEBUG

? __lsan_do_recoverable_leak_check();

#endif

}

int main() {

? signal(SIGCONT, handlerCont); // kill -CONT 123 # pid

? //...

? printf("main\n");

? foo();

? int a[1024];

? int n = 102400; //asan

? a[n] = 1;

}


CMake的評論 (共 條)

分享到微博請遵守國家法律
大余县| 汤阴县| 大丰市| 阿拉善左旗| 新乡县| 江永县| 铜梁县| 上杭县| 固安县| 德昌县| 天门市| 华池县| 贵港市| 唐海县| 九龙坡区| 广宁县| 涪陵区| 班戈县| 平定县| 麟游县| 浙江省| 绥阳县| 镇坪县| 岚皋县| 宿迁市| 葵青区| 凤凰县| 东兰县| 吉木乃县| 林芝县| 佳木斯市| 桓仁| 武汉市| 延津县| 鄂托克前旗| 揭东县| 博乐市| 白水县| 云梦县| 电白县| 桂平市|