fix cmake

This commit is contained in:
blueloveTH 2025-05-23 12:58:09 +08:00
parent d424089e86
commit 0a0d567704
2 changed files with 7 additions and 1 deletions

View File

@ -66,6 +66,9 @@ endif()
if(PK_BUILD_SHARED_LIB)
message(">> Building shared library")
if(PK_ENABLE_DETERMINISM)
message(FATAL_ERROR "PK_ENABLE_DETERMINISM is not supported with shared library")
endif()
add_library(${PROJECT_NAME} SHARED ${POCKETPY_SRC})
elseif(PK_BUILD_STATIC_LIB)
message(">> Building static library")
@ -76,6 +79,9 @@ else()
add_library(${PROJECT_NAME} STATIC ${POCKETPY_SRC})
else()
message(">> Building shared library + executable")
if(PK_ENABLE_DETERMINISM)
message(FATAL_ERROR "PK_ENABLE_DETERMINISM is not supported with shared library")
endif()
add_library(${PROJECT_NAME} SHARED ${POCKETPY_SRC})
endif()
add_executable(main src2/main.c)

View File

@ -20,7 +20,7 @@ assert config in ['Debug', 'Release', 'RelWithDebInfo']
os.chdir("build")
code = os.system(f"cmake .. -DPK_ENABLE_OS=ON -DPK_ENABLE_DETERMINISM=ON -DCMAKE_BUILD_TYPE={config} {extra_flags}")
code = os.system(f"cmake .. -DPK_ENABLE_OS=ON -DPK_ENABLE_DETERMINISM=ON -DPK_BUILD_STATIC_MAIN=ON -DCMAKE_BUILD_TYPE={config} {extra_flags}")
assert code == 0
code = os.system(f"cmake --build . --config {config} -j 4")
assert code == 0